Commit 568e322b authored by Gabrielle Harang's avatar Gabrielle Harang
Browse files

create filter controller for site, date and stage

parent 3331c85a
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers;

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

class DivesByDateList extends Controller
{
    public function index($date): View
    {
        $divesByDate = 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')
            ->where('DS_DATE', $date)
            ->get();
        return view('divesByDate', ['divesByDate' => $divesByDate]);
    }
}
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers;

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

class DivesBySiteList extends Controller
{
    public function index($site): View
    {
        $divesBySite = 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')
            ->where('DL_NAME', $site)
            ->get();
        return view('divesBySite', ['divesBySite' => $divesBySite]);
    }
}
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers;

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

class DivesByStageList extends Controller
{
    public function index($stage): View
    {
        $divesByStage = 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')
            ->where('DL_NAME', $stage)
            ->get();
        return view('divesByStage', ['divesByStage' => $divesByStage]);
    }
}
 No newline at end of file
+0 −0

Empty file deleted.