Changeset 6dec591
- Timestamp:
- 02/08/24 16:34:49 (11 months ago)
- Branches:
- main
- Children:
- d9c4096
- Parents:
- cf84baa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/CrimeCaseController.php
rcf84baa r6dec591 4 4 5 5 use Illuminate\Http\Request; 6 6 use Illuminate\Support\Facades\DB; 7 use Illuminate\Support\Facades\Session; 7 8 class CrimeCaseController extends Controller 8 9 { 9 10 function cases(){ 10 return view('cases'); 11 12 $police_station= DB::select('select * from police_station where pe_id=:pe_id;',['pe_id'=> Session::get('pe_id')]); 13 $cases = DB::select('select * from crime_case where p_id=:p_id;',['p_id'=> $police_station[0]->p_id]); 14 15 return view('cases', [ 16 'cases' => $cases 17 ]); 18 11 19 } 12 20 function case(){ -
app/Http/Controllers/SessionsController.php
rcf84baa r6dec591 13 13 public function store() 14 14 { 15 16 15 $credentials = request()->validate([ 17 16 'badge_no' => 'required', … … 42 41 Session::put('badge_no', $badge_no); 43 42 Session::put('is_policeman', $policeman); 43 Session::put('pe_id', $exists[0]->pe_id); 44 44 return redirect()->intended('/'); 45 45 } -
resources/views/cases.blade.php
rcf84baa r6dec591 153 153 </thead> 154 154 <tbody class="text-gray-700"> 155 <tr> 156 <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="/namehere">Подморница</a></td> 157 <td class="w-1/3 text-left py-3 px-4">2023-11-27</td> 158 <td class="w-1/3 text-left py-3 px-4">A</td> 159 <td class="w-1/3 text-left py-3 px-4">Кире Петков</td> 160 </tr> 161 <tr> 162 <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="/namehere">Хакери</a></td> 163 <td class="w-1/3 text-left py-3 px-4">2011-03-03</td> 164 <td class="w-1/3 text-left py-3 px-4">Z</td> 165 <td class="w-1/3 text-left py-3 px-4">Петко Кирев</td> 166 </tr> 167 <tr> 168 <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="/namehere">Тероризам</a></td> 169 <td class="w-1/3 text-left py-3 px-4">2016-02-01</td> 170 <td class="w-1/3 text-left py-3 px-4">A</td> 171 <td class="w-1/3 text-left py-3 px-4">Наташа Илиева</td> 172 </tr> 173 <tr> 174 <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="/namehere">Киднапирање</a></td> 175 <td class="w-1/3 text-left py-3 px-4">2022-08-27</td> 176 <td class="w-1/3 text-left py-3 px-4">A</td> 177 <td class="w-1/3 text-left py-3 px-4">Наташа Илиева</td> 178 </tr> 155 @foreach($cases as $case) 156 <tr> 157 <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="/case/{{$case->c_id}}">{{$case->c_name}}</a></td> 158 <td class="w-1/3 text-left py-3 px-4">{{$case->opening_date}}</td> 159 <td class="w-1/3 text-left py-3 px-4">{{$case->c_status}}</td> 160 <td class="w-1/3 text-left py-3 px-4">{{$case->p_id}}</td> 161 </tr> 162 @endforeach 163 164 179 165 </tbody> 180 166 </table>
Note:
See TracChangeset
for help on using the changeset viewer.