Changeset 6dec591 for app/Http


Ignore:
Timestamp:
02/08/24 16:34:49 (11 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Children:
d9c4096
Parents:
cf84baa
Message:

Cases listing

Location:
app/Http/Controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/CrimeCaseController.php

    rcf84baa r6dec591  
    44
    55use Illuminate\Http\Request;
    6 
     6use Illuminate\Support\Facades\DB;
     7use Illuminate\Support\Facades\Session;
    78class CrimeCaseController extends Controller
    89{
    910    function cases(){
    10         return view('cases');
     11
     12        $police_station= DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]);
     13        $cases = DB::select('select * from crime_case where p_id=:p_id;',['p_id'=> $police_station[0]->p_id]);
     14
     15        return view('cases', [
     16            'cases' => $cases
     17        ]);
     18
    1119    }
    1220    function case(){
  • app/Http/Controllers/SessionsController.php

    rcf84baa r6dec591  
    1313    public function store()
    1414    {
    15 
    1615        $credentials = request()->validate([
    1716            'badge_no' => 'required',
     
    4241            Session::put('badge_no', $badge_no);
    4342            Session::put('is_policeman', $policeman);
     43            Session::put('pe_id', $exists[0]->pe_id);
    4444            return redirect()->intended('/');
    4545        }
Note: See TracChangeset for help on using the changeset viewer.