Loading app/Http/Controllers/DiveSessionCreation.php +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ public static function add($request) $dv->DS_MAX_DIVERS = $request->max; $dv->DS_LEVEL = $request->level; $dv->save(); return $dv; } } resources/views/create_dive.blade.php +29 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,15 @@ <label for="locationInput" style="margin-right: 20px;">Site : </label> <select name="location" id="locationInput" style="width: 200px;"> @foreach ($locations as $location) @if(isset($precedent)) @if($location->DL_ID == $precedent->DL_ID) <option value="{{ $location->DL_ID }}" selected>{{ $location->DL_NAME }}</option> @else <option value="{{ $location->DL_ID }}">{{ $location->DL_NAME }}</option> @endif @else <option value="{{ $location->DL_ID }}">{{ $location->DL_NAME }}</option> @endif @endforeach </select> </div> Loading @@ -24,6 +32,13 @@ <label for="boatInput" style="margin-right: 20px;">Bateau : </label> <select name="boat" id="boatInput" style="width: 200px;"> @foreach ($boats as $boat) @if(isset($precedent)) @if($location->BO_ID == $precedent->BO_ID) <option value="{{ $boat->BO_ID }}" selected>{{ $boat->BO_NAME }}</option> @else <option value="{{ $boat->BO_ID }}">{{ $boat->BO_NAME }}</option> @endif @else <option value="{{ $boat->BO_ID }}">{{ $boat->BO_NAME }}</option> @endforeach </select> Loading @@ -42,8 +57,13 @@ </div> <div> <label for="minInput">Maximum : </label> @if(isset($precedent)) <input type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 42px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" value="{{ $precedent->DS_MAX_DIVERS }}"> @else <input type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 42px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;"> @endif </div> </div> <label for="levelInput">Niveau requis : </label> Loading @@ -53,9 +73,12 @@ @endforeach </select> <label for="levelInput">Niveau : </label> @if(isset($precedent)) <input type="number" name="level" id="levelInput" min=1 max=4 style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0" value="{{$precedent->DS_LEVEL}}"> @else <input type="number" name="level" id="levelInput" min=1 max=4 style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0"> @endif <br> <label for="maxDepth">Profondeur maximum : </label> <input type="number" name="maxDepth" id="maxDepth" style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0"> </div> Loading @@ -65,8 +88,13 @@ <div style="display: flex;flex-direction: column;"> <div> <label for="dayInput">Jour : </label> @if(isset($precedent)) <input type="date" name="day" id="dayInput" style="border: 2px solid black;border-radius: 10px;padding: 7px;" value="{{ $precedent->DS_DATE }}"> @else <input type="date" name="day" id="dayInput" style="border: 2px solid black;border-radius: 10px;padding: 7px;"> @endif </div> <div style="margin-top: 15px;"> <label for="hourInput">Heure de début</label> Loading routes/web.php +2 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,8 @@ Route::middleware('App\Http\Middleware\rightChecker') ->post('/create/dive', function(Request $request) { DiveSessionCreation::add($request); return redirect('/'); $pre = DiveSessionCreation::add($request); return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all(), 'precedent' => $pre]); }); Route::get('/tewst2', function(){ Loading Loading
app/Http/Controllers/DiveSessionCreation.php +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ public static function add($request) $dv->DS_MAX_DIVERS = $request->max; $dv->DS_LEVEL = $request->level; $dv->save(); return $dv; } }
resources/views/create_dive.blade.php +29 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,15 @@ <label for="locationInput" style="margin-right: 20px;">Site : </label> <select name="location" id="locationInput" style="width: 200px;"> @foreach ($locations as $location) @if(isset($precedent)) @if($location->DL_ID == $precedent->DL_ID) <option value="{{ $location->DL_ID }}" selected>{{ $location->DL_NAME }}</option> @else <option value="{{ $location->DL_ID }}">{{ $location->DL_NAME }}</option> @endif @else <option value="{{ $location->DL_ID }}">{{ $location->DL_NAME }}</option> @endif @endforeach </select> </div> Loading @@ -24,6 +32,13 @@ <label for="boatInput" style="margin-right: 20px;">Bateau : </label> <select name="boat" id="boatInput" style="width: 200px;"> @foreach ($boats as $boat) @if(isset($precedent)) @if($location->BO_ID == $precedent->BO_ID) <option value="{{ $boat->BO_ID }}" selected>{{ $boat->BO_NAME }}</option> @else <option value="{{ $boat->BO_ID }}">{{ $boat->BO_NAME }}</option> @endif @else <option value="{{ $boat->BO_ID }}">{{ $boat->BO_NAME }}</option> @endforeach </select> Loading @@ -42,8 +57,13 @@ </div> <div> <label for="minInput">Maximum : </label> @if(isset($precedent)) <input type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 42px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" value="{{ $precedent->DS_MAX_DIVERS }}"> @else <input type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 42px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;"> @endif </div> </div> <label for="levelInput">Niveau requis : </label> Loading @@ -53,9 +73,12 @@ @endforeach </select> <label for="levelInput">Niveau : </label> @if(isset($precedent)) <input type="number" name="level" id="levelInput" min=1 max=4 style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0" value="{{$precedent->DS_LEVEL}}"> @else <input type="number" name="level" id="levelInput" min=1 max=4 style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0"> @endif <br> <label for="maxDepth">Profondeur maximum : </label> <input type="number" name="maxDepth" id="maxDepth" style="width: 40px;border: 2px solid black;border-radius: 7px;-moz-appearance: textfield;text-align: center;" placeholder="0"> </div> Loading @@ -65,8 +88,13 @@ <div style="display: flex;flex-direction: column;"> <div> <label for="dayInput">Jour : </label> @if(isset($precedent)) <input type="date" name="day" id="dayInput" style="border: 2px solid black;border-radius: 10px;padding: 7px;" value="{{ $precedent->DS_DATE }}"> @else <input type="date" name="day" id="dayInput" style="border: 2px solid black;border-radius: 10px;padding: 7px;"> @endif </div> <div style="margin-top: 15px;"> <label for="hourInput">Heure de début</label> Loading
routes/web.php +2 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,8 @@ Route::middleware('App\Http\Middleware\rightChecker') ->post('/create/dive', function(Request $request) { DiveSessionCreation::add($request); return redirect('/'); $pre = DiveSessionCreation::add($request); return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all(), 'precedent' => $pre]); }); Route::get('/tewst2', function(){ Loading