Commit 0f03188d authored by LucBUTGH's avatar LucBUTGH
Browse files

feat: files security for res and dir

parents 25db1cba 119b6b93
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -15,4 +15,11 @@ function index(): View

        return view('sessionslist',['sessions' => $files]);
    }

    function indexWithId(): View
    {
        $files = DivingSession::sessionsWithFilledFileWithId();

        return view('sessionslistid',['sessions' => $files]);
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -28,6 +28,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 = [];
+7 −0
Original line number Diff line number Diff line
@@ -36,6 +36,13 @@
                        <path stroke-linecap="round" stroke-linejoin="round" d="M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5" />
                      </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))
+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>
+3 −1
Original line number Diff line number Diff line
@@ -308,4 +308,6 @@

Route::post('/modification/password-changer', [ManageAdherentController::class, 'updatePassword']);

Route::get('/sessions/filesecurity',[fileSecurityController::class,'index'])->name('sessionsecurity');
Route::get('/sessions/filessecurity', [fileSecurityController::class,'index'])->name('sessionsecurity');

Route::get('/sessions/filesecurity', [fileSecurityController::class,'indexWithId'])->name('sessionsecurityid');
 No newline at end of file