Commit 38664937 authored by Julien Sailly's avatar Julien Sailly
Browse files

fix: level bug fixed

parent 7a93ea74
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ function index(): View
            ->get();
        $user = session()->get('user');
        $locations = DivingLocation::all();
        $levels = Prerogative::all();
        $levels = Prerogative::select('PRE_MAX_DEPTH')->groupby('PRE_MAX_DEPTH')->get();
        return view('dives', ['dives' => $dives, 'userPre' => Prerogative::find($user->PRE_CODE), 'locations' => $locations, 'levels' => $levels]);
    }

@@ -68,7 +68,7 @@ function filter(Request $request) {
            $dives = $dives->where('CAR_SCHEDULE', $creneau);
        }
        if ($level != null && $level != 'default') {
            $dives = $dives->where('DS_MAX_DEPTH', '<=', $level);
            $dives = $dives->where('DS_MAX_DEPTH', '<=', intval($level));
        }
        if ($date != null && $date != 'default') {
            $dives = $dives->where('DS_DATE', '>=', $date);
@@ -76,7 +76,7 @@ function filter(Request $request) {
        $dives = $dives->orderBy('DS_DATE', 'asc')->get();
        $user = session()->get('user');
        $locations = DivingLocation::all();
        $levels = Prerogative::all();
        $levels = Prerogative::select('PRE_MAX_DEPTH')->groupby('PRE_MAX_DEPTH')->get();
        return view('dives', ['dives' => $dives, 'userPre' => Prerogative::find($user->PRE_CODE), 'locations' => $locations, 'levels' => $levels]);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@
                        <tr class="odd:bg-white even:bg-gray-50 border-b">
                            <td class="px-6 py-4">{{ strftime('%d/%m/%Y', strtotime($dive->DS_DATE)) }}</td>
                            <td class="px-6 py-4">{{ $dive->CAR_SCHEDULE }}</td>
                            <td class="px-6 py-4">{{ $dive->DL_DEPTH }}m</td>
                            <td class="px-6 py-4">@if ($dive->DS_MAX_DEPTH != null) {{$dive->DS_MAX_DEPTH}}m @else Profondeur inconnue @endif</td>
                            <td class="px-6 py-4">{{ $dive->DL_NAME }}</td>
                            <td class="px-8 py-4">
                                <a href='/dives/{{$dive->DS_CODE}}'>