Ignore:
Timestamp:
02/16/24 12:49:16 (10 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Children:
5d9dd4e
Parents:
7e9dadd
Message:

Added involved people

File:
1 edited

Legend:

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

    r7e9dadd r2bd3041  
    3434        $statements = DB::select('select * from statements where c_id=:c_id;',['c_id'=> $wildcard]);
    3535        $evidence = DB::select('select * from evidence_of_case where c_id=:c_id;',['c_id'=> $wildcard]);
     36        $victims=[];
     37        $witness=[];
     38        foreach ($statements as $st){
     39            $victim=DB::select('select * from people where pe_id=:pe_id;',['pe_id'=> $st->victim_pe_id]);
     40            $victims[] = $victim[0];
     41        }
     42        foreach ($statements as $st){
     43            $witnes=DB::select('select * from people where pe_id=:pe_id;',['pe_id'=> $st->witness_pe_id]);
     44            $witness[] = $witnes[0];
     45        }
     46
    3647        return view('case', [
    3748            'case' => $case[0],
     
    3950            'statements'=>$statements,
    4051            'evidence'=>$evidence,
     52            'victims'=> $victims,
     53            'witness'=> $witness
    4154        ]);
     55
    4256    }
    4357}
Note: See TracChangeset for help on using the changeset viewer.