Commit 21c69a98 authored by LucBUTGH's avatar LucBUTGH
Browse files

feat: sessions list with file security

parent d7fa3c59
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers;

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

class fileSecurityController extends Controller
{
    function index(): View
    {
        $files = DivingSession::sessionsWithFilledFile();

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

    use HasFactory;

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

    public function getParticipants(): array{
        $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get();
        $participants = [];
@@ -67,4 +73,6 @@ public function getRoleForUser(User $user){
        
        return "Plongeur";
    }

    
}
+8 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
                </svg>
            </x-square-button>
            @if (array_search('DIR', $highestRole))
                <x-square-button bgColor="bg-[#909aef]" textColor="text-black" textSubtitle="Gérer mes plongées (directeur)"
                <x-square-button bgColor="bg-[#fc8f54]" textColor="text-black" textSubtitle="Gérer mes plongées (directeur)"
                    link="#">
                    <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" />
@@ -66,6 +66,13 @@
                            d="M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75" />
                    </svg>
                </x-square-button>
                <x-square-button bgColor="bg-[#ffa0f9]" textColor="text-black" textSubtitle="Gérer les fiches de sécurité"
                link="/manage/dives">
                <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>
            </div>
        @endif
    @endif
+0 −0

Empty file added.