Commit a04cdee6 authored by Guilhem's avatar Guilhem
Browse files

Merge branch 'numberdives' of...

Merge branch 'numberdives' of https://forge.info.unicaen.fr/git/but-info-sae3-2024-groupe3 into numberdives
parents 9429bae9 e3e34546
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -11,6 +11,12 @@ class DivingNumberController extends Controller
{
    public function index(): View
    {

        $dateDives = DivingNumberModel::join('car_registration', 'car_user.us_id', '=', 'car_registration.us_id')
        ->join('car_diving_session','car_registration.ds_code','=','car_diving_session.ds_code')
        ->where('car_user.US_ID',3)
        ->get();

        $user = Auth::user();
        if ($user) {
            $userId = $user->US_ID;
@@ -28,7 +34,7 @@ public function index(): View
            ->count();
        $usersCount = 99 - $usersCount;

        return view('diveractivities', compact('usersCount'));
        return view('diveractivities', compact('usersCount'), ['dates' => $dateDives]);
    }

    public function allIndex(Request $request): View
+21 −0
Original line number Diff line number Diff line
@@ -14,4 +14,25 @@
            </tbody>
        </table>        
    </div>

    <div class="mt-10 shadow-md max-w-full w-1/3 rounded-lg overflow-hidden border-2 mx-auto">
        <table class="text-sm text-left text-gray-500 w-full">
            <thead class="text-xs text-gray-700 uppercase bg-gray-50">
            <tr>
                <th scope="col" class="px-6 py-3">Nom</th>
                <th scope="col" class="px-6 py-3">Prénom</th>
                <th scope="col" class="px-6 py-3">Date</th>
            </tr>
            </thead>
            <tbody>
                @foreach($dates as $date)
                <tr class="odd:bg-white even:bg-gray-50 border-b">
                <td class="px-6 py-4">{{ $date->US_NAME }}</td>
                    <td class="px-6 py-4">{{ $date->US_FIRST_NAME }}</td>
                    <td class="px-6 py-4">{{ $date->DS_DATE }}</td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</x-layout>