Commit 3b5d35d615587e83fa5ec8c5efc86765c4ffe050

Authored by Fedor K
Exists in master

Merge branch 'task-132687' into 'master'

task-132687 minor changes

Showing 12 changed files Side-by-side Diff

app/Classes/Tools.php
... ... @@ -51,13 +51,13 @@ class Tools
51 51 ];
52 52  
53 53 foreach ($workerFields as $fieldName) {
54   - if (!empty($Worker->$fieldName)) {
  54 + if (!empty($Worker->$fieldName) && $Worker->$fieldName !== 'Не указано') {
55 55 $persent += 2.8;
56 56 }
57 57 }
58 58  
59 59 foreach ($workerUserFields as $fieldName) {
60   - if (!empty($Worker->user->$fieldName)) {
  60 + if (!empty($Worker->users->$fieldName)) {
61 61 $persent += 2.8;
62 62 }
63 63 }
app/Http/Controllers/EmployerController.php
... ... @@ -566,8 +566,10 @@ class EmployerController extends Controller
566 566 }
567 567  
568 568 // Данные
569   - $users = $users->Baseuser()->
570   - orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
  569 + $users = $users
  570 + ->Baseuser()
  571 + ->orderByDesc(Worker::select('created_at')
  572 + ->whereColumn('workers.user_id', 'users.id'));
571 573 $count_users = $users->count();
572 574 $users = $users->paginate(10);
573 575  
app/Http/Controllers/WorkerController.php
... ... @@ -30,6 +30,7 @@ use Illuminate\Auth\Events\Registered;
30 30 use Illuminate\Database\Eloquent\Builder;
31 31 use Illuminate\Http\Request;
32 32 use Illuminate\Support\Facades\Auth;
  33 +use Illuminate\Support\Facades\DB;
33 34 use Illuminate\Support\Facades\Hash;
34 35 use Illuminate\Support\Facades\Storage;
35 36 use Illuminate\Support\Facades\Validator;
... ... @@ -247,15 +248,14 @@ class WorkerController extends Controller
247 248 $status_work = WorkerStatuses::getWorkerStatuses();
248 249 $infoblocks = infobloks::query()->get();
249 250  
250   - //dd($Query[0]);
251   - return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
  251 + //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
252 252 $pdf = PDF::loadView('layout.pdf', [
253 253 'Query' => $Query,
254 254 'status_work' => $status_work,
255 255 'infoblocks' => $infoblocks
256 256 ])->setPaper('a4', 'landscape');
257 257  
258   - return $pdf->stream();
  258 + return $pdf->download();
259 259 }
260 260  
261 261 public function resume_download_all(Request $request) {
... ... @@ -276,18 +276,26 @@ class WorkerController extends Controller
276 276 return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.');
277 277 }
278 278  
279   - $query = User::select($columns)
280   - ->leftJoin('workers', 'users.id', '=', 'workers.user_id')
281   - ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id')
282   - ->where('users.is_bd', '=', 1);
  279 + $jobIds = $request->input('job_title_list', []);
  280 +
  281 + $users = DB::select(
  282 + "select `job_titles`.`name`, `users`.`surname`, `users`.`name_man`, `users`.`surname2`, `users`.`email`, `users`.`telephone`
  283 + from users
  284 + join workers on `users`.`id` = `workers`.`user_id`
  285 + join `job_titles`
  286 + where `users`.`is_bd` = 1
  287 + and (`workers`.`position_work` = `job_titles`.`id`
  288 + or exists (select 1
  289 + from JSON_TABLE(
  290 + workers.positions_work,
  291 + '$[*]' COLUMNS (id INT PATH '$')) pw
  292 + where pw.id = job_titles.id)
  293 + )". ((!empty($jobIds)) ? 'and job_titles.id in ('. implode(',', $jobIds).')' : '')
  294 + );
283 295  
284   - $job_title_list = $request->input('job_title_list', []);
285   - if (!empty($job_title_list)){
286   - $query->whereIn('job_titles.id', $job_title_list);
287   - }
  296 + $users = collect($users);
288 297  
289   - $users = $query->get();
290   - if ($users->count()){
  298 + if ($users->count()) {
291 299 $i = 2;
292 300 foreach ($users->toArray() as $user){
293 301 $j = 0;
... ... @@ -580,40 +588,12 @@ class WorkerController extends Controller
580 588 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
581 589 }
582 590  
583   - /*$haystack = $request->get('password');
584   -
585   - $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
586   - $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
587   - 'X', 'C', 'V', 'B', 'N', 'M');
588   - $lenpwd_bool = true;
589   - $spec_bool = false;
590   - $alpha_bool = false;
591   -
592   - if (strlen($haystack) < 8) $lenpwd_bool = false;
593   -
594   - foreach ($specsumbol as $it) {
595   - if (strpos($haystack, $it) !== false) {
596   - $spec_bool = true;
597   - }
598   - }
599   -
600   - foreach ($alpha as $it) {
601   - if (strpos($haystack, $it) !== false) {
602   - $alpha_bool = true;
603   - }
604   - }
605   -
606   - if ((!$spec_bool) || (!$alpha_bool)) {
607   - return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
608   - }*/
609   -
610 591 if (($request->has('politik')) && ($request->get('politik') == 1)) {
611 592 $validator = Validator::make($params, $rules, $messages);
612 593  
613 594 if ($validator->fails()) {
614 595 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
615 596 } else {
616   - //dd($params);
617 597 $user = $this->create($params);
618 598 event(new Registered($user));
619 599 Auth::guard()->login($user);
... ... @@ -6,6 +6,7 @@ namespace App\Models;
6 6 use Illuminate\Database\Eloquent\Factories\HasFactory;
7 7 use Illuminate\Foundation\Auth\User as Authenticatable;
8 8 use Illuminate\Notifications\Notifiable;
  9 +use JsonException;
9 10 use Laravel\Sanctum\HasApiTokens;
10 11  
11 12 class User extends Authenticatable
... ... @@ -87,7 +88,8 @@ class User extends Authenticatable
87 88 * users - workers
88 89 */
89 90 public function work() {
90   - return $this->hasMany(Worker::class, 'user_id')->select('telephone', 'email', 'position_work', 'persent_anketa');
  91 + return $this->hasMany(Worker::class, 'user_id')
  92 + ->select('telephone', 'email', 'position_work', 'persent_anketa');
91 93 }
92 94  
93 95 /*
... ... @@ -156,4 +158,22 @@ class User extends Authenticatable
156 158 return $query->where('admin', '=', '0');
157 159 }
158 160  
  161 + /**
  162 + * @throws JsonException
  163 + */
  164 + public function getJobAttribute(): ?string
  165 + {
  166 + $positions = $this->workers[0]?->positions_work;
  167 + if (is_string($positions)) {
  168 + $jobIds = json_decode($positions, true, 512, JSON_THROW_ON_ERROR);
  169 + } else {
  170 + $jobIds = $positions;
  171 + }
  172 +
  173 + if ($jobIds !== null && count($jobIds) > 0) {
  174 + return Job_title::whereIn('id', $jobIds)->first()->name;
  175 + }
  176 + return null;
  177 + }
  178 +
159 179 }
resources/views/admin/worker/edit.blade.php
... ... @@ -15,48 +15,59 @@ use Illuminate\Support\Facades\Storage;
15 15 <label for="tab-btn-1">Общие настройки</label>
16 16 <input type="radio" name="tab-btn" id="tab-btn-2" value="">
17 17 <label for="tab-btn-2">Анкета</label>
18   - <!--<input type="radio" name="tab-btn" id="tab-btn-3" value="">
19   - <label for="tab-btn-3">Вкладка 3</label>-->
20 18 <div id="content-1">
  19 +
21 20 <label class="block text-sm">
22   - <span class="text-gray-700 dark:text-gray-400">Должность соискателя</span>
23   - <select name="position_work" id="position_work" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray">
24   - @foreach($job_titles as $job)
25   - <option value="{{ $job->id }}"
26   - @if($worker->position_work == $job->id)
27   - selected
28   - @endif
29   - >{{ $job->name }} ({{ $job->id }})</option>
  21 + <span class="text-gray-700 dark:text-gray-400">Должность</span>
  22 + <select
  23 + name="positions_work[]"
  24 + id="positions_work[]"
  25 + data-placeholder="Выберите должность"
  26 + {{--multiple="multiple"--}}
  27 + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
  28 + >
  29 + <option value="{{ null }}">
  30 + Не выбрано
  31 + </option>
  32 + @foreach($job_titles as $job_title)
  33 + <option value="{{ $job_title->id }}"
  34 + @if ($worker?->positions_work && in_array($job_title->id , $worker->positions_work))
  35 + selected
  36 + @endif
  37 + >
  38 + {{ $job_title->name }} ({{ $job_title->id }})
  39 + </option>
30 40 @endforeach
31 41 </select>
32   - @error('position_work')
  42 + @error('positions_work')
33 43 <span class="text-xs text-red-600 dark:text-red-400">
34 44 {{ $message }}
35 45 </span>
36 46 @enderror
37   - </label><br>
38   -
  47 + </label>
  48 + <br>
39 49 <label class="block text-sm">
40 50 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Избранный кандидат </p>
41 51 <input type="hidden" name="favorite_user" value="0" />
42   - <input name="favorite_user" <? if ($worker->favorite_user) echo "checked";?>
  52 + <input name="favorite_user" <?= $worker->favorite_user ? "checked" : '';?>
43 53 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
44 54 placeholder="" type="checkbox" value="1"
45 55 /><br>
46 56  
47 57 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Срочный кандидат</p>
48 58 <input type="hidden" name="sroch_user" value="0" />
49   - <input name="sroch_user" id="sroch_user" <? if ($worker->sroch_user) echo "checked";?>
  59 + <input name="sroch_user" id="sroch_user" <?= $worker->sroch_user ? "checked" : '';?>
50 60 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
51 61 placeholder="" type="checkbox" value="1"
52 62 /><br>
53 63  
54 64 </label>
55   -
  65 + <br>
56 66 <label class="block text-sm">
57 67 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета действительна до <span style="color:#333">{{ $time_end_anketa }}</span></p>
58 68  
59   - </label><br>
  69 + </label>
  70 + <br>
60 71 </div>
61 72 <div id="content-2">
62 73 <label class="block text-sm">
... ... @@ -147,11 +158,8 @@ use Illuminate\Support\Facades\Storage;
147 158 >{{ old('text') ?? $worker->text ?? '' }}</textarea>
148 159 </label>
149 160 </div>
150   - <div id="content-3">
151   -
152   - </div>
153   - </div><br>
154   -
  161 + </div>
  162 + <br>
155 163 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
156 164 <div>
157 165 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
... ... @@ -165,227 +173,4 @@ use Illuminate\Support\Facades\Storage;
165 173 </div>
166 174 </div>
167 175 </form>
168   - <!--
169   - <label class="block mt-4 text-sm">
170   - <span class="text-gray-700 dark:text-gray-400">
171   - Requested Limit
172   - </span>
173   - <select
174   - class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
175   - >
176   - <option>$1,000</option>
177   - <option>$5,000</option>
178   - <option>$10,000</option>
179   - <option>$25,000</option>
180   - </select>
181   - </label>
182   -
183   - <label class="block mt-4 text-sm">
184   - <span class="text-gray-700 dark:text-gray-400">
185   - Multiselect
186   - </span>
187   - <select
188   - class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
189   - multiple
190   - >
191   - <option>Option 1</option>
192   - <option>Option 2</option>
193   - <option>Option 3</option>
194   - <option>Option 4</option>
195   - <option>Option 5</option>
196   - </select>
197   - </label>
198   -
199   - <label class="block mt-4 text-sm">
200   - <span class="text-gray-700 dark:text-gray-400">Message</span>
201   - <textarea
202   - class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
203   - rows="3"
204   - placeholder="Enter some long form content."
205   - ></textarea>
206   - </label>
207   -
208   - <div class="flex mt-6 text-sm">
209   - <label class="flex items-center dark:text-gray-400">
210   - <input
211   - type="checkbox"
212   - class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
213   - />
214   - <span class="ml-2">
215   - I agree to the
216   - <span class="underline">privacy policy</span>
217   - </span>
218   - </label>
219   - </div>
220   -</div>
221   -
222   -<!-- Validation inputs -->
223   - <!--<h4
224   - class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
225   - >
226   - Validation
227   - </h4>
228   - <div
229   - class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
230   - >
231   - <!-- Invalid input -->
232   - <!--<label class="block text-sm">
233   - <span class="text-gray-700 dark:text-gray-400">
234   - Invalid input
235   - </span>
236   - <input
237   - class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input"
238   - placeholder="Jane Doe"
239   - />
240   - <span class="text-xs text-red-600 dark:text-red-400">
241   - Your password is too short.
242   - </span>
243   - </label>
244   -
245   - <!-- Valid input -->
246   - <!--<label class="block mt-4 text-sm">
247   - <span class="text-gray-700 dark:text-gray-400">
248   - Valid input
249   - </span>
250   - <input
251   - class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input"
252   - placeholder="Jane Doe"
253   - />
254   - <span class="text-xs text-green-600 dark:text-green-400">
255   - Your password is strong.
256   - </span>
257   - </label>
258   -
259   - <!-- Helper text -->
260   - <!--<label class="block mt-4 text-sm">
261   - <span class="text-gray-700 dark:text-gray-400">
262   - Helper text
263   - </span>
264   - <input
265   - class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
266   - placeholder="Jane Doe"
267   - />
268   - <span class="text-xs text-gray-600 dark:text-gray-400">
269   - Your password must be at least 6 characters long.
270   - </span>
271   - </label>
272   -</div>
273   -
274   -<!-- Inputs with icons -->
275   - <!--<h4
276   - class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
277   - >
278   - Icons
279   - </h4>
280   - <div
281   - class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
282   - >
283   - <label class="block text-sm">
284   - <span class="text-gray-700 dark:text-gray-400">Icon left</span>
285   - <!-- focus-within sets the color for the icon when input is focused -->
286   - <!--<div
287   - class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
288   - >
289   - <input
290   - class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
291   - placeholder="Jane Doe"
292   - />
293   - <div
294   - class="absolute inset-y-0 flex items-center ml-3 pointer-events-none"
295   - >
296   - <svg
297   - class="w-5 h-5"
298   - aria-hidden="true"
299   - fill="none"
300   - stroke-linecap="round"
301   - stroke-linejoin="round"
302   - stroke-width="2"
303   - viewBox="0 0 24 24"
304   - stroke="currentColor"
305   - >
306   - <path
307   - d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
308   - ></path>
309   - </svg>
310   - </div>
311   - </div>
312   -</label>
313   -
314   -<label class="block mt-4 text-sm">
315   - <span class="text-gray-700 dark:text-gray-400">Icon right</span>
316   - <!-- focus-within sets the color for the icon when input is focused -->
317   - <!--<div
318   - class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
319   - >
320   - <input
321   - class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
322   - placeholder="Jane Doe"
323   - />
324   - <div
325   - class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none"
326   - >
327   - <svg
328   - class="w-5 h-5"
329   - aria-hidden="true"
330   - fill="none"
331   - stroke-linecap="round"
332   - stroke-linejoin="round"
333   - stroke-width="2"
334   - viewBox="0 0 24 24"
335   - stroke="currentColor"
336   - >
337   - <path
338   - d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
339   - ></path>
340   - </svg>
341   - </div>
342   - </div>
343   -</label>
344   -</div>
345   -
346   -<!-- Inputs with buttons -->
347   - <!--<h4
348   - class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
349   - >
350   - Buttons
351   - </h4>
352   - <div
353   - class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
354   - >
355   - <label class="block text-sm">
356   - <span class="text-gray-700 dark:text-gray-400">
357   - Button left
358   - </span>
359   - <div class="relative">
360   - <input
361   - class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
362   - placeholder="Jane Doe"
363   - />
364   - <button
365   - class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
366   - >
367   - Click
368   - </button>
369   - </div>
370   - </label>
371   -
372   - <label class="block mt-4 text-sm">
373   - <span class="text-gray-700 dark:text-gray-400">
374   - Button right
375   - </span>
376   - <div
377   - class="relative text-gray-500 focus-within:text-purple-600"
378   - >
379   - <input
380   - class="block w-full pr-20 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
381   - placeholder="Jane Doe"
382   - />
383   - <button
384   - class="absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
385   - >
386   - Click
387   - </button>
388   - </div>
389   - </label>
390   - </div>-->
391 176 @endsection
resources/views/admin/worker/index.blade.php
... ... @@ -145,8 +145,8 @@
145 145 </td>
146 146  
147 147 <td class="px-4 py-3 text-xs">
148   - @if (isset($user->jobtitles[0]->name))
149   - {{ $user->jobtitles[0]->name }}
  148 + @if ($user->job !== null)
  149 + {{ $user->job }}
150 150 @else
151 151 Не задана
152 152 @endif
... ... @@ -169,107 +169,5 @@
169 169 <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">
170 170 <?=$users->appends($_GET)->links('admin.pagginate'); ?>
171 171 </div>
172   -
173   -
174   - <!--<div
175   - 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"
176   - >
177   - <span class="flex items-center col-span-3">
178   - Showing 21-30 of 100
179   - </span>
180   - <span class="col-span-2"></span>
181   -
182   - <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
183   - <nav aria-label="Table navigation">
184   - <ul class="inline-flex items-center">
185   - <li>
186   - <button
187   - class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
188   - aria-label="Previous"
189   - >
190   - <svg
191   - aria-hidden="true"
192   - class="w-4 h-4 fill-current"
193   - viewBox="0 0 20 20"
194   - >
195   - <path
196   - 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"
197   - clip-rule="evenodd"
198   - fill-rule="evenodd"
199   - ></path>
200   - </svg>
201   - </button>
202   - </li>
203   - <li>
204   - <button
205   - class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
206   - >
207   - 1
208   - </button>
209   - </li>
210   - <li>
211   - <button
212   - class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
213   - >
214   - 2
215   - </button>
216   - </li>
217   - <li>
218   - <button
219   - 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"
220   - >
221   - 3
222   - </button>
223   - </li>
224   - <li>
225   - <button
226   - class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
227   - >
228   - 4
229   - </button>
230   - </li>
231   - <li>
232   - <span class="px-3 py-1">...</span>
233   - </li>
234   - <li>
235   - <button
236   - class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
237   - >
238   - 8
239   - </button>
240   - </li>
241   - <li>
242   - <button
243   - class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
244   - >
245   - 9
246   - </button>
247   - </li>
248   - <li>
249   - <button
250   - class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
251   - aria-label="Next"
252   - >
253   - <svg
254   - class="w-4 h-4 fill-current"
255   - aria-hidden="true"
256   - viewBox="0 0 20 20"
257   - >
258   - <path
259   - 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"
260   - clip-rule="evenodd"
261   - fill-rule="evenodd"
262   - ></path>
263   - </svg>
264   - </button>
265   - </li>
266   - </ul>
267   - </nav>
268   - </span>
269   - </div>-->
270 172 </div>
271   -
272   - <?//=$users->appends($_GET)->links('catalogs.paginate'); ?>
273   -
274   -
275 173 @endsection
resources/views/employers/bd.blade.php
... ... @@ -136,7 +136,7 @@
136 136 </div>
137 137 <span>
138 138 Пользователей найдено:
139   - <b>{{ $users->count() }}</b>
  139 + <b>{{ $count_users }}</b>
140 140 </span>
141 141 </div>
142 142 <div class="table table_spoiler">
... ... @@ -167,12 +167,7 @@
167 167  
168 168 <td>
169 169 @if($it->workers[0]->positions_work)
170   - @foreach($it->workers[0]->jobs as $job)
171   - {{ $job->name }}
172   - @if(!$loop->last)
173   - <br>
174   - @endif
175   - @endforeach
  170 + {{ $it->workers[0]->jobs->first()->name }}
176 171 @endif
177 172 </td>
178 173  
resources/views/info_company_new.blade.php
... ... @@ -5,7 +5,6 @@
5 5 $(document).on('change', '#sort_ajax', function() {
6 6 var this_ = $(this);
7 7 var val_ = this_.val();
8   - console.log('sort items '+val_);
9 8  
10 9 $.ajax({
11 10 type: "GET",
... ... @@ -30,8 +29,6 @@
30 29 url: "{{ route('shipping_companies') }}",
31 30 data: "sort="+val_+"&block=2",
32 31 success: function (data) {
33   - console.log('Выбор сортировки2');
34   - console.log(data);
35 32 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 33 $('#block_2').html(data);
37 34 },
... ... @@ -49,7 +46,6 @@
49 46 var sel = $('#select2-sort_ajax-container');
50 47 var key = getUrlParameter('sort');
51 48 if (key !=='') {
52   - console.log(key);
53 49 switch (key) {
54 50 case "default": sel.html('Сортировка (по умолчанию)'); break;
55 51 case "name_up": sel.html('По имени (возрастание)'); break;
... ... @@ -61,23 +57,6 @@
61 57 }
62 58 });
63 59  
64   - //end
65   - $(document).on('click', '.js_send_it_button', function() {
66   - var this_ = $(this);
67   - var code_user_id = this_.attr('data-uid');
68   - var code_to_user_id = this_.attr('data-tuid');
69   - var code_vacancy = this_.attr('data-vacancy');
70   - var user_id = $('#send_user_id');
71   - var to_user_id = $('#send_to_user_id');
72   - var vacancy = $('#send_vacancy');
73   -
74   - console.log('Клик на кнопки...');
75   -
76   - user_id.val(code_user_id);
77   - to_user_id.val(code_to_user_id);
78   - vacancy.val(code_vacancy);
79   - });
80   -
81 60 $("#list_button").on('click', function () {
82 61 $('#flot').removeClass('active');
83 62 $('#flot_list').removeClass('showed');
... ... @@ -86,6 +65,7 @@
86 65 })
87 66 </script>
88 67 @include('js.favorite-vacancy-45')
  68 + @include('js.vacancy-response')
89 69 @endsection
90 70  
91 71 @section('content')
... ... @@ -113,7 +93,6 @@
113 93 @endif
114 94  
115 95 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
116   - <!--<p class="thing__text"> $company[0]->text !!}</p>-->
117 96 <div class="thing__buttons">
118 97 <a href="#vacancy" id="list_button">
119 98 <button type="button" class="button">
... ... @@ -123,16 +102,28 @@
123 102 {{ $company[0]->ads->count() }} вакансии
124 103 </button>
125 104 </a>
126   - @if ($user_id == 0)
127   - <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
  105 + @guest
  106 + <a
  107 + data-fancybox
  108 + data-src="#question"
  109 + data-options='{"touch":false,"autoFocus":false}'
  110 + class="button">
128 111 Написать сообщение
129 112 </a>
130 113 @else
131   - <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
132   - class="button js_send_it_button">
133   - Написать сообщение
134   - </button>
135   - @endif
  114 + @if (App\Classes\StatusUser::Status() == 1)
  115 + <a
  116 + data-fancybox
  117 + data-src="#send3"
  118 + data-vacancy="0"
  119 + data-uid="{{ $user_id }}"
  120 + data-tuid="{{ $company[0]->users->id }}"
  121 + data-options='{"touch":false,"autoFocus":false}'
  122 + class="button">
  123 + Написать сообщение
  124 + </a>
  125 + @endif
  126 + @endguest
136 127 </div>
137 128 </div>
138 129 </div>
... ... @@ -250,13 +241,17 @@
250 241 </div>
251 242 @endif
252 243 <div class="main__employer-page-two-item-buttons">
253   -
254   - <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
255   - class="button main__employer-page-two-item-button js_send_it_button">Оставить
256   - отклик...</button>
257   -
258   - <!--<a href="#"
259   - class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
  244 + <button type="button"
  245 + data-fancybox
  246 + data-src="#send3"
  247 + data-vacancy="{{ $job->id }}"
  248 + data-uid="{{ $user_id }}"
  249 + data-tuid="{{ $company[0]->users->id }}"
  250 + data-options='{"touch":false,"autoFocus":false}'
  251 + class="button main__employer-page-two-item-button js_send_it_button"
  252 + >
  253 + Оставить отклик
  254 + </button>
260 255 </div>
261 256 <div class="main__employer-page-two-item-bottom">
262 257 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
resources/views/modals/send_worker.blade.php
... ... @@ -3,8 +3,6 @@
3 3 var val = $(this).val();
4 4 var send_title = $('#send_title');
5 5 var send_title_val = send_title.val();
6   -
7   - console.log('Click form.');
8 6 });
9 7  
10 8 $(document).on('change', '#btn_send_file', function() {
... ... @@ -13,7 +11,6 @@
13 11 var send_name_val = send_name.val();
14 12 var send_name_file = $('#send_name_file');
15 13  
16   - console.log(send_name_val);
17 14 send_name_file.html(send_name_val);
18 15  
19 16 });
... ... @@ -31,20 +28,6 @@
31 28 Вакансия:
32 29 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
33 30 </div>
34   - <div class="modal__form-item send_title_div error_">
35   - <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
36   - <label for="title">Не заполнено поле</label>
37   - </div>
38   - <div class="modal__form-item send_title_div error_">
39   - <select class="js-select2" name="send_job_title_id" id="send_job_title_id">
40   - @if ($jobs->count())
41   - @foreach($jobs as $j)
42   - <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option>
43   - @endforeach
44   - @endif
45   - </select>
46   - <label for="title">Не заполнено поле</label>
47   - </div>
48 31 <div class="modal__form-item send_text_div">
49 32 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
50 33 <label for="i2">Не заполнено поле</label>
resources/views/modals/vacancy/add_comment.blade.php
  1 +<script>
  2 + $('[data-fancybox]').fancybox({
  3 + autoFocus: false
  4 + });
  5 +</script>
1 6 <div id="add_comment" class="modal">
2 7 <div class="modal__body">
3 8 <div class="modal__title">Комментарий для работодателя</div>
... ... @@ -18,8 +23,7 @@
18 23 name="text"
19 24 placeholder="Пожалуйста напишите в комментарии вашу должность, номер телефона и дату готовности к посадке."
20 25 required
21   - value="">
22   - </textarea>
  26 + value=""></textarea>
23 27 <label for="comment_text">Не заполнено поле</label>
24 28 </div>
25 29 <div class="modal__form-item">
resources/views/modals/vacancy/ask_for_resume_comment.blade.php
... ... @@ -16,6 +16,7 @@
16 16 id="comment"
17 17 data-fancybox
18 18 data-src="#add_comment"
  19 + data-auto-focus="false"
19 20 class="button main__employer-page-two-item-button">Да</button>
20 21 <button type="button"
21 22 data-fancybox
... ... @@ -105,16 +105,6 @@ Auth::routes([&#39;verify&#39; =&gt; true]);
105 105 //Личный кабинет пользователя
106 106 Route::get('/home', [HomeController::class, 'index'])->name('home');
107 107  
108   -/*
109   -Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
110   - $user = User::where('email',$request->input('email'))->first();
111   -
112   - $user->sendEmailVerificationNotification();
113   -
114   - return 'your response';
115   -})->middleware('throttle:6,1')->name('verification.resend');
116   -*/
117   -
118 108 // Авторизация, регистрация в админку
119 109 Route::group([
120 110 'as' => 'admin.', // имя маршрута, например auth.index