Commit e0775ea7 authored by Waterfox's avatar Waterfox
Browse files

Merge branch 'DivingCreation'

parents 5abbcda0 84544c47
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ class DiveSessionCreation extends Controller
    public static function add($request)
    {
        $dv = new DivingSession();

        $dv->DS_CODE = 'DS'.sizeof(DivingSession::all())+1;
        $dv->US_ID = $request->pilot;
        $dv->DL_ID = $request->location;
@@ -27,6 +28,8 @@ public static function add($request)
        $dv->DS_MAX_DEPTH = DivingLocation::find($request->location)->DL_DEPTH;
        $dv->DS_ACTIVE = 1;
        $dv->DS_MAX_DIVERS = $request->max;
        $dv->DS_MIN_DIVERS = $request->min;

        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";
+6 −0
Original line number Diff line number Diff line
@@ -106,8 +106,14 @@ class="fa-solid fa-xmark"></i></button></form>
                            <label for="maxInput">Maximum :</label>
                        </div>
                        <div class="divideFlexBig Column">
                            @if (isset($precedent))
                                <input required type="number" name="min" id="minInput" min="0" placeholder="0"
                                    style="width: 20%;-moz-appearance: textfield;text-align: center;"
                                    value="{{ $precedent->DS_MIN_DIVERS }}">
                            @else
                                <input required type="number" name="min" id="minInput" min="0" placeholder="0"
                                    style="width: 20%;-moz-appearance: textfield;text-align: center;">
                            @endif
                            @if (isset($precedent))
                                <input required type="number" name="max" id="maxInput" min="0"
                                    placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;"
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
                    {
                        <p>{{$msg}}</p>
                    }
                    @endif
                    <h2>Lieu</h2>
                    <hr style="height: 3px;background-color: black;margin-bottom: 15px;margin-top: 5px; width : 40%">
                    <div class="aligne">