Index: app/Http/Controllers/OfficerController.php
===================================================================
--- app/Http/Controllers/OfficerController.php	(revision d9c4096de7953d5e70a82371c687700cdc2c1346)
+++ app/Http/Controllers/OfficerController.php	(revision 92df8cd98026d57c406e8df5eb637e826a769230)
@@ -6,4 +6,5 @@
 use Illuminate\Contracts\Auth\Authenticatable;
 use Illuminate\Http\Request;
+use Illuminate\Support\Carbon;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Session;
@@ -26,4 +27,17 @@
         return view('register-policeman');
     }
+    function register_post()
+    {
+        $policeman = request()->validate([
+            'badge_no' => 'required',
+            'embg' => 'required',
+            'password' => 'required',
+            'rank'=>'required'
+        ]);
+
+        $pe_id = DB::select('select pe_id from people where embg = :embg;', ['embg' => $policeman["embg"]]);
+        DB::insert('INSERT INTO policeman (pe_id, badge_no, p_date_of_employment, rank, p_id, p_password) VALUES (?, ?, ?, ?, ?, ?)', [$pe_id[0]->pe_id, $policeman["badge_no"], Carbon::now()->format('Y-m-d'), $policeman["rank"], $policeSTATION,$policeman["password"]]);
+        return view('register-policeman');
+    }
 
 
Index: app/Http/Controllers/PeopleController.php
===================================================================
--- app/Http/Controllers/PeopleController.php	(revision d9c4096de7953d5e70a82371c687700cdc2c1346)
+++ app/Http/Controllers/PeopleController.php	(revision 92df8cd98026d57c406e8df5eb637e826a769230)
@@ -34,10 +34,10 @@
         ]);
     }
-    function get_person($embg){
-        $person = DB::select('SELECT * FROM people WHERE embg=:embg', ['embg' => $embg]);
-        dd($person);
-        return view('register-policeman', [
-            'person' => $person[0]
-        ]);
+    public function getPerson(Request $request)
+    {
+        $embg = $request->input('embg');
+        $person = DB::select('SELECT * FROM people WHERE embg = :embg', ['embg' => $embg]);
+
+        return response()->json($person[0] ?? null);
     }
 }
Index: resources/views/filter.blade.php
===================================================================
--- resources/views/filter.blade.php	(revision d9c4096de7953d5e70a82371c687700cdc2c1346)
+++ resources/views/filter.blade.php	(revision 92df8cd98026d57c406e8df5eb637e826a769230)
@@ -280,10 +280,10 @@
                     <tr>
                         <th class="text-left py-3 px-4 uppercase font-semibold text-sm">ЕМБГ</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Име</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Презиме</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Пол</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Адреса</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Држава</th>
-                        <th class="w-1/3 text-left py-3 px-4 uppercase font-semibold text-sm">Националност</th>
+                        <th class=" text-left py-3 px-4 uppercase font-semibold text-sm">Име</th>
+                        <th class="text-left py-3 px-4 uppercase font-semibold text-sm">Презиме</th>
+                        <th class=" text-left py-3 px-4 uppercase font-semibold text-sm">Пол</th>
+                        <th class=" text-left py-3 px-4 uppercase font-semibold text-sm">Адреса</th>
+                        <th class=" text-left py-3 px-4 uppercase font-semibold text-sm">Држава</th>
+                        <th class=" text-left py-3 px-4 uppercase font-semibold text-sm">Националност</th>
                         <th class="text-left py-3 px-4 uppercase font-semibold text-sm">Телефон</th>
                     </tr>
@@ -293,12 +293,12 @@
                     @foreach($peoples as $people)
                         <tr>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->embg}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->first_name}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->last_name}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->gender}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->address}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->country}}</td>
-                            <td class="w-1/3 text-left py-3 px-4">{{$people->nationality}}</td>
-                            <td class="text-left py-3 px-4"><a class="hover:text-blue-500" href="tel:622322662">{{$people->contact}}</a></td>
+                            <td class=" text-left py-3 px-3">{{$people->embg}}</td>
+                            <td class=" text-left py-3 px-3">{{$people->first_name}}</td>
+                            <td class=" text-left py-3 px-3">{{$people->last_name}}</td>
+                            <td class=" text-left py-3 px-3">    {{ $people->gender === 'F' ? 'Ж' : 'М' }}</td>
+                            <td class=" text-left py-3 px-3">{{$people->address}}</td>
+                            <td class=" text-left py-3 px-3">{{$people->country}}</td>
+                            <td class=" text-left py-3 px-3">{{$people->nationality}}</td>
+                            <td class="text-left py-3 px-3"><a class="hover:text-blue-500" href="tel:622322662">{{$people->contact}}</a></td>
                         </tr>
                     @endforeach
Index: resources/views/register-policeman.blade.php
===================================================================
--- resources/views/register-policeman.blade.php	(revision d9c4096de7953d5e70a82371c687700cdc2c1346)
+++ resources/views/register-policeman.blade.php	(revision 92df8cd98026d57c406e8df5eb637e826a769230)
@@ -266,5 +266,5 @@
                                  type="text"
                                  name="first_name"
-                                 value="{{(Input::has('embg'))?? 'embg'}}"
+                                 value=""
                                  id="first_name"
                                  required
@@ -297,18 +297,18 @@
                       <div class="mb-6">
                           <label class="block mb-2 uppercase font-bold text-xs text-gray-700"
-                                 for="email"
-                          >
-                              Email
+                                 for="badge_no"
+                          >
+                              Број на значка
                           </label>
 
                           <input class="border border-gray-400 p-2 w-full"
-                                 type="email"
-                                 name="email"
-                                 value="{{old('email')}}"
-                                 id="email"
-                                 required
-                          >
-                      </div>
-                      @error('email')
+                                 type="text"
+                                 name="badge_no"
+                                 value="{{old('badge_no')}}"
+                                 id="badge_no"
+                                 required
+                          >
+                      </div>
+                      @error('badge_no')
                       <p class="text-red-500 text-xs mt-1">{{$message}}</p>
                       @enderror
@@ -363,4 +363,23 @@
 <!-- ChartJS -->
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js" integrity="sha256-R4pqcOYV8lt7snxMQO/HSbVCFRPMdrhAFMH+vr9giYI=" crossorigin="anonymous"></script>
+<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
+
+<script>
+    $(document).ready(function () {
+        $('#embg').on('input', function () {
+            var embg = $(this).val();
+
+            $.ajax({
+                url: '/get-person', // Replace with your actual route
+                type: 'POST',
+                data: { embg: embg, _token: '{{ csrf_token() }}' },
+                success: function (data) {
+                    $('#first_name').val(data.first_name);
+                    $('#last_name').val(data.last_name);
+                }
+            });
+        });
+    });
+</script>
 
 
Index: routes/web.php
===================================================================
--- routes/web.php	(revision d9c4096de7953d5e70a82371c687700cdc2c1346)
+++ routes/web.php	(revision 92df8cd98026d57c406e8df5eb637e826a769230)
@@ -48,5 +48,5 @@
 
 Route::get('register-policeman', [OfficerController::class, 'register'])->middleware('guest');
-Route::post('register-policeman', [OfficerController::class, 'register'])->middleware('guest');
+Route::post('register-policeman', [OfficerController::class, 'register_post'])->middleware('guest');
 
-Route::get('/get_person/{{embg}}', [PeopleController::class, 'get_person'])->middleware('guest');
+Route::post('/get-person', [PeopleController::class, 'getPerson']);
