Loading app/Http/Controllers/DiveSessionCreation.php 0 → 100644 +30 −0 Original line number Diff line number Diff line <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\DivingSession; class DiveSessionCreation extends Controller { /** * Add */ public static function add($request) { $dv = new DivingSession(); $dv->DS_CODE = 'DS'.sizeof(DivingSession::all())+1; $dv->US_ID = $request->pilot; $dv->DL_ID = $request->location; $dv->BO_ID = $request->boat; $dv->US_ID_CAR_SECURE = $request->security; $dv->US_ID_CAR_DIRECT = $request->manager; $dv->DS_DATE = $request->day; $dv->DS_MAX_DEPTH = $request->maxDepth; $dv->DS_ACTIVE = 1; $dv->DS_MAX_DIVERS = $request->max; $dv->DS_LEVEL = $request->level; $dv->save(); } } app/Http/Controllers/DivesList.php +2 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ class DivesList extends Controller { function index(): View { $dives = DivingSession::select('DS_CODE', '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('DS_CODE', '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]); } Loading app/Models/DivingLocation.php +1 −0 Original line number Diff line number Diff line Loading @@ -12,4 +12,5 @@ class DivingLocation extends Model protected $table = 'CAR_DIVING_LOCATION'; protected $primaryKey = 'DL_ID'; } app/Models/DivingSession.php +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,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; Loading app/Models/Prerogative.php 0 → 100644 +16 −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 Prerogative extends Model { use HasFactory; protected $table = 'CAR_PREROGATIVE'; protected $primaryKey = 'PRE_CODE'; protected $keyType = 'string'; } Loading
app/Http/Controllers/DiveSessionCreation.php 0 → 100644 +30 −0 Original line number Diff line number Diff line <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\DivingSession; class DiveSessionCreation extends Controller { /** * Add */ public static function add($request) { $dv = new DivingSession(); $dv->DS_CODE = 'DS'.sizeof(DivingSession::all())+1; $dv->US_ID = $request->pilot; $dv->DL_ID = $request->location; $dv->BO_ID = $request->boat; $dv->US_ID_CAR_SECURE = $request->security; $dv->US_ID_CAR_DIRECT = $request->manager; $dv->DS_DATE = $request->day; $dv->DS_MAX_DEPTH = $request->maxDepth; $dv->DS_ACTIVE = 1; $dv->DS_MAX_DIVERS = $request->max; $dv->DS_LEVEL = $request->level; $dv->save(); } }
app/Http/Controllers/DivesList.php +2 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ class DivesList extends Controller { function index(): View { $dives = DivingSession::select('DS_CODE', '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('DS_CODE', '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]); } Loading
app/Models/DivingLocation.php +1 −0 Original line number Diff line number Diff line Loading @@ -12,4 +12,5 @@ class DivingLocation extends Model protected $table = 'CAR_DIVING_LOCATION'; protected $primaryKey = 'DL_ID'; }
app/Models/DivingSession.php +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,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; Loading
app/Models/Prerogative.php 0 → 100644 +16 −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 Prerogative extends Model { use HasFactory; protected $table = 'CAR_PREROGATIVE'; protected $primaryKey = 'PRE_CODE'; protected $keyType = 'string'; }