Commit 87993c70 authored by LucBUTGH's avatar LucBUTGH
Browse files

feat: sessions security

parent 21c69a98
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@

use Illuminate\Http\Request;
use App\Models\DivingSession;
use Illuminate\View\View;


class fileSecurityController extends Controller
{
@@ -11,6 +13,6 @@ function index(): View
    {
        $files = DivingSession::sessionsWithFilledFile();

        return view('sessionlist',['sessions' => $files]);
        return view('sessionslist',['sessions' => $files]);
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@ class DivingSession extends Model

    use HasFactory;

    public function sessionsWithFilledFile():array
    static public function sessionsWithFilledFile():array
    {
        $res =  DB::table('CAR_REGISTRATION')->where('DS_FILE_FILLED', 1)->get();
        return $res;
        $res =  DB::table('CAR_DIVING_SESSION')->where('DS_FILE_FILLED', 1)->get();
        return $res->toArray();
    }

    public function getParticipants(): array{
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
                    </svg>
                </x-square-button>
                <x-square-button bgColor="bg-[#ffa0f9]" textColor="text-black" textSubtitle="Gérer les fiches de sécurité"
                link="/manage/dives">
                link="{{ route('sessionsecurity')}}">
                <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" />
+29 −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">Pas rempli</td>
                        @elseif($session->DS_FILE_FILLED == 0)
                            <td class="px-6 py-4">Rempli</td>
                        @endif
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</x-layout>
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
use Illuminate\Http\Request;
use App\Models\DivingSession;
use App\Models\DivingLocation;
use App\Http\Controllers\fileSecurityController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\DiversBySession;
@@ -284,3 +285,5 @@
});

Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']);

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