Commit b52b1df0d9cc9a5d7c4417de46254fec9a47c781
1 parent
eae6b80f5e
Exists in
master
and in
1 other branch
Опция поднятия вакансий, и счетчик статистика работников
Showing 6 changed files with 261 additions and 25 deletions Inline Diff
app/Http/Controllers/Admin/Ad_EmployersController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Models\Ad_employer; | 6 | use App\Models\Ad_employer; |
7 | use App\Models\Employer; | ||
7 | use App\Models\Job_title; | 8 | use App\Models\Job_title; |
8 | use App\Models\User; | 9 | use App\Models\User; |
10 | use Carbon\Carbon; | ||
9 | use Illuminate\Http\Request; | 11 | use Illuminate\Http\Request; |
10 | use Illuminate\Support\Facades\Auth; | 12 | use Illuminate\Support\Facades\Auth; |
11 | use Illuminate\Support\Facades\Validator; | 13 | use Illuminate\Support\Facades\Validator; |
12 | 14 | ||
13 | class Ad_EmployersController extends Controller | 15 | class Ad_EmployersController extends Controller |
14 | { | 16 | { |
15 | /** | 17 | /** |
16 | * Display a listing of the resource. | 18 | * Display a listing of the resource. |
17 | * | 19 | * |
18 | * @return \Illuminate\Http\Response | 20 | * @return \Illuminate\Http\Response |
19 | */ | 21 | */ |
20 | public function index(Request $request) | 22 | public function index(Request $request) |
21 | { | 23 | { |
22 | $title = 'Админка - Вакансии работодателей'; | 24 | $title = 'Админка - Вакансии работодателей'; |
23 | $ad_employers = Ad_employer::with('employer')->with('jobs') | 25 | if ($request->ajax()) { |
24 | ->where('is_remove', '0')->paginate(15); | 26 | $params = $request->all(); |
27 | foreach ($params['data'] as $item) { | ||
28 | $emp = Ad_employer::find($item); | ||
29 | $emp->updated_at = Carbon::now(); | ||
30 | $emp->save(); | ||
31 | } | ||
32 | } | ||
25 | 33 | ||
26 | return view('admin.ad_employers.index', compact('ad_employers', 'title')); | 34 | $ad_employers = Ad_employer::with('employer')->with('jobs') |
35 | ->where('is_remove', '0')->OrderBy('updated_at', 'desc')->paginate(15); | ||
27 | 36 | ||
37 | if ($request->ajax()) { | ||
38 | return view('admin.ad_employers.index_ajax', compact('ad_employers', 'params')); | ||
39 | } else { | ||
40 | return view('admin.ad_employers.index', compact('ad_employers', 'title')); | ||
41 | } | ||
28 | } | 42 | } |
29 | 43 | ||
30 | /** | 44 | /** |
31 | * Show the form for creating a new resource. | 45 | * Show the form for creating a new resource. |
32 | * | 46 | * |
33 | * @return \Illuminate\Http\Response | 47 | * @return \Illuminate\Http\Response |
34 | */ | 48 | */ |
35 | public function create() | 49 | public function create() |
36 | { | 50 | { |
37 | // | 51 | // |
38 | } | 52 | } |
39 | 53 | ||
40 | /** | 54 | /** |
41 | * Store a newly created resource in storage. | 55 | * Store a newly created resource in storage. |
42 | * | 56 | * |
43 | * @param \Illuminate\Http\Request $request | 57 | * @param \Illuminate\Http\Request $request |
44 | * @return \Illuminate\Http\Response | 58 | * @return \Illuminate\Http\Response |
45 | */ | 59 | */ |
46 | public function store(Request $request) | 60 | public function store(Request $request) |
47 | { | 61 | { |
48 | // | 62 | // |
49 | } | 63 | } |
50 | 64 | ||
51 | /** | 65 | /** |
52 | * Display the specified resource. | 66 | * Display the specified resource. |
53 | * | 67 | * |
54 | * @param \App\Models\Ad_employer $ad_employer | 68 | * @param \App\Models\Ad_employer $ad_employer |
55 | * @return \Illuminate\Http\Response | 69 | * @return \Illuminate\Http\Response |
56 | */ | 70 | */ |
57 | public function show(Ad_employer $ad_employer) | 71 | public function show(Ad_employer $ad_employer) |
58 | { | 72 | { |
59 | // | 73 | // |
60 | } | 74 | } |
61 | 75 | ||
62 | /** | 76 | /** |
63 | * Show the form for editing the specified resource. | 77 | * Show the form for editing the specified resource. |
64 | * | 78 | * |
65 | * @param \App\Models\Ad_employer $ad_employer | 79 | * @param \App\Models\Ad_employer $ad_employer |
66 | * @return \Illuminate\Http\Response | 80 | * @return \Illuminate\Http\Response |
67 | */ | 81 | */ |
68 | public function edit(Ad_employer $ad_employer) | 82 | public function edit(Ad_employer $ad_employer) |
69 | { | 83 | { |
70 | $sel = Array(); | 84 | $sel = Array(); |
71 | $job_titles = Job_title::active()->get(); | 85 | $job_titles = Job_title::active()->get(); |
72 | 86 | ||
73 | foreach ($ad_employer->jobs as $j) { | 87 | foreach ($ad_employer->jobs as $j) { |
74 | $sel[] = $j->id; | 88 | $sel[] = $j->id; |
75 | } | 89 | } |
76 | 90 | ||
77 | return view('admin.ad_employers.edit', compact('ad_employer', 'job_titles', 'sel')); | 91 | return view('admin.ad_employers.edit', compact('ad_employer', 'job_titles', 'sel')); |
78 | } | 92 | } |
79 | 93 | ||
80 | /** | 94 | /** |
81 | * Update the specified resource in storage. | 95 | * Update the specified resource in storage. |
82 | * | 96 | * |
83 | * @param \Illuminate\Http\Request $request | 97 | * @param \Illuminate\Http\Request $request |
84 | * @param \App\Models\Ad_employer $ad_employer | 98 | * @param \App\Models\Ad_employer $ad_employer |
85 | * @return \Illuminate\Http\Response | 99 | * @return \Illuminate\Http\Response |
86 | */ | 100 | */ |
87 | public function update(Request $request, Ad_employer $ad_employer) | 101 | public function update(Request $request, Ad_employer $ad_employer) |
88 | { | 102 | { |
89 | $params = $request->all(); | 103 | $params = $request->all(); |
90 | unset($params->position_work); | 104 | unset($params->position_work); |
91 | $rules = [ | 105 | $rules = [ |
92 | 'name' => 'required|min:3', | 106 | 'name' => 'required|min:3', |
93 | ]; | 107 | ]; |
94 | $messages = [ | 108 | $messages = [ |
95 | 'required' => 'Укажите обязательное поле', | 109 | 'required' => 'Укажите обязательное поле', |
96 | ]; | 110 | ]; |
97 | $validator = Validator::make($params, $rules, $messages); | 111 | $validator = Validator::make($params, $rules, $messages); |
98 | 112 | ||
99 | if ($validator->fails()) { | 113 | if ($validator->fails()) { |
100 | return redirect()->route('admin.edit-ad-employers', ['ad_employer' => $ad_employer->id]) | 114 | return redirect()->route('admin.edit-ad-employers', ['ad_employer' => $ad_employer->id]) |
101 | ->withErrors($validator); | 115 | ->withErrors($validator); |
102 | } else { | 116 | } else { |
103 | $ad_employer->update($params); | 117 | $ad_employer->update($params); |
104 | $ad_employer->jobs()->sync($request->position_work); | 118 | $ad_employer->jobs()->sync($request->position_work); |
105 | 119 | ||
106 | return redirect()->route('admin.ad-employers') | 120 | return redirect()->route('admin.ad-employers') |
107 | ->with('success', 'Данные были успешно сохранены'); | 121 | ->with('success', 'Данные были успешно сохранены'); |
108 | } | 122 | } |
109 | return redirect()->route('admin.ad-employers'); | 123 | return redirect()->route('admin.ad-employers'); |
110 | } | 124 | } |
111 | 125 | ||
112 | /** | 126 | /** |
113 | * Remove the specified resource from storage. | 127 | * Remove the specified resource from storage. |
114 | * | 128 | * |
115 | * @param \App\Models\Ad_employer $ad_employer | 129 | * @param \App\Models\Ad_employer $ad_employer |
116 | * @return \Illuminate\Http\Response | 130 | * @return \Illuminate\Http\Response |
117 | */ | 131 | */ |
118 | public function destroy(Ad_employer $ad_employer) | 132 | public function destroy(Ad_employer $ad_employer) |
119 | { | 133 | { |
120 | // | 134 | // |
121 | } | 135 | } |
122 | } | 136 | } |
123 | 137 |
app/Http/Controllers/WorkerController.php
File was created | 1 | <?php | |
2 | |||
3 | namespace App\Http\Controllers; | ||
4 | |||
5 | use App\Models\Static_worker; | ||
6 | use App\Models\Worker; | ||
7 | use Illuminate\Http\Request; | ||
8 | |||
9 | class WorkerController extends Controller | ||
10 | { | ||
11 | public function index() { | ||
12 | |||
13 | } | ||
14 | |||
15 | public function profile(Worker $worker) { | ||
16 | $get_date = '2023.12'; //date('Y.m'); | ||
17 | |||
18 | $c = Static_worker::query()->where('year_month', '=', $get_date) | ||
19 | ->where('user_id', '=', $worker->users->id) | ||
20 | ->get(); | ||
21 | |||
22 | if ($c->count() > 0) { | ||
23 | $upd = Static_worker::find($c[0]->id); | ||
24 | $upd->lookin = $upd->lookin + 1; | ||
25 | $upd->save(); | ||
26 | } else { | ||
27 | $crt = new Static_worker(); | ||
28 | $crt->lookin = 1; | ||
29 | $crt->year_month = $get_date; | ||
30 | $crt->user_id = $worker->user_id; | ||
31 | $crt->save(); | ||
32 | } | ||
33 | |||
34 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | ||
35 | ->where('user_id', '=', $worker->users->id) | ||
36 | ->get(); | ||
37 | |||
38 | return view('public.workers.profile', compact('worker', 'stat')); | ||
39 | } | ||
40 | } | ||
41 |
resources/views/admin/ad_employers/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Вакансии']) | 1 | @extends('layout.admin', ['title' => 'Админка - Вакансии']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | <script> | ||
5 | $(document).ready(function() { | ||
6 | $(document).on('click', '#refresh_btn', function () { | ||
7 | var this_ = $(this); | ||
8 | var ajax_block = $('#ajax_block'); | ||
9 | var mas = []; | ||
10 | var str_get = ''; | ||
11 | |||
12 | $('input:checkbox:checked').each(function(){ | ||
13 | mas.push($(this).val()); | ||
14 | console.log($(this).val()); | ||
15 | }); | ||
16 | |||
17 | $.ajax({ | ||
18 | type: "GET", | ||
19 | dataType: 'html', | ||
20 | url: "{{ url()->full()}}", | ||
21 | data: ({data:mas}), | ||
22 | success: function (data) { | ||
23 | console.log('Обновление таблицы пользователей '); | ||
24 | //data = JSON.parse(data); | ||
25 | //console.log(data); | ||
26 | ajax_block.html(data); | ||
27 | }, | ||
28 | headers: { | ||
29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
30 | }, | ||
31 | error: function (data) { | ||
32 | console.log('Error: ' + data); | ||
33 | } | ||
34 | }); | ||
35 | }); | ||
36 | }); | ||
37 | </script> | ||
4 | @endsection | 38 | @endsection |
5 | 39 | ||
6 | @section('search') | 40 | @section('search') |
7 | 41 | ||
8 | @endsection | 42 | @endsection |
9 | 43 | ||
10 | @section('content') | 44 | @section('content') |
45 | <button style="margin-bottom: 10px; width:165px" id="refresh_btn" name="refresh_btn" 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"> | ||
46 | Обновить вакансии | ||
47 | </button> | ||
11 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 48 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
12 | <div class="w-full overflow-x-auto"> | 49 | <div class="w-full overflow-x-auto"> |
13 | <table class="w-full whitespace-no-wrap"> | 50 | <table class="w-full whitespace-no-wrap"> |
14 | <thead> | 51 | <thead> |
15 | <tr | 52 | <tr |
16 | 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" | 53 | 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" |
17 | > | 54 | > |
18 | <th class="px-4 py-3">№</th> | 55 | <th class="px-4 py-3"></th> |
19 | <th class="px-4 py-3">Название объявления</th> | 56 | <th class="px-4 py-3 class1">№</th> |
20 | <th class="px-4 py-3">Название компании</th> | 57 | <th class="px-4 py-3 class2">Название объявления</th> |
21 | <th class="px-4 py-3">Должности</th> | 58 | <th class="px-4 py-3 class3">Название компании</th> |
22 | <th class="px-4 py-3">Избранные</th> | 59 | <th class="px-4 py-3 class4">Должности</th> |
23 | <th class="px-4 py-3">Срочные</th> | 60 | <th class="px-4 py-3 class5">Избранные</th> |
24 | <th class="px-4 py-3">Статус</th> | 61 | <th class="px-4 py-3 class6">Срочные</th> |
25 | <th class="px-4 py-3">Дата создан.</th> | 62 | <th class="px-4 py-3 class7">Статус</th> |
26 | <th class="px-4 py-3">Дата изменен.</th> | 63 | <th class="px-4 py-3 class8">Дата создан.</th> |
27 | <th class="px-4 py-3">Изменить</th> | 64 | <th class="px-4 py-3 class9">Дата изменен.</th> |
65 | <th class="px-4 py-3 class10">Изменить</th> | ||
28 | </tr> | 66 | </tr> |
29 | </thead> | 67 | </thead> |
30 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 68 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
31 | @foreach($ad_employers as $ad) | 69 | @foreach($ad_employers as $ad) |
32 | <tr class="text-gray-700 dark:text-gray-400"> | 70 | <tr class="text-gray-700 dark:text-gray-400"> |
33 | <td class="px-4 py-3"> | 71 | <td class="px-4 py-3 class1"> |
72 | <input type="checkbox" class="box" name="vacan_{{$ad->id}}" id="vacan_{{$ad->id}}" value="{{$ad->id}}"/> | ||
73 | </td> | ||
74 | <td class="px-4 py-3 class1"> | ||
34 | {{$ad->id}} | 75 | {{$ad->id}} |
35 | </td> | 76 | </td> |
36 | <td class="px-4 py-3"> | 77 | <td class="px-4 py-3 class2"> |
37 | {{$ad->name}} | 78 | {{$ad->name}} |
38 | </td> | 79 | </td> |
39 | <td class="px-4 py-3"> | 80 | <td class="px-4 py-3 class3"> |
40 | {{$ad->employer->name_company}} | 81 | {{$ad->employer->name_company}} |
41 | </td> | 82 | </td> |
42 | <td class="px-4 py-3"> | 83 | <td class="px-4 py-3 class4"> |
43 | <div class="flex items-center text-sm"> | 84 | <div class="flex items-center text-sm"> |
44 | @if ($ad->jobs->count()) | 85 | @if ($ad->jobs->count()) |
45 | <div> | 86 | <div> |
46 | <?php $i = 0;?> | 87 | <?php $i = 0;?> |
47 | @foreach ($ad->jobs as $title) | 88 | @foreach ($ad->jobs as $title) |
48 | <?php if ($i==0) {?> | 89 | <?php if ($i==0) {?> |
49 | <p class="font-semibold">{{$title->name}}</p> | 90 | <p class="font-semibold">{{$title->name}}</p> |
50 | <?php } else {?> | 91 | <?php } else {?> |
51 | <p class="font-semibold">/ {{$title->name}}</p> | 92 | <p class="font-semibold">/ {{$title->name}}</p> |
52 | <?php } | 93 | <?php } |
53 | $i++; | 94 | $i++; |
54 | ?> | 95 | ?> |
55 | @endforeach | 96 | @endforeach |
56 | </div> | 97 | </div> |
57 | @endif | 98 | @endif |
58 | </div> | 99 | </div> |
59 | 100 | ||
60 | </td> | 101 | </td> |
61 | 102 | ||
62 | <td class="px-4 py-3 text-sm"> | 103 | <td class="px-4 py-3 text-sm class5"> |
63 | @if ($ad->favorite_vacancy==1) | 104 | @if ($ad->favorite_vacancy==1) |
64 | <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"> | 105 | <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"> |
65 | Да | 106 | Да |
66 | </span> | 107 | </span> |
67 | @else | 108 | @else |
68 | <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"> | 109 | <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"> |
69 | Нет | 110 | Нет |
70 | </span> | 111 | </span> |
71 | @endif | 112 | @endif |
72 | </td> | 113 | </td> |
73 | 114 | ||
74 | <td class="px-4 py-3 text-sm"> | 115 | <td class="px-4 py-3 text-sm class6"> |
75 | @if ($ad->sroch_vacancy==1) | 116 | @if ($ad->sroch_vacancy==1) |
76 | <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"> | 117 | <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"> |
77 | Да | 118 | Да |
78 | </span> | 119 | </span> |
79 | @else | 120 | @else |
80 | <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"> | 121 | <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"> |
81 | Нет | 122 | Нет |
82 | </span> | 123 | </span> |
83 | @endif | 124 | @endif |
84 | </td> | 125 | </td> |
85 | 126 | ||
86 | <td class="px-4 py-3 text-sm"> | 127 | <td class="px-4 py-3 text-sm class7"> |
87 | {{ $ad->status }} | 128 | {{ $ad->status }} |
88 | </td> | 129 | </td> |
89 | <td class="px-4 py-3 text-sm"> | 130 | |
131 | <td class="px-4 py-3 text-sm class8"> | ||
90 | {{ date('d.m.Y', strtotime($ad->created_at)) }} | 132 | {{ date('d.m.Y', strtotime($ad->created_at)) }} |
91 | </td> | 133 | </td> |
92 | <td class="px-4 py-3 text-sm"> | 134 | |
135 | <td class="px-4 py-3 text-sm class9"> | ||
93 | {{ date('d.m.Y', strtotime($ad->updated_at)) }} | 136 | {{ date('d.m.Y', strtotime($ad->updated_at)) }} |
94 | </td> | 137 | </td> |
95 | <td class="px-4 py-3 text-sm"> | 138 | |
139 | <td class="px-4 py-3 text-sm class10"> | ||
96 | <a href="{{ route('admin.edit-ad-employers', ['ad_employer' => $ad->id]) }}"> | 140 | <a href="{{ route('admin.edit-ad-employers', ['ad_employer' => $ad->id]) }}"> |
97 | Изменить | 141 | Изменить |
98 | </a> | 142 | </a> |
99 | </td> | 143 | </td> |
100 | </tr> | 144 | </tr> |
101 | @endforeach | 145 | @endforeach |
102 | </tbody> | 146 | </tbody> |
103 | </table> | 147 | </table> |
104 | </div> | 148 | </div> |
105 | 149 | ||
106 | <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"> | 150 | <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"> |
107 | <?=$ad_employers->appends($_GET)->links('admin.pagginate'); ?> | 151 | <?=$ad_employers->appends($_GET)->links('admin.pagginate'); ?> |
108 | </div> | 152 | </div> |
109 | </div> | 153 | </div> |
110 | @endsection | 154 | @endsection |
111 | 155 |
resources/views/admin/ad_employers/index_ajax.blade.php
File was created | 1 | <div class="w-full overflow-x-auto"> | |
2 | <table class="w-full whitespace-no-wrap"> | ||
3 | <thead> | ||
4 | <tr | ||
5 | 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" | ||
6 | > | ||
7 | <th class="px-4 py-3"></th> | ||
8 | <th class="px-4 py-3 class1">№</th> | ||
9 | <th class="px-4 py-3 class2">Название объявления</th> | ||
10 | <th class="px-4 py-3 class3">Название компании</th> | ||
11 | <th class="px-4 py-3 class4">Должности</th> | ||
12 | <th class="px-4 py-3 class5">Избранные</th> | ||
13 | <th class="px-4 py-3 class6">Срочные</th> | ||
14 | <th class="px-4 py-3 class7">Статус</th> | ||
15 | <th class="px-4 py-3 class8">Дата создан.</th> | ||
16 | <th class="px-4 py-3 class9">Дата изменен.</th> | ||
17 | <th class="px-4 py-3 class10">Изменить</th> | ||
18 | </tr> | ||
19 | </thead> | ||
20 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | ||
21 | @foreach($ad_employers as $ad) | ||
22 | <tr class="text-gray-700 dark:text-gray-400"> | ||
23 | <td class="px-4 py-3 class1"> | ||
24 | <input type="checkbox" class="box" name="vacan_{{$ad->id}}" id="vacan_{{$ad->id}}" value="{{$ad->id}}"/> | ||
25 | </td> | ||
26 | <td class="px-4 py-3 class1"> | ||
27 | {{$ad->id}} | ||
28 | </td> | ||
29 | <td class="px-4 py-3 class2"> | ||
30 | {{$ad->name}} | ||
31 | </td> | ||
32 | <td class="px-4 py-3 class3"> | ||
33 | {{$ad->employer->name_company}} | ||
34 | </td> | ||
35 | <td class="px-4 py-3 class4"> | ||
36 | <div class="flex items-center text-sm"> | ||
37 | @if ($ad->jobs->count()) | ||
38 | <div> | ||
39 | <?php $i = 0;?> | ||
40 | @foreach ($ad->jobs as $title) | ||
41 | <?php if ($i==0) {?> | ||
42 | <p class="font-semibold">{{$title->name}}</p> | ||
43 | <?php } else {?> | ||
44 | <p class="font-semibold">/ {{$title->name}}</p> | ||
45 | <?php } | ||
46 | $i++; | ||
47 | ?> | ||
48 | @endforeach | ||
49 | </div> | ||
50 | @endif | ||
51 | </div> | ||
52 | |||
53 | </td> | ||
54 | |||
55 | <td class="px-4 py-3 text-sm class5"> | ||
56 | @if ($ad->favorite_vacancy==1) | ||
57 | <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"> | ||
58 | Да | ||
59 | </span> | ||
60 | @else | ||
61 | <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"> | ||
62 | Нет | ||
63 | </span> | ||
64 | @endif | ||
65 | </td> | ||
66 | |||
67 | <td class="px-4 py-3 text-sm class6"> | ||
68 | @if ($ad->sroch_vacancy==1) | ||
69 | <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"> | ||
70 | Да | ||
71 | </span> | ||
72 | @else | ||
73 | <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"> | ||
74 | Нет | ||
75 | </span> | ||
76 | @endif | ||
77 | </td> | ||
78 | |||
79 | <td class="px-4 py-3 text-sm class7"> | ||
80 | {{ $ad->status }} | ||
81 | </td> | ||
82 | |||
83 | <td class="px-4 py-3 text-sm class8"> | ||
84 | {{ date('d.m.Y', strtotime($ad->created_at)) }} | ||
85 | </td> | ||
86 | |||
87 | <td class="px-4 py-3 text-sm class9"> | ||
88 | {{ date('d.m.Y', strtotime($ad->updated_at)) }} | ||
89 | </td> | ||
90 | |||
91 | <td class="px-4 py-3 text-sm class10"> | ||
92 | <a href="{{ route('admin.edit-ad-employers', ['ad_employer' => $ad->id]) }}"> | ||
93 | Изменить | ||
94 | </a> | ||
95 | </td> | ||
96 | </tr> | ||
97 | @endforeach | ||
98 | </tbody> | ||
99 | </table> | ||
100 | </div> | ||
101 | |||
102 | <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"> | ||
103 | <?=$ad_employers->appends($_GET)->links('admin.pagginate'); ?> | ||
104 | </div> | ||
105 | |||
106 |
resources/views/public/workers/profile.blade.php
File was created | 1 | @extends('layouts.app', ['title' => 'Профиль пользователя - '.$worker->users->name_man.'('.$worker->users->id.')']) | |
2 | |||
3 | @section('content') | ||
4 | <div class="container"> | ||
5 | <div class="row justify-content-center"> | ||
6 | <div class="col-md-8"> | ||
7 | <div class="card"> | ||
8 | <div class="card-header">Профиль пользователя - {{$worker->users->name_man}}({{$worker->users->id}})</div> | ||
9 | <div class="card-body"> | ||
10 | <p>Имя: {{ $worker->users->name_man }}</p> | ||
11 | <p>Фамилия: {{ $worker->users->surname }}</p> | ||
12 | <p>Отчество: {{ $worker->users->surname2 }}</p> | ||
13 | <br> | ||
14 | |||
15 | @if (isset($stat[0])) | ||
16 | |||
17 | <p>Количество просмотров: {{ $stat[0]->lookin}}</p> | ||
18 | <p>Количество сообщений: {{ $stat[0]->message}}</p> | ||
19 | |||
20 | @endif | ||
21 | |||
22 | </div> | ||
23 | </div> | ||
24 | </div> | ||
25 | </div> | ||
26 | </div> | ||
27 | @endsection | ||
28 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Admin\AdminController; | 3 | use App\Http\Controllers\Admin\AdminController; |
4 | use App\Http\Controllers\Admin\CategoryController; | 4 | use App\Http\Controllers\Admin\CategoryController; |
5 | use App\Http\Controllers\Admin\CategoryEmpController; | 5 | use App\Http\Controllers\Admin\CategoryEmpController; |
6 | use App\Http\Controllers\Admin\EducationController; | 6 | use App\Http\Controllers\Admin\EducationController; |
7 | use App\Http\Controllers\Admin\EmployersController; | 7 | use App\Http\Controllers\Admin\EmployersController; |
8 | use App\Http\Controllers\Admin\InfoBloksController; | 8 | use App\Http\Controllers\Admin\InfoBloksController; |
9 | use App\Http\Controllers\Admin\JobTitlesController; | 9 | use App\Http\Controllers\Admin\JobTitlesController; |
10 | use App\Http\Controllers\Admin\UsersController; | 10 | use App\Http\Controllers\Admin\UsersController; |
11 | use App\Http\Controllers\Admin\WorkersController; | 11 | use App\Http\Controllers\Admin\WorkersController; |
12 | use App\Http\Controllers\Auth\ForgotPasswordController; | 12 | use App\Http\Controllers\Auth\ForgotPasswordController; |
13 | use App\Http\Controllers\Auth\LoginController; | 13 | use App\Http\Controllers\Auth\LoginController; |
14 | use App\Http\Controllers\Auth\RegisterController; | 14 | use App\Http\Controllers\Auth\RegisterController; |
15 | use App\Http\Controllers\CKEditorController; | 15 | use App\Http\Controllers\CKEditorController; |
16 | use App\Http\Controllers\WorkerController; | ||
16 | use App\Models\User; | 17 | use App\Models\User; |
17 | use App\Http\Controllers\MainController; | 18 | use App\Http\Controllers\MainController; |
18 | use App\Http\Controllers\HomeController; | 19 | use App\Http\Controllers\HomeController; |
19 | use Illuminate\Support\Facades\Route; | 20 | use Illuminate\Support\Facades\Route; |
20 | use App\Http\Controllers\Admin\CompanyController; | 21 | use App\Http\Controllers\Admin\CompanyController; |
21 | use App\Http\Controllers\Admin\Ad_EmployersController; | 22 | use App\Http\Controllers\Admin\Ad_EmployersController; |
22 | use App\Http\Controllers\Admin\MsgAnswersController; | 23 | use App\Http\Controllers\Admin\MsgAnswersController; |
23 | use App\Http\Controllers\Admin\GroupsController; | 24 | use App\Http\Controllers\Admin\GroupsController; |
24 | use App\Http\Controllers\PagesController; | 25 | use App\Http\Controllers\PagesController; |
25 | use Illuminate\Support\Facades\Storage; | 26 | use Illuminate\Support\Facades\Storage; |
26 | 27 | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | |-------------------------------------------------------------------------- | 30 | |-------------------------------------------------------------------------- |
30 | | Web Routes | 31 | | Web Routes |
31 | |-------------------------------------------------------------------------- | 32 | |-------------------------------------------------------------------------- |
32 | | | 33 | | |
33 | | Here is where you can register web routes for your application. These | 34 | | Here is where you can register web routes for your application. These |
34 | | routes are loaded by the RouteServiceProvider within a group which | 35 | | routes are loaded by the RouteServiceProvider within a group which |
35 | | contains the "web" middleware group. Now create something great! | 36 | | contains the "web" middleware group. Now create something great! |
36 | | | 37 | | |
37 | */ | 38 | */ |
38 | /* | 39 | /* |
39 | Route::get('/', function () { | 40 | Route::get('/', function () { |
40 | return view('welcome'); | 41 | return view('welcome'); |
41 | })->name('index'); | 42 | })->name('index'); |
42 | */ | 43 | */ |
43 | Route::get('/', [MainController::class, 'index'])->name('index'); | 44 | Route::get('/', [MainController::class, 'index'])->name('index'); |
44 | 45 | ||
45 | //Роуты авторизации, регистрации, восстановления, аутентификации | 46 | //Роуты авторизации, регистрации, восстановления, аутентификации |
46 | Auth::routes(['verify' => true]); | 47 | Auth::routes(['verify' => true]); |
47 | 48 | ||
48 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 49 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
49 | /*Route::group([ | 50 | /*Route::group([ |
50 | 'as' => 'auth.', //имя маршрута, например auth.index | 51 | 'as' => 'auth.', //имя маршрута, например auth.index |
51 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 52 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
52 | ], function () { | 53 | ], function () { |
53 | //форма регистрации | 54 | //форма регистрации |
54 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 55 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
55 | 56 | ||
56 | //создание пользователя | 57 | //создание пользователя |
57 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 58 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
58 | 59 | ||
59 | //форма входа авторизации | 60 | //форма входа авторизации |
60 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 61 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
61 | 62 | ||
62 | //аутентификация | 63 | //аутентификация |
63 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 64 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
64 | 65 | ||
65 | //выход | 66 | //выход |
66 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 67 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
67 | 68 | ||
68 | //форма ввода адреса почты | 69 | //форма ввода адреса почты |
69 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 70 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
70 | 71 | ||
71 | //письмо на почту | 72 | //письмо на почту |
72 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 73 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
73 | 74 | ||
74 | //форма восстановления пароля | 75 | //форма восстановления пароля |
75 | Route::get('reset-password/token/{token}/email/{email}', | 76 | Route::get('reset-password/token/{token}/email/{email}', |
76 | [ResetPasswordController::class, 'form'] | 77 | [ResetPasswordController::class, 'form'] |
77 | )->name('reset-form'); | 78 | )->name('reset-form'); |
78 | 79 | ||
79 | //восстановление пароля | 80 | //восстановление пароля |
80 | Route::post('reset-password', | 81 | Route::post('reset-password', |
81 | [ResetPasswordController::class, 'reset'] | 82 | [ResetPasswordController::class, 'reset'] |
82 | )->name('reset-password'); | 83 | )->name('reset-password'); |
83 | 84 | ||
84 | //сообщение о необходимости проверки адреса почты | 85 | //сообщение о необходимости проверки адреса почты |
85 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 86 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
86 | 87 | ||
87 | //подтверждение адреса почты нового пользователя | 88 | //подтверждение адреса почты нового пользователя |
88 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 89 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
89 | ->where('token', '[a-f0-9]{32}') | 90 | ->where('token', '[a-f0-9]{32}') |
90 | ->where('id', '[0-9]+') | 91 | ->where('id', '[0-9]+') |
91 | ->name('verify-email'); | 92 | ->name('verify-email'); |
92 | });*/ | 93 | });*/ |
93 | 94 | ||
94 | //Личный кабинет пользователя | 95 | //Личный кабинет пользователя |
95 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 96 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
96 | 97 | ||
97 | /* | 98 | /* |
98 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 99 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
99 | $user = User::where('email',$request->input('email'))->first(); | 100 | $user = User::where('email',$request->input('email'))->first(); |
100 | 101 | ||
101 | $user->sendEmailVerificationNotification(); | 102 | $user->sendEmailVerificationNotification(); |
102 | 103 | ||
103 | return 'your response'; | 104 | return 'your response'; |
104 | })->middleware('throttle:6,1')->name('verification.resend'); | 105 | })->middleware('throttle:6,1')->name('verification.resend'); |
105 | */ | 106 | */ |
106 | 107 | ||
107 | // Авторизация, регистрация в админку | 108 | // Авторизация, регистрация в админку |
108 | Route::group([ | 109 | Route::group([ |
109 | 'as' => 'admin.', // имя маршрута, например auth.index | 110 | 'as' => 'admin.', // имя маршрута, например auth.index |
110 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 111 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
111 | 'middleware' => ['guest'], | 112 | 'middleware' => ['guest'], |
112 | ], function () { | 113 | ], function () { |
113 | // Форма регистрации | 114 | // Форма регистрации |
114 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 115 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
115 | 116 | ||
116 | // Создание пользователя | 117 | // Создание пользователя |
117 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 118 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
118 | //Форма входа | 119 | //Форма входа |
119 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 120 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
120 | 121 | ||
121 | // аутентификация | 122 | // аутентификация |
122 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 123 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
123 | 124 | ||
124 | }); | 125 | }); |
125 | 126 | ||
126 | // Личный кабинет админки | 127 | // Личный кабинет админки |
127 | Route::group([ | 128 | Route::group([ |
128 | 'as' => 'admin.', // имя маршрута, например auth.index | 129 | 'as' => 'admin.', // имя маршрута, например auth.index |
129 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 130 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
130 | 'middleware' => ['auth'], ['admin'], | 131 | 'middleware' => ['auth'], ['admin'], |
131 | ], function() { | 132 | ], function() { |
132 | 133 | ||
133 | // выход | 134 | // выход |
134 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 135 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
135 | 136 | ||
136 | // кабинет главная страница | 137 | // кабинет главная страница |
137 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 138 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
138 | 139 | ||
139 | // кабинет профиль админа - форма | 140 | // кабинет профиль админа - форма |
140 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 141 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
141 | // кабинет профиль админа - сохранение формы | 142 | // кабинет профиль админа - сохранение формы |
142 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 143 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
143 | 144 | ||
144 | //кабинет сообщения админа | 145 | //кабинет сообщения админа |
145 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 146 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
146 | 147 | ||
147 | 148 | ||
148 | // кабинет профиль - форма пароли | 149 | // кабинет профиль - форма пароли |
149 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 150 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
150 | // кабинет профиль - сохранение формы пароля | 151 | // кабинет профиль - сохранение формы пароля |
151 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 152 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
152 | 153 | ||
153 | 154 | ||
154 | // кабинет профиль пользователя - форма | 155 | // кабинет профиль пользователя - форма |
155 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 156 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
156 | // кабинет профиль пользователя - сохранение формы | 157 | // кабинет профиль пользователя - сохранение формы |
157 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 158 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
158 | 159 | ||
159 | // кабинет профиль работодатель - форма | 160 | // кабинет профиль работодатель - форма |
160 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 161 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
161 | // кабинет профиль работодатель - сохранение формы | 162 | // кабинет профиль работодатель - сохранение формы |
162 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 163 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
163 | // кабинет удаление профиль работодателя и юзера | 164 | // кабинет удаление профиль работодателя и юзера |
164 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 165 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
165 | 166 | ||
166 | // кабинет профиль работник - форма | 167 | // кабинет профиль работник - форма |
167 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 168 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
168 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 169 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
169 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 170 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
170 | // кабинет профиль работник - сохранение формы | 171 | // кабинет профиль работник - сохранение формы |
171 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 172 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
172 | 173 | ||
173 | 174 | ||
174 | // кабинет настройки сайта - форма | 175 | // кабинет настройки сайта - форма |
175 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 176 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
176 | // кабинет настройки сайта сохранение формы | 177 | // кабинет настройки сайта сохранение формы |
177 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 178 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
178 | 179 | ||
179 | // кабинет - пользователи | 180 | // кабинет - пользователи |
180 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 181 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
181 | 182 | ||
182 | // кабинет - пользователи | 183 | // кабинет - пользователи |
183 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 184 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
184 | 185 | ||
185 | // кабинет - работодатели | 186 | // кабинет - работодатели |
186 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 187 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
187 | 188 | ||
188 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 189 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
189 | 190 | ||
190 | // кабинет - соискатели | 191 | // кабинет - соискатели |
191 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 192 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
192 | 193 | ||
193 | // кабинет - база данных | 194 | // кабинет - база данных |
194 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 195 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
195 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 196 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
196 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 197 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
197 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 198 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
198 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 199 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
199 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 200 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
200 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 201 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
201 | 202 | ||
202 | // кабинет - вакансии | 203 | // кабинет - вакансии |
203 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 204 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
204 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 205 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
205 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 206 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
206 | 207 | ||
207 | // кабинет - категории | 208 | // кабинет - категории |
208 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 209 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
209 | /* | 210 | /* |
210 | * CRUD-операции над Справочником Категории | 211 | * CRUD-операции над Справочником Категории |
211 | */ | 212 | */ |
212 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 213 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
213 | 214 | ||
214 | // CRUD-операции над справочником Категории для работодателей | 215 | // CRUD-операции над справочником Категории для работодателей |
215 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 216 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
216 | 217 | ||
217 | // CRUD-операции над справочником Образование | 218 | // CRUD-операции над справочником Образование |
218 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 219 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
219 | 220 | ||
220 | Route::get('program-education/{education}/{level}', [EducationController::class, 'add_program'])->name('add-program-education'); | 221 | Route::get('program-education/{education}/{level}', [EducationController::class, 'add_program'])->name('add-program-education'); |
221 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 222 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
222 | 223 | ||
223 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 224 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
224 | /* | 225 | /* |
225 | * кабинет - CRUD-операции по справочнику должности | 226 | * кабинет - CRUD-операции по справочнику должности |
226 | * | 227 | * |
227 | */ | 228 | */ |
228 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 229 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
229 | 230 | ||
230 | // кабинет - сообщения (чтение чужих) | 231 | // кабинет - сообщения (чтение чужих) |
231 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 232 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
232 | // кабинет - просмотр сообщения чужого (чтение) | 233 | // кабинет - просмотр сообщения чужого (чтение) |
233 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 234 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
234 | 235 | ||
235 | // кабинет - сообщения (админские) | 236 | // кабинет - сообщения (админские) |
236 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 237 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
237 | // кабинет - сообщения (админские) | 238 | // кабинет - сообщения (админские) |
238 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 239 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
239 | // кабинет - sql - конструкция запросов | 240 | // кабинет - sql - конструкция запросов |
240 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 241 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
241 | 242 | ||
242 | /* | 243 | /* |
243 | * Расписанный подход в описании каждой директорий групп пользователей. | 244 | * Расписанный подход в описании каждой директорий групп пользователей. |
244 | */ | 245 | */ |
245 | // кабинет - группы пользователей | 246 | // кабинет - группы пользователей |
246 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 247 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
247 | // кабинет - добавление форма группы пользователей | 248 | // кабинет - добавление форма группы пользователей |
248 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 249 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
249 | // кабинет - сохранение формы группы пользователей | 250 | // кабинет - сохранение формы группы пользователей |
250 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 251 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
251 | // кабинет - редактирование форма группы пользователей | 252 | // кабинет - редактирование форма группы пользователей |
252 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 253 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
253 | // кабинет - сохранение редактированной формы группы пользователей | 254 | // кабинет - сохранение редактированной формы группы пользователей |
254 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 255 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
255 | // кабинет - удаление группы пользователей | 256 | // кабинет - удаление группы пользователей |
256 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 257 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
257 | 258 | ||
258 | 259 | ||
259 | // кабинет - список админов | 260 | // кабинет - список админов |
260 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 261 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
261 | 262 | ||
262 | 263 | ||
263 | /////редактор////// кабинет - редактор сайта//////////////////////// | 264 | /////редактор////// кабинет - редактор сайта//////////////////////// |
264 | Route::get('editor-site', function() { | 265 | Route::get('editor-site', function() { |
265 | return view('admin.editor.index'); | 266 | return view('admin.editor.index'); |
266 | })->name('editor-site'); | 267 | })->name('editor-site'); |
267 | 268 | ||
268 | 269 | ||
269 | // кабинет - редактор шапки-футера сайта | 270 | // кабинет - редактор шапки-футера сайта |
270 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 271 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
271 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 272 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
272 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 273 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
273 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 274 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
274 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 275 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
275 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 276 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
276 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 277 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
277 | 278 | ||
278 | 279 | ||
279 | // кабинет - редактор должности на главной | 280 | // кабинет - редактор должности на главной |
280 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 281 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
281 | 282 | ||
282 | // кабинет - редактор работодатели на главной | 283 | // кабинет - редактор работодатели на главной |
283 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 284 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
284 | 285 | ||
285 | 286 | ||
286 | // кабинет - редактор seo-сайта | 287 | // кабинет - редактор seo-сайта |
287 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 288 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
288 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 289 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
289 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 290 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
290 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 291 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
291 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 292 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
292 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 293 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
293 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 294 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
294 | 295 | ||
295 | 296 | ||
296 | // кабинет - редактор страниц | 297 | // кабинет - редактор страниц |
297 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 298 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
298 | // кабинет - добавление страницы | 299 | // кабинет - добавление страницы |
299 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 300 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
300 | // кабинет - сохранение формы страницы | 301 | // кабинет - сохранение формы страницы |
301 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 302 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
302 | // кабинет - редактирование форма страницы | 303 | // кабинет - редактирование форма страницы |
303 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 304 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
304 | // кабинет - сохранение редактированной формы страницы | 305 | // кабинет - сохранение редактированной формы страницы |
305 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 306 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
306 | // кабинет - удаление страницы | 307 | // кабинет - удаление страницы |
307 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 308 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
308 | 309 | ||
309 | 310 | ||
310 | // кабинет - реклама сайта | 311 | // кабинет - реклама сайта |
311 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 312 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
312 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 313 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
313 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 314 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
314 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 315 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
315 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 316 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
316 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 317 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
317 | //////////////////////////////////////////////////////////////////////// | 318 | //////////////////////////////////////////////////////////////////////// |
318 | 319 | ||
319 | 320 | ||
320 | // кабинет - отзывы о работодателе для модерации | 321 | // кабинет - отзывы о работодателе для модерации |
321 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 322 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
322 | 323 | ||
323 | // Общая страница статистики | 324 | // Общая страница статистики |
324 | Route::get('statics', function () { | 325 | Route::get('statics', function () { |
325 | return view('admin.static.index'); | 326 | return view('admin.static.index'); |
326 | })->name('statics'); | 327 | })->name('statics'); |
327 | 328 | ||
328 | // кабинет - статистика работников | 329 | // кабинет - статистика работников |
329 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 330 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
330 | 331 | ||
331 | // кабинет - статистика вакансий работодателя | 332 | // кабинет - статистика вакансий работодателя |
332 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 333 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
333 | 334 | ||
334 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 335 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
335 | /* | 336 | /* |
336 | * CRUD-операции над справочником дипломы и документы | 337 | * CRUD-операции над справочником дипломы и документы |
337 | */ | 338 | */ |
338 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 339 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
339 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 340 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
340 | 341 | ||
341 | // кабинет - роли пользователя | 342 | // кабинет - роли пользователя |
342 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 343 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
343 | 344 | ||
344 | Route::get('logs', function() { | 345 | Route::get('logs', function() { |
345 | $files = Storage::files('logs/laravel.log'); | 346 | $files = Storage::files('logs/laravel.log'); |
346 | print_r($files); | 347 | print_r($files); |
347 | })->name('logs'); | 348 | })->name('logs'); |
348 | 349 | ||
349 | }); | 350 | }); |
350 | 351 | ||
352 | // Инструментальные страницы | ||
351 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 353 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
352 | 354 | ||
353 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | ||
354 | |||
355 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 355 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
356 | 356 | ||
357 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 357 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
358 | |||
359 | // Страницы с произвольным контентом | ||
360 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | ||
361 | |||
362 | // Публичные страницы соискателя |