Loading app/Http/Controllers/DivesList.php +10 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,14 @@ function show($id) { $divingSession->DS_DATE = strftime('%d/%m/%Y', strtotime($divingSession->DS_DATE)); return view('dive_infos_palanque', ['dive' => $divingSession, 'divers' => $divingSession->getParticipants(), 'creator' => $creator, 'security' => $security, 'director' => $director]); } function showManagementList() { $userID = session('user')->US_ID; $dives = DivingSession::select('DS_CODE', 'DS_ACTIVE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME', 'DS_MAX_DEPTH') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID') ->where('DS_ACTIVE', '=', 1, 'and', 'DS_DATE', '>=', date('Y-m-d'), 'and', 'US_ID_CAR_DIRECT', '=', $userID) ->orderBy('DS_DATE', 'asc') ->get(); return view('dives_list_management', ['dives' => $dives]); } } resources/views/components/header.blade.php +4 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class="flex text-sm bg-blue-500 rounded-full md:me-0 focus:ring-4 focus:ring-blu id="user-menu-button" aria-expanded="false" data-dropdown-toggle="user-dropdown" data-dropdown-placement="bottom"> <span class="w-8 h-8 rounded-full py-1 font-bold text-white">{{ substr(session('user')->US_FIRST_NAME, 0, 1) . substr(session('user')->US_NAME, 0, 1) }}</span> class="w-8 h-8 rounded-full py-2 font-bold text-white">{{ substr(session('user')->US_FIRST_NAME, 0, 1) . substr(session('user')->US_NAME, 0, 1) }}</span> </button> <!-- Dropdown menu --> <div class="z-50 hidden my-4 text-base list-none divide-y rounded-lg shadow bg-blue-700 divide-blue-500" Loading Loading @@ -57,8 +57,9 @@ class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-5 <a href="{{ route('homepage') }}" @if(request()->routeIs('homepage')) class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500" aria-current="page" @else class="block py-2 px-3 rounded hover:bg-blue-700 md:p-0 text-white md:hover:text-blue-500 hover:text-white md:hover:bg-transparent border-gray-700" @endif>Page d'accueil</a> @else class="block py-2 px-3 rounded hover:bg-blue-700 md:p-0 text-white md:hover:text-blue-500 hover:text-white md:hover:bg-transparent border-gray-700" @endif> Tableau de bord </a> </li> @if (session()->has('user')) <li class="py-2 @if(request()->routeIs('dives'))border-b border-b-[#FFBE55]@endif"> Loading resources/views/dashboard.blade.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ </x-square-button> @if (array_search('DIR', $highestRole)) <x-square-button bgColor="bg-[#909aef]" textColor="text-black" textSubtitle="Gérer mes plongées (directeur)" link="#"> link="{{ route('manage_dives_dir') }}"> <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="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> Loading resources/views/dive_infos_palanque.blade.php +9 −3 Original line number Diff line number Diff line Loading @@ -3,8 +3,14 @@ <x-layout> <x-page-title>Plongée du {{ $dive->DS_DATE }} - {{ $dive->DL_NAME }}</x-page-title> <div class="text-right mb-4"> <a href="javascript:history. back()" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> Revenir en arrière </a> </div> <div class="flex flex-col md:flex-row gap-2 rounded-lg border shadow"> <div class="flex-1 border-r p-4"> <div class="flex-1 p-4"> <h3 class="text-xl font-bold mb-2">Plongée</h3> <ul class="space-y-2 list-disc list-inside"> <li>Date : {{ $dive->DS_DATE }} ({{ $dive->CAR_SCHEDULE }})</li> Loading @@ -17,7 +23,7 @@ </li> <li>Nombre de plongeurs : {{ $dive->DS_DIVERS_COUNT }}</li> <li>Bateau : {{ $dive->BO_NAME }}</li> <li>Observation : {{ $dive->DS_OBSERVATION_FIELD }}</li> <!--<li>Observation : {{ $dive->DS_OBSERVATION_FIELD }}</li>--> </ul> @if(preg_match("/[0-9]*\.[0-9]*/", $dive->DL_LONGITUDE) == 1 && preg_match("/[0-9]*\.[0-9]*/", $dive->DL_LATITUDE) == 1) <div id='map' class="shadow rounded-lg w-full mt-4 aspect-video"></div> Loading Loading @@ -48,7 +54,7 @@ @endif <p class="text-xl font-bold my-2">{{ $dive->DL_NAME }} • {{ $dive->DS_MAX_DEPTH }}m</p> </div> <div class="flex-1 border-r p-4"> <div class="flex-1 p-4"> <h3 class="text-xl font-bold mb-2">Plongeurs</h3> </div> <div class="flex-1 p-4"> Loading resources/views/dives_list_management.blade.php 0 → 100644 +55 −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>Gestion de mes plongées en tant que directeur</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">Plage horaire</th> <th scope="col" class="px-6 py-3">Profondeur</th> <th scope="col" class="px-6 py-3">Lieu</th> <th scope="col" class="px-6 py-3">Actions</th> </tr> </thead> <tbody> @foreach ($dives as $dive) <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $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">{{ $dive->DL_NAME }}</td> <td class="px-8 py-4"> <a href="{{ route('dives_show', ['id' => $dive->DS_CODE]) }}"> <x-button> <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-button> </a> <x-button diveId="dropdownButton-{{$dive->DS_CODE}}"> <svg class="w-6 h-6 text-gray-800 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18"> <path d="M14 2a3.963 3.963 0 0 0-1.4.267 6.439 6.439 0 0 1-1.331 6.638A4 4 0 1 0 14 2Zm1 9h-1.264A6.957 6.957 0 0 1 15 15v2a2.97 2.97 0 0 1-.184 1H19a1 1 0 0 0 1-1v-1a5.006 5.006 0 0 0-5-5ZM6.5 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 10H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z"/> </svg> </x-button> </td> </tr> <x-drop-down id="dropdown{{$dive->DS_CODE}}"> @php $participants = $dive->getParticipants(); @endphp <div class="drop-down"> @foreach($participants as $user) <p class = "drop-down-items">{{$user->US_NAME}} {{$user->US_FIRST_NAME}}</p> @endforeach </div> </x-drop-down> @endforeach </tbody> </table> </div> </x-layout> <script type="text/javascript" src="/js/drop-down.js"></script> Loading
app/Http/Controllers/DivesList.php +10 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,14 @@ function show($id) { $divingSession->DS_DATE = strftime('%d/%m/%Y', strtotime($divingSession->DS_DATE)); return view('dive_infos_palanque', ['dive' => $divingSession, 'divers' => $divingSession->getParticipants(), 'creator' => $creator, 'security' => $security, 'director' => $director]); } function showManagementList() { $userID = session('user')->US_ID; $dives = DivingSession::select('DS_CODE', 'DS_ACTIVE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME', 'DS_MAX_DEPTH') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID') ->where('DS_ACTIVE', '=', 1, 'and', 'DS_DATE', '>=', date('Y-m-d'), 'and', 'US_ID_CAR_DIRECT', '=', $userID) ->orderBy('DS_DATE', 'asc') ->get(); return view('dives_list_management', ['dives' => $dives]); } }
resources/views/components/header.blade.php +4 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class="flex text-sm bg-blue-500 rounded-full md:me-0 focus:ring-4 focus:ring-blu id="user-menu-button" aria-expanded="false" data-dropdown-toggle="user-dropdown" data-dropdown-placement="bottom"> <span class="w-8 h-8 rounded-full py-1 font-bold text-white">{{ substr(session('user')->US_FIRST_NAME, 0, 1) . substr(session('user')->US_NAME, 0, 1) }}</span> class="w-8 h-8 rounded-full py-2 font-bold text-white">{{ substr(session('user')->US_FIRST_NAME, 0, 1) . substr(session('user')->US_NAME, 0, 1) }}</span> </button> <!-- Dropdown menu --> <div class="z-50 hidden my-4 text-base list-none divide-y rounded-lg shadow bg-blue-700 divide-blue-500" Loading Loading @@ -57,8 +57,9 @@ class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-5 <a href="{{ route('homepage') }}" @if(request()->routeIs('homepage')) class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500" aria-current="page" @else class="block py-2 px-3 rounded hover:bg-blue-700 md:p-0 text-white md:hover:text-blue-500 hover:text-white md:hover:bg-transparent border-gray-700" @endif>Page d'accueil</a> @else class="block py-2 px-3 rounded hover:bg-blue-700 md:p-0 text-white md:hover:text-blue-500 hover:text-white md:hover:bg-transparent border-gray-700" @endif> Tableau de bord </a> </li> @if (session()->has('user')) <li class="py-2 @if(request()->routeIs('dives'))border-b border-b-[#FFBE55]@endif"> Loading
resources/views/dashboard.blade.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ </x-square-button> @if (array_search('DIR', $highestRole)) <x-square-button bgColor="bg-[#909aef]" textColor="text-black" textSubtitle="Gérer mes plongées (directeur)" link="#"> link="{{ route('manage_dives_dir') }}"> <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="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> Loading
resources/views/dive_infos_palanque.blade.php +9 −3 Original line number Diff line number Diff line Loading @@ -3,8 +3,14 @@ <x-layout> <x-page-title>Plongée du {{ $dive->DS_DATE }} - {{ $dive->DL_NAME }}</x-page-title> <div class="text-right mb-4"> <a href="javascript:history. back()" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> Revenir en arrière </a> </div> <div class="flex flex-col md:flex-row gap-2 rounded-lg border shadow"> <div class="flex-1 border-r p-4"> <div class="flex-1 p-4"> <h3 class="text-xl font-bold mb-2">Plongée</h3> <ul class="space-y-2 list-disc list-inside"> <li>Date : {{ $dive->DS_DATE }} ({{ $dive->CAR_SCHEDULE }})</li> Loading @@ -17,7 +23,7 @@ </li> <li>Nombre de plongeurs : {{ $dive->DS_DIVERS_COUNT }}</li> <li>Bateau : {{ $dive->BO_NAME }}</li> <li>Observation : {{ $dive->DS_OBSERVATION_FIELD }}</li> <!--<li>Observation : {{ $dive->DS_OBSERVATION_FIELD }}</li>--> </ul> @if(preg_match("/[0-9]*\.[0-9]*/", $dive->DL_LONGITUDE) == 1 && preg_match("/[0-9]*\.[0-9]*/", $dive->DL_LATITUDE) == 1) <div id='map' class="shadow rounded-lg w-full mt-4 aspect-video"></div> Loading Loading @@ -48,7 +54,7 @@ @endif <p class="text-xl font-bold my-2">{{ $dive->DL_NAME }} • {{ $dive->DS_MAX_DEPTH }}m</p> </div> <div class="flex-1 border-r p-4"> <div class="flex-1 p-4"> <h3 class="text-xl font-bold mb-2">Plongeurs</h3> </div> <div class="flex-1 p-4"> Loading
resources/views/dives_list_management.blade.php 0 → 100644 +55 −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>Gestion de mes plongées en tant que directeur</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">Plage horaire</th> <th scope="col" class="px-6 py-3">Profondeur</th> <th scope="col" class="px-6 py-3">Lieu</th> <th scope="col" class="px-6 py-3">Actions</th> </tr> </thead> <tbody> @foreach ($dives as $dive) <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $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">{{ $dive->DL_NAME }}</td> <td class="px-8 py-4"> <a href="{{ route('dives_show', ['id' => $dive->DS_CODE]) }}"> <x-button> <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-button> </a> <x-button diveId="dropdownButton-{{$dive->DS_CODE}}"> <svg class="w-6 h-6 text-gray-800 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18"> <path d="M14 2a3.963 3.963 0 0 0-1.4.267 6.439 6.439 0 0 1-1.331 6.638A4 4 0 1 0 14 2Zm1 9h-1.264A6.957 6.957 0 0 1 15 15v2a2.97 2.97 0 0 1-.184 1H19a1 1 0 0 0 1-1v-1a5.006 5.006 0 0 0-5-5ZM6.5 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 10H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z"/> </svg> </x-button> </td> </tr> <x-drop-down id="dropdown{{$dive->DS_CODE}}"> @php $participants = $dive->getParticipants(); @endphp <div class="drop-down"> @foreach($participants as $user) <p class = "drop-down-items">{{$user->US_NAME}} {{$user->US_FIRST_NAME}}</p> @endforeach </div> </x-drop-down> @endforeach </tbody> </table> </div> </x-layout> <script type="text/javascript" src="/js/drop-down.js"></script>