Changeset 249bf91 for resources/views/employees.blade.php
- Timestamp:
- 06/05/24 13:35:43 (7 months ago)
- Branches:
- main
- Children:
- 768f473
- Parents:
- f7acd52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/views/employees.blade.php
rf7acd52 r249bf91 46 46 background: #3d68ff; 47 47 } 48 /* styles.css */ 49 #clickableTable tr { 50 cursor: pointer; 51 transition: background-color 0.2s ease; 52 } 53 54 #clickableTable tr:hover { 55 background-color: #d7d4d4; 56 } 57 48 58 </style> 49 59 <script src="https://cdn.tailwindcss.com"></script> … … 55 65 @if (Session::get('is_policeman')) 56 66 <a href="#" class="text-white text-3xl font-semibold uppercase hover:text-gray-300">Полицаец</a> 67 <button class="w-full bg-white cta-btn font-semibold py-2 mt-5 rounded-br-lg rounded-bl-lg rounded-tr-lg shadow-lg hover:shadow-xl hover:bg-gray-300 flex items-center justify-center"> 68 <i class="fas fa-plus mr-3"></i> <a href="/register-statement">Додади изјава</a> 69 </button> 57 70 @else 58 71 <a href="#" class="text-white text-3xl font-semibold uppercase hover:text-gray-300">Началник</a> … … 87 100 class="absolute w-full upgrade-btn bottom-0 active-nav-link text-white flex items-center justify-center py-4"> 88 101 <i class="fas fa-arrow-circle-up mr-3"></i> 89 Поставки за профил 102 90 103 </a> 91 104 </aside> … … 98 111 <button @click="isOpen = !isOpen" 99 112 class="realtive z-10 w-12 h-12 rounded-full overflow-hidden border-4 border-gray-400 hover:border-gray-300 focus:border-gray-300 focus:outline-none"> 100 <img src="https://source.unsplash.com/uJ8LNVCBjFQ/400x400"> 113 @php 114 $person = DB::select('select * from people where pe_id=:pe_id;', ['pe_id' => Session::get('pe_id')]); 115 116 if (!empty($person)) { 117 $image = $person[0]->picture; 118 } else { 119 $image = null; 120 } 121 @endphp 122 123 <img src="{{ $image }}"> 124 101 125 </button> 102 126 <button x-show="isOpen" @click="isOpen = false" class="h-full w-full fixed inset-0 cursor-default"></button> … … 173 197 </p> 174 198 <div class="bg-white overflow-auto"> 175 <table class="min-w-full bg-white" >199 <table class="min-w-full bg-white" id="clickableTable"> 176 200 <thead class="bg-gray-800 text-white"> 177 201 <tr> … … 185 209 186 210 @foreach($employees as $employee) 187 <tr >211 <tr data-id="{{$employee->pe_id}}"> 188 212 <td class="w-1/3 text-left py-3 px-4">{{$employee->first_name}}</td> 189 213 <td class="w-1/3 text-left py-3 px-4">{{$employee->last_name}}</td> … … 217 241 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js" 218 242 integrity="sha256-R4pqcOYV8lt7snxMQO/HSbVCFRPMdrhAFMH+vr9giYI=" crossorigin="anonymous"></script> 243 <script> 244 245 document.addEventListener('DOMContentLoaded', function() { 246 const rows = document.querySelectorAll('#clickableTable tr'); 247 248 rows.forEach(row => { 249 row.addEventListener('click', function() { 250 const id = this.getAttribute('data-id'); 251 if (id) { 252 window.location.href = `http://127.0.0.1:8000/employees/${id}`; 253 } 254 }); 255 }); 256 }); 257 258 </script> 219 259 220 260 </body>
Note:
See TracChangeset
for help on using the changeset viewer.