Ignore:
Timestamp:
06/05/24 13:35:43 (7 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Children:
768f473
Parents:
f7acd52
Message:

New feature - details for employee

File:
1 edited

Legend:

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

    rf7acd52 r249bf91  
    3131    }
    3232
     33    function show($id){
     34        if(Session::get('is_policeman')){
     35            $police_station = DB::select('select * from police_station where p_id=:p_id;',['p_id'=>  Session::get('p_id')]);
     36        } else {
     37            $police_station = DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=>  Session::get('pe_id')]);
     38        }
     39        $result = DB::select('select * from policeman join people on policeman.pe_id = people.pe_id where p_id=:p_id and people.pe_id=:pe_id;',['p_id'=>  $police_station[0]->p_id, 'pe_id' => $id]);
     40        $cases = DB::select('select * from statements where pe_id=:pe_id;',['pe_id' => $id]);
     41
     42        return view('employee', [
     43            'employee' => $result[0],
     44            'p_address'=>$police_station[0]->p_address,
     45            'cases' => $cases
     46        ]);
     47    }
     48
    3349    function register()
    3450    {
Note: See TracChangeset for help on using the changeset viewer.