Loading app/Http/Controllers/DivingNumberController.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace App\Http\Controllers; use App\Models\DivingNumberModel; use Illuminate\Http\Request; use Illuminate\View\View; class DivingNumberController extends Controller { public function index(): View{ $request = DivingNumberModel::select()->join('car_registration', 'car_user.us_id', '=', 'car_registration.us_id') ->join('car_diving_group', function($dg){ $dg->on('car_registration.ds_code', '=', 'car_diving_group.ds_code') ->on('car_registration.dg_number', '=', 'car_diving_group.dg_number'); })->count(); return view('alldiversactivities', ['users'=>$users]); } } app/Models/DivingNumberModel.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class DivingNumberModel extends Model { protected $table = "CAR_USER"; protected $primaryKey = "US_ID"; protected $type = "int"; use HasFactory; } app/Models/User.php +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class User extends Model { Loading Loading @@ -54,6 +55,10 @@ public function hasRole($roleCode) { return $this->roles->contains('ROL_CODE', $roleCode); } } ?> resources/views/alldiversactivities.blade.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Plongées restantes</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">Noms et Prénoms</th> <th scope="col" class="px-6 py-3">Nombre de plongées</th> </tr> </thead> <tbody> @foreach ($users as $user) <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 }}</td> <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-6 py-4"><x-button>S'inscrire</x-button><x-button>Voir les inscrits</x-button></td> </tr> @endforeach </tbody> </table> </div> </x-layout> resources/views/diveractivities.blade.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Plongées restantes</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">Noms et Prénoms</th> <th scope="col" class="px-6 py-3">Nombre de plongées</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 }}</td> <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-6 py-4"><x-button>S'inscrire</x-button><x-button>Voir les inscrits</x-button></td> </tr> @endforeach </tbody> </table> </div> </x-layout> Loading
app/Http/Controllers/DivingNumberController.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace App\Http\Controllers; use App\Models\DivingNumberModel; use Illuminate\Http\Request; use Illuminate\View\View; class DivingNumberController extends Controller { public function index(): View{ $request = DivingNumberModel::select()->join('car_registration', 'car_user.us_id', '=', 'car_registration.us_id') ->join('car_diving_group', function($dg){ $dg->on('car_registration.ds_code', '=', 'car_diving_group.ds_code') ->on('car_registration.dg_number', '=', 'car_diving_group.dg_number'); })->count(); return view('alldiversactivities', ['users'=>$users]); } }
app/Models/DivingNumberModel.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class DivingNumberModel extends Model { protected $table = "CAR_USER"; protected $primaryKey = "US_ID"; protected $type = "int"; use HasFactory; }
app/Models/User.php +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class User extends Model { Loading Loading @@ -54,6 +55,10 @@ public function hasRole($roleCode) { return $this->roles->contains('ROL_CODE', $roleCode); } } ?>
resources/views/alldiversactivities.blade.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Plongées restantes</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">Noms et Prénoms</th> <th scope="col" class="px-6 py-3">Nombre de plongées</th> </tr> </thead> <tbody> @foreach ($users as $user) <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 }}</td> <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-6 py-4"><x-button>S'inscrire</x-button><x-button>Voir les inscrits</x-button></td> </tr> @endforeach </tbody> </table> </div> </x-layout>
resources/views/diveractivities.blade.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <x-layout> <x-page-title>Plongées restantes</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">Noms et Prénoms</th> <th scope="col" class="px-6 py-3">Nombre de plongées</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 }}</td> <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-6 py-4"><x-button>S'inscrire</x-button><x-button>Voir les inscrits</x-button></td> </tr> @endforeach </tbody> </table> </div> </x-layout>