Commit f27cb250 authored by Waterfox's avatar Waterfox
Browse files

Update diving session table and views

parent e4d7af80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ class DivesList extends Controller
{
    function index(): View
    {
        $dives = DivingSession::select('car_diving_session.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME')
            ->join('car_diving_location', 'car_diving_session.DL_ID', '=', 'car_diving_location.DL_ID')
        $dives = DivingSession::select('CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME')
            ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID')
            ->get();
        return view('dives', ['dives' => $dives]);
    }

app/Models/Boat.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 Boat extends Model
{
    use HasFactory;
    protected $table = 'CAR_BOAT';

    protected $primaryKey = 'BO_ID';
}
+15 −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 DivingLocation extends Model
{
    use HasFactory;

    protected $table = 'CAR_DIVING_LOCATION';

    protected $primaryKey = 'DL_ID';
}
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
 */
class DivingSession extends Model
{
    protected $table = 'car_diving_session';
    protected $table = 'CAR_DIVING_SESSION';
    protected $primaryKey = 'ds_code';
    protected $keyType = 'string';
    public $timestamps = false;
+19 −0
Original line number Diff line number Diff line
<x-layout>
    <x-page-title>Créer une plongée</x-page-title>
    <h1>Création d'une plongée</h1>
    <form action="/create/dive" method="POST">
        <div>
            <label for="locationInput">Site : </label>
            <select name="location" id="locationInput">
                @foreach ($locations as $location)
                    <option value="{{ $location->DL_ID }}">{{ $location->DL_NAME }}</option>
                @endforeach
            </select>
            <label for="boatInput">Bateau : </label>
            <select name="boat" id="boatInput">
                @foreach ($boats as $boat)
                    <option value="{{ $boat->BO_ID }}">{{ $boat->BO_NAME }}</option>
                @endforeach
        </div>
    </form>
</x-layout>
Loading