Commit 524793fcac9b52d5930cf0686cdef763e9b16599
Exists in
master
Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su
Showing 1 changed file Inline Diff
resources/views/admin/worker/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Работники']) | 1 | @extends('layout.admin', ['title' => 'Админка - Работники']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | <script> | 4 | <script> |
5 | $(document).ready(function() { | 5 | $(document).ready(function() { |
6 | $(document).on('click', '.checkban', function () { | 6 | $(document).on('click', '.checkban', function () { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var value = this_.val(); | 8 | var value = this_.val(); |
9 | var ajax_block = $('#ajax_block'); | 9 | var ajax_block = $('#ajax_block'); |
10 | var bool = 0; | 10 | var bool = 0; |
11 | 11 | ||
12 | if(this.checked){ | 12 | if(this.checked){ |
13 | bool = 1; | 13 | bool = 1; |
14 | } else { | 14 | } else { |
15 | bool = 0; | 15 | bool = 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | $.ajax({ | 18 | $.ajax({ |
19 | type: "GET", | 19 | type: "GET", |
20 | url: "{{ url()->full()}}", | 20 | url: "{{ url()->full()}}", |
21 | data: "id=" + value + "&is_ban=" + bool, | 21 | data: "id=" + value + "&is_ban=" + bool, |
22 | success: function (data) { | 22 | success: function (data) { |
23 | console.log('Обновление таблицы работников '); | 23 | console.log('Обновление таблицы работников '); |
24 | //data = JSON.parse(data); | 24 | //data = JSON.parse(data); |
25 | console.log(data); | 25 | console.log(data); |
26 | ajax_block.html(data); | 26 | ajax_block.html(data); |
27 | }, | 27 | }, |
28 | headers: { | 28 | headers: { |
29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
30 | }, | 30 | }, |
31 | error: function (data) { | 31 | error: function (data) { |
32 | console.log('Error: ' + data); | 32 | console.log('Error: ' + data); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | }); | 35 | }); |
36 | 36 | ||
37 | }); | 37 | }); |
38 | </script> | 38 | </script> |
39 | @endsection | 39 | @endsection |
40 | 40 | ||
41 | @section('search') | 41 | @section('search') |
42 | @include('admin.find_worker', ['find_status_work' => $find_status_work]) | 42 | @include('admin.find_worker', ['find_status_work' => $find_status_work]) |
43 | @endsection | 43 | @endsection |
44 | 44 | ||
45 | @section('content') | 45 | @section('content') |
46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
47 | <div class="w-full overflow-x-auto"> | 47 | <div class="w-full overflow-x-auto"> |
48 | <table class="w-full whitespace-no-wrap"> | 48 | <table class="w-full whitespace-no-wrap"> |
49 | <thead> | 49 | <thead> |
50 | <tr | 50 | <tr |
51 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | 51 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" |
52 | > | 52 | > |
53 | <th class="px-4 py-3">№</th> | 53 | <th class="px-4 py-3">№</th> |
54 | <th class="px-4 py-3">Имя</th> | 54 | <th class="px-4 py-3">ФИО</th> |
55 | <th class="px-4 py-3">Email/Телефон</th> | 55 | <th class="px-4 py-3">Email/Телефон</th> |
56 | <th class="px-4 py-3">% заполнения анкеты</th> | 56 | <th class="px-4 py-3">% заполнения анкеты</th> |
57 | <th class="px-4 py-3">Должность</th> | 57 | <th class="px-4 py-3">Должность</th> |
58 | <th class="px-4 py-3">Дата регистрации</th> | 58 | <th class="px-4 py-3">Дата регистрации</th> |
59 | <th class="px-4 py-3">Изменить</th> | 59 | <th class="px-4 py-3">Изменить</th> |
60 | <!--<th class="px-4 py-3">Бан</th>--> | 60 | <!--<th class="px-4 py-3">Бан</th>--> |
61 | </tr> | 61 | </tr> |
62 | </thead> | 62 | </thead> |
63 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 63 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
64 | @foreach($users as $user) | 64 | @foreach($users as $user) |
65 | <tr class="text-gray-700 dark:text-gray-400"> | 65 | <tr class="text-gray-700 dark:text-gray-400"> |
66 | <td class="px-4 py-3"> | 66 | <td class="px-4 py-3"> |
67 | {{$user->id}} | 67 | {{$user->id}} |
68 | </td> | 68 | </td> |
69 | <td class="px-4 py-3"> | 69 | <td class="px-4 py-3"> |
70 | {{ !empty($user->name_man) ? $user->name_man : $user->name }} | 70 | {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }} |
71 | </td> | 71 | </td> |
72 | <td class="px-4 py-3 text-sm"> | 72 | <td class="px-4 py-3 text-sm"> |
73 | <div class="flex items-center text-sm"> | 73 | <div class="flex items-center text-sm"> |
74 | <div> | 74 | <div> |
75 | <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p> | 75 | <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p> |
76 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 76 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
77 | {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} | 77 | {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} |
78 | </p> | 78 | </p> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | </td> | 81 | </td> |
82 | <td class="px-4 py-3 text-xs"> | 82 | <td class="px-4 py-3 text-xs"> |
83 | @if (isset($user->workers[0]->persent_anketa)) | 83 | @if (isset($user->workers[0]->persent_anketa)) |
84 | @if ($user->workers[0]->persent_anketa > 40) | 84 | @if ($user->workers[0]->persent_anketa > 40) |
85 | <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> | 85 | <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> |
86 | {{$user->workers[0]->persent_anketa}}% | 86 | {{$user->workers[0]->persent_anketa}}% |
87 | </span> | 87 | </span> |
88 | @else | 88 | @else |
89 | <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> | 89 | <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> |
90 | {{$user->workers[0]->persent_anketa}}% | 90 | {{$user->workers[0]->persent_anketa}}% |
91 | </span> | 91 | </span> |
92 | @endif | 92 | @endif |
93 | @else | 93 | @else |
94 | <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> | 94 | <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> |
95 | 0% | 95 | 0% |
96 | </span> | 96 | </span> |
97 | @endif | 97 | @endif |
98 | </td> | 98 | </td> |
99 | <td class="px-4 py-3 text-sm"> | 99 | <td class="px-4 py-3 text-sm"> |
100 | @if (isset($user->jobtitles[0]->name)) | 100 | @if (isset($user->jobtitles[0]->name)) |
101 | {{ $user->jobtitles[0]->name }} | 101 | {{ $user->jobtitles[0]->name }} |
102 | @else | 102 | @else |
103 | Не задана | 103 | Не задана |
104 | @endif | 104 | @endif |
105 | </td> | 105 | </td> |
106 | <td class="px-4 py-3 text-sm"> | 106 | <td class="px-4 py-3 text-sm"> |
107 | {{ $user->created_at }} | 107 | {{ $user->created_at }} |
108 | </td> | 108 | </td> |
109 | <td class="px-4 py-3 text-sm"> | 109 | <td class="px-4 py-3 text-sm"> |
110 | @if ($user->id > 1) | 110 | <!--if ($user->id > 1)--> |
111 | @if (isset($user->workers[0]->id)) | 111 | @if (isset($user->workers[0]->id)) |
112 | <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a> | 112 | <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a> |
113 | 113 | ||
114 | @endif | 114 | @endif |
115 | @endif | 115 | <!--endif--> |
116 | </td> | 116 | </td> |
117 | <!--<td class="px-4 py-3 text-sm"> | 117 | <!--<td class="px-4 py-3 text-sm"> |
118 | @if ($user->id > 1) | 118 | @if ($user->id > 1) |
119 | <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 119 | <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
120 | @endif | 120 | @endif |
121 | </td>--> | 121 | </td>--> |
122 | </tr> | 122 | </tr> |
123 | @endforeach | 123 | @endforeach |
124 | </tbody> | 124 | </tbody> |
125 | </table> | 125 | </table> |
126 | </div> | 126 | </div> |
127 | 127 | ||
128 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> | 128 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> |
129 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> | 129 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> |
130 | </div> | 130 | </div> |
131 | 131 | ||
132 | 132 | ||
133 | <!--<div | 133 | <!--<div |
134 | class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800" | 134 | class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800" |
135 | > | 135 | > |
136 | <span class="flex items-center col-span-3"> | 136 | <span class="flex items-center col-span-3"> |
137 | Showing 21-30 of 100 | 137 | Showing 21-30 of 100 |
138 | </span> | 138 | </span> |
139 | <span class="col-span-2"></span> | 139 | <span class="col-span-2"></span> |
140 | 140 | ||
141 | <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> | 141 | <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> |
142 | <nav aria-label="Table navigation"> | 142 | <nav aria-label="Table navigation"> |
143 | <ul class="inline-flex items-center"> | 143 | <ul class="inline-flex items-center"> |
144 | <li> | 144 | <li> |
145 | <button | 145 | <button |
146 | class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" | 146 | class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" |
147 | aria-label="Previous" | 147 | aria-label="Previous" |
148 | > | 148 | > |
149 | <svg | 149 | <svg |
150 | aria-hidden="true" | 150 | aria-hidden="true" |
151 | class="w-4 h-4 fill-current" | 151 | class="w-4 h-4 fill-current" |
152 | viewBox="0 0 20 20" | 152 | viewBox="0 0 20 20" |
153 | > | 153 | > |
154 | <path | 154 | <path |
155 | d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" | 155 | d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" |
156 | clip-rule="evenodd" | 156 | clip-rule="evenodd" |
157 | fill-rule="evenodd" | 157 | fill-rule="evenodd" |
158 | ></path> | 158 | ></path> |
159 | </svg> | 159 | </svg> |
160 | </button> | 160 | </button> |
161 | </li> | 161 | </li> |
162 | <li> | 162 | <li> |
163 | <button | 163 | <button |
164 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | 164 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" |
165 | > | 165 | > |
166 | 1 | 166 | 1 |
167 | </button> | 167 | </button> |
168 | </li> | 168 | </li> |
169 | <li> | 169 | <li> |
170 | <button | 170 | <button |
171 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | 171 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" |
172 | > | 172 | > |
173 | 2 | 173 | 2 |
174 | </button> | 174 | </button> |
175 | </li> | 175 | </li> |
176 | <li> | 176 | <li> |
177 | <button | 177 | <button |
178 | class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple" | 178 | class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple" |
179 | > | 179 | > |
180 | 3 | 180 | 3 |
181 | </button> | 181 | </button> |
182 | </li> | 182 | </li> |
183 | <li> | 183 | <li> |
184 | <button | 184 | <button |
185 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | 185 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" |
186 | > | 186 | > |
187 | 4 | 187 | 4 |
188 | </button> | 188 | </button> |
189 | </li> | 189 | </li> |
190 | <li> | 190 | <li> |
191 | <span class="px-3 py-1">...</span> | 191 | <span class="px-3 py-1">...</span> |
192 | </li> | 192 | </li> |
193 | <li> | 193 | <li> |
194 | <button | 194 | <button |
195 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | 195 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" |
196 | > | 196 | > |
197 | 8 | 197 | 8 |
198 | </button> | 198 | </button> |
199 | </li> | 199 | </li> |
200 | <li> | 200 | <li> |
201 | <button | 201 | <button |
202 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | 202 | class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" |
203 | > | 203 | > |
204 | 9 | 204 | 9 |
205 | </button> | 205 | </button> |
206 | </li> | 206 | </li> |
207 | <li> | 207 | <li> |
208 | <button | 208 | <button |
209 | class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" | 209 | class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" |
210 | aria-label="Next" | 210 | aria-label="Next" |
211 | > | 211 | > |
212 | <svg | 212 | <svg |
213 | class="w-4 h-4 fill-current" | 213 | class="w-4 h-4 fill-current" |
214 | aria-hidden="true" | 214 | aria-hidden="true" |
215 | viewBox="0 0 20 20" | 215 | viewBox="0 0 20 20" |
216 | > | 216 | > |
217 | <path | 217 | <path |
218 | d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" | 218 | d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" |
219 | clip-rule="evenodd" | 219 | clip-rule="evenodd" |
220 | fill-rule="evenodd" | 220 | fill-rule="evenodd" |
221 | ></path> | 221 | ></path> |
222 | </svg> | 222 | </svg> |
223 | </button> | 223 | </button> |
224 | </li> | 224 | </li> |
225 | </ul> | 225 | </ul> |
226 | </nav> | 226 | </nav> |
227 | </span> | 227 | </span> |
228 | </div>--> | 228 | </div>--> |
229 | </div> | 229 | </div> |
230 | 230 | ||
231 | <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> | 231 | <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> |
232 | 232 | ||
233 | 233 | ||
234 | @endsection | 234 | @endsection |
235 | 235 |