Commit af85153d authored by Andgel Brissaud's avatar Andgel Brissaud
Browse files
parents c2c2cbc4 45ac4a66
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class="block text-sm text-white">{{ session('user')->US_FIRST_NAME . " " . sessi
                    </div>
                    <ul class="py-2" aria-labelledby="user-menu-button">
                        <li>
                             <a  href="{{--{{route('divings')}}--}}#" class="block px-4 py-2 text-sm hover:bg-gray-600 text-gray-200 hover:text-white">Historique de mes plongées</a> 
                             <a  href="{{route('divings')}}" class="block px-4 py-2 text-sm hover:bg-gray-600 text-gray-200 hover:text-white">Historique de mes plongées</a> 
                        </li>
                        <li>
                            <a href="{{ route('logout') }}"
@@ -58,6 +58,7 @@ class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-5
                       @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>
                </li>
                @if (session()->has('user'))
                <li class="py-2 @if(request()->routeIs('dives'))border-b border-b-[#FFBE55]@endif">
                    <a href="{{ route('dives') }}"
                       @if(request()->routeIs('dives')) 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"
@@ -65,6 +66,7 @@ class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-5
                       @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>Inscription
                        aux plongées</a>
                </li>
                @endif
            </ul>
        </div>
    </div>
+41 −18
Original line number Diff line number Diff line
<x-layout>
    <x-page-title>Gestion des adhérents</x-page-title>

    <h2 class="underline">Accéder aux plongées par période :</h2>
    <a href="{{ route('alldivings') }}">
        <button class="bg-blue-500 hover:bg-blue-700 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-4">
            Plongées par période
        </button>
    </a>
    <hr class="my-4">
    <form action="{{ route('updateMembersRole') }}" method="POST">
        @csrf <!-- {{ csrf_field() }} -->
        <button type="submit" class="invisible bg-blue-500 sticky top-4 hover text-white font-bold py-2 px-4 rounded mx-auto mb-4 block">
            Enregistrer les modifications
        </button>
        <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">
@@ -16,18 +27,26 @@
                <tbody>
                    @foreach ($users[0] as $i => $value)
                        <tr class="odd:bg-white even:bg-gray-50 border-b">
                        <td class="px-6 py-4">{{ $users[0][$i][1] . " " . strtoupper($users[0][$i][2]) }}</td>
                            <td class="px-6 py-4">{{ $users[0][$i][1] . ' ' . strtoupper($users[0][$i][2]) }}</td>
                            <td class="px-6 py-4">
                            <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}" name="checkbox_{{ $users[0][$i][0] }}_DIV" value="DIV" @if(array_search('DIV', $users[1][$i]) !== false) checked @endif>
                                <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}"
                                    name="checkbox_{{ $users[0][$i][0] }}_DIV" value="DIV"
                                    @if (array_search('DIV', $users[1][$i]) !== false) checked @endif>
                            </td>
                            <td class="px-6 py-4">
                            <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}" name="checkbox_{{ $users[0][$i][0] }}_SEC" value="SEC" @if(array_search('SEC', $users[1][$i]) !== false) checked @endif>
                                <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}"
                                    name="checkbox_{{ $users[0][$i][0] }}_SEC" value="SEC"
                                    @if (array_search('SEC', $users[1][$i]) !== false) checked @endif>
                            </td>
                            <td class="px-6 py-4">
                            <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}" name="checkbox_{{ $users[0][$i][0] }}_PIL" value="PIL" @if(array_search('PIL', $users[1][$i]) !== false) checked @endif>
                                <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}"
                                    name="checkbox_{{ $users[0][$i][0] }}_PIL" value="PIL"
                                    @if (array_search('PIL', $users[1][$i]) !== false) checked @endif>
                            </td>
                            <td class="px-6 py-4">
                            <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}" name="checkbox_{{ $users[0][$i][0] }}_DIR" value="DIR" @if(array_search('DIR', $users[1][$i]) !== false) checked @endif>
                                <input type="checkbox" id="checkbox{{ $users[0][$i][0] }}"
                                    name="checkbox_{{ $users[0][$i][0] }}_DIR" value="DIR"
                                    @if (array_search('DIR', $users[1][$i]) !== false) checked @endif>
                            </td>
                        </tr>
                    @endforeach
@@ -35,18 +54,22 @@
            </table>

        </div>
        <div class="text-right">
            <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-4">
                Valider
            </button>
        </div>
    </form>

    <h2 class="underline">Accéder aux plongées par période :</h2>
    <a href="{{ route('alldivings') }}">
        <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-4">
            Plongées par période
        </button>
    </a>
    <script>
        var checkboxes = document.querySelectorAll('input[type="checkbox"]');
        var submitButton = document.querySelector('button[type="submit"]');
        submitButton.disabled = true;
        checkboxes.forEach(function(checkbox) {
            checkbox.addEventListener('change', function() {
                submitButton.disabled = false;
                submitButton.classList.remove('invisible');
            });
        });
        window.addEventListener('beforeunload', function(e) {
            if (submitButton.disabled === false && e.target.activeElement !== submitButton) {
                e.preventDefault();
                e.returnValue = '';
            }
        });
    </script>
</x-layout>