source: app/Http/Controllers/PeopleController.php@ d9c4096

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.1 KB
RevLine 
[75151c6]1<?php
2
3namespace App\Http\Controllers;
4
5use Illuminate\Http\Request;
[cf84baa]6use Illuminate\Support\Facades\DB;
[d9c4096]7use Illuminate\Support\Facades\Session;
[75151c6]8
9class PeopleController extends Controller
10{
11 function filter(){
[d9c4096]12 if(Session::get('pe_id') == null) {
13 return view('login');
14 }
[cf84baa]15 $peoples = DB::select('select * from people;');
16
17 return view('filter', [
18 'peoples' => $peoples
19 ]);
20 }
21 function filter_post(){
[d9c4096]22 if(Session::get('pe_id') == null) {
23 return view('login');
24 }
[cf84baa]25 $credentials = request()->validate([
26 'embg' => 'required'
27 ]);
28 $embg = $credentials['embg'];
29
30 $peoples = DB::select('SELECT * FROM people WHERE embg ~ :embg', ['embg' => '^' . $embg]);
31
32 return view('filter', [
33 'peoples' => $peoples
34 ]);
[75151c6]35 }
[d9c4096]36 function get_person($embg){
37 $person = DB::select('SELECT * FROM people WHERE embg=:embg', ['embg' => $embg]);
38 dd($person);
39 return view('register-policeman', [
40 'person' => $person[0]
41 ]);
42 }
[75151c6]43}
Note: See TracBrowser for help on using the repository browser.