main
Last change
on this file since d9c4096 was d9c4096, checked in by bube-ristovska <ristovska725@…>, 9 months ago |
Bug with embg
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[75151c6] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Http\Controllers;
|
---|
| 4 |
|
---|
| 5 | use Illuminate\Http\Request;
|
---|
[6dec591] | 6 | use Illuminate\Support\Facades\DB;
|
---|
| 7 | use Illuminate\Support\Facades\Session;
|
---|
[75151c6] | 8 | class CrimeCaseController extends Controller
|
---|
| 9 | {
|
---|
| 10 | function cases(){
|
---|
[d9c4096] | 11 | if(Session::get('pe_id') == null) {
|
---|
| 12 | return view('login');
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 |
|
---|
| 16 | if(Session::get('is_policeman')){
|
---|
| 17 | $police_station = DB::select('select * from police_station where p_id=:p_id;',['p_id'=> Session::get('p_id')]);
|
---|
| 18 | } else {
|
---|
| 19 | $police_station = DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]);
|
---|
| 20 | }
|
---|
[6dec591] | 21 |
|
---|
| 22 | $cases = DB::select('select * from crime_case where p_id=:p_id;',['p_id'=> $police_station[0]->p_id]);
|
---|
| 23 |
|
---|
[d9c4096] | 24 |
|
---|
[6dec591] | 25 | return view('cases', [
|
---|
[d9c4096] | 26 | 'cases' => $cases,
|
---|
| 27 | 'p_address'=>$police_station[0]->p_address
|
---|
[6dec591] | 28 | ]);
|
---|
| 29 |
|
---|
[75151c6] | 30 | }
|
---|
[d9c4096] | 31 | function case($wildcard){
|
---|
| 32 | $case = DB::select('select * from crime_case where c_id=:c_id;',['c_id'=> $wildcard]);
|
---|
| 33 | $p_address = DB::select('select p_address from police_station where p_id=:p_id;',['p_id'=> $case[0]->p_id]);
|
---|
| 34 | $statements = DB::select('select * from statements where c_id=:c_id;',['c_id'=> $wildcard]);
|
---|
| 35 | $evidence = DB::select('select * from evidence_of_case where c_id=:c_id;',['c_id'=> $wildcard]);
|
---|
| 36 | return view('case', [
|
---|
| 37 | 'case' => $case[0],
|
---|
| 38 | 'p_address'=>$p_address[0]->p_address,
|
---|
| 39 | 'statements'=>$statements,
|
---|
| 40 | 'evidence'=>$evidence,
|
---|
| 41 | ]);
|
---|
[6b10b67] | 42 | }
|
---|
[75151c6] | 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.