Changeset 7e9dadd for app/Http/Controllers/OfficerController.php
- Timestamp:
- 02/12/24 14:17:23 (11 months ago)
- Branches:
- main
- Children:
- 2bd3041
- Parents:
- 92df8cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/OfficerController.php
r92df8cd r7e9dadd 17 17 return view('login'); 18 18 } 19 $results = DB::select('select * from policeman join people on policeman.pe_id = people.pe_id;'); 19 if(Session::get('is_policeman')){ 20 $police_station = DB::select('select * from police_station where p_id=:p_id;',['p_id'=> Session::get('p_id')]); 21 } else { 22 $police_station = DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]); 23 } 24 $results = DB::select('select * from policeman join people on policeman.pe_id = people.pe_id where p_id=:p_id;',['p_id'=> $police_station[0]->p_id]); 25 // $results = DB::select('select * from policeman join people on policeman.pe_id = people.pe_id;'); 26 20 27 return view('employees', [ 21 'employees' => $results 28 'employees' => $results, 29 'p_address'=>$police_station[0]->p_address 22 30 ]); 23 31 } … … 36 44 ]); 37 45 46 47 $police_station = DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]); 48 38 49 $pe_id = DB::select('select pe_id from people where embg = :embg;', ['embg' => $policeman["embg"]]); 39 DB::insert('INSERT INTO policeman (pe_id, badge_no, p_date_of_employment, rank, p_id, p_password) VALUES (?, ?, ?, ?, ?, ?)', [$pe_id[0]->pe_id, $policeman["badge_no"], Carbon::now()->format('Y-m-d'), $policeman["rank"], $police STATION,$policeman["password"]]);40 return view('register-policeman');50 DB::insert('INSERT INTO policeman (pe_id, badge_no, p_date_of_employment, rank, p_id, p_password) VALUES (?, ?, ?, ?, ?, ?)', [$pe_id[0]->pe_id, $policeman["badge_no"], Carbon::now()->format('Y-m-d'), $policeman["rank"], $police_station[0]->p_id,$policeman["password"]]); 51 return redirect()->back()->with('message',"Додадено"); 41 52 } 42 53
Note:
See TracChangeset
for help on using the changeset viewer.