Ignore:
Timestamp:
02/10/24 17:58:54 (11 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Children:
92df8cd
Parents:
6dec591
Message:

Bug with embg

File:
1 edited

Legend:

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

    r6dec591 rd9c4096  
    99{
    1010    function cases(){
     11        if(Session::get('pe_id') == null) {
     12            return view('login');
     13        }
    1114
    12         $police_station= DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]);
     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        }
     21
    1322        $cases = DB::select('select * from crime_case where p_id=:p_id;',['p_id'=> $police_station[0]->p_id]);
    1423
     24
    1525        return view('cases', [
    16             'cases' => $cases
     26            'cases' => $cases,
     27            'p_address'=>$police_station[0]->p_address
    1728        ]);
    1829
    1930    }
    20     function case(){
    21         return view('case');
     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        ]);
    2242    }
    2343}
Note: See TracChangeset for help on using the changeset viewer.