Commit a89ff088a2ae8caff3d748b0b7aedb481bc78884
1 parent
3e44ec5151
Exists in
master
and in
1 other branch
Поисковая система в сообщениях админки
Showing 7 changed files with 199 additions and 39 deletions Inline Diff
app/Http/Controllers/Admin/MsgAnswersController.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\Message; | 6 | use App\Models\Message; |
7 | use App\Models\User; | 7 | use App\Models\User; |
8 | use Illuminate\Database\Eloquent\Builder; | ||
8 | use Illuminate\Http\Request; | 9 | use Illuminate\Http\Request; |
9 | use Illuminate\Support\Facades\Auth; | 10 | use Illuminate\Support\Facades\Auth; |
10 | use Illuminate\Support\Facades\DB; | 11 | use Illuminate\Support\Facades\DB; |
11 | use Illuminate\Support\Facades\Validator; | 12 | use Illuminate\Support\Facades\Validator; |
12 | 13 | ||
13 | class MsgAnswersController extends Controller | 14 | class MsgAnswersController extends Controller |
14 | { | 15 | { |
15 | public function messages() { | 16 | public function messages(Request $request) { |
16 | $Msgs = Message::with('user_from')->with('user_to')->with('response')->orderByDesc('created_at')->paginate(25); | 17 | $find_key = ""; |
18 | $find_cat = ""; | ||
19 | $Msgs = Message::with('user_from')->with('user_to')->with('response'); | ||
20 | |||
21 | $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat); | ||
22 | |||
23 | $Msgs = $Msgs->orderByDesc('created_at')->paginate(25); | ||
24 | |||
25 | return view('admin.messages', compact('Msgs', 'find_key', 'find_cat')); | ||
26 | } | ||
27 | |||
28 | public function read_message(Message $message) { | ||
29 | return view('admin.message-read', compact('message')); | ||
30 | } | ||
31 | |||
32 | public function filter($Msgs, Request $request, &$find_key, &$find_cat) { | ||
33 | if (isset($request->find)) { | ||
34 | $find_key = $request->find; | ||
35 | $Msgs = $Msgs->where(function($q) use ($find_key) { | ||
36 | $q->whereHas('user_from', | ||
37 | function (Builder $query) use ($find_key) { | ||
38 | $query->where('name', 'LIKE', "%$find_key%"); | ||
39 | } | ||
40 | )-> | ||
41 | orWhereHas('user_to', | ||
42 | function (Builder $query) use ($find_key) { | ||
43 | $query->where('name', 'LIKE', "%$find_key%"); | ||
44 | } | ||
45 | ); | ||
46 | }); | ||
47 | } | ||
48 | |||
49 | if (isset($request->category)) { | ||
50 | $find_cat = $request->category; | ||
51 | |||
52 | switch ($find_cat) { | ||
53 | case 'Работодатели': | ||
54 | $Msgs = $Msgs->where(function($q) { | ||
55 | $q->whereHas('user_to', | ||
56 | function (Builder $query) { | ||
57 | $query->where('is_worker', '0'); | ||
58 | } | ||
59 | )->orwhereHas('user_from', | ||
60 | function (Builder $query) { | ||
61 | $query->where('is_worker', '0'); | ||
62 | } | ||
63 | ); | ||
64 | }); | ||
65 | break; | ||
66 | case 'Соискатели': | ||
67 | $Msgs = $Msgs->where(function($q) { | ||
68 | $q->whereHas('user_to', | ||
69 | function (Builder $query) { | ||
70 | $query->where('is_worker', '1'); | ||
71 | } | ||
72 | )->orwhereHas('user_from', | ||
73 | function (Builder $query) { | ||
74 | $query->where('is_worker', '1'); | ||
75 | } | ||
76 | ); | ||
77 | }); | ||
78 | break; | ||
79 | case 'Администраторы': | ||
80 | $Msgs = $Msgs->where(function($q) { | ||
81 | $q->whereHas('user_to', | ||
82 | function (Builder $query) { | ||
83 | $query->where('admin', '1'); | ||
84 | } | ||
85 | )->orwhereHas('user_from', | ||
86 | function (Builder $query) { | ||
87 | $query->where('admin', '1'); | ||
88 | } | ||
89 | ); | ||
90 | }); | ||
91 | break; | ||
92 | default:break; | ||
93 | } | ||
94 | } | ||
95 | |||
96 | return $Msgs; | ||
17 | 97 | ||
18 | return view('admin.messages', compact('Msgs')); | ||
19 | } | 98 | } |
20 | 99 | ||
21 | public function admin_messages(Request $request) { | 100 | public function admin_messages(Request $request) { |
22 | if ($request->ajax()) { | 101 | if ($request->ajax()) { |
23 | $msg = Message::find($request->id); | 102 | $msg = Message::find($request->id); |
24 | $msg->flag_new = !($request->flag_new); | 103 | $msg->flag_new = !($request->flag_new); |
25 | $msg->save(); | 104 | $msg->save(); |
26 | } | 105 | } |
27 | 106 | ||
28 | $id_admin = Auth::user()->id; | 107 | $id_admin = Auth::user()->id; |
29 | $users = User::query()->OrderBy('name')->get(); | 108 | $users = User::query()->OrderBy('name')->get(); |
30 | 109 | ||
31 | $Msgs = Message::with('user_from')->with('user_to')->with('response') | 110 | $Msgs = Message::with('user_from')->with('user_to')->with('response') |
32 | ->where('user_id', '=', $id_admin) | 111 | ->where(function($query) use ($id_admin) { |
33 | ->orWhere('to_user_id', '=', $id_admin) | 112 | $query->where('user_id', '=', $id_admin) |
34 | ->orderByDesc('created_at')->paginate(5); | 113 | ->orWhere('to_user_id', '=', $id_admin); |
114 | }); | ||
115 | |||
116 | $find_key = ''; | ||
117 | $find_cat = ''; | ||
118 | |||
119 | $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat); | ||
120 | |||
121 | $Msgs = $Msgs->orderByDesc('created_at')->paginate(5); | ||
35 | 122 | ||
36 | if ($request->ajax()) | 123 | if ($request->ajax()) |
37 | return view('admin.message.index_ajax', compact('Msgs', 'id_admin', 'users')); | 124 | return view('admin.message.index_ajax', compact('Msgs', 'id_admin', 'users')); |
38 | else | 125 | else |
39 | return view('admin.message.index', compact('Msgs', 'id_admin', 'users')); | 126 | return view('admin.message.index', compact('Msgs', 'id_admin', 'users', 'find_key', 'find_cat')); |
40 | } | 127 | } |
41 | 128 | ||
42 | public function messages_sql(Request $request) { | 129 | public function messages_sql(Request $request) { |
43 | $id = Auth::user()->id; | 130 | $id = Auth::user()->id; |
44 | DB::enableQueryLog(); | 131 | DB::enableQueryLog(); |
45 | //$query = DB::select('select * from users where id = :id', ['id' => 1]); | 132 | //$query = DB::select('select * from users where id = :id', ['id' => 1]); |
46 | $query = DB::select(DB::raw('SELECT u1.name as "To-user", u2.name as "From-user", m1.`text`, m1.created_at | 133 | $query = DB::select(DB::raw('SELECT u1.name as "To-user", u2.name as "From-user", m1.`text`, m1.created_at |
47 | FROM messages m1 | 134 | FROM messages m1 |
48 | JOIN (SELECT MAX(id) id FROM messages | 135 | JOIN (SELECT MAX(id) id FROM messages |
49 | GROUP BY LEAST(user_id, to_user_id), | 136 | GROUP BY LEAST(user_id, to_user_id), |
50 | GREATEST(user_id, to_user_id) | 137 | GREATEST(user_id, to_user_id) |
51 | ) m2 USING (id) | 138 | ) m2 USING (id) |
52 | JOIN users u1 ON u1.id = m1.user_id | 139 | JOIN users u1 ON u1.id = m1.user_id |
53 | JOIN users u2 ON u2.id = m1.to_user_id | 140 | JOIN users u2 ON u2.id = m1.to_user_id |
54 | Where ((m1.user_id = :uid) or (m1.to_user_id = :uid2)) | 141 | Where ((m1.user_id = :uid) or (m1.to_user_id = :uid2)) |
55 | '), ['uid' => $id, 'uid2' => $id]); | 142 | '), ['uid' => $id, 'uid2' => $id]); |
56 | //dump(DB::getQueryLog()); | 143 | //dump(DB::getQueryLog()); |
57 | dd($query); | 144 | dd($query); |
58 | return; | 145 | return; |
59 | } | 146 | } |
60 | 147 | ||
61 | public function admin_messages_post(Request $request) { | 148 | public function admin_messages_post(Request $request) { |
62 | $rules = [ | 149 | $rules = [ |
63 | 'title' => 'required|min:3|max:255', | 150 | 'title' => 'required|min:3|max:255', |
64 | 'text' => 'required|min:1' | 151 | 'text' => 'required|min:1' |
65 | ]; | 152 | ]; |
66 | 153 | ||
67 | $messages = [ | 154 | $messages = [ |
68 | 'required' => 'Поле не может быть пустым!', | 155 | 'required' => 'Поле не может быть пустым!', |
69 | ]; | 156 | ]; |
70 | 157 | ||
71 | $validator = Validator::make($request->all(), $rules, $messages); | 158 | $validator = Validator::make($request->all(), $rules, $messages); |
72 | 159 | ||
73 | if ($validator->fails()) { | 160 | if ($validator->fails()) { |
74 | return redirect()->route('admin.admin-messages')->withErrors($validator); | 161 | return redirect()->route('admin.admin-messages')->withErrors($validator); |
75 | } else { | 162 | } else { |
76 | $params = $request->all(); | 163 | $params = $request->all(); |
77 | $id_admin = Auth::user()->id; | 164 | $id_admin = Auth::user()->id; |
78 | if ($request->has('file')) { | 165 | if ($request->has('file')) { |
79 | $params['file'] = $request->file('file')->store("upload/".$id_admin, 'public'); | 166 | $params['file'] = $request->file('file')->store("upload/".$id_admin, 'public'); |
80 | } | 167 | } |
81 | Message::create($params); | 168 | Message::create($params); |
82 | return redirect()->route('admin.admin-messages'); | 169 | return redirect()->route('admin.admin-messages'); |
83 | } | 170 | } |
84 | } | 171 | } |
85 | } | 172 | } |
resources/views/admin/find_message.blade.php
File was created | 1 | <div class="absolute inset-y-0 flex items-center pl-2"> | |
2 | <svg | ||
3 | class="w-4 h-4" | ||
4 | aria-hidden="true" | ||
5 | fill="currentColor" | ||
6 | viewBox="0 0 20 20" | ||
7 | > | ||
8 | <path | ||
9 | fill-rule="evenodd" | ||
10 | d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" | ||
11 | clip-rule="evenodd" | ||
12 | ></path> | ||
13 | </svg> | ||
14 | </div> | ||
15 | <form action="" method="GET"> | ||
16 | <div style="float:left; margin-right:10px"><input | ||
17 | name="find" id="find" | ||
18 | class="w-full pl-8 pr-2 text-sm text-gray-700 placeholder-gray-600 bg-gray-100 border-0 rounded-md dark:placeholder-gray-500 dark:focus:shadow-outline-gray dark:focus:placeholder-gray-600 dark:bg-gray-700 dark:text-gray-200 focus:placeholder-gray-500 focus:bg-white focus:border-purple-300 focus:outline-none focus:shadow-outline-purple form-input" | ||
19 | style="width: 300px" | ||
20 | type="text" | ||
21 | placeholder="Искать..." | ||
22 | aria-label="Search" | ||
23 | value="{{$find_key}}" | ||
24 | /> | ||
25 | </div> | ||
26 | <div style="float:left; margin-top: -5px;"> | ||
27 | <select | ||
28 | name="category" id="category" | ||
29 | placeholder="Категории" | ||
30 | 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" | ||
31 | > | ||
32 | <option value="Все категории">Все категории</option> | ||
33 | <option value="Работодатели" @if ($find_cat =="Работодатели") selected @endif>Работодатели</option> | ||
34 | <option value="Соискатели" @if ($find_cat =="Соискатели") selected @endif>Соискатели</option> | ||
35 | <option value="Администраторы" @if ($find_cat =="Администраторы") selected @endif>Администраторы</option> | ||
36 | </select> | ||
37 | </div> | ||
38 | <div style="float: left"> | ||
39 | <button type="submit" class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple">Искать</button> | ||
40 | </div> | ||
41 | </form> | ||
42 |
resources/views/admin/message-read.blade.php
File was created | 1 | @extends('layout.admin', ['title' => 'Админка - Чтение чужого сообщения']) | |
2 | |||
3 | @section('script') | ||
4 | @endsection | ||
5 | |||
6 | @section('search') | ||
7 | @endsection | ||
8 | |||
9 | @section('content') | ||
10 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | ||
11 | <label class="block text-sm"> | ||
12 | <span class="text-gray-700 dark:text-gray-400">Отправитель</span> | ||
13 | <input name="name1" id="name1" disabled | ||
14 | class="block w-full 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 form-input" | ||
15 | placeholder="Название пункта" value="@php echo (isset($message->user_from->name)) ? $message->user_from->name.' ('.$message->user_from->id.')' : 'Не определен'; @endphp" | ||
16 | /> | ||
17 | </label><br> | ||
18 | |||
19 | <label class="block text-sm"> | ||
20 | <span class="text-gray-700 dark:text-gray-400">Получатель</span> | ||
21 | <input name="name2" id="name2" disabled | ||
22 | class="block w-full 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 form-input" | ||
23 | placeholder="Название пункта" value="@php echo (isset($message->user_to->name)) ? $message->user_to->name.' ('.$message->user_to->id.')' : 'Не определен'; @endphp" | ||
24 | /> | ||
25 | </label><br> | ||
26 | |||
27 | <label class="block text-sm"> | ||
28 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | ||
29 | <textarea name="text" id="text" disabled | ||
30 | class="block w-full 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 form-input" | ||
31 | placeholder="Текст">{{ $message->text }}</textarea> | ||
32 | </label><br> | ||
33 | |||
34 | <label class="block text-sm"> | ||
35 | <span class="text-gray-700 dark:text-gray-400">Дата отправки</span> | ||
36 | <input name="created_at" id="created_at" disabled | ||
37 | class="block w-full 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 form-input" | ||
38 | placeholder="Дата отправки" value="{{ $message->created_at }}" | ||
39 | /> | ||
40 | </label><br> | ||
41 | |||
42 | <label class="block text-sm"> | ||
43 | <span class="text-gray-700 dark:text-gray-400">Дата изменения</span> | ||
44 | <input name="updated_at" id="updated_at" disabled | ||
45 | class="block w-full 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 form-input" | ||
46 | placeholder="Дата редактирования" value="{{ $message->updated_at }}" | ||
47 | /> | ||
48 | </label><br> | ||
49 | |||
50 | <a href="{{ route('admin.messages') }}" | ||
51 | 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" | ||
52 | style="display: -webkit-inline-box; height: 30px!important;" | ||
53 | >Назад</a> | ||
54 | </div> | ||
55 | @endsection | ||
56 |
resources/views/admin/message/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Сообщения адмистратора']) | 1 | @extends('layout.admin', ['title' => 'Админка - Сообщения адмистратора']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | <script> | 4 | <script> |
5 | $(document).ready(function() { | 5 | $(document).ready(function() { |
6 | $(document).on('change', '.checkread', function () { | 6 | $(document).on('change', '.checkread', function () { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var value = this_.val(); | 8 | var value = this_.val(); |
9 | var ajax_block = $('#ajax_block'); | 9 | var ajax_block = $('#ajax_block'); |
10 | var bool = 0; | 10 | var bool = 0; |
11 | 11 | ||
12 | if(this.checked){ | 12 | if(this.checked){ |
13 | bool = 1; | 13 | bool = 1; |
14 | } else { | 14 | } else { |
15 | bool = 0; | 15 | bool = 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | $.ajax({ | 18 | $.ajax({ |
19 | type: "GET", | 19 | type: "GET", |
20 | url: "{{ url()->full()}}", | 20 | url: "{{ url()->full()}}", |
21 | data: "id=" + value + "&flag_new=" + bool, | 21 | data: "id=" + value + "&flag_new=" + bool, |
22 | success: function (data) { | 22 | success: function (data) { |
23 | console.log('Обновление таблицы сообщений администратора '); | 23 | console.log('Обновление таблицы сообщений администратора '); |
24 | //data = JSON.parse(data); | 24 | //data = JSON.parse(data); |
25 | //console.log(data); | 25 | //console.log(data); |
26 | ajax_block.html(data); | 26 | ajax_block.html(data); |
27 | }, | 27 | }, |
28 | headers: { | 28 | headers: { |
29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
30 | }, | 30 | }, |
31 | error: function (data) { | 31 | error: function (data) { |
32 | console.log('Error: ' + data); | 32 | console.log('Error: ' + data); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | }); | 35 | }); |
36 | 36 | ||
37 | }); | 37 | }); |
38 | </script> | 38 | </script> |
39 | @endsection | 39 | @endsection |
40 | 40 | ||
41 | @section('search') | 41 | @section('search') |
42 | 42 | @include('admin.find_message') | |
43 | @endsection | 43 | @endsection |
44 | 44 | ||
45 | @section('content') | 45 | @section('content') |
46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
47 | <div class="w-full overflow-x-auto"> | 47 | <div class="w-full overflow-x-auto"> |
48 | <table class="w-full whitespace-no-wrap"> | 48 | <table class="w-full whitespace-no-wrap"> |
49 | <thead> | 49 | <thead> |
50 | <tr | 50 | <tr |
51 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | 51 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" |
52 | > | 52 | > |
53 | <th class="px-4 py-3">№</th> | 53 | <th class="px-4 py-3">№</th> |
54 | <th class="px-4 py-3">От юзера</th> | 54 | <th class="px-4 py-3">От юзера</th> |
55 | <th class="px-4 py-3">К юзеру</th> | 55 | <th class="px-4 py-3">К юзеру</th> |
56 | <th class="px-4 py-3">Текст</th> | 56 | <th class="px-4 py-3">Текст</th> |
57 | <th class="px-4 py-3">Дата</th> | 57 | <th class="px-4 py-3">Дата</th> |
58 | <th class="px-4 py-3">Прочтено</th> | 58 | <th class="px-4 py-3">Прочтено</th> |
59 | </tr> | 59 | </tr> |
60 | </thead> | 60 | </thead> |
61 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 61 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
62 | @foreach($Msgs as $msg) | 62 | @foreach($Msgs as $msg) |
63 | <tr class="text-gray-700 dark:text-gray-400" | 63 | <tr class="text-gray-700 dark:text-gray-400" |
64 | @if (isset($msg->user_to->id)) | 64 | @if (isset($msg->user_to->id)) |
65 | @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) | 65 | @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) |
66 | style="background-color: #403998;" | 66 | style="background-color: #403998;" |
67 | @endif | 67 | @endif |
68 | @endif> | 68 | @endif> |
69 | <td class="px-4 py-3"> | 69 | <td class="px-4 py-3"> |
70 | {{$msg->id}} | 70 | {{$msg->id}} |
71 | </td> | 71 | </td> |
72 | <td class="px-4 py-3"> | 72 | <td class="px-4 py-3"> |
73 | @if (isset($msg->user_from->name)) | 73 | @if (isset($msg->user_from->name)) |
74 | {{$msg->user_from->name}} ({{$msg->user_from->id}}) | 74 | {{$msg->user_from->name}} ({{$msg->user_from->id}}) |
75 | @else | 75 | @else |
76 | Пользователь удален | 76 | Пользователь удален |
77 | @endif | 77 | @endif |
78 | </td> | 78 | </td> |
79 | <td class="px-4 py-3"> | 79 | <td class="px-4 py-3"> |
80 | @if (isset($msg->user_to->name)) | 80 | @if (isset($msg->user_to->name)) |
81 | {{$msg->user_to->name}} ({{$msg->user_to->id}}) | 81 | {{$msg->user_to->name}} ({{$msg->user_to->id}}) |
82 | @else | 82 | @else |
83 | Пользователь удален | 83 | Пользователь удален |
84 | @endif | 84 | @endif |
85 | </td> | 85 | </td> |
86 | <td class="px-4 py-3"> | 86 | <td class="px-4 py-3"> |
87 | {{$msg->title}} | 87 | {{$msg->title}} |
88 | <div class="flex items-center text-sm"> | 88 | <div class="flex items-center text-sm"> |
89 | <textarea cols="7" style="width:250px;">{{ $msg->text }}</textarea> | 89 | <textarea cols="7" style="width:250px;">{{ $msg->text }}</textarea> |
90 | </div> | 90 | </div> |
91 | </td> | 91 | </td> |
92 | <td class="px-4 py-3 text-sm"> | 92 | <td class="px-4 py-3 text-sm"> |
93 | {{ $msg->created_at }} | 93 | {{ $msg->created_at }} |
94 | </td> | 94 | </td> |
95 | <td class="px-4 py-3 text-sm"> | 95 | <td class="px-4 py-3 text-sm"> |
96 | @if (isset($msg->user_to->id)) | 96 | @if (isset($msg->user_to->id)) |
97 | @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) | 97 | @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) |
98 | <input type="checkbox" class="checkread" value="{{$msg->id}}" name="read_{{$msg->id}}"/> | 98 | <input type="checkbox" class="checkread" value="{{$msg->id}}" name="read_{{$msg->id}}"/> |
99 | @endif | 99 | @endif |
100 | @endif | 100 | @endif |
101 | </td> | 101 | </td> |
102 | </tr> | 102 | </tr> |
103 | @endforeach | 103 | @endforeach |
104 | </tbody> | 104 | </tbody> |
105 | </table> | 105 | </table> |
106 | </div> | 106 | </div> |
107 | 107 | ||
108 | <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"> | 108 | <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"> |
109 | <?=$Msgs->appends($_GET)->links('admin.pagginate'); ?> | 109 | <?=$Msgs->appends($_GET)->links('admin.pagginate'); ?> |
110 | </div> | 110 | </div> |
111 | </div><br> | 111 | </div><br> |
112 | 112 | ||
113 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block2"> | 113 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block2"> |
114 | 114 | ||
115 | <form method="POST" action="{{ route('admin.admin-messages-post') }}" enctype="multipart/form-data"> | 115 | <form method="POST" action="{{ route('admin.admin-messages-post') }}" enctype="multipart/form-data"> |
116 | @csrf | 116 | @csrf |
117 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 117 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
118 | <h3 class="text-gray-700 dark:text-gray-400">Отправка сообщения</h3> | 118 | <h3 class="text-gray-700 dark:text-gray-400">Отправка сообщения</h3> |
119 | <hr> | 119 | <hr> |
120 | <label for="ad_employer_id" class="block text-sm"> | 120 | <label for="ad_employer_id" class="block text-sm"> |
121 | <input type="hidden" name="user_id" id="user_id" value="{{ $id_admin }}"/> | 121 | <input type="hidden" name="user_id" id="user_id" value="{{ $id_admin }}"/> |
122 | 122 | ||
123 | <span class="text-gray-700 dark:text-gray-400">Кому:</span> | 123 | <span class="text-gray-700 dark:text-gray-400">Кому:</span> |
124 | 124 | ||
125 | <select name="to_user_id" id="to_user_id" class="block change_js 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"> | 125 | <select name="to_user_id" id="to_user_id" class="block change_js 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"> |
126 | @foreach($users as $user) | 126 | @foreach($users as $user) |
127 | <option value="{{ $user->id }}">{{ $user->name }} ({{ $user->id }})</option> | 127 | <option value="{{ $user->id }}">{{ $user->name }} ({{ $user->id }})</option> |
128 | @endforeach | 128 | @endforeach |
129 | </select> | 129 | </select> |
130 | </label><br> | 130 | </label><br> |
131 | 131 | ||
132 | <label class="block text-sm"> | 132 | <label class="block text-sm"> |
133 | <span class="text-gray-700 dark:text-gray-400">Заголовок</span> | 133 | <span class="text-gray-700 dark:text-gray-400">Заголовок</span> |
134 | <input name="title" id="title" | 134 | <input name="title" id="title" |
135 | class="block w-full 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 form-input" | 135 | class="block w-full 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 form-input" |
136 | placeholder="Заголовок" value="{{ old('title') ?? '' }}" | 136 | placeholder="Заголовок" value="{{ old('title') ?? '' }}" |
137 | /> | 137 | /> |
138 | @error('title') | 138 | @error('title') |
139 | <span class="text-xs text-red-600 dark:text-red-400"> | 139 | <span class="text-xs text-red-600 dark:text-red-400"> |
140 | {{ $message }} | 140 | {{ $message }} |
141 | </span> | 141 | </span> |
142 | @enderror | 142 | @enderror |
143 | </label><br> | 143 | </label><br> |
144 | 144 | ||
145 | <label class="block text-sm"> | 145 | <label class="block text-sm"> |
146 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | 146 | <span class="text-gray-700 dark:text-gray-400">Текст</span> |
147 | <textarea 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" name="text" placeholder="Текст" required | 147 | <textarea 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" name="text" placeholder="Текст" required |
148 | rows="4">{{ old('text') ?? '' }}</textarea> | 148 | rows="4">{{ old('text') ?? '' }}</textarea> |
149 | @error('text') | 149 | @error('text') |
150 | <span class="text-xs text-red-600 dark:text-red-400"> | 150 | <span class="text-xs text-red-600 dark:text-red-400"> |
151 | {{ $message }} | 151 | {{ $message }} |
152 | </span> | 152 | </span> |
153 | @enderror | 153 | @enderror |
154 | </label><br> | 154 | </label><br> |
155 | 155 | ||
156 | 156 | ||
157 | <label class="block text-sm"> | 157 | <label class="block text-sm"> |
158 | <span class="text-gray-700 dark:text-gray-400">Файл</span> | 158 | <span class="text-gray-700 dark:text-gray-400">Файл</span> |
159 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | 159 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 |
160 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | 160 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple |
161 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 161 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
162 | id="file" name="file"> | 162 | id="file" name="file"> |
163 | @error('file') | 163 | @error('file') |
164 | <span class="text-xs text-red-600 dark:text-red-400"> | 164 | <span class="text-xs text-red-600 dark:text-red-400"> |
165 | {{ $message }} | 165 | {{ $message }} |
166 | </span> | 166 | </span> |
167 | @enderror | 167 | @enderror |
168 | </label><br> | 168 | </label><br> |
169 | 169 | ||
170 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 170 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
171 | <div> | 171 | <div> |
172 | <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"> | 172 | <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"> |
173 | Отправить | 173 | Отправить |
174 | </button> | 174 | </button> |
175 | </div> | 175 | </div> |
176 | </div> | 176 | </div> |
177 | </div> | 177 | </div> |
178 | </form> | 178 | </form> |
179 | </div> | 179 | </div> |
180 | @endsection | 180 | @endsection |
181 | 181 |
resources/views/admin/messages.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Сообщения']) | 1 | @extends('layout.admin', ['title' => 'Админка - Сообщения']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | @endsection | 4 | @endsection |
5 | 5 | ||
6 | @section('search') | 6 | @section('search') |
7 | <!--<div class="absolute inset-y-0 flex items-center pl-2"> | 7 | @include('admin.find_message') |
8 | <svg | ||
9 | class="w-4 h-4" | ||
10 | aria-hidden="true" | ||
11 | fill="currentColor" | ||
12 | viewBox="0 0 20 20" | ||
13 | > | ||
14 | <path | ||
15 | fill-rule="evenodd" | ||
16 | d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" | ||
17 | clip-rule="evenodd" | ||
18 | ></path> | ||
19 | </svg> | ||
20 | </div> | ||
21 | <form action="" method="POST"> | ||
22 | <div style="float:left;"><input | ||
23 | class="w-full pl-8 pr-2 text-sm text-gray-700 placeholder-gray-600 bg-gray-100 border-0 rounded-md dark:placeholder-gray-500 dark:focus:shadow-outline-gray dark:focus:placeholder-gray-600 dark:bg-gray-700 dark:text-gray-200 focus:placeholder-gray-500 focus:bg-white focus:border-purple-300 focus:outline-none focus:shadow-outline-purple form-input" | ||
24 | style="width: 400px" | ||
25 | type="text" | ||
26 | placeholder="Искать компанию или вакансию" | ||
27 | aria-label="Search" | ||
28 | /></div> | ||
29 | <div style="float: left"> | ||
30 | <button type="submit" class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple">Поиск</button> | ||
31 | </div> | ||
32 | </form>--> | ||
33 | @endsection | 8 | @endsection |
34 | 9 | ||
35 | @section('content') | 10 | @section('content') |
36 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 11 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
37 | <div class="w-full overflow-x-auto"> | 12 | <div class="w-full overflow-x-auto"> |
38 | <table class="w-full whitespace-no-wrap"> | 13 | <table class="w-full whitespace-no-wrap"> |
39 | <thead> | 14 | <thead> |
40 | <tr | 15 | <tr |
41 | 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" | 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" |
42 | > | 17 | > |
43 | <th class="px-4 py-3">№</th> | 18 | <th class="px-4 py-3">№</th> |
44 | <th class="px-4 py-3">От юзера</th> | 19 | <th class="px-4 py-3">От юзера</th> |
45 | <th class="px-4 py-3">К юзеру</th> | 20 | <th class="px-4 py-3">К юзеру</th> |
46 | <th class="px-4 py-3">Заголовок</th> | ||
47 | <th class="px-4 py-3">Отклик</th> | 21 | <th class="px-4 py-3">Отклик</th> |
22 | <th class="px-4 py-3">Читать</th> | ||
48 | <th class="px-4 py-3">Дата</th> | 23 | <th class="px-4 py-3">Дата</th> |
49 | </tr> | 24 | </tr> |
50 | </thead> | 25 | </thead> |
51 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 26 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
52 | @foreach($Msgs as $msg) | 27 | @foreach($Msgs as $msg) |
53 | <tr class="text-gray-700 dark:text-gray-400"> | 28 | <tr class="text-gray-700 dark:text-gray-400"> |
54 | <td class="px-4 py-3"> | 29 | <td class="px-4 py-3"> |
55 | {{$msg->id}} | 30 | {{$msg->id}} |
56 | </td> | 31 | </td> |
57 | <td class="px-4 py-3"> | 32 | <td class="px-4 py-3"> |
58 | @if (isset($msg->user_from->id)) | 33 | @if (isset($msg->user_from->id)) |
59 | {{$msg->user_from->name}} ({{$msg->user_from->id}}) | 34 | {{$msg->user_from->name}} ({{$msg->user_from->id}}) |
60 | @else | 35 | @else |
61 | Пользователь удален | 36 | Пользователь удален |
62 | @endif | 37 | @endif |
63 | </td> | 38 | </td> |
64 | <td class="px-4 py-3"> | 39 | <td class="px-4 py-3"> |
65 | @if (isset($msg->user_to->id)) | 40 | @if (isset($msg->user_to->id)) |
66 | {{$msg->user_to->name}} ({{$msg->user_to->id}}) | 41 | {{$msg->user_to->name}} ({{$msg->user_to->id}}) |
67 | @else | 42 | @else |
68 | Пользователь удален | 43 | Пользователь удален |
69 | @endif | 44 | @endif |
70 | </td> | 45 | </td> |
71 | <td class="px-4 py-3"> | 46 | <td class="px-4 py-3"> |
72 | {{$msg->title}} | ||
73 | </td> | ||
74 | <td class="px-4 py-3"> | ||
75 | <div class="flex items-center text-sm"> | 47 | <div class="flex items-center text-sm"> |
76 | <div> | 48 | <div> |
77 | @if ($msg->response->count()) | 49 | @if ($msg->response->count()) |
78 | Да | 50 | Да |
79 | @else | 51 | @else |
80 | Нет | 52 | Нет |
81 | @endif | 53 | @endif |
82 | </div> | 54 | </div> |
83 | </div> | 55 | </div> |
84 | </td> | 56 | </td> |
85 | <td class="px-4 py-3 text-sm"> | 57 | <td class="px-4 py-3 text-sm"> |
58 | <a style="text-decoration: underline;" href="{{ route('admin.read-message', ['message' => $msg->id]) }}">Читать</a> | ||
59 | </td> | ||
60 | <td class="px-4 py-3 text-sm"> | ||
86 | {{ $msg->created_at }} | 61 | {{ $msg->created_at }} |
87 | </td> | 62 | </td> |
88 | </tr> | 63 | </tr> |
89 | @endforeach | 64 | @endforeach |
90 | </tbody> | 65 | </tbody> |
91 | </table> | 66 | </table> |
92 | </div> | 67 | </div> |
93 | 68 | ||
94 | <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"> | 69 | <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"> |
95 | <?=$Msgs->appends($_GET)->links('admin.pagginate'); ?> | 70 | <?=$Msgs->appends($_GET)->links('admin.pagginate'); ?> |
resources/views/admin/users/profile.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Профиль '.$user->name]) | 1 | @extends('layout.admin', ['title' => 'Админка - Профиль '.$user->name]) |
2 | 2 | ||
3 | @section('content') | 3 | @section('content') |
4 | <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> | 4 | <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> |
5 | Личные данные пользователя "{{$user->name}} ({{$user->id}})" | 5 | Личные данные пользователя "{{$user->name}} ({{$user->id}})" |
6 | </h4> | 6 | </h4> |
7 | <form method="POST" action=""> | 7 | <form method="POST" action=""> |
8 | @csrf | 8 | @csrf |
9 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 9 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
10 | <label class="block text-sm"> | 10 | <label class="block text-sm"> |
11 | <span class="text-gray-700 dark:text-gray-400">Имя/Псевдоним/Имя компании</span> | 11 | <span class="text-gray-700 dark:text-gray-400">Имя/Псевдоним/Имя компании</span> |
12 | <input name="name" id="name" | 12 | <input name="name" id="name" |
13 | class="block w-full 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 form-input" | 13 | class="block w-full 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 form-input" |
14 | placeholder="Псевдоним для админки" value="{{ old('name') ?? $user->name ?? '' }}" | 14 | placeholder="Псевдоним для админки" value="{{ old('name') ?? $user->name ?? '' }}" |
15 | /> | 15 | /> |
16 | @error('name') | 16 | @error('name') |
17 | <span class="text-xs text-red-600 dark:text-red-400"> | 17 | <span class="text-xs text-red-600 dark:text-red-400"> |
18 | {{ $message }} | 18 | {{ $message }} |
19 | </span> | 19 | </span> |
20 | @enderror | 20 | @enderror |
21 | </label><br> | 21 | </label><br> |
22 | 22 | ||
23 | <!--<label class="block text-sm"> | 23 | <!--<label class="block text-sm"> |
24 | <span class="text-gray-700 dark:text-gray-400">Email</span> | 24 | <span class="text-gray-700 dark:text-gray-400">Email</span> |
25 | <input name="email" id="email" | 25 | <input name="email" id="email" |
26 | class="block w-full 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 form-input" | 26 | class="block w-full 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 form-input" |
27 | placeholder="Почта" value="{{ old('email') ?? $user->email ?? '' }}" | 27 | placeholder="Почта" value="{{ old('email') ?? $user->email ?? '' }}" |
28 | /> | 28 | /> |
29 | @error('email') | 29 | @error('email') |
30 | <span class="text-xs text-red-600 dark:text-red-400"> | 30 | <span class="text-xs text-red-600 dark:text-red-400"> |
31 | {{ $message }} | 31 | {{ $message }} |
32 | </span> | 32 | </span> |
33 | @enderror | 33 | @enderror |
34 | </label><br>--> | 34 | </label><br>--> |
35 | 35 | ||
36 | <label class="block text-sm"> | 36 | <label class="block text-sm"> |
37 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | 37 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> |
38 | <input name="telephone" id="telephone" | 38 | <input name="telephone" id="telephone" |
39 | class="block w-full 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 form-input" | 39 | class="block w-full 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 form-input" |
40 | placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" | 40 | placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" |
41 | /> | 41 | /> |
42 | @error('telephone') | 42 | @error('telephone') |
43 | <span class="text-xs text-red-600 dark:text-red-400"> | 43 | <span class="text-xs text-red-600 dark:text-red-400"> |
44 | {{ $message }} | 44 | {{ $message }} |
45 | </span> | 45 | </span> |
46 | @enderror | 46 | @enderror |
47 | </label><br> | 47 | </label><br> |
48 | 48 | ||
49 | <label class="block text-sm"> | 49 | <label class="block text-sm"> |
50 | <span class="text-gray-700 dark:text-gray-400">Фамилия</span> | 50 | <span class="text-gray-700 dark:text-gray-400">Фамилия</span> |
51 | <input name="surname" id="surname" | 51 | <input name="surname" id="surname" |
52 | class="block w-full 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 form-input" | 52 | class="block w-full 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 form-input" |
53 | placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}" | 53 | placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}" |
54 | /> | 54 | /> |
55 | @error('surname') | 55 | @error('surname') |
56 | <span class="text-xs text-red-600 dark:text-red-400"> | 56 | <span class="text-xs text-red-600 dark:text-red-400"> |
57 | {{ $message }} | 57 | {{ $message }} |
58 | </span> | 58 | </span> |
59 | @enderror | 59 | @enderror |
60 | </label><br> | 60 | </label><br> |
61 | 61 | ||
62 | <label class="block text-sm"> | 62 | <label class="block text-sm"> |
63 | <span class="text-gray-700 dark:text-gray-400">Имя человека</span> | 63 | <span class="text-gray-700 dark:text-gray-400">Имя человека</span> |
64 | <input name="name_man" id="name_man" | 64 | <input name="name_man" id="name_man" |
65 | class="block w-full 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 form-input" | 65 | class="block w-full 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 form-input" |
66 | placeholder="Имя человека" value="{{ old('name_man') ?? $user->name_man ?? '' }}" | 66 | placeholder="Имя человека" value="{{ old('name_man') ?? $user->name_man ?? '' }}" |
67 | /> | 67 | /> |
68 | @error('name_man') | 68 | @error('name_man') |
69 | <span class="text-xs text-red-600 dark:text-red-400"> | 69 | <span class="text-xs text-red-600 dark:text-red-400"> |
70 | {{ $message }} | 70 | {{ $message }} |
71 | </span> | 71 | </span> |
72 | @enderror | 72 | @enderror |
73 | </label><br> | 73 | </label><br> |
74 | 74 | ||
75 | <label class="block text-sm"> | 75 | <label class="block text-sm"> |
76 | <span class="text-gray-700 dark:text-gray-400">Отчество</span> | 76 | <span class="text-gray-700 dark:text-gray-400">Отчество</span> |
77 | <input name="surname2" id="surname2" | 77 | <input name="surname2" id="surname2" |
78 | class="block w-full 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 form-input" | 78 | class="block w-full 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 form-input" |
79 | placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" | 79 | placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" |
80 | /> | 80 | /> |
81 | @error('surname2') | 81 | @error('surname2') |
82 | <span class="text-xs text-red-600 dark:text-red-400"> | 82 | <span class="text-xs text-red-600 dark:text-red-400"> |
83 | {{ $message }} | 83 | {{ $message }} |
84 | </span> | 84 | </span> |
85 | @enderror | 85 | @enderror |
86 | </label><br> | 86 | </label><br> |
87 | 87 | ||
88 | 88 | ||
89 | |||
90 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 89 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
91 | <div> | 90 | <div> |
92 | <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"> | 91 | <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"> |
93 | Сохранить | 92 | Сохранить |
94 | </button> | 93 | </button> |
95 | <!--<a href="{{ route('admin.users') }}" | 94 | <!--<a href="{{ route('admin.users') }}" |
96 | 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" | 95 | 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" |
97 | style="display: -webkit-inline-box; height: 30px!important;" | 96 | style="display: -webkit-inline-box; height: 30px!important;" |
98 | >Назад</a>--> | 97 | >Назад</a>--> |
99 | @if ($visible==true) | 98 | @if ($visible==true) |
100 | <a href="{{$link}}" | 99 | <a href="{{$link}}" |
101 | 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" | 100 | 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" |
102 | style="display: -webkit-inline-box; height: 30px!important;"> | 101 | style="display: -webkit-inline-box; height: 30px!important;"> |
103 | {{ $caption }} | 102 | {{ $caption }} |
104 | </a> | 103 | </a> |
105 | @endif | 104 | @endif |
106 | </div> | 105 | </div> |
107 | </div> | 106 | </div> |
108 | </div> | 107 | </div> |
109 | </form> | 108 | </form> |
110 | @endsection | 109 | @endsection |
111 | 110 |
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\Models\User; | 16 | use App\Models\User; |
17 | use App\Http\Controllers\MainController; | 17 | use App\Http\Controllers\MainController; |
18 | use App\Http\Controllers\HomeController; | 18 | use App\Http\Controllers\HomeController; |
19 | use Illuminate\Support\Facades\Route; | 19 | use Illuminate\Support\Facades\Route; |
20 | use App\Http\Controllers\Admin\CompanyController; | 20 | use App\Http\Controllers\Admin\CompanyController; |
21 | use App\Http\Controllers\Admin\Ad_EmployersController; | 21 | use App\Http\Controllers\Admin\Ad_EmployersController; |
22 | use App\Http\Controllers\Admin\MsgAnswersController; | 22 | use App\Http\Controllers\Admin\MsgAnswersController; |
23 | use App\Http\Controllers\Admin\GroupsController; | 23 | use App\Http\Controllers\Admin\GroupsController; |
24 | use App\Http\Controllers\PagesController; | 24 | use App\Http\Controllers\PagesController; |
25 | use Illuminate\Support\Facades\Storage; | 25 | use Illuminate\Support\Facades\Storage; |
26 | 26 | ||
27 | 27 | ||
28 | /* | 28 | /* |
29 | |-------------------------------------------------------------------------- | 29 | |-------------------------------------------------------------------------- |
30 | | Web Routes | 30 | | Web Routes |
31 | |-------------------------------------------------------------------------- | 31 | |-------------------------------------------------------------------------- |
32 | | | 32 | | |
33 | | Here is where you can register web routes for your application. These | 33 | | Here is where you can register web routes for your application. These |
34 | | routes are loaded by the RouteServiceProvider within a group which | 34 | | routes are loaded by the RouteServiceProvider within a group which |
35 | | contains the "web" middleware group. Now create something great! | 35 | | contains the "web" middleware group. Now create something great! |
36 | | | 36 | | |
37 | */ | 37 | */ |
38 | /* | 38 | /* |
39 | Route::get('/', function () { | 39 | Route::get('/', function () { |
40 | return view('welcome'); | 40 | return view('welcome'); |
41 | })->name('index'); | 41 | })->name('index'); |
42 | */ | 42 | */ |
43 | Route::get('/', [MainController::class, 'index'])->name('index'); | 43 | Route::get('/', [MainController::class, 'index'])->name('index'); |
44 | 44 | ||
45 | //Роуты авторизации, регистрации, восстановления, аутентификации | 45 | //Роуты авторизации, регистрации, восстановления, аутентификации |
46 | Auth::routes(['verify' => true]); | 46 | Auth::routes(['verify' => true]); |
47 | 47 | ||
48 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 48 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
49 | /*Route::group([ | 49 | /*Route::group([ |
50 | 'as' => 'auth.', //имя маршрута, например auth.index | 50 | 'as' => 'auth.', //имя маршрута, например auth.index |
51 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 51 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
52 | ], function () { | 52 | ], function () { |
53 | //форма регистрации | 53 | //форма регистрации |
54 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 54 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
55 | 55 | ||
56 | //создание пользователя | 56 | //создание пользователя |
57 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 57 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
58 | 58 | ||
59 | //форма входа авторизации | 59 | //форма входа авторизации |
60 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 60 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
61 | 61 | ||
62 | //аутентификация | 62 | //аутентификация |
63 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 63 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
64 | 64 | ||
65 | //выход | 65 | //выход |
66 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 66 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
67 | 67 | ||
68 | //форма ввода адреса почты | 68 | //форма ввода адреса почты |
69 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 69 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
70 | 70 | ||
71 | //письмо на почту | 71 | //письмо на почту |
72 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 72 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
73 | 73 | ||
74 | //форма восстановления пароля | 74 | //форма восстановления пароля |
75 | Route::get('reset-password/token/{token}/email/{email}', | 75 | Route::get('reset-password/token/{token}/email/{email}', |
76 | [ResetPasswordController::class, 'form'] | 76 | [ResetPasswordController::class, 'form'] |
77 | )->name('reset-form'); | 77 | )->name('reset-form'); |
78 | 78 | ||
79 | //восстановление пароля | 79 | //восстановление пароля |
80 | Route::post('reset-password', | 80 | Route::post('reset-password', |
81 | [ResetPasswordController::class, 'reset'] | 81 | [ResetPasswordController::class, 'reset'] |
82 | )->name('reset-password'); | 82 | )->name('reset-password'); |
83 | 83 | ||
84 | //сообщение о необходимости проверки адреса почты | 84 | //сообщение о необходимости проверки адреса почты |
85 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 85 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
86 | 86 | ||
87 | //подтверждение адреса почты нового пользователя | 87 | //подтверждение адреса почты нового пользователя |
88 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 88 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
89 | ->where('token', '[a-f0-9]{32}') | 89 | ->where('token', '[a-f0-9]{32}') |
90 | ->where('id', '[0-9]+') | 90 | ->where('id', '[0-9]+') |
91 | ->name('verify-email'); | 91 | ->name('verify-email'); |
92 | });*/ | 92 | });*/ |
93 | 93 | ||
94 | //Личный кабинет пользователя | 94 | //Личный кабинет пользователя |
95 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 95 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
96 | 96 | ||
97 | /* | 97 | /* |
98 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 98 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
99 | $user = User::where('email',$request->input('email'))->first(); | 99 | $user = User::where('email',$request->input('email'))->first(); |
100 | 100 | ||
101 | $user->sendEmailVerificationNotification(); | 101 | $user->sendEmailVerificationNotification(); |
102 | 102 | ||
103 | return 'your response'; | 103 | return 'your response'; |
104 | })->middleware('throttle:6,1')->name('verification.resend'); | 104 | })->middleware('throttle:6,1')->name('verification.resend'); |
105 | */ | 105 | */ |
106 | 106 | ||
107 | // Авторизация, регистрация в админку | 107 | // Авторизация, регистрация в админку |
108 | Route::group([ | 108 | Route::group([ |
109 | 'as' => 'admin.', // имя маршрута, например auth.index | 109 | 'as' => 'admin.', // имя маршрута, например auth.index |
110 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 110 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
111 | 'middleware' => ['guest'], | 111 | 'middleware' => ['guest'], |
112 | ], function () { | 112 | ], function () { |
113 | // Форма регистрации | 113 | // Форма регистрации |
114 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 114 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
115 | 115 | ||
116 | // Создание пользователя | 116 | // Создание пользователя |
117 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 117 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
118 | //Форма входа | 118 | //Форма входа |
119 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 119 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
120 | 120 | ||
121 | // аутентификация | 121 | // аутентификация |
122 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 122 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
123 | 123 | ||
124 | }); | 124 | }); |
125 | 125 | ||
126 | // Личный кабинет админки | 126 | // Личный кабинет админки |
127 | Route::group([ | 127 | Route::group([ |
128 | 'as' => 'admin.', // имя маршрута, например auth.index | 128 | 'as' => 'admin.', // имя маршрута, например auth.index |
129 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 129 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
130 | 'middleware' => ['auth'], ['admin'], | 130 | 'middleware' => ['auth'], ['admin'], |
131 | ], function() { | 131 | ], function() { |
132 | 132 | ||
133 | // выход | 133 | // выход |
134 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 134 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
135 | 135 | ||
136 | // кабинет главная страница | 136 | // кабинет главная страница |
137 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 137 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
138 | 138 | ||
139 | // кабинет профиль админа - форма | 139 | // кабинет профиль админа - форма |
140 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 140 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
141 | // кабинет профиль админа - сохранение формы | 141 | // кабинет профиль админа - сохранение формы |
142 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 142 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
143 | 143 | ||
144 | //кабинет сообщения админа | 144 | //кабинет сообщения админа |
145 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 145 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
146 | 146 | ||
147 | 147 | ||
148 | // кабинет профиль - форма пароли | 148 | // кабинет профиль - форма пароли |
149 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 149 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
150 | // кабинет профиль - сохранение формы пароля | 150 | // кабинет профиль - сохранение формы пароля |
151 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 151 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
152 | 152 | ||
153 | 153 | ||
154 | // кабинет профиль пользователя - форма | 154 | // кабинет профиль пользователя - форма |
155 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 155 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
156 | // кабинет профиль пользователя - сохранение формы | 156 | // кабинет профиль пользователя - сохранение формы |
157 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 157 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
158 | 158 | ||
159 | // кабинет профиль работодатель - форма | 159 | // кабинет профиль работодатель - форма |
160 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 160 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
161 | // кабинет профиль работодатель - сохранение формы | 161 | // кабинет профиль работодатель - сохранение формы |
162 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 162 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
163 | // кабинет удаление профиль работодателя и юзера | 163 | // кабинет удаление профиль работодателя и юзера |
164 | Route::delete('employer-profile/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 164 | Route::delete('employer-profile/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
165 | 165 | ||
166 | // кабинет профиль работник - форма | 166 | // кабинет профиль работник - форма |
167 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 167 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
168 | // кабинет профиль работник - сохранение формы | 168 | // кабинет профиль работник - сохранение формы |
169 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 169 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
170 | 170 | ||
171 | 171 | ||
172 | // кабинет настройки сайта - форма | 172 | // кабинет настройки сайта - форма |
173 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 173 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
174 | // кабинет настройки сайта сохранение формы | 174 | // кабинет настройки сайта сохранение формы |
175 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 175 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
176 | 176 | ||
177 | // кабинет - пользователи | 177 | // кабинет - пользователи |
178 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 178 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
179 | 179 | ||
180 | // кабинет - пользователи | 180 | // кабинет - пользователи |
181 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 181 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
182 | 182 | ||
183 | // кабинет - работодатели | 183 | // кабинет - работодатели |
184 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 184 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
185 | 185 | ||
186 | // кабинет - соискатели | 186 | // кабинет - соискатели |
187 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 187 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
188 | 188 | ||
189 | // кабинет - вакансии | 189 | // кабинет - вакансии |
190 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 190 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
191 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 191 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
192 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 192 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
193 | 193 | ||
194 | // кабинет - категории | 194 | // кабинет - категории |
195 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 195 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
196 | /* | 196 | /* |
197 | * CRUD-операции над Справочником Категории | 197 | * CRUD-операции над Справочником Категории |
198 | */ | 198 | */ |
199 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 199 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
200 | 200 | ||
201 | // CRUD-операции над справочником Категории для работодателей | 201 | // CRUD-операции над справочником Категории для работодателей |
202 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 202 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
203 | 203 | ||
204 | // CRUD-операции над справочником Образование | 204 | // CRUD-операции над справочником Образование |
205 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 205 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
206 | 206 | ||
207 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 207 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
208 | /* | 208 | /* |
209 | * кабинет - CRUD-операции по справочнику должности | 209 | * кабинет - CRUD-операции по справочнику должности |
210 | * | 210 | * |
211 | */ | 211 | */ |
212 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 212 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
213 | 213 | ||
214 | // кабинет - сообщения (чтение чужих) | 214 | // кабинет - сообщения (чтение чужих) |
215 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 215 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
216 | // кабинет - просмотр сообщения чужого (чтение) | ||
217 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | ||
218 | |||
216 | // кабинет - сообщения (админские) | 219 | // кабинет - сообщения (админские) |
217 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 220 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
218 | // кабинет - сообщения (админские) | 221 | // кабинет - сообщения (админские) |
219 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 222 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
220 | // кабинет - sql - конструкция запросов | 223 | // кабинет - sql - конструкция запросов |
221 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 224 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
222 | 225 | ||
223 | /* | 226 | /* |
224 | * Расписанный подход в описании каждой директорий групп пользователей. | 227 | * Расписанный подход в описании каждой директорий групп пользователей. |
225 | */ | 228 | */ |
226 | // кабинет - группы пользователей | 229 | // кабинет - группы пользователей |
227 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 230 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
228 | // кабинет - добавление форма группы пользователей | 231 | // кабинет - добавление форма группы пользователей |
229 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 232 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
230 | // кабинет - сохранение формы группы пользователей | 233 | // кабинет - сохранение формы группы пользователей |
231 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 234 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
232 | // кабинет - редактирование форма группы пользователей | 235 | // кабинет - редактирование форма группы пользователей |
233 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 236 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
234 | // кабинет - сохранение редактированной формы группы пользователей | 237 | // кабинет - сохранение редактированной формы группы пользователей |
235 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 238 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
236 | // кабинет - удаление группы пользователей | 239 | // кабинет - удаление группы пользователей |
237 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 240 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
238 | 241 | ||
239 | 242 | ||
240 | // кабинет - список админов | 243 | // кабинет - список админов |
241 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 244 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
242 | 245 | ||
243 | 246 | ||
244 | /////редактор////// кабинет - редактор сайта//////////////////////// | 247 | /////редактор////// кабинет - редактор сайта//////////////////////// |
245 | Route::get('editor-site', function() { | 248 | Route::get('editor-site', function() { |
246 | return view('admin.editor.index'); | 249 | return view('admin.editor.index'); |
247 | })->name('editor-site'); | 250 | })->name('editor-site'); |
248 | 251 | ||
249 | 252 | ||
250 | // кабинет - редактор шапки-футера сайта | 253 | // кабинет - редактор шапки-футера сайта |
251 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 254 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
252 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 255 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
253 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 256 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
254 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 257 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
255 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 258 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
256 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 259 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
257 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 260 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
258 | 261 | ||
259 | 262 | ||
260 | // кабинет - редактор должности на главной | 263 | // кабинет - редактор должности на главной |
261 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 264 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
262 | 265 | ||
263 | // кабинет - редактор работодатели на главной | 266 | // кабинет - редактор работодатели на главной |
264 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 267 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
265 | 268 | ||
266 | 269 | ||
267 | // кабинет - редактор seo-сайта | 270 | // кабинет - редактор seo-сайта |
268 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 271 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
269 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 272 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
270 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 273 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
271 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 274 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
272 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 275 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
273 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 276 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
274 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 277 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
275 | 278 | ||
276 | 279 | ||
277 | // кабинет - редактор страниц | 280 | // кабинет - редактор страниц |
278 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 281 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
279 | // кабинет - добавление страницы | 282 | // кабинет - добавление страницы |
280 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 283 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
281 | // кабинет - сохранение формы страницы | 284 | // кабинет - сохранение формы страницы |
282 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 285 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
283 | // кабинет - редактирование форма страницы | 286 | // кабинет - редактирование форма страницы |
284 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 287 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
285 | // кабинет - сохранение редактированной формы страницы | 288 | // кабинет - сохранение редактированной формы страницы |
286 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 289 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
287 | // кабинет - удаление страницы | 290 | // кабинет - удаление страницы |
288 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 291 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
289 | 292 | ||
290 | 293 | ||
291 | // кабинет - реклама сайта | 294 | // кабинет - реклама сайта |
292 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 295 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
293 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 296 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
294 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 297 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
295 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 298 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
296 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 299 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
297 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 300 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
298 | //////////////////////////////////////////////////////////////////////// | 301 | //////////////////////////////////////////////////////////////////////// |
299 | 302 | ||
300 | 303 | ||
301 | // кабинет - отзывы о работодателе для модерации | 304 | // кабинет - отзывы о работодателе для модерации |
302 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 305 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
303 | 306 | ||
304 | // Общая страница статистики | 307 | // Общая страница статистики |
305 | Route::get('statics', function () { | 308 | Route::get('statics', function () { |
306 | return view('admin.static.index'); | 309 | return view('admin.static.index'); |
307 | })->name('statics'); | 310 | })->name('statics'); |
308 | 311 | ||
309 | // кабинет - статистика работников | 312 | // кабинет - статистика работников |
310 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 313 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
311 | 314 | ||
312 | // кабинет - статистика вакансий работодателя | 315 | // кабинет - статистика вакансий работодателя |
313 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 316 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
314 | 317 | ||
315 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 318 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
316 | /* | 319 | /* |
317 | * CRUD-операции над справочником дипломы и документы | 320 | * CRUD-операции над справочником дипломы и документы |
318 | */ | 321 | */ |
319 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 322 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
320 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 323 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
321 | 324 | ||
322 | // кабинет - роли пользователя | 325 | // кабинет - роли пользователя |
323 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 326 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
324 | 327 | ||
325 | Route::get('logs', function() { | 328 | Route::get('logs', function() { |
326 | $files = Storage::files('logs/laravel.log'); | 329 | $files = Storage::files('logs/laravel.log'); |
327 | print_r($files); | 330 | print_r($files); |
328 | })->name('logs'); | 331 | })->name('logs'); |
329 | 332 | ||
330 | }); | 333 | }); |
331 | 334 | ||
332 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 335 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
333 | 336 | ||
334 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 337 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
335 | 338 | ||
336 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 339 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
337 | 340 |