Loading app/Http/Controllers/fileSecurityController.php +7 −0 Original line number Diff line number Diff line Loading @@ -15,4 +15,11 @@ function index(): View return view('sessionslist',['sessions' => $files]); } function indexWithId(): View { $files = DivingSession::sessionsWithFilledFileWithId(); return view('sessionslistid',['sessions' => $files]); } } app/Models/DivingSession.php +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,12 @@ static public function sessionsWithFilledFile():array return $res->toArray(); } static public function sessionsWithFilledFileWithId():array { $res = DB::table('CAR_DIVING_SESSION')->where('US_ID',session('user')->US_ID)->get(); return $res->toArray(); } public function getParticipants(): array{ $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get(); $participants = []; Loading resources/views/dashboard.blade.php +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,13 @@ </svg> </x-square-button> <x-square-button bgColor="bg-[#ffa0f9]" textColor="text-black" textSubtitle="Gérer les fiches de sécurité" link="{{ route('sessionsecurityid')}}"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-12 h-12"> <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /> </svg> </x-square-button> @endif </div> @if (array_search('RES', $highestRole)) Loading resources/views/sessionslistid.blade.php 0 → 100644 +76 −0 Original line number Diff line number Diff line <x-layout> <link rel="stylesheet" href="/css/drop-down.css"> <link rel="stylesheet" href="{{ asset('/css/app.css') }}"> <x-page-title>Sessions de plongées</x-page-title> <div class="shadow-md max-w-full rounded-lg overflow-hidden border-2"> <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">Date</th> <th scope="col" class="px-6 py-3">Session</th> <th scope="col" class="px-6 py-3">Fichier de sécurité</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->DS_DATE }}</td> <td class="px-6 py-4">{{ $session->DS_CODE }}</td> @if($session->DS_FILE_FILLED == 1) <td class="px-6 py-4 flex items-center justify-between">Rempli <span class="flex items-center"> <!-- Second Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/generate"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> <!-- Third Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/test"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /> </svg> </x-redirect-button> </span> </td> @elseif($session->DS_FILE_FILLED == 0) <td class="px-6 py-4 flex items-center justify-between"> <span class="flex items-center"> <!-- Text and First Icon --> <span class="mr-2">Pas rempli</span> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/edit"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> </span> <span class="flex items-center"> <!-- Second Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/generate"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> <!-- Third Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/test"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /> </svg> </x-redirect-button> </span> </td> @endif </tr> @endforeach </tbody> </table> </div> </x-layout> routes/web.php +2 −0 Original line number Diff line number Diff line Loading @@ -287,3 +287,5 @@ Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']); Route::get('/sessions/filesecurity', [fileSecurityController::class,'index'])->name('sessionsecurity'); Route::get('/sessions/filesecurity', [fileSecurityController::class,'indexWithId'])->name('sessionsecurityid'); No newline at end of file Loading
app/Http/Controllers/fileSecurityController.php +7 −0 Original line number Diff line number Diff line Loading @@ -15,4 +15,11 @@ function index(): View return view('sessionslist',['sessions' => $files]); } function indexWithId(): View { $files = DivingSession::sessionsWithFilledFileWithId(); return view('sessionslistid',['sessions' => $files]); } }
app/Models/DivingSession.php +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,12 @@ static public function sessionsWithFilledFile():array return $res->toArray(); } static public function sessionsWithFilledFileWithId():array { $res = DB::table('CAR_DIVING_SESSION')->where('US_ID',session('user')->US_ID)->get(); return $res->toArray(); } public function getParticipants(): array{ $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get(); $participants = []; Loading
resources/views/dashboard.blade.php +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,13 @@ </svg> </x-square-button> <x-square-button bgColor="bg-[#ffa0f9]" textColor="text-black" textSubtitle="Gérer les fiches de sécurité" link="{{ route('sessionsecurityid')}}"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-12 h-12"> <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /> </svg> </x-square-button> @endif </div> @if (array_search('RES', $highestRole)) Loading
resources/views/sessionslistid.blade.php 0 → 100644 +76 −0 Original line number Diff line number Diff line <x-layout> <link rel="stylesheet" href="/css/drop-down.css"> <link rel="stylesheet" href="{{ asset('/css/app.css') }}"> <x-page-title>Sessions de plongées</x-page-title> <div class="shadow-md max-w-full rounded-lg overflow-hidden border-2"> <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">Date</th> <th scope="col" class="px-6 py-3">Session</th> <th scope="col" class="px-6 py-3">Fichier de sécurité</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->DS_DATE }}</td> <td class="px-6 py-4">{{ $session->DS_CODE }}</td> @if($session->DS_FILE_FILLED == 1) <td class="px-6 py-4 flex items-center justify-between">Rempli <span class="flex items-center"> <!-- Second Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/generate"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> <!-- Third Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/test"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /> </svg> </x-redirect-button> </span> </td> @elseif($session->DS_FILE_FILLED == 0) <td class="px-6 py-4 flex items-center justify-between"> <span class="flex items-center"> <!-- Text and First Icon --> <span class="mr-2">Pas rempli</span> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/edit"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> </span> <span class="flex items-center"> <!-- Second Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/generate"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> </x-redirect-button> <!-- Third Icon --> <x-redirect-button link="/dives/{{$session->DS_CODE}}/security-sheet/test"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /> </svg> </x-redirect-button> </span> </td> @endif </tr> @endforeach </tbody> </table> </div> </x-layout>
routes/web.php +2 −0 Original line number Diff line number Diff line Loading @@ -287,3 +287,5 @@ Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']); Route::get('/sessions/filesecurity', [fileSecurityController::class,'index'])->name('sessionsecurity'); Route::get('/sessions/filesecurity', [fileSecurityController::class,'indexWithId'])->name('sessionsecurityid'); No newline at end of file