Loading app/Http/Controllers/DiveSessionCreation.php +9 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ use Illuminate\Http\Request; use App\Models\DivingSession; use App\Models\DivingLocation; use App\Models\Boat; use Error; class DiveSessionCreation extends Controller { Loading @@ -22,13 +24,17 @@ public static function add($request) $dv->US_ID_CAR_DIRECT = $request->manager; $dv->DS_DATE = $request->day; $dv->CAR_SCHEDULE = $request->hour; $dv->DS_MAX_DEPTH = $request->maxDepth; $dv->DS_MAX_DEPTH = DivingLocation::find($request->location)->DL_DEPTH; $dv->DS_ACTIVE = 1; $dv->DS_MAX_DIVERS = $request->max; if(intval($dv->DS_MAX_DIVERS) > Boat::find($request->boat)->BO_NUMBER_OF_SEATS) { return "Le nombre de plongeurs est supérieur au nombre de places du bateau"; } $dv->PRE_CODE = $request->level; $dv->DS_LEVEL = 1; $dv->save(); error_log($dv->DS_CODE); $dv->DS_CODE = 'DS'.sizeof(DivingSession::all()); return $dv; } } app/Http/Controllers/DiveSessionDelete.php +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class DiveSessionDelete extends Controller public static function update($id) { $dv = DivingSession::where('DS_CODE', $id)->first(); $dv = DivingSession::find($id); $dv->DS_ACTIVE = 0; $dv->save(); } Loading public/css/app.css +26 −3 Original line number Diff line number Diff line Loading @@ -10,8 +10,8 @@ :root --yellowDarker : #daa654; --good : #00ff04; --bad : #dc2323; --badDarker : #c23232; --bad : #f94f4f; --badDarker : #cd4b4b; --BigTitle : 32px; --title : 25px; Loading Loading @@ -51,8 +51,31 @@ .clickableRed:hover{ color: var(--white) } .align{ .aligne{ display: flex; align-items: center; justify-content: center; } .Line{ display: flex; flex-direction: row; } .Column{ display: flex; flex-direction: column; } .divideFlex{ flex-grow: 1; display: flex; } .divideFlexSmall{ flex-grow: 0.5; } .divideFlexBig{ flex-grow: 1.5; } No newline at end of file public/css/create_div.css +33 −4 Original line number Diff line number Diff line Loading @@ -39,12 +39,41 @@ tr:nth-child(odd) { } .clickableRed{ width: 30px; height: 30px; border-radius: 30px; width: 40px; height: 40px; border-radius: 40px; color: white; } input{ width: 80%; padding: 10px; } select{ padding: 6px; width: 80%; } select, label{ padding: 10px; } select, input{ background: var(--yellow); color: black; border-radius: 12px; } input, select, label{ margin-top: 10px; margin-bottom: 10px; } .Line{ margin-top: 30px; } .inputTime{ padding: 7px; width: 60% !important; } No newline at end of file public/js/create_div.js 0 → 100644 +0 −0 Empty file added. Loading
app/Http/Controllers/DiveSessionCreation.php +9 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ use Illuminate\Http\Request; use App\Models\DivingSession; use App\Models\DivingLocation; use App\Models\Boat; use Error; class DiveSessionCreation extends Controller { Loading @@ -22,13 +24,17 @@ public static function add($request) $dv->US_ID_CAR_DIRECT = $request->manager; $dv->DS_DATE = $request->day; $dv->CAR_SCHEDULE = $request->hour; $dv->DS_MAX_DEPTH = $request->maxDepth; $dv->DS_MAX_DEPTH = DivingLocation::find($request->location)->DL_DEPTH; $dv->DS_ACTIVE = 1; $dv->DS_MAX_DIVERS = $request->max; if(intval($dv->DS_MAX_DIVERS) > Boat::find($request->boat)->BO_NUMBER_OF_SEATS) { return "Le nombre de plongeurs est supérieur au nombre de places du bateau"; } $dv->PRE_CODE = $request->level; $dv->DS_LEVEL = 1; $dv->save(); error_log($dv->DS_CODE); $dv->DS_CODE = 'DS'.sizeof(DivingSession::all()); return $dv; } }
app/Http/Controllers/DiveSessionDelete.php +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class DiveSessionDelete extends Controller public static function update($id) { $dv = DivingSession::where('DS_CODE', $id)->first(); $dv = DivingSession::find($id); $dv->DS_ACTIVE = 0; $dv->save(); } Loading
public/css/app.css +26 −3 Original line number Diff line number Diff line Loading @@ -10,8 +10,8 @@ :root --yellowDarker : #daa654; --good : #00ff04; --bad : #dc2323; --badDarker : #c23232; --bad : #f94f4f; --badDarker : #cd4b4b; --BigTitle : 32px; --title : 25px; Loading Loading @@ -51,8 +51,31 @@ .clickableRed:hover{ color: var(--white) } .align{ .aligne{ display: flex; align-items: center; justify-content: center; } .Line{ display: flex; flex-direction: row; } .Column{ display: flex; flex-direction: column; } .divideFlex{ flex-grow: 1; display: flex; } .divideFlexSmall{ flex-grow: 0.5; } .divideFlexBig{ flex-grow: 1.5; } No newline at end of file
public/css/create_div.css +33 −4 Original line number Diff line number Diff line Loading @@ -39,12 +39,41 @@ tr:nth-child(odd) { } .clickableRed{ width: 30px; height: 30px; border-radius: 30px; width: 40px; height: 40px; border-radius: 40px; color: white; } input{ width: 80%; padding: 10px; } select{ padding: 6px; width: 80%; } select, label{ padding: 10px; } select, input{ background: var(--yellow); color: black; border-radius: 12px; } input, select, label{ margin-top: 10px; margin-bottom: 10px; } .Line{ margin-top: 30px; } .inputTime{ padding: 7px; width: 60% !important; } No newline at end of file