Commit 8ff66ec2 authored by cyprien's avatar cyprien
Browse files

Merge branch 'DivingCreation'

parents 54f51b0b ad8b3869
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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
{
@@ -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;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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();
    }
+26 −3
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@ :root
  --yellowDarker : #daa654;

  --good : #00ff04;
  --bad : #dc2323;
  --badDarker : #c23232;
  --bad : #f94f4f;
  --badDarker : #cd4b4b;

  --BigTitle : 32px;
  --title : 25px;
@@ -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
+33 −4
Original line number Diff line number Diff line
@@ -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
+0 −0

Empty file added.

Loading