Loading app/Http/Controllers/DiversBySession.php +4 −5 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ class DiversBySession extends Controller public function getDiversBySession($ds_code): View { $request = User::selectRaw('US_NAME, US_FIRST_NAME') ->join('CAR_REGISTRATION','CAR_USER.US_ID','=','CAR_REGISTRATION.US_ID') ->join('CAR_USER','CAR_USER.US_ID','=','CAR_DIVING_SESSION.US_ID') ->get(); return view('diversinsessions', ['datas' => $request]); Loading @@ -20,12 +20,11 @@ public function getDiversBySession($ds_code): View public function getAllSessions(): View { $request = User::join('car_registration', 'car_user.US_ID', '=', 'car_registration.US_ID') ->groupBy('car_registration.ds_code', 'car_user.us_name', 'car_user.US_FIRST_NAME') ->select('car_user.us_name', 'car_user.US_FIRST_NAME', 'car_registration.ds_code') $sessions = User::select('US_NAME', 'US_FIRST_NAME', 'DS_CODE') ->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID') ->get(); return view('diversinsessions', ['sessions' => $sessions]); return view('diversinsessions',['sessions' => $request]); } } app/Models/DivingSignUpModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ class DivingSignUpModel extends Model { protected $table = 'car_registration'; protected $primaryKey = ['us_id', 'ds_code']; protected $table = 'CAR_REGISTRATION'; protected $primaryKey = ['US_ID', 'DS_CODE']; protected $keyType = ['int', 'string']; protected $fillable = ['US_ID', 'DS_CODE']; use HasFactory; Loading resources/views/diversinsessions.blade.php 0 → 100644 +26 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Historique des plongées</x-page-title> <div class="shadow-md max-w-full w-2/3 rounded-lg overflow-hidden border-2 mx-auto"> @if(is_array($sessions)) <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">Session</th> </tr> </thead> <tbody> @foreach($sessions as $session) <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $session->US_NAME }}</td> <td class="px-6 py-4">{{ $session->US_FIRST_NAME }}</td> <td class="px-6 py-4">{{ $session->DS_CODE }}</td> </tr> @endforeach </tbody> </table> @else @endif </div> </x-layout> resources/views/diversinsessions.phpdeleted 100644 → 0 +0 −51 File deleted.Preview size limit exceeded, changes collapsed. Show changes Loading
app/Http/Controllers/DiversBySession.php +4 −5 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ class DiversBySession extends Controller public function getDiversBySession($ds_code): View { $request = User::selectRaw('US_NAME, US_FIRST_NAME') ->join('CAR_REGISTRATION','CAR_USER.US_ID','=','CAR_REGISTRATION.US_ID') ->join('CAR_USER','CAR_USER.US_ID','=','CAR_DIVING_SESSION.US_ID') ->get(); return view('diversinsessions', ['datas' => $request]); Loading @@ -20,12 +20,11 @@ public function getDiversBySession($ds_code): View public function getAllSessions(): View { $request = User::join('car_registration', 'car_user.US_ID', '=', 'car_registration.US_ID') ->groupBy('car_registration.ds_code', 'car_user.us_name', 'car_user.US_FIRST_NAME') ->select('car_user.us_name', 'car_user.US_FIRST_NAME', 'car_registration.ds_code') $sessions = User::select('US_NAME', 'US_FIRST_NAME', 'DS_CODE') ->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID') ->get(); return view('diversinsessions', ['sessions' => $sessions]); return view('diversinsessions',['sessions' => $request]); } }
app/Models/DivingSignUpModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ class DivingSignUpModel extends Model { protected $table = 'car_registration'; protected $primaryKey = ['us_id', 'ds_code']; protected $table = 'CAR_REGISTRATION'; protected $primaryKey = ['US_ID', 'DS_CODE']; protected $keyType = ['int', 'string']; protected $fillable = ['US_ID', 'DS_CODE']; use HasFactory; Loading
resources/views/diversinsessions.blade.php 0 → 100644 +26 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Historique des plongées</x-page-title> <div class="shadow-md max-w-full w-2/3 rounded-lg overflow-hidden border-2 mx-auto"> @if(is_array($sessions)) <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">Session</th> </tr> </thead> <tbody> @foreach($sessions as $session) <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $session->US_NAME }}</td> <td class="px-6 py-4">{{ $session->US_FIRST_NAME }}</td> <td class="px-6 py-4">{{ $session->DS_CODE }}</td> </tr> @endforeach </tbody> </table> @else @endif </div> </x-layout>
resources/views/diversinsessions.phpdeleted 100644 → 0 +0 −51 File deleted.Preview size limit exceeded, changes collapsed. Show changes