Commit 18e40504a16e05a8fcccb96a8526a8d0398fa8ed

Authored by Андрей Ларионов
Exists in master

Обновление недели

Showing 19 changed files Inline Diff

app/Http/Controllers/Admin/JobTitlesController.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\Http\Requests\JobTitlesRequest; 6 use App\Http\Requests\JobTitlesRequest;
7 use App\Models\Category; 7 use App\Models\Category;
8 use App\Models\Job_title; 8 use App\Models\Job_title;
9 use App\Models\Positions; 9 use App\Models\Positions;
10 use Illuminate\Http\Request; 10 use Illuminate\Http\Request;
11 11
12 class JobTitlesController extends Controller 12 class JobTitlesController extends Controller
13 { 13 {
14 /** 14 /**
15 * Display a listing of the resource. 15 * Display a listing of the resource.
16 * 16 *
17 * @return \Illuminate\Http\Response 17 * @return \Illuminate\Http\Response
18 */ 18 */
19 public function index(Request $request) 19 public function index(Request $request)
20 { 20 {
21 if ($request->has('sort')) { 21 if ($request->has('sort')) {
22 $Jobs = Job_title::query()->where('is_remove', '=', '0'); 22 $Jobs = Job_title::query()->where('is_remove', '=', '0');
23 if ($request->get('sort') == 'up')
24 $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15);
25 else
26 $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15);
27 } else {
28 $Jobs = Job_title::query()->where('is_remove', '=', '0')->
29 orderByDesc('sort')->orderBy('name')->paginate(15);
30 }
31
23 if ($request->get('sort') == 'up') 32 return view('admin.job_titles.index', compact('Jobs'));
24 $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15); 33 }
25 else 34
26 $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15); 35 /**
27 } else { 36 * Show the form for creating a new resource.
28 $Jobs = Job_title::query()->where('is_remove', '=', '0')-> 37 *
29 orderByDesc('sort')->orderBy('name')->paginate(15); 38 * @return \Illuminate\Http\Response
30 } 39 */
31 40 public function create()
32 return view('admin.job_titles.index', compact('Jobs')); 41 {
33 } 42 /*$items = Job_title::query()->
34 43 orderByDesc('sort')->
35 /** 44 orderBy('name')->
36 * Show the form for creating a new resource. 45 active()->
37 * 46 get();*/
38 * @return \Illuminate\Http\Response 47 $category = Category::query()->active()->get();
39 */ 48
40 public function create() 49 return view('admin.job_titles.add', compact('category'));
41 { 50 }
42 /*$items = Job_title::query()-> 51
43 orderByDesc('sort')-> 52 /**
44 orderBy('name')-> 53 * Store a newly created resource in storage.
45 active()-> 54 *
46 get();*/ 55 * @param \Illuminate\Http\Request $request
47 $category = Category::query()->active()->get(); 56 * @return \Illuminate\Http\Response
48 57 */
49 return view('admin.job_titles.add', compact('category')); 58 public function store(JobTitlesRequest $request)
50 } 59 {
51 60 Job_title::create($request->all());
52 /** 61 return redirect()->route('admin.job-titles.index');
53 * Store a newly created resource in storage. 62 }
54 * 63
55 * @param \Illuminate\Http\Request $request 64 /**
56 * @return \Illuminate\Http\Response 65 * Display the specified resource.
57 */ 66 *
58 public function store(JobTitlesRequest $request) 67 * @param \App\Models\Job_title $job_title
59 { 68 * @return \Illuminate\Http\Response
60 Job_title::create($request->all()); 69 */
61 return redirect()->route('admin.job-titles.index'); 70 public function show(Job_title $job_title)
62 } 71 {
63 72 //
64 /** 73 }
65 * Display the specified resource. 74
66 * 75 /**
67 * @param \App\Models\Job_title $job_title 76 * Show the form for editing the specified resource.
68 * @return \Illuminate\Http\Response 77 *
69 */ 78 * @param \App\Models\Job_title $job_title
70 public function show(Job_title $job_title) 79 * @return \Illuminate\Http\Response
71 { 80 */
72 // 81 public function edit(Job_title $job_title)
73 } 82 {
74 83 $category = Category::query()->active()->get();
75 /** 84 return view('admin.job_titles.edit', compact('job_title', 'category'));
76 * Show the form for editing the specified resource. 85 }
77 * 86
78 * @param \App\Models\Job_title $job_title 87 /**
79 * @return \Illuminate\Http\Response 88 * Update the specified resource in storage.
80 */ 89 *
81 public function edit(Job_title $job_title) 90 * @param \Illuminate\Http\Request $request
82 { 91 * @param \App\Models\Job_title $job_title
83 $category = Category::query()->active()->get(); 92 * @return \Illuminate\Http\Response
84 return view('admin.job_titles.edit', compact('job_title', 'category')); 93 */
85 } 94 public function update(JobTitlesRequest $request, Job_title $job_title)
86 95 {
87 /** 96 $job_title->update($request->all());
88 * Update the specified resource in storage. 97 return redirect()->route('admin.job-titles.index');
89 * 98 }
90 * @param \Illuminate\Http\Request $request 99
91 * @param \App\Models\Job_title $job_title 100 /**
92 * @return \Illuminate\Http\Response 101 * Remove the specified resource from storage.
93 */ 102 *
94 public function update(JobTitlesRequest $request, Job_title $job_title) 103 * @param \App\Models\Job_title $job_title
95 { 104 * @return \Illuminate\Http\Response
96 $job_title->update($request->all()); 105 */
97 return redirect()->route('admin.job-titles.index'); 106 public function destroy(Job_title $job_title)
98 } 107 {
99 108 $job_title->update(['is_remove' => 1]);
100 /** 109 return redirect()->route('admin.job-titles.index');
101 * Remove the specified resource from storage. 110 }
102 * 111 }
103 * @param \App\Models\Job_title $job_title 112
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\Database\Eloquent\Builder;
9 use Illuminate\Http\Request; 9 use Illuminate\Http\Request;
10 use Illuminate\Support\Facades\Auth; 10 use Illuminate\Support\Facades\Auth;
11 use Illuminate\Support\Facades\DB; 11 use Illuminate\Support\Facades\DB;
12 use Illuminate\Support\Facades\Validator; 12 use Illuminate\Support\Facades\Validator;
13 13
14 class MsgAnswersController extends Controller 14 class MsgAnswersController extends Controller
15 { 15 {
16 public function messages(Request $request) { 16 public function messages(Request $request) {
17 $find_key = ""; 17 $find_key = "";
18 $find_cat = ""; 18 $find_cat = "";
19 $Msgs = Message::with('user_from')->with('user_to'); //->with('response'); 19 $Msgs = Message::with('user_from')->with('user_to'); //->with('response');
20 20
21 $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat); 21 $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat);
22 22
23 $Msgs = $Msgs->orderByDesc('created_at')->paginate(25); 23 $Msgs = $Msgs->orderByDesc('created_at')->paginate(25);
24 24
25 return view('admin.messages', compact('Msgs', 'find_key', 'find_cat')); 25 return view('admin.messages', compact('Msgs', 'find_key', 'find_cat'));
26 } 26 }
27 27
28 public function read_message(Message $message) { 28 public function read_message(Message $message) {
29 return view('admin.message-read', compact('message')); 29 return view('admin.message-read', compact('message'));
30 } 30 }
31 31
32 public function filter($Msgs, Request $request, &$find_key, &$find_cat) { 32 public function filter($Msgs, Request $request, &$find_key, &$find_cat) {
33 if (isset($request->find)) { 33 if (isset($request->find)) {
34 $find_key = $request->find; 34 $find_key = $request->find;
35 $Msgs = $Msgs->where(function($q) use ($find_key) { 35 $Msgs = $Msgs->where(function($q) use ($find_key) {
36 $q->whereHas('user_from', 36 $q->whereHas('user_from',
37 function (Builder $query) use ($find_key) { 37 function (Builder $query) use ($find_key) {
38 $query->where('name', 'LIKE', "%$find_key%"); 38 $query->where('name', 'LIKE', "%$find_key%");
39 } 39 }
40 )-> 40 )->
41 orWhereHas('user_to', 41 orWhereHas('user_to',
42 function (Builder $query) use ($find_key) { 42 function (Builder $query) use ($find_key) {
43 $query->where('name', 'LIKE', "%$find_key%"); 43 $query->where('name', 'LIKE', "%$find_key%");
44 } 44 }
45 ); 45 );
46 }); 46 });
47 } 47 }
48 48
49 if (isset($request->category)) { 49 if (isset($request->category)) {
50 $find_cat = $request->category; 50 $find_cat = $request->category;
51 51
52 switch ($find_cat) { 52 switch ($find_cat) {
53 case 'Работодатели': 53 case 'Работодатели':
54 $Msgs = $Msgs->where(function($q) { 54 $Msgs = $Msgs->where(function($q) {
55 $q->whereHas('user_to', 55 $q->whereHas('user_to',
56 function (Builder $query) { 56 function (Builder $query) {
57 $query->where('is_worker', '0'); 57 $query->where('is_worker', '0');
58 } 58 }
59 )->orwhereHas('user_from', 59 )->orwhereHas('user_from',
60 function (Builder $query) { 60 function (Builder $query) {
61 $query->where('is_worker', '0'); 61 $query->where('is_worker', '0');
62 } 62 }
63 ); 63 );
64 }); 64 });
65 break; 65 break;
66 case 'Соискатели': 66 case 'Соискатели':
67 $Msgs = $Msgs->where(function($q) { 67 $Msgs = $Msgs->where(function($q) {
68 $q->whereHas('user_to', 68 $q->whereHas('user_to',
69 function (Builder $query) { 69 function (Builder $query) {
70 $query->where('is_worker', '1'); 70 $query->where('is_worker', '1');
71 } 71 }
72 )->orwhereHas('user_from', 72 )->orwhereHas('user_from',
73 function (Builder $query) { 73 function (Builder $query) {
74 $query->where('is_worker', '1'); 74 $query->where('is_worker', '1');
75 } 75 }
76 ); 76 );
77 }); 77 });
78 break; 78 break;
79 case 'Администраторы': 79 case 'Администраторы':
80 $Msgs = $Msgs->where(function($q) { 80 $Msgs = $Msgs->where(function($q) {
81 $q->whereHas('user_to', 81 $q->whereHas('user_to',
82 function (Builder $query) { 82 function (Builder $query) {
83 $query->where('admin', '1'); 83 $query->where('admin', '1');
84 } 84 }
85 )->orwhereHas('user_from', 85 )->orwhereHas('user_from',
86 function (Builder $query) { 86 function (Builder $query) {
87 $query->where('admin', '1'); 87 $query->where('admin', '1');
88 } 88 }
89 ); 89 );
90 }); 90 });
91 break; 91 break;
92 default:break; 92 default:break;
93 } 93 }
94 } 94 }
95 95
96 return $Msgs; 96 return $Msgs;
97 97
98 } 98 }
99 99
100 public function admin_messages(Request $request) { 100 public function admin_messages(Request $request) {
101 if ($request->ajax()) { 101 if ($request->ajax()) {
102 $msg = Message::find($request->id); 102 $msg = Message::find($request->id);
103 $msg->flag_new = !($request->flag_new); 103 $msg->flag_new = !($request->flag_new);
104 $msg->save(); 104 $msg->save();
105 } 105 }
106 106
107 $id_admin = Auth::user()->id; 107 $id_admin = Auth::user()->id;
108 $users = User::query()->OrderBy('name')->where('is_bd', '=', '0')->get(); 108 $users = User::query()->OrderBy('name')->where('is_bd', '=', '0')->get();
109 109
110 $Msgs = Message::with('user_from')->with('user_to') //->with('response') 110 $Msgs = Message::with('user_from')->with('user_to') //->with('response')
111 ->where(function($query) use ($id_admin) { 111 ->where(function($query) use ($id_admin) {
112 $query->where('user_id', '=', $id_admin) 112 $query->where('user_id', '=', $id_admin)
113 ->orWhere('to_user_id', '=', $id_admin); 113 ->orWhere('to_user_id', '=', $id_admin);
114 }); 114 });
115 115
116 $find_key = ''; 116 $find_key = '';
117 $find_cat = ''; 117 $find_cat = '';
118 118
119 $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat); 119 $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat);
120 120
121 $Msgs = $Msgs->orderByDesc('created_at')->paginate(5); 121 $Msgs = $Msgs->orderByDesc('created_at')->paginate(5);
122 122
123 if ($request->ajax()) 123 if ($request->ajax())
124 return view('admin.message.index_ajax', compact('Msgs', 'id_admin', 'users')); 124 return view('admin.message.index_ajax', compact('Msgs', 'id_admin', 'users'));
125 else 125 else
126 return view('admin.message.index', compact('Msgs', 'id_admin', 'users', 'find_key', 'find_cat')); 126 return view('admin.message.index', compact('Msgs', 'id_admin', 'users', 'find_key', 'find_cat'));
127 } 127 }
128 128
129 public function messages_sql(Request $request) { 129 public function messages_sql(Request $request) {
130 $id = Auth::user()->id; 130 $id = Auth::user()->id;
131 DB::enableQueryLog(); 131 DB::enableQueryLog();
132 //$query = DB::select('select * from users where id = :id', ['id' => 1]); 132 //$query = DB::select('select * from users where id = :id', ['id' => 1]);
133 $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
134 FROM messages m1 134 FROM messages m1
135 JOIN (SELECT MAX(id) id FROM messages 135 JOIN (SELECT MAX(id) id FROM messages
136 GROUP BY LEAST(user_id, to_user_id), 136 GROUP BY LEAST(user_id, to_user_id),
137 GREATEST(user_id, to_user_id) 137 GREATEST(user_id, to_user_id)
138 ) m2 USING (id) 138 ) m2 USING (id)
139 JOIN users u1 ON u1.id = m1.user_id 139 JOIN users u1 ON u1.id = m1.user_id
140 JOIN users u2 ON u2.id = m1.to_user_id 140 JOIN users u2 ON u2.id = m1.to_user_id
141 Where ((m1.user_id = :uid) or (m1.to_user_id = :uid2)) 141 Where ((m1.user_id = :uid) or (m1.to_user_id = :uid2))
142 '), ['uid' => $id, 'uid2' => $id]); 142 '), ['uid' => $id, 'uid2' => $id]);
143 //dump(DB::getQueryLog()); 143 //dump(DB::getQueryLog());
144 dd($query); 144 dd($query);
145 return; 145 return;
146 } 146 }
147 147
148 public function admin_messages_post(Request $request) { 148 public function admin_messages_post(Request $request) {
149 $rules = [ 149 $rules = [
150 'title' => 'required|min:3|max:255', 150 'title' => 'required|min:3|max:255',
151 'text' => 'required|min:1' 151 'text' => 'required|min:1'
152 ]; 152 ];
153 153
154 $messages = [ 154 $messages = [
155 'required' => 'Поле не может быть пустым!', 155 'required' => 'Поле не может быть пустым!',
156 ]; 156 ];
157 157
158 $validator = Validator::make($request->all(), $rules, $messages); 158 $validator = Validator::make($request->all(), $rules, $messages);
159 159
160 if ($validator->fails()) { 160 if ($validator->fails()) {
161 return redirect()->route('admin.admin-messages')->withErrors($validator); 161 return redirect()->route('admin.admin-messages')->withErrors($validator);
162 } else { 162 } else {
163 $params = $request->all(); 163 $params = $request->all();
164 $id_admin = Auth::user()->id; 164 $id_admin = Auth::user()->id;
165 if ($request->has('file')) { 165 if ($request->has('file')) {
166 $params['file'] = $request->file('file')->store("upload/".$id_admin, 'public'); 166 $params['file'] = $request->file('file')->store("upload/".$id_admin, 'public');
167 } 167 }
168 Message::create($params); 168 Message::create($params);
169 return redirect()->route('admin.admin-messages'); 169 return redirect()->route('admin.admin-messages');
170 } 170 }
171 } 171 }
172 } 172 }
173 173
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\BaseUserRequest; 8 use App\Http\Requests\BaseUserRequest;
9 use App\Http\Requests\FlotRequest; 9 use App\Http\Requests\FlotRequest;
10 use App\Http\Requests\MessagesRequiest; 10 use App\Http\Requests\MessagesRequiest;
11 use App\Http\Requests\VacancyRequestEdit; 11 use App\Http\Requests\VacancyRequestEdit;
12 use App\Http\Requests\VacansiaRequiest; 12 use App\Http\Requests\VacansiaRequiest;
13 use App\Mail\MailSotrudnichestvo; 13 use App\Mail\MailSotrudnichestvo;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\Ad_jobs; 16 use App\Models\Ad_jobs;
17 use App\Models\ad_response; 17 use App\Models\ad_response;
18 use App\Models\Category; 18 use App\Models\Category;
19 use App\Models\Education; 19 use App\Models\Education;
20 use App\Models\Employer; 20 use App\Models\Employer;
21 use App\Models\employers_main; 21 use App\Models\employers_main;
22 use App\Models\Flot; 22 use App\Models\Flot;
23 use App\Models\Job_title; 23 use App\Models\Job_title;
24 use App\Models\Like_vacancy; 24 use App\Models\Like_vacancy;
25 use App\Models\Like_worker; 25 use App\Models\Like_worker;
26 use App\Models\Message; 26 use App\Models\Message;
27 use App\Models\Positions; 27 use App\Models\Positions;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Carbon\Carbon; 29 use Carbon\Carbon;
30 use Illuminate\Auth\Events\Registered; 30 use Illuminate\Auth\Events\Registered;
31 use Illuminate\Database\Eloquent\Builder; 31 use Illuminate\Database\Eloquent\Builder;
32 use Illuminate\Database\Eloquent\Model; 32 use Illuminate\Database\Eloquent\Model;
33 use Illuminate\Foundation\Auth\User; 33 use Illuminate\Foundation\Auth\User;
34 use Illuminate\Http\Request; 34 use Illuminate\Http\Request;
35 use Illuminate\Support\Facades\Auth; 35 use Illuminate\Support\Facades\Auth;
36 use Illuminate\Support\Facades\Hash; 36 use Illuminate\Support\Facades\Hash;
37 use Illuminate\Support\Facades\Mail; 37 use Illuminate\Support\Facades\Mail;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use App\Models\User as User_Model; 39 use App\Models\User as User_Model;
40 use Illuminate\Support\Facades\Validator; 40 use Illuminate\Support\Facades\Validator;
41 41
42 class EmployerController extends Controller 42 class EmployerController extends Controller
43 { 43 {
44 public function vacancie($vacancy, Request $request) { 44 public function vacancie($vacancy, Request $request) {
45 $title = 'Заголовок вакансии'; 45 $title = 'Заголовок вакансии';
46 $Query = Ad_employer::with('jobs')-> 46 $Query = Ad_employer::with('jobs')->
47 with('cat')-> 47 with('cat')->
48 with('employer')-> 48 with('employer')->
49 with('jobs_code')-> 49 with('jobs_code')->
50 select('ad_employers.*')-> 50 select('ad_employers.*')->
51 where('id', '=', $vacancy)->get(); 51 where('id', '=', $vacancy)->get();
52 52
53 if (isset(Auth()->user()->id)) 53 if (isset(Auth()->user()->id))
54 $uid = Auth()->user()->id; 54 $uid = Auth()->user()->id;
55 else 55 else
56 $uid = 0; 56 $uid = 0;
57 $title = $Query[0]->name; 57 $title = $Query[0]->name;
58 if ($request->ajax()) { 58 if ($request->ajax()) {
59 return view('ajax.vacance-item', compact('Query','uid')); 59 return view('ajax.vacance-item', compact('Query','uid'));
60 } else { 60 } else {
61 return view('vacance-item', compact('title', 'Query', 'uid')); 61 return view('vacance-item', compact('title', 'Query', 'uid'));
62 } 62 }
63 } 63 }
64 64
65 public function logout() { 65 public function logout() {
66 Auth::logout(); 66 Auth::logout();
67 return redirect()->route('index') 67 return redirect()->route('index')
68 ->with('success', 'Вы вышли из личного кабинета'); 68 ->with('success', 'Вы вышли из личного кабинета');
69 } 69 }
70 70
71 public function employer_info() { 71 public function employer_info() {
72 // код юзера 72 // код юзера
73 $user_info = Auth()->user(); 73 $user_info = Auth()->user();
74 // вьюшка для вывода данных 74 // вьюшка для вывода данных
75 return view('employers.info', compact('user_info')); 75 return view('employers.info', compact('user_info'));
76 } 76 }
77 77
78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
79 // Все данные через реквест 79 // Все данные через реквест
80 $all = $request->all(); 80 $all = $request->all();
81 unset($all['_token']); 81 unset($all['_token']);
82 // обновление 82 // обновление
83 $user->update($all); 83 $user->update($all);
84 return redirect()->route('employer.employer_info'); 84 return redirect()->route('employer.employer_info');
85 } 85 }
86 86
87 public function cabinet() { 87 public function cabinet() {
88 $id = Auth()->user()->id; 88 $id = Auth()->user()->id;
89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
90 WhereHas('users', 90 WhereHas('users',
91 function (Builder $query) use ($id) {$query->Where('id', $id); 91 function (Builder $query) use ($id) {$query->Where('id', $id);
92 })->get(); 92 })->get();
93 return view('employers.cabinet45', compact('Employer')); 93 return view('employers.cabinet45', compact('Employer'));
94 } 94 }
95 95
96 public function slider_flot() { 96 public function slider_flot() {
97 $id = Auth()->user()->id; 97 $id = Auth()->user()->id;
98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
99 WhereHas('users', 99 WhereHas('users',
100 function (Builder $query) use ($id) {$query->Where('id', $id); 100 function (Builder $query) use ($id) {$query->Where('id', $id);
101 })->get(); 101 })->get();
102 return view('employers.fly-flot', compact('Employer')); 102 return view('employers.fly-flot', compact('Employer'));
103 } 103 }
104 104
105 public function cabinet_save(Employer $Employer, Request $request) { 105 public function cabinet_save(Employer $Employer, Request $request) {
106 $params = $request->all(); 106 $params = $request->all();
107 $params['user_id'] = Auth()->user()->id; 107 $params['user_id'] = Auth()->user()->id;
108 $id = $Employer->id; 108 $id = $Employer->id;
109 109
110 if ($request->has('logo')) { 110 if ($request->has('logo')) {
111 if (!empty($Employer->logo)) { 111 if (!empty($Employer->logo)) {
112 Storage::delete($Employer->logo); 112 Storage::delete($Employer->logo);
113 } 113 }
114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
115 } 115 }
116 116
117 $Employer->update($params); 117 $Employer->update($params);
118 118
119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
120 } 120 }
121 121
122 public function save_add_flot(FlotRequest $request) { 122 public function save_add_flot(FlotRequest $request) {
123 // отмена 123 // отмена
124 $params = $request->all(); 124 $params = $request->all();
125 125
126 if ($request->has('image')) { 126 if ($request->has('image')) {
127 $params['image'] = $request->file('image')->store("flot", 'public'); 127 $params['image'] = $request->file('image')->store("flot", 'public');
128 } 128 }
129 Flot::create($params); 129 Flot::create($params);
130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
132 } 132 }
133 133
134 public function edit_flot(Flot $Flot, Employer $Employer) { 134 public function edit_flot(Flot $Flot, Employer $Employer) {
135 return view('employers.edit-flot', compact('Flot', 'Employer')); 135 return view('employers.edit-flot', compact('Flot', 'Employer'));
136 } 136 }
137 137
138 public function update_flot(FlotRequest $request, Flot $Flot) { 138 public function update_flot(FlotRequest $request, Flot $Flot) {
139 $params = $request->all(); 139 $params = $request->all();
140 140
141 if ($request->has('image')) { 141 if ($request->has('image')) {
142 if (!empty($flot->image)) { 142 if (!empty($flot->image)) {
143 Storage::delete($flot->image); 143 Storage::delete($flot->image);
144 } 144 }
145 $params['image'] = $request->file('image')->store("flot", 'public'); 145 $params['image'] = $request->file('image')->store("flot", 'public');
146 } else { 146 } else {
147 if (!empty($flot->image)) $params['image'] = $flot->image; 147 if (!empty($flot->image)) $params['image'] = $flot->image;
148 } 148 }
149 149
150 $Flot->update($params); 150 $Flot->update($params);
151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
152 } 152 }
153 153
154 public function delete_flot(Flot $Flot) { 154 public function delete_flot(Flot $Flot) {
155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
156 156
157 if (isset($Flot->id)) $Flot->delete(); 157 if (isset($Flot->id)) $Flot->delete();
158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
159 } 159 }
160 160
161 // Форма добавления вакансий 161 // Форма добавления вакансий
162 public function cabinet_vacancie() { 162 public function cabinet_vacancie() {
163 $id = Auth()->user()->id; 163 $id = Auth()->user()->id;
164 164
165 if (Auth()->user()->is_public) { 165 if (Auth()->user()->is_public) {
166 $categories = Category::query()->active()->get(); 166 $categories = Category::query()->active()->get();
167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
168 where('is_remove', '=', '0')-> 168 where('is_remove', '=', '0')->
169 where('is_bd', '=', '0')-> 169 where('is_bd', '=', '0')->
170 get(); 170 get();
171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
172 WhereHas('users', 172 WhereHas('users',
173 function (Builder $query) use ($id) { 173 function (Builder $query) use ($id) {
174 $query->Where('id', $id); 174 $query->Where('id', $id);
175 })->get(); 175 })->get();
176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
177 } else { 177 } else {
178 return redirect()->route('employer.cabinet_vacancie_danger'); 178 return redirect()->route('employer.cabinet_vacancie_danger');
179 } 179 }
180 } 180 }
181 181
182 // Форма предупреждения об оплате 182 // Форма предупреждения об оплате
183 public function cabinet_vacancie_danger() { 183 public function cabinet_vacancie_danger() {
184 return view('employers.add_vacancy_danger'); 184 return view('employers.add_vacancy_danger');
185 } 185 }
186 186
187 // Сохранение вакансии 187 // Сохранение вакансии
188 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 188 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
189 $params_emp = $request->all(); 189 $params_emp = $request->all();
190 190
191 $params_job["job_title_id"] = $params_emp['job_title_id']; 191 $params_job["job_title_id"] = $params_emp['job_title_id'];
192 //$params_job["min_salary"] = $params_emp['min_salary']; 192 //$params_job["min_salary"] = $params_emp['min_salary'];
193 //$params_job["max_salary"] = $params_emp['max_salary']; 193 //$params_job["max_salary"] = $params_emp['max_salary'];
194 //$params_job["region"] = $params_emp['region']; 194 //$params_job["region"] = $params_emp['region'];
195 //$params_job["power"] = $params_emp['power']; 195 //$params_job["power"] = $params_emp['power'];
196 //$params_job["sytki"] = $params_emp['sytki']; 196 //$params_job["sytki"] = $params_emp['sytki'];
197 //$params_job["start"] = $params_emp['start']; 197 //$params_job["start"] = $params_emp['start'];
198 //$params_job["flot"] = $params_emp['flot']; 198 //$params_job["flot"] = $params_emp['flot'];
199 //$params_job["description"] = $params_emp['description']; 199 //$params_job["description"] = $params_emp['description'];
200 200
201 $ad_jobs = Ad_employer::create($params_emp); 201 $ad_jobs = Ad_employer::create($params_emp);
202 //$params_job['ad_employer_id'] = $ad_jobs->id; 202 //$params_job['ad_employer_id'] = $ad_jobs->id;
203 //Ad_jobs::create($params_job); 203 //Ad_jobs::create($params_job);
204 $ad_jobs->jobs()->sync($request->get('job_title_id')); 204 $ad_jobs->jobs()->sync($request->get('job_title_id'));
205 205
206 return redirect()->route('employer.vacancy_list'); 206 return redirect()->route('employer.vacancy_list');
207 } 207 }
208 208
209 // Список вакансий 209 // Список вакансий
210 public function vacancy_list(Request $request) { 210 public function vacancy_list(Request $request) {
211 $id = Auth()->user()->id; 211 $id = Auth()->user()->id;
212 212
213 //dd($request->all()); 213 //dd($request->all());
214 $Employer = Employer::query()->where('user_id', $id)->first(); 214 $Employer = Employer::query()->where('user_id', $id)->first();
215 $vacancy_list = Ad_employer::query()->with('jobs')-> 215 $vacancy_list = Ad_employer::query()->with('jobs')->
216 with('jobs_code')-> 216 with('jobs_code')->
217 where('employer_id', $Employer->id); 217 where('employer_id', $Employer->id);
218 218
219 if (($request->has('search')) && (!empty($request->get('search')))) { 219 if (($request->has('search')) && (!empty($request->get('search')))) {
220 $search = $request->get('search'); 220 $search = $request->get('search');
221 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 221 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
222 } 222 }
223 223
224 if ($request->get('sort')) { 224 if ($request->get('sort')) {
225 $sort = $request->get('sort'); 225 $sort = $request->get('sort');
226 switch ($sort) { 226 switch ($sort) {
227 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 227 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
228 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 228 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
229 case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break;
230 case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break;
229 case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break; 231 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
230 case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break; 232 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
231 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 233 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break;
232 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 234 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break;
233 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break; 235 }
234 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break; 236 }
235 } 237 $vacancy_list = $vacancy_list->paginate(4);
236 } 238
237 $vacancy_list = $vacancy_list->paginate(4); 239 //ajax
238 240 if ($request->ajax()) {
239 //ajax 241 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
240 if ($request->ajax()) { 242 } else {
241 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 243 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
242 } else { 244 }
243 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 245 }
244 } 246
245 } 247 // Карточка вакансии
246 248 public function vacancy_edit(Ad_employer $ad_employer) {
247 // Карточка вакансии 249 $id = Auth()->user()->id;
248 public function vacancy_edit(Ad_employer $ad_employer) { 250 $Positions = Category::query()->where('is_remove', '=', '0')->get();
249 $id = Auth()->user()->id; 251
250 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 252 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
251 253 where('is_remove', '=', '0')->
252 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 254 where('is_bd', '=', '0')->get();
253 where('is_remove', '=', '0')-> 255
254 where('is_bd', '=', '0')->get(); 256 $Employer = Employer::query()->with('users')->with('ads')->
255 257 with('flots')->where('user_id', $id)->first();
256 $Employer = Employer::query()->with('users')->with('ads')-> 258
257 with('flots')->where('user_id', $id)->first(); 259 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
258 260 }
259 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 261
260 } 262 // Сохранение-редактирование записи
261 263 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
262 // Сохранение-редактирование записи 264 $params = $request->all();
263 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 265 $params_job["job_title_id"] = $params['job_title_id'];
264 $params = $request->all(); 266
265 $params_job["job_title_id"] = $params['job_title_id']; 267 //$jobs['flot'] = $params['flot'];
266 268 //$jobs['job_title_id'] = $params['job_title_id'];
267 //$jobs['flot'] = $params['flot']; 269 //$titles['position_id'] = $params['position_id'];
268 //$jobs['job_title_id'] = $params['job_title_id']; 270 //unset($params['job_title_id']);
269 //$titles['position_id'] = $params['position_id']; 271 //dd($params);
270 //unset($params['job_title_id']); 272 $ad_employer->update($params);
271 //dd($params); 273 $ad_employer->jobs()->sync($request->get('job_title_id'));
272 $ad_employer->update($params); 274
273 $ad_employer->jobs()->sync($request->get('job_title_id')); 275 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
274 276 // where('ad_employer_id', $ad_employer->id)->first();
275 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> 277 //$data = Ad_jobs::find($job_->id);
276 // where('ad_employer_id', $ad_employer->id)->first(); 278 //$ad_jobs = $data->update($jobs);
277 //$data = Ad_jobs::find($job_->id); 279 return redirect()->route('employer.vacancy_list');
278 //$ad_jobs = $data->update($jobs); 280 }
279 return redirect()->route('employer.vacancy_list'); 281
280 } 282 // Сохранение карточки вакансии
281 283 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
282 // Сохранение карточки вакансии 284 $all = $request->all();
283 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 285 $ad_employer->update($all);
284 $all = $request->all(); 286 return redirect()->route('employer.cabinet_vacancie');
285 $ad_employer->update($all); 287 }
286 return redirect()->route('employer.cabinet_vacancie'); 288
287 } 289 // Удаление карточки вакансии
288 290 public function vacancy_delete(Ad_employer $ad_employer) {
289 // Удаление карточки вакансии 291 $ad_employer->delete();
290 public function vacancy_delete(Ad_employer $ad_employer) { 292
291 $ad_employer->delete(); 293 return redirect()->route('employer.vacancy_list')
292 294 ->with('success', 'Данные были успешно сохранены');
293 return redirect()->route('employer.vacancy_list') 295 }
294 ->with('success', 'Данные были успешно сохранены'); 296
295 } 297 // Обновление даты
296 298 public function vacancy_up(Ad_employer $ad_employer) {
297 // Обновление даты 299 $up = date('m/d/Y h:i:s', time());;
298 public function vacancy_up(Ad_employer $ad_employer) { 300 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
299 $up = date('m/d/Y h:i:s', time());; 301 $vac_emp->updated_at = $up;
300 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 302 $vac_emp->save();
301 $vac_emp->updated_at = $up; 303
302 $vac_emp->save(); 304 return redirect()->route('employer.vacancy_list');
303 305 // начало конца
304 return redirect()->route('employer.vacancy_list'); 306 }
305 // начало конца 307
306 } 308 //Видимость вакансии
307 309 public function vacancy_eye(Ad_employer $ad_employer, $status) {
308 //Видимость вакансии 310 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
309 public function vacancy_eye(Ad_employer $ad_employer, $status) { 311 $vac_emp->active_is = $status;
310 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 312 $vac_emp->save();
311 $vac_emp->active_is = $status; 313
312 $vac_emp->save(); 314 return redirect()->route('employer.vacancy_list');
313 315 }
314 return redirect()->route('employer.vacancy_list'); 316
315 } 317 //Вакансия редактирования (шаблон)
316 318 public function vacancy_update(Ad_employer $id) {
317 //Вакансия редактирования (шаблон) 319
318 public function vacancy_update(Ad_employer $id) { 320 }
319 321
320 } 322 //Отклики на вакансию - лист
321 323 public function answers(Employer $employer, Request $request) {
322 //Отклики на вакансию - лист 324 $user_id = Auth()->user()->id;
323 public function answers(Employer $employer, Request $request) { 325 $answer = Ad_employer::query()->where('employer_id', $employer->id);
324 $user_id = Auth()->user()->id; 326 if ($request->has('search')) {
325 $answer = Ad_employer::query()->where('employer_id', $employer->id); 327 $search = trim($request->get('search'));
326 if ($request->has('search')) { 328 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
327 $search = trim($request->get('search')); 329 }
328 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 330
329 } 331 $answer = $answer->with('response')->OrderByDESC('id')->get();
330 332
331 $answer = $answer->with('response')->OrderByDESC('id')->get(); 333 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
332 334 }
333 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 335
334 } 336 //Обновление статуса
335 337 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
336 //Обновление статуса 338 $ad_response->update(Array('flag' => $flag));
337 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 339 return redirect()->route('employer.answers', ['employer' => $employer->id]);
338 $ad_response->update(Array('flag' => $flag)); 340 }
339 return redirect()->route('employer.answers', ['employer' => $employer->id]); 341
340 } 342 //Страницы сообщений список
341 343 public function messages($type_message) {
342 //Страницы сообщений список 344 $user_id = Auth()->user()->id;
343 public function messages($type_message) { 345
344 $user_id = Auth()->user()->id; 346 $messages_input = Message::query()->with('vacancies')->with('user_from')->
345 347 Where('to_user_id', $user_id)->OrderByDesc('created_at');
346 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 348
347 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 349 $messages_output = Message::query()->with('vacancies')->
348 350 with('user_to')->where('user_id', $user_id)->
349 $messages_output = Message::query()->with('vacancies')-> 351 OrderByDesc('created_at');
350 with('user_to')->where('user_id', $user_id)-> 352
351 OrderByDesc('created_at'); 353 $count_input = $messages_input->count();
352 354 $count_output = $messages_output->count();
353 $count_input = $messages_input->count(); 355
354 $count_output = $messages_output->count(); 356 if ($type_message == 'input') {
355 357 $messages = $messages_input->paginate(5);
356 if ($type_message == 'input') { 358 }
357 $messages = $messages_input->paginate(5); 359
358 } 360 if ($type_message == 'output') {
359 361 $messages = $messages_output->paginate(5);
360 if ($type_message == 'output') { 362 }
361 $messages = $messages_output->paginate(5); 363
362 } 364 //dd($user_id, $messages[2]->vacancies);
363 365 //jobs);
364 //dd($user_id, $messages[2]->vacancies); 366
365 //jobs); 367 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
366 368 }
367 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 369
368 } 370 // Диалог между пользователями
369 371 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
370 // Диалог между пользователями 372 // Получение параметров.
371 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 373 if ($request->has('ad_employer')){
372 // Получение параметров. 374 $ad_employer = $request->get('ad_employer');
373 if ($request->has('ad_employer')){ 375 } else {
374 $ad_employer = $request->get('ad_employer'); 376 $ad_employer = 0;
375 } else { 377 }
376 $ad_employer = 0; 378
377 } 379 if (isset($user2->id)) {
378 380 $companion = User_Model::query()->with('workers')->
379 if (isset($user2->id)) { 381 with('employers')->
380 $companion = User_Model::query()->with('workers')-> 382 where('id', $user2->id)->first();
381 with('employers')-> 383 }
382 where('id', $user2->id)->first(); 384
383 } 385 $Messages = Message::query()->
384 386 where('ad_employer_id', '=', $ad_employer)->
385 $Messages = Message::query()-> 387 where(function($query) use ($user1, $user2) {
386 where('ad_employer_id', '=', $ad_employer)-> 388 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
387 where(function($query) use ($user1, $user2) { 389 })->orWhere(function($query) use ($user1, $user2) {
388 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 390 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
389 })->orWhere(function($query) use ($user1, $user2) { 391 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
390 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 392
391 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 393 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
392 394
393 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 395 //$ad_employer = null;
394 396 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
395 //$ad_employer = null; 397 $sender = $user1;
396 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 398
397 $sender = $user1; 399 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
398 400 }
399 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 401
400 } 402 // Регистрация работодателя
401 403 public function register_employer(Request $request) {
402 // Регистрация работодателя 404 $params = $request->all();
403 public function register_employer(Request $request) { 405
404 $params = $request->all(); 406 $rules = [
405 407 //'surname' => ['required', 'string', 'max:255'],
406 $rules = [ 408 //'name_man' => ['required', 'string', 'max:255'],
407 //'surname' => ['required', 'string', 'max:255'], 409 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
408 //'name_man' => ['required', 'string', 'max:255'], 410 'name_company' => ['required', 'string', 'max:255'],
409 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 411 'password' => ['required', 'string', 'min:6'],
410 'name_company' => ['required', 'string', 'max:255'], 412 ];
411 'password' => ['required', 'string', 'min:6'], 413
412 ]; 414
413 415 $messages = [
414 416 'required' => 'Укажите обязательное поле',
415 $messages = [ 417 'min' => [
416 'required' => 'Укажите обязательное поле', 418 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
417 'min' => [ 419 'integer' => 'Поле «:attribute» должно быть :min или больше',
418 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 420 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
419 'integer' => 'Поле «:attribute» должно быть :min или больше', 421 ],
420 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 422 'max' => [
421 ], 423 'string' => 'Поле «:attribute» должно быть не больше :max символов',
422 'max' => [ 424 'integer' => 'Поле «:attribute» должно быть :max или меньше',
423 'string' => 'Поле «:attribute» должно быть не больше :max символов', 425 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
424 'integer' => 'Поле «:attribute» должно быть :max или меньше', 426 ]
425 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 427 ];
426 ] 428
427 ]; 429 $email = $request->get('email');
428 430 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
429 $email = $request->get('email'); 431 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
430 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 432 }
431 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 433
432 } 434 if ($request->get('password') !== $request->get('confirmed')){
433 435 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
434 if ($request->get('password') !== $request->get('confirmed')){ 436 }
435 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 437
436 } 438 if (strlen($request->get('password')) < 6) {
437 439 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
438 if (strlen($request->get('password')) < 6) { 440 }
439 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 441 /*
440 } 442 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
441 /* 443 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
442 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 444 'X', 'C', 'V', 'B', 'N', 'M');
443 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 445 $spec_bool = false;
444 'X', 'C', 'V', 'B', 'N', 'M'); 446 $alpha_bool = false;
445 $spec_bool = false; 447
446 $alpha_bool = false; 448 $haystack = $request->get('password');
447 449
448 $haystack = $request->get('password'); 450 foreach ($specsumbol as $it) {
449 451 if (strpos($haystack, $it) !== false) {
450 foreach ($specsumbol as $it) { 452 $spec_bool = true;
451 if (strpos($haystack, $it) !== false) { 453 }
452 $spec_bool = true; 454 }
453 } 455
454 } 456 foreach ($alpha as $it) {
455 457 if (strpos($haystack, $it) !== false) {
456 foreach ($alpha as $it) { 458 $alpha_bool = true;
457 if (strpos($haystack, $it) !== false) { 459 }
458 $alpha_bool = true; 460 }
459 } 461
460 } 462 if ((!$spec_bool) || (!$alpha_bool)) {
461 463 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
462 if ((!$spec_bool) || (!$alpha_bool)) { 464 }*/
463 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 465
464 }*/ 466 if (empty($request->get('surname'))) {
465 467 $params['surname'] = 'Неизвестно';
466 if (empty($request->get('surname'))) { 468 }
467 $params['surname'] = 'Неизвестно'; 469 if (empty($request->get('name_man'))) {
468 } 470 $params['name_man'] = 'Неизвестно';
469 if (empty($request->get('name_man'))) { 471 }
470 $params['name_man'] = 'Неизвестно'; 472 $validator = Validator::make($params, $rules, $messages);
471 } 473
472 $validator = Validator::make($params, $rules, $messages); 474 if ($validator->fails()) {
473 475 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
474 if ($validator->fails()) { 476 } else {
475 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 477 $user = $this->create($params);
476 } else { 478 event(new Registered($user));
477 $user = $this->create($params); 479 Auth::guard()->login($user);
478 event(new Registered($user)); 480 }
479 Auth::guard()->login($user); 481
480 } 482 if ($user) {
481 483 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
482 if ($user) { 484 } else {
483 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 485 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
484 } else { 486 }
485 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 487 }
486 } 488
487 } 489 // Создание пользователя
488 490 protected function create(array $data)
489 // Создание пользователя 491 {
490 protected function create(array $data) 492 $Use = new User_Model();
491 { 493 $Code_user = $Use->create([
492 $Use = new User_Model(); 494 'name' => $data['surname']." ".$data['name_man'],
493 $Code_user = $Use->create([ 495 'name_man' => $data['name_man'],
494 'name' => $data['surname']." ".$data['name_man'], 496 'surname' => $data['surname'],
495 'name_man' => $data['name_man'], 497 'surname2' => $data['surname2'],
496 'surname' => $data['surname'], 498 'subscribe_email' => $data['email'],
497 'surname2' => $data['surname2'], 499 'email' => $data['email'],
498 'subscribe_email' => $data['email'], 500 'telephone' => $data['telephone'],
499 'email' => $data['email'], 501 'is_worker' => 0,
500 'telephone' => $data['telephone'], 502 'password' => Hash::make($data['password']),
501 'is_worker' => 0, 503 'pubpassword' => base64_encode($data['password']),
502 'password' => Hash::make($data['password']), 504 'email_verified_at' => Carbon::now()
503 'pubpassword' => base64_encode($data['password']), 505 ]);
504 'email_verified_at' => Carbon::now() 506
505 ]); 507 if ($Code_user->id > 0) {
506 508 $Employer = new Employer();
507 if ($Code_user->id > 0) { 509 $Employer->user_id = $Code_user->id;
508 $Employer = new Employer(); 510 $Employer->name_company = $data['name_company'];
509 $Employer->user_id = $Code_user->id; 511 $Employer->email = $data['email'];
510 $Employer->name_company = $data['name_company']; 512 $Employer->telephone = $data['telephone'];
511 $Employer->email = $data['email']; 513 $Employer->code = Tools::generator_id(10);
512 $Employer->telephone = $data['telephone']; 514 $Employer->save();
513 $Employer->code = Tools::generator_id(10); 515
514 $Employer->save(); 516 return $Code_user;
515 517 }
516 return $Code_user; 518 }
517 } 519
518 } 520 // Отправка сообщения от работодателя
519 521 public function send_message(MessagesRequiest $request) {
520 // Отправка сообщения от работодателя 522 $params = $request->all();
521 public function send_message(MessagesRequiest $request) { 523 dd($params);
522 $params = $request->all(); 524 $user1 = $params['user_id'];
523 dd($params); 525 $user2 = $params['to_user_id'];
524 $user1 = $params['user_id']; 526
525 $user2 = $params['to_user_id']; 527 if ($request->has('file')) {
526 528 $params['file'] = $request->file('file')->store("messages", 'public');
527 if ($request->has('file')) { 529 }
528 $params['file'] = $request->file('file')->store("messages", 'public'); 530 Message::create($params);
529 } 531 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
530 Message::create($params); 532 }
531 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 533
532 } 534 public function test123(Request $request) {
533 535 $params = $request->all();
534 public function test123(Request $request) { 536 $user1 = $params['user_id'];
535 $params = $request->all(); 537 $user2 = $params['to_user_id'];
536 $user1 = $params['user_id']; 538 $id_vacancy = $params['ad_employer_id'];
537 $user2 = $params['to_user_id']; 539 $ad_name = $params['ad_name'];
538 $id_vacancy = $params['ad_employer_id']; 540
539 $ad_name = $params['ad_name']; 541 $rules = [
540 542 'text' => 'required|min:1|max:150000',
541 $rules = [ 543 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
542 'text' => 'required|min:1|max:150000', 544 ];
543 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 545 $messages = [
544 ]; 546 'required' => 'Укажите обязательное поле',
545 $messages = [ 547 'min' => [
546 'required' => 'Укажите обязательное поле', 548 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
547 'min' => [ 549 'integer' => 'Поле «:attribute» должно быть :min или больше',
548 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 550 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
549 'integer' => 'Поле «:attribute» должно быть :min или больше', 551 ],
550 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 552 'max' => [
551 ], 553 'string' => 'Поле «:attribute» должно быть не больше :max символов',
552 'max' => [ 554 'integer' => 'Поле «:attribute» должно быть :max или меньше',
553 'string' => 'Поле «:attribute» должно быть не больше :max символов', 555 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
554 'integer' => 'Поле «:attribute» должно быть :max или меньше', 556 ]
555 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 557 ];
556 ] 558
557 ]; 559 $validator = Validator::make($request->all(), $rules, $messages);
558 560
559 $validator = Validator::make($request->all(), $rules, $messages); 561 if ($validator->fails()) {
560 562 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
561 if ($validator->fails()) { 563 ->withErrors($validator);
562 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 564 } else {
563 ->withErrors($validator); 565 if ($request->has('file')) {
564 } else { 566 $params['file'] = $request->file('file')->store("messages", 'public');
565 if ($request->has('file')) { 567 }
566 $params['file'] = $request->file('file')->store("messages", 'public'); 568 Message::create($params);
567 } 569 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
568 Message::create($params); 570 return redirect()->route('employer.dialog',
569 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 571 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
570 return redirect()->route('employer.dialog', 572
571 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 573 }
572 574 }
573 } 575
574 } 576 //Избранные люди
575 577 public function favorites(Request $request) {
576 //Избранные люди 578 $IP_address = RusDate::ip_addr_client();
577 public function favorites(Request $request) { 579 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
578 $IP_address = RusDate::ip_addr_client(); 580
579 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 581 if ($Arr->count()) {
580 582 $A = Array();
581 if ($Arr->count()) { 583 foreach ($Arr as $it) {
582 $A = Array(); 584 $A[] = $it->code_record;
583 foreach ($Arr as $it) { 585 }
584 $A[] = $it->code_record; 586
585 } 587 $Workers = Worker::query()->whereIn('id', $A);
586 588 } else {
587 $Workers = Worker::query()->whereIn('id', $A); 589 $Workers = Worker::query()->where('id', '=', '0');
588 } else { 590 }
589 $Workers = Worker::query()->where('id', '=', '0'); 591
590 } 592 if (($request->has('search')) && (!empty($request->get('search')))) {
591 593 $search = $request->get('search');
592 if (($request->has('search')) && (!empty($request->get('search')))) { 594
593 $search = $request->get('search'); 595 $Workers = $Workers->WhereHas('users',
594 596 function (Builder $query) use ($search) {
595 $Workers = $Workers->WhereHas('users', 597 $query->Where('surname', 'LIKE', "%$search%")
596 function (Builder $query) use ($search) { 598 ->orWhere('name_man', 'LIKE', "%$search%")
597 $query->Where('surname', 'LIKE', "%$search%") 599 ->orWhere('surname2', 'LIKE', "%$search%");
598 ->orWhere('name_man', 'LIKE', "%$search%") 600 });
599 ->orWhere('surname2', 'LIKE', "%$search%"); 601 } else {
600 }); 602 $Workers = $Workers->with('users');
601 } else { 603 }
602 $Workers = $Workers->with('users'); 604
603 } 605 $Workers = $Workers->get();
604 606
605 $Workers = $Workers->get(); 607
606 608 return view('employers.favorite', compact('Workers'));
607 609 }
608 return view('employers.favorite', compact('Workers')); 610
609 } 611 // База данных
610 612 public function bd(Request $request) {
611 // База данных 613 // для типа BelongsTo
612 public function bd(Request $request) { 614 //$documents = Document::query()->orderBy(Location::select('name')
613 // для типа BelongsTo 615 // ->whereColumn('locations.id', 'documents.location_id')
614 //$documents = Document::query()->orderBy(Location::select('name') 616 //);
615 // ->whereColumn('locations.id', 'documents.location_id') 617
616 //); 618 // для типа HasOne/Many
617 619 // $documents = Document::::query()->orderBy(Location::select('name')
618 // для типа HasOne/Many 620 // ->whereColumn('locations.document_id', 'documents.id')
619 // $documents = Document::::query()->orderBy(Location::select('name') 621 //);
620 // ->whereColumn('locations.document_id', 'documents.id') 622
621 //); 623
622 624 $users = User_Model::query()->with('workers');
623 625
624 $users = User_Model::query()->with('workers'); 626 if ($request->has('search')) {
625 627 $find_key = $request->get('search');
626 if ($request->has('search')) { 628 $users = $users->where('name', 'LIKE', "%$find_key%")
627 $find_key = $request->get('search'); 629 ->orWhere('surname', 'LIKE', "%$find_key%")
628 $users = $users->where('name', 'LIKE', "%$find_key%") 630 ->orWhere('name_man', 'LIKE', "%$find_key%")
629 ->orWhere('surname', 'LIKE', "%$find_key%") 631 ->orWhere('email', 'LIKE', "%$find_key%")
630 ->orWhere('name_man', 'LIKE', "%$find_key%") 632 ->orWhere('telephone', 'LIKE', "%$find_key%");
631 ->orWhere('email', 'LIKE', "%$find_key%") 633 }
632 ->orWhere('telephone', 'LIKE', "%$find_key%"); 634
633 } 635 // Данные
634 636 $users = $users->Baseuser()->
635 // Данные 637 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'));
636 $users = $users->Baseuser()-> 638 $count_users = $users;
637 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); 639 $users = $users->paginate(5);
638 $count_users = $users; 640
639 $users = $users->paginate(5); 641
640 642 return view('employers.bd', compact('users', 'count_users'));
641 643 }
642 return view('employers.bd', compact('users', 'count_users')); 644
643 } 645 //Настройка уведомлений
644 646 public function subscribe() {
645 //Настройка уведомлений 647 return view('employers.subcribe');
646 public function subscribe() { 648 }
647 return view('employers.subcribe'); 649
648 } 650 //Установка уведомлений сохранение
649 651 public function save_subscribe(Request $request) {
650 //Установка уведомлений сохранение 652 dd($request->all());
651 public function save_subscribe(Request $request) { 653 $msg = $request->validate([
652 dd($request->all()); 654 'subscribe_email' => 'required|email|min:5|max:255',
653 $msg = $request->validate([ 655 ]);
654 'subscribe_email' => 'required|email|min:5|max:255', 656 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
655 ]); 657 }
656 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 658
657 } 659 //Сбросить форму с паролем
658 660 public function password_reset() {
659 //Сбросить форму с паролем 661 $email = Auth()->user()->email;
660 public function password_reset() { 662 return view('employers.password-reset', compact('email'));
661 $email = Auth()->user()->email; 663 }
662 return view('employers.password-reset', compact('email')); 664
663 } 665 //Обновление пароля
664 666 public function new_password(Request $request) {
665 //Обновление пароля 667 $use = Auth()->user();
666 public function new_password(Request $request) { 668 $request->validate([
667 $use = Auth()->user(); 669 'password' => 'required|string',
668 $request->validate([ 670 'new_password' => 'required|string',
669 'password' => 'required|string', 671 'new_password2' => 'required|string'
670 'new_password' => 'required|string', 672 ]);
671 'new_password2' => 'required|string' 673
672 ]); 674 if ($request->get('new_password') == $request->get('new_password2'))
673 675 if ($request->get('password') !== $request->get('new_password')) {
674 if ($request->get('new_password') == $request->get('new_password2')) 676 $credentials = $request->only('email', 'password');
675 if ($request->get('password') !== $request->get('new_password')) { 677 if (Auth::attempt($credentials)) {
676 $credentials = $request->only('email', 'password'); 678
677 if (Auth::attempt($credentials)) { 679 if (!is_null($use->email_verified_at)){
678 680
679 if (!is_null($use->email_verified_at)){ 681 $user_data = User_Model::find($use->id);
680 682 $user_data->update([
681 $user_data = User_Model::find($use->id); 683 'password' => Hash::make($request->get('new_password')),
682 $user_data->update([ 684 'pubpassword' => base64_encode($request->get('new_password')),
683 'password' => Hash::make($request->get('new_password')), 685 ]);
684 'pubpassword' => base64_encode($request->get('new_password')), 686 return redirect()
685 ]); 687 ->route('employer.password_reset')
686 return redirect() 688 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
687 ->route('employer.password_reset') 689 }
688 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 690
689 } 691 return redirect()
690 692 ->route('employer.password_reset')
691 return redirect() 693 ->withError('Данная учетная запись не было верифицированна!');
692 ->route('employer.password_reset') 694 }
693 ->withError('Данная учетная запись не было верифицированна!'); 695 }
694 } 696
695 } 697 return redirect()
696 698 ->route('employer.password_reset')
697 return redirect() 699 ->withErrors('Не совпадение данных, обновите пароли!');
698 ->route('employer.password_reset') 700 }
699 ->withErrors('Не совпадение данных, обновите пароли!'); 701
700 } 702
701 703
702 704 // Форма Удаление пипла
703 705 public function delete_people() {
704 // Форма Удаление пипла 706 $login = Auth()->user()->email;
705 public function delete_people() { 707 return view('employers.delete_people', compact('login'));
706 $login = Auth()->user()->email; 708 }
707 return view('employers.delete_people', compact('login')); 709
708 } 710 // Удаление аккаунта
709 711 public function action_delete_user(Request $request) {
710 // Удаление аккаунта 712 $Answer = $request->all();
711 public function action_delete_user(Request $request) { 713 $user_id = Auth()->user()->id;
712 $Answer = $request->all(); 714 $request->validate([
713 $user_id = Auth()->user()->id; 715 'password' => 'required|string',
714 $request->validate([ 716 ]);
715 'password' => 'required|string', 717
716 ]); 718 $credentials = $request->only('email', 'password');
717 719 if (Auth::attempt($credentials)) {
718 $credentials = $request->only('email', 'password'); 720 Auth::logout();
719 if (Auth::attempt($credentials)) { 721 $it = User_Model::find($user_id);
720 Auth::logout(); 722 $it->delete();
721 $it = User_Model::find($user_id); 723 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
722 $it->delete(); 724 } else {
723 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 725 return redirect()->route('employer.delete_people')
724 } else { 726 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
725 return redirect()->route('employer.delete_people') 727 }
726 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 728 }
727 } 729
728 } 730 public function ajax_delete_user(Request $request) {
729 731 $Answer = $request->all();
730 public function ajax_delete_user(Request $request) { 732 $user_id = Auth()->user()->id;
731 $Answer = $request->all(); 733 $request->validate([
732 $user_id = Auth()->user()->id; 734 'password' => 'required|string',
733 $request->validate([ 735 ]);
734 'password' => 'required|string', 736 $credentials = $request->only('email', 'password');
735 ]); 737 if (Auth::attempt($credentials)) {
736 $credentials = $request->only('email', 'password'); 738
737 if (Auth::attempt($credentials)) { 739 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
738 740 'email' => $request->get('email'),
739 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 741 'password' => $request->get('password')));
740 'email' => $request->get('email'), 742 } else {
741 'password' => $request->get('password'))); 743 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
742 } else { 744 }
743 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 745 }
744 } 746
745 } 747 // FAQ - Вопросы/ответы для работодателей и соискателей
746 748 public function faq() {
747 // FAQ - Вопросы/ответы для работодателей и соискателей 749 return view('employers.faq');
748 public function faq() { 750 }
749 return view('employers.faq'); 751
750 } 752 // Рассылка сообщений
751 753 public function send_all_messages() {
752 // Рассылка сообщений 754 $id = Auth()->user()->id;
753 public function send_all_messages() { 755 $sending = Employer::query()->where('user_id', '=', "$id")->first();
754 $id = Auth()->user()->id; 756
755 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 757 if ($sending->sending_is)
756 758 return view('employers.send_all');
757 if ($sending->sending_is) 759 else
758 return view('employers.send_all'); 760 return view('employers.send_all_danger');
759 else 761 }
760 return view('employers.send_all_danger'); 762
761 } 763 // Отправка сообщений для информации
762 764 public function send_all_post(Request $request) {
763 // Отправка сообщений для информации 765 $data = $request->all();
764 public function send_all_post(Request $request) { 766
765 $data = $request->all(); 767 $emails = User_Model::query()->where('is_worker', '1')->get();
766 768
767 $emails = User_Model::query()->where('is_worker', '1')->get(); 769 foreach ($emails as $e) {
768 770 Mail::to($e->email)->send(new SendAllMessages($data));
769 foreach ($emails as $e) { 771 }
770 Mail::to($e->email)->send(new SendAllMessages($data)); 772
771 } 773 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
772 774 }
773 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 775
774 } 776 // База резюме
775 777 public function bd_tupe(Request $request) {
776 // База резюме 778 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
777 public function bd_tupe(Request $request) { 779
778 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 780 return view('employers.bd_tupe', compact('Resume'));
779 781 }
780 return view('employers.bd_tupe', compact('Resume')); 782
781 } 783 //////////////////////////////////////////////////////////////////
782 784 // Отправил сообщение
783 ////////////////////////////////////////////////////////////////// 785 //////////////////////////////////////////////////////////////////
784 // Отправил сообщение 786 public function new_message(Request $request) {
785 ////////////////////////////////////////////////////////////////// 787 $params = $request->all();
786 public function new_message(Request $request) { 788 $id = $params['_user_id'];
787 $params = $request->all(); 789 $message = new Message();
788 $id = $params['_user_id']; 790 $message->user_id = $params['_user_id'];
789 $message = new Message(); 791 $message->to_user_id = $params['_to_user_id'];
790 $message->user_id = $params['_user_id']; 792 $message->title = $params['title'];
791 $message->to_user_id = $params['_to_user_id']; 793 $message->text = $params['text'];
792 $message->title = $params['title']; 794 if ($request->has('_file')) {
793 $message->text = $params['text']; 795 $message->file = $request->file('_file')->store("worker/$id", 'public');
794 if ($request->has('_file')) { 796 }
795 $message->file = $request->file('_file')->store("worker/$id", 'public'); 797 $message->ad_employer_id = $params['_vacancy'];
796 } 798 $message->flag_new = 1;
797 $message->ad_employer_id = $params['_vacancy']; 799 $id_message = $message->save();
798 $message->flag_new = 1; 800
799 $id_message = $message->save(); 801 //$data['message_id'] = $id_message;
800 802 //$data['ad_employer_id'] = $params['_vacancy'];
801 //$data['message_id'] = $id_message; 803 //$data['job_title_id'] = 0;
802 //$data['ad_employer_id'] = $params['_vacancy']; 804
803 //$data['job_title_id'] = 0; 805 $data['flag'] = 1;
804 806 //$ad_responce = ad_response::create($data);
805 $data['flag'] = 1; 807 return redirect()->route('employer.messages', ['type_message' => 'output']);
806 //$ad_responce = ad_response::create($data); 808 }
807 return redirect()->route('employer.messages', ['type_message' => 'output']); 809
808 } 810 // Восстановление пароля
809 811 public function repair_password(Request $request) {
810 // Восстановление пароля 812 $params = $request->get('email');
811 public function repair_password(Request $request) { 813 }
812 $params = $request->get('email'); 814
813 } 815 // Избранные люди на корабль
814 816 public function selected_people(Request $request) {
815 // Избранные люди на корабль 817 $id = $request->get('id');
816 public function selected_people(Request $request) { 818 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
817 $id = $request->get('id'); 819 where('is_remove', '=', '0')->
818 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 820 where('is_bd', '=', '0')->
819 where('is_remove', '=', '0')-> 821 where('position_id', $id)->
820 where('is_bd', '=', '0')-> 822 get();
821 where('position_id', $id)-> 823 return view('favorite_people', compact('favorite_people'));
822 get(); 824 }
823 return view('favorite_people', compact('favorite_people')); 825 }
824 } 826
app/Http/Controllers/PagesController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Http\Requests\RequestSendAdmin; 5 use App\Http\Requests\RequestSendAdmin;
6 use App\Mail\MailAdminy; 6 use App\Mail\MailAdminy;
7 use App\Mail\MailRepair; 7 use App\Mail\MailRepair;
8 use App\Models\pages; 8 use App\Models\pages;
9 use Illuminate\Http\Request; 9 use Illuminate\Http\Request;
10 use Illuminate\Support\Facades\Mail; 10 use Illuminate\Support\Facades\Mail;
11 use Illuminate\Support\Facades\Redis; 11 use Illuminate\Support\Facades\Redis;
12 use PhpOffice\PhpSpreadsheet\Spreadsheet; 12 use PhpOffice\PhpSpreadsheet\Spreadsheet;
13 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 13 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
14 14
15 class PagesController extends Controller 15 class PagesController extends Controller
16 { 16 {
17 public function pages(pages $pages) { 17 public function pages(pages $pages) {
18 $page = pages::query()->where('slug', $pages->slug)->first(); 18 $page = pages::query()->where('slug', $pages->slug)->first();
19 $slug = $pages->slug;
19 $slug = $pages->slug; 20
20 21 return view('pages', compact('page', 'slug'));
21 return view('pages', compact('page', 'slug')); 22 }
22 } 23
23 24 public function form_feedback(RequestSendAdmin $request){
24 public function form_feedback(RequestSendAdmin $request){ 25 $all = $request->all();
25 $all = $request->all(); 26
26 27 Mail::to(env('EMAIL_ADMIN'))->send(new MailAdminy($all));
27 Mail::to(env('EMAIL_ADMIN'))->send(new MailAdminy($all)); 28
28 29 return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано');
29 return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); 30 }
30 } 31
31 32 public function redis() {
32 public function redis() { 33 $redis = Redis::connection();
33 $redis = Redis::connection(); 34 $redis->set('User:CompanyName', 'РЕКАМОРЕ');
34 $redis->set('User:CompanyName', 'РЕКАМОРЕ'); 35 $id = 1;
35 $id = 1; 36 //dd(Redis::get('MyVar'));
36 //dd(Redis::get('MyVar')); 37 $redis->command('rpush', array("Сообщение1"));
37 $redis->command('rpush', array("Сообщение1")); 38 $redis->command('rpush', array("Сообщение2"));
38 $redis->command('rpush', array("Сообщение2")); 39 $values = $redis->command('lrange', array("mylist", 0, 1));
39 $values = $redis->command('lrange', array("mylist", 0, 1)); 40 dd($values);
40 dd($values); 41
41 42 }
42 } 43
43 44 public function excel() {
44 public function excel() { 45 $spreadsheet = new Spreadsheet();
45 $spreadsheet = new Spreadsheet(); 46 $activeWorksheet = $spreadsheet->getActiveSheet();
46 $activeWorksheet = $spreadsheet->getActiveSheet(); 47 $activeWorksheet->setCellValue('A1', 'Hello World !');
47 $activeWorksheet->setCellValue('A1', 'Hello World !'); 48
48 49 $writer = new Xlsx($spreadsheet);
49 $writer = new Xlsx($spreadsheet); 50 $writer->save('hello_world.xlsx');
50 $writer->save('hello_world.xlsx'); 51 }
51 } 52
52 53 public function private_policy() {
53 public function private_policy() { 54 return view('private_policy');
54 return view('private_policy'); 55 }
55 } 56
56 57 public function terms_of_use() {
57 public function terms_of_use() { 58 return view('terms_of_use');
58 return view('terms_of_use'); 59 }
59 } 60 }
60 } 61
app/Http/Controllers/WorkerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Http\Requests\DocumentsRequest; 6 use App\Http\Requests\DocumentsRequest;
7 use App\Http\Requests\PrevCompanyRequest; 7 use App\Http\Requests\PrevCompanyRequest;
8 use App\Http\Requests\SertificationRequest; 8 use App\Http\Requests\SertificationRequest;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\ad_response; 10 use App\Models\ad_response;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Dop_info; 12 use App\Models\Dop_info;
13 use App\Models\Employer; 13 use App\Models\Employer;
14 use App\Models\infobloks; 14 use App\Models\infobloks;
15 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
17 use App\Models\Like_worker; 17 use App\Models\Like_worker;
18 use App\Models\Message; 18 use App\Models\Message;
19 use App\Models\place_works; 19 use App\Models\place_works;
20 use App\Models\PrevCompany; 20 use App\Models\PrevCompany;
21 use App\Models\reclame; 21 use App\Models\reclame;
22 use App\Models\ResponseWork; 22 use App\Models\ResponseWork;
23 use App\Models\sertification; 23 use App\Models\sertification;
24 use App\Models\Static_worker; 24 use App\Models\Static_worker;
25 use App\Models\Title_worker; 25 use App\Models\Title_worker;
26 use App\Models\User; 26 use App\Models\User;
27 use App\Models\User as User_Model; 27 use App\Models\User as User_Model;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Barryvdh\DomPDF\Facade\Pdf; 29 use Barryvdh\DomPDF\Facade\Pdf;
30 use Carbon\Carbon; 30 use Carbon\Carbon;
31 use Illuminate\Auth\Events\Registered; 31 use Illuminate\Auth\Events\Registered;
32 use Illuminate\Database\Eloquent\Builder; 32 use Illuminate\Database\Eloquent\Builder;
33 use Illuminate\Database\Eloquent\Model; 33 use Illuminate\Database\Eloquent\Model;
34 use Illuminate\Http\JsonResponse; 34 use Illuminate\Http\JsonResponse;
35 use Illuminate\Http\Request; 35 use Illuminate\Http\Request;
36 use Illuminate\Support\Facades\Auth; 36 use Illuminate\Support\Facades\Auth;
37 use Illuminate\Support\Facades\Hash; 37 use Illuminate\Support\Facades\Hash;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use Illuminate\Support\Facades\Validator; 39 use Illuminate\Support\Facades\Validator;
40 40
41 class WorkerController extends Controller 41 class WorkerController extends Controller
42 { 42 {
43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
44 44
45 //профиль 45 //профиль
46 public function profile(Worker $worker) 46 public function profile(Worker $worker)
47 { 47 {
48 $get_date = date('Y.m'); 48 $get_date = date('Y.m');
49 49
50 $c = Static_worker::query()->where('year_month', '=', $get_date) 50 $c = Static_worker::query()->where('year_month', '=', $get_date)
51 ->where('user_id', '=', $worker->users->id) 51 ->where('user_id', '=', $worker->users->id)
52 ->get(); 52 ->get();
53 53
54 if ($c->count() > 0) { 54 if ($c->count() > 0) {
55 $upd = Static_worker::find($c[0]->id); 55 $upd = Static_worker::find($c[0]->id);
56 $upd->lookin = $upd->lookin + 1; 56 $upd->lookin = $upd->lookin + 1;
57 $upd->save(); 57 $upd->save();
58 } else { 58 } else {
59 $crt = new Static_worker(); 59 $crt = new Static_worker();
60 $crt->lookin = 1; 60 $crt->lookin = 1;
61 $crt->year_month = $get_date; 61 $crt->year_month = $get_date;
62 $crt->user_id = $worker->user_id; 62 $crt->user_id = $worker->user_id;
63 $crt->save(); 63 $crt->save();
64 } 64 }
65 65
66 $stat = Static_worker::query()->where('year_month', '=', $get_date) 66 $stat = Static_worker::query()->where('year_month', '=', $get_date)
67 ->where('user_id', '=', $worker->users->id) 67 ->where('user_id', '=', $worker->users->id)
68 ->get(); 68 ->get();
69 69
70 return view('public.workers.profile', compact('worker', 'stat')); 70 return view('public.workers.profile', compact('worker', 'stat'));
71 } 71 }
72 72
73 // лист база резюме 73 // лист база резюме
74 public function bd_resume(Request $request) 74 public function bd_resume(Request $request)
75 { 75 {
76 $look = false; 76 $look = false;
77 $idiot = 0; 77 $idiot = 0;
78 if (isset(Auth()->user()->id)) { 78 if (isset(Auth()->user()->id)) {
79 $idiot = Auth()->user()->id; 79 $idiot = Auth()->user()->id;
80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) 80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin))
81 $look = true; 81 $look = true;
82 } 82 }
83 83
84 if ($look) { 84 if ($look) {
85 $status_work = $this->status_work; 85 $status_work = $this->status_work;
86 $resumes = Worker::query()->with('users')->with('job_titles'); 86 $resumes = Worker::query()->with('users')->with('job_titles');
87 $resumes = $resumes->whereHas('users', function (Builder $query) { 87 $resumes = $resumes->whereHas('users', function (Builder $query) {
88 $query->Where('is_worker', '=', '1') 88 $query->Where('is_worker', '=', '1')
89 ->Where('is_bd', '=', '0'); 89 ->Where('is_bd', '=', '0');
90 }); 90 });
91 91
92 //dd($request->get('job')); 92 //dd($request->get('job'));
93 if (($request->has('job')) && ($request->get('job') > 0)) { 93 if (($request->has('job')) && ($request->get('job') > 0)) {
94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { 94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) {
95 $query->Where('job_titles.id', $request->get('job')); 95 $query->Where('job_titles.id', $request->get('job'));
96 }); 96 });
97 } 97 }
98 98
99 $Job_title = Job_title::query()-> 99 $Job_title = Job_title::query()->
100 where('is_remove', '=', '0')-> 100 where('is_remove', '=', '0')->
101 where('is_bd', '=' , '1')-> 101 where('is_bd', '=' , '1')->
102 get(); 102 get();
103 103
104 if ($request->get('sort')) { 104 if ($request->get('sort')) {
105 $sort = $request->get('sort'); 105 $sort = $request->get('sort');
106 switch ($sort) { 106 switch ($sort) {
107 case 'name_up': 107 case 'name_up':
108 $resumes = $resumes->orderBy(User::select('surname') 108 $resumes = $resumes->orderBy(User::select('surname')
109 ->whereColumn('Workers.user_id', 'users.id') 109 ->whereColumn('Workers.user_id', 'users.id')
110 ); 110 );
111 break; 111 break;
112 case 'name_down': 112 case 'name_down':
113 $resumes = $resumes->orderByDesc(User::select('surname') 113 $resumes = $resumes->orderByDesc(User::select('surname')
114 ->whereColumn('Workers.user_id', 'users.id') 114 ->whereColumn('Workers.user_id', 'users.id')
115 ); 115 );
116 break; 116 break;
117 case 'created_at_up': 117 case 'created_at_up':
118 $resumes = $resumes->OrderBy('created_at')->orderBy('id'); 118 $resumes = $resumes->OrderBy('created_at')->orderBy('id');
119 break; 119 break;
120 case 'created_at_down': 120 case 'created_at_down':
121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); 121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id');
122 break; 122 break;
123 case 'default': 123 case 'default':
124 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 124 $resumes = $resumes->orderBy('id')->orderby('updated_at');
125 break; 125 break;
126 default: 126 default:
127 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 127 $resumes = $resumes->orderBy('id')->orderby('updated_at');
128 break; 128 break;
129 } 129 }
130 } 130 }
131 131
132 $res_count = $resumes->count(); 132 $res_count = $resumes->count();
133 //$resumes = $resumes->get(); 133 //$resumes = $resumes->get();
134 $resumes = $resumes->paginate(4); 134 $resumes = $resumes->paginate(4);
135 if ($request->ajax()) { 135 if ($request->ajax()) {
136 // Условия обставлены 136 // Условия обставлены
137 if ($request->has('block') && ($request->get('block') == 1)) { 137 if ($request->has('block') && ($request->get('block') == 1)) {
138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
139 } 139 }
140 140
141 if ($request->has('block') && ($request->get('block') == 2)) { 141 if ($request->has('block') && ($request->get('block') == 2)) {
142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
143 } 143 }
144 } else { 144 } else {
145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); 145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title'));
146 } 146 }
147 } else { 147 } else {
148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); 148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]);
149 } 149 }
150 } 150 }
151 151
152 //Лайк резюме 152 //Лайк резюме
153 public function like_controller() { 153 public function like_controller() {
154 154
155 } 155 }
156 156
157 // анкета соискателя 157 // анкета соискателя
158 public function resume_profile(Worker $worker) 158 public function resume_profile(Worker $worker)
159 { 159 {
160 if (isset(Auth()->user()->id)) { 160 if (isset(Auth()->user()->id)) {
161 $idiot = Auth()->user()->id; 161 $idiot = Auth()->user()->id;
162 } else { 162 } else {
163 $idiot = 0; 163 $idiot = 0;
164 } 164 }
165 165
166 $status_work = $this->status_work; 166 $status_work = $this->status_work;
167 $Query = Worker::query()->with('users')->with('job_titles') 167 $Query = Worker::query()->with('users')->with('job_titles')
168 ->with('place_worker')->with('sertificate')->with('prev_company') 168 ->with('place_worker')->with('sertificate')->with('prev_company')
169 ->with('infobloks')->with('response'); 169 ->with('infobloks')->with('response');
170 $Query = $Query->where('id', '=', $worker->id); 170 $Query = $Query->where('id', '=', $worker->id);
171 $Query = $Query->get(); 171 $Query = $Query->get();
172 172
173 $get_date = date('Y.m'); 173 $get_date = date('Y.m');
174 174
175 $infoblocks = infobloks::query()->get(); 175 $infoblocks = infobloks::query()->get();
176 176
177 $c = Static_worker::query()->where('year_month', '=', $get_date) 177 $c = Static_worker::query()->where('year_month', '=', $get_date)
178 ->where('user_id', '=', $worker->user_id) 178 ->where('user_id', '=', $worker->user_id)
179 ->get(); 179 ->get();
180 180
181 if ($c->count() > 0) { 181 if ($c->count() > 0) {
182 $upd = Static_worker::find($c[0]->id); 182 $upd = Static_worker::find($c[0]->id);
183 $upd->lookin = $upd->lookin + 1; 183 $upd->lookin = $upd->lookin + 1;
184 $upd->save(); 184 $upd->save();
185 } else { 185 } else {
186 $crt = new Static_worker(); 186 $crt = new Static_worker();
187 $crt->lookin = 1; 187 $crt->lookin = 1;
188 $crt->year_month = $get_date; 188 $crt->year_month = $get_date;
189 $crt->user_id = $worker->user_id; 189 $crt->user_id = $worker->user_id;
190 $status = $crt->save(); 190 $status = $crt->save();
191 } 191 }
192 192
193 $stat = Static_worker::query()->where('year_month', '=', $get_date) 193 $stat = Static_worker::query()->where('year_month', '=', $get_date)
194 ->where('user_id', '=', $worker->user_id) 194 ->where('user_id', '=', $worker->user_id)
195 ->get(); 195 ->get();
196 196
197 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); 197 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat'));
198 } 198 }
199 199
200 // скачать анкету соискателя 200 // скачать анкету соискателя
201 public function resume_download(Worker $worker) 201 public function resume_download(Worker $worker)
202 { 202 {
203 $status_work = $this->status_work; 203 $status_work = $this->status_work;
204 $Query = Worker::query()->with('users')->with('job_titles') 204 $Query = Worker::query()->with('users')->with('job_titles')
205 ->with('place_worker')->with('sertificate')->with('prev_company') 205 ->with('place_worker')->with('sertificate')->with('prev_company')
206 ->with('infobloks'); 206 ->with('infobloks');
207 $Query = $Query->where('id', '=', $worker->id); 207 $Query = $Query->where('id', '=', $worker->id);
208 $Query = $Query->get()->toArray(); 208 $Query = $Query->get()->toArray();
209 209
210 view()->share('Query',$Query); 210 view()->share('Query',$Query);
211 211
212 212
213 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 213 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
214 214
215 return $pdf->stream(); 215 return $pdf->stream();
216 } 216 }
217 217
218 public function resume_download_all() { 218 public function resume_download_all() {
219 $status_work = $this->status_work; 219 $status_work = $this->status_work;
220 $Query = Worker::query()->with('users')->with('job_titles') 220 $Query = Worker::query()->with('users')->with('job_titles')
221 ->with('place_worker')->with('sertificate')->with('prev_company') 221 ->with('place_worker')->with('sertificate')->with('prev_company')
222 ->with('infobloks')-> 222 ->with('infobloks')->
223 whereHas('users', function (Builder $query) { 223 whereHas('users', function (Builder $query) {
224 $query->Where('is_worker', '=', '1') 224 $query->Where('is_worker', '=', '1')
225 ->Where('is_bd', '=', '1'); 225 ->Where('is_bd', '=', '1');
226 }); 226 });
227 //$Query = $Query->where('id', '=', $worker->id); 227 //$Query = $Query->where('id', '=', $worker->id);
228 $Query = $Query->get()->toArray(); 228 $Query = $Query->get()->toArray();
229 229
230 view()->share('Query',$Query); 230 view()->share('Query',$Query);
231 231
232 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); 232 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape');
233 233
234 return $pdf->stream(); 234 return $pdf->stream();
235 } 235 }
236 236
237 // Кабинет работника 237 // Кабинет работника
238 public function cabinet(Request $request) 238 public function cabinet(Request $request)
239 { 239 {
240 // дата год и месяц 240 // дата год и месяц
241 $get_date = date('Y.m'); 241 $get_date = date('Y.m');
242 242
243 $id = Auth()->user()->id; 243 $id = Auth()->user()->id;
244 244
245 $Infobloks = infobloks::query()->get(); 245 $Infobloks = infobloks::query()->get();
246 246
247 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 247 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
248 with('infobloks')->with('place_worker')-> 248 with('infobloks')->with('place_worker')->
249 WhereHas('users', 249 WhereHas('users',
250 function (Builder $query) use ($id) {$query->Where('id', $id); 250 function (Builder $query) use ($id) {$query->Where('id', $id);
251 })->get(); 251 })->get();
252 252
253 $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> 253 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->
254 where('is_bd', '=' , '1')-> 254 where('is_bd', '=' , '1')->
255 OrderByDesc('sort')->OrderBy('name')->get(); 255 OrderByDesc('sort')->OrderBy('name')->get();
256 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 256 $Infoblocks = infobloks::query()->OrderBy('name')->get();
257 257
258 $stat = Static_worker::query()->where('year_month', '=', $get_date) 258 $stat = Static_worker::query()->where('year_month', '=', $get_date)
259 ->where('user_id', '=', $id) 259 ->where('user_id', '=', $id)
260 ->get(); 260 ->get();
261 261
262 262
263 // 10% 263 // 10%
264 264
265 $persent = 10; 265 $persent = 10;
266 $persent1 = 0; 266 $persent1 = 0;
267 $persent2 = 0; 267 $persent2 = 0;
268 $persent3 = 0; 268 $persent3 = 0;
269 $persent4 = 0; 269 $persent4 = 0;
270 $persent5 = 0; 270 $persent5 = 0;
271 271
272 if ((!empty($Worker[0]->telephone)) && 272 if ((!empty($Worker[0]->telephone)) &&
273 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 273 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
274 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 274 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
275 // 40% 275 // 40%
276 $persent = $persent + 40; 276 $persent = $persent + 40;
277 $persent1 = 40; 277 $persent1 = 40;
278 } 278 }
279 279
280 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); 280 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year);
281 281
282 if ($Worker[0]->sertificate->count() > 0) { 282 if ($Worker[0]->sertificate->count() > 0) {
283 // 15% 283 // 15%
284 $persent = $persent + 15; 284 $persent = $persent + 15;
285 $persent2 = 15; 285 $persent2 = 15;
286 } 286 }
287 287
288 if ($Worker[0]->infobloks->count() > 0) { 288 if ($Worker[0]->infobloks->count() > 0) {
289 // 20% 289 // 20%
290 $persent = $persent + 20; 290 $persent = $persent + 20;
291 $persent3 = 20; 291 $persent3 = 20;
292 } 292 }
293 293
294 if ($Worker[0]->prev_company->count() > 0) { 294 if ($Worker[0]->prev_company->count() > 0) {
295 // 10% 295 // 10%
296 $persent = $persent + 10; 296 $persent = $persent + 10;
297 $persent4 = 10; 297 $persent4 = 10;
298 } 298 }
299 299
300 if (!empty($Worker[0]->photo)) { 300 if (!empty($Worker[0]->photo)) {
301 // 5% 301 // 5%
302 $persent = $persent + 5; 302 $persent = $persent + 5;
303 $persent5 = 5; 303 $persent5 = 5;
304 } 304 }
305 if ($request->has('print')) { 305 if ($request->has('print')) {
306 dd($Worker); 306 dd($Worker);
307 } else { 307 } else {
308 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 308 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
309 } 309 }
310 } 310 }
311 311
312 // Сохранение данных 312 // Сохранение данных
313 public function cabinet_save(Worker $worker, Request $request) 313 public function cabinet_save(Worker $worker, Request $request)
314 { 314 {
315 $id = $worker->id; 315 $id = $worker->id;
316 $params = $request->all(); 316 $params = $request->all();
317 317
318 $job_title_id = $request->get('job_title_id'); 318 $job_title_id = $request->get('job_title_id');
319 319
320 unset($params['new_diplom']); 320 unset($params['new_diplom']);
321 unset($params['new_data_begin']); 321 unset($params['new_data_begin']);
322 unset($params['new_data_end']); 322 unset($params['new_data_end']);
323 unset($params['new_job_title']); 323 unset($params['new_job_title']);
324 unset($params['new_teplohod']); 324 unset($params['new_teplohod']);
325 unset($params['new_GWT']); 325 unset($params['new_GWT']);
326 unset($params['new_KBT']); 326 unset($params['new_KBT']);
327 unset($params['new_Begin_work']); 327 unset($params['new_Begin_work']);
328 unset($params['new_End_work']); 328 unset($params['new_End_work']);
329 unset($params['new_name_company']); 329 unset($params['new_name_company']);
330 330
331 $rules = [ 331 $rules = [
332 'surname' => ['required', 'string', 'max:255'], 332 'surname' => ['required', 'string', 'max:255'],
333 'name_man' => ['required', 'string', 'max:255'], 333 'name_man' => ['required', 'string', 'max:255'],
334 'email' => ['required', 'string', 'email', 'max:255'], 334 'email' => ['required', 'string', 'email', 'max:255'],
335 335
336 ]; 336 ];
337 337
338 $messages = [ 338 $messages = [
339 'required' => 'Укажите обязательное поле', 339 'required' => 'Укажите обязательное поле',
340 'min' => [ 340 'min' => [
341 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 341 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
342 'integer' => 'Поле «:attribute» должно быть :min или больше', 342 'integer' => 'Поле «:attribute» должно быть :min или больше',
343 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 343 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
344 ], 344 ],
345 'max' => [ 345 'max' => [
346 'string' => 'Поле «:attribute» должно быть не больше :max символов', 346 'string' => 'Поле «:attribute» должно быть не больше :max символов',
347 'integer' => 'Поле «:attribute» должно быть :max или меньше', 347 'integer' => 'Поле «:attribute» должно быть :max или меньше',
348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
349 ] 349 ]
350 ]; 350 ];
351 351
352 $validator = Validator::make($params, $rules, $messages); 352 $validator = Validator::make($params, $rules, $messages);
353 353
354 if ($validator->fails()) { 354 if ($validator->fails()) {
355 return redirect()->route('worker.cabinet')->withErrors($validator); 355 return redirect()->route('worker.cabinet')->withErrors($validator);
356 } else { 356 } else {
357 357
358 if ($request->has('photo')) { 358 if ($request->has('photo')) {
359 if (!empty($Worker->photo)) { 359 if (!empty($Worker->photo)) {
360 Storage::delete($Worker->photo); 360 Storage::delete($Worker->photo);
361 } 361 }
362 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 362 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
363 } 363 }
364 364
365 if ($request->has('file')) { 365 if ($request->has('file')) {
366 if (!empty($Worker->file)) { 366 if (!empty($Worker->file)) {
367 Storage::delete($Worker->file); 367 Storage::delete($Worker->file);
368 } 368 }
369 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 369 $params['file'] = $request->file('file')->store("worker/$id", 'public');
370 } 370 }
371 371
372 $id_wor = $worker->update($params); 372 $id_wor = $worker->update($params);
373 $use = User::find($worker->user_id); 373 $use = User::find($worker->user_id);
374 $use->surname = $request->get('surname'); 374 $use->surname = $request->get('surname');
375 $use->name_man = $request->get('name_man'); 375 $use->name_man = $request->get('name_man');
376 $use->surname2 = $request->get('surname2'); 376 $use->surname2 = $request->get('surname2');
377 377
378 $use->save(); 378 $use->save();
379 $worker->job_titles()->sync($job_title_id); 379 $worker->job_titles()->sync($job_title_id);
380 380
381 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 381 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
382 } 382 }
383 } 383 }
384 384
385 // Сообщения данные 385 // Сообщения данные
386 public function messages($type_message) 386 public function messages($type_message)
387 { 387 {
388 $user_id = Auth()->user()->id; 388 $user_id = Auth()->user()->id;
389 389
390 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 390 $messages_input = Message::query()->with('vacancies')->with('user_from')->
391 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 391 Where('to_user_id', $user_id)->OrderByDesc('created_at');
392 392
393 $messages_output = Message::query()->with('vacancies')-> 393 $messages_output = Message::query()->with('vacancies')->
394 with('user_to')->where('user_id', $user_id)-> 394 with('user_to')->where('user_id', $user_id)->
395 OrderByDesc('created_at'); 395 OrderByDesc('created_at');
396 396
397 $count_input = $messages_input->count(); 397 $count_input = $messages_input->count();
398 $count_output = $messages_output->count(); 398 $count_output = $messages_output->count();
399 399
400 if ($type_message == 'input') { 400 if ($type_message == 'input') {
401 $messages = $messages_input->paginate(5); 401 $messages = $messages_input->paginate(5);
402 } 402 }
403 403
404 if ($type_message == 'output') { 404 if ($type_message == 'output') {
405 $messages = $messages_output->paginate(5); 405 $messages = $messages_output->paginate(5);
406 } 406 }
407 407
408 //dd($messages); 408 //dd($messages);
409 // Вернуть все 100% 409 // Вернуть все 100%
410 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 410 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
411 } 411 }
412 412
413 // Избранный 413 // Избранный
414 public function favorite() 414 public function favorite()
415 { 415 {
416 return view('workers.favorite'); 416 return view('workers.favorite');
417 } 417 }
418 418
419 // Сменить пароль 419 // Сменить пароль
420 public function new_password() 420 public function new_password()
421 { 421 {
422 $email = Auth()->user()->email; 422 $email = Auth()->user()->email;
423 return view('workers.new_password', compact('email')); 423 return view('workers.new_password', compact('email'));
424 } 424 }
425 425
426 // Обновление пароля 426 // Обновление пароля
427 public function save_new_password(Request $request) { 427 public function save_new_password(Request $request) {
428 $use = Auth()->user(); 428 $use = Auth()->user();
429 $request->validate([ 429 $request->validate([
430 'password' => 'required|string', 430 'password' => 'required|string',
431 'new_password' => 'required|string', 431 'new_password' => 'required|string',
432 'new_password2' => 'required|string' 432 'new_password2' => 'required|string'
433 ]); 433 ]);
434 434
435 if ($request->get('new_password') == $request->get('new_password2')) 435 if ($request->get('new_password') == $request->get('new_password2'))
436 if ($request->get('password') !== $request->get('new_password')) { 436 if ($request->get('password') !== $request->get('new_password')) {
437 $credentials = $request->only('email', 'password'); 437 $credentials = $request->only('email', 'password');
438 if (Auth::attempt($credentials, $request->has('save_me'))) { 438 if (Auth::attempt($credentials, $request->has('save_me'))) {
439 439
440 if (!is_null($use->email_verified_at)){ 440 if (!is_null($use->email_verified_at)){
441 441
442 $user_data = User_Model::find($use->id); 442 $user_data = User_Model::find($use->id);
443 $user_data->update([ 443 $user_data->update([
444 'password' => Hash::make($request->get('new_password')), 444 'password' => Hash::make($request->get('new_password')),
445 'pubpassword' => base64_encode($request->get('new_password')), 445 'pubpassword' => base64_encode($request->get('new_password')),
446 ]); 446 ]);
447 return redirect() 447 return redirect()
448 ->route('worker.new_password') 448 ->route('worker.new_password')
449 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 449 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
450 } 450 }
451 451
452 return redirect() 452 return redirect()
453 ->route('worker.new_password') 453 ->route('worker.new_password')
454 ->withError('Данная учетная запись не было верифицированна!'); 454 ->withError('Данная учетная запись не было верифицированна!');
455 } 455 }
456 } 456 }
457 457
458 return redirect() 458 return redirect()
459 ->route('worker.new_password') 459 ->route('worker.new_password')
460 ->withErrors('Не совпадение данных, обновите пароли!'); 460 ->withErrors('Не совпадение данных, обновите пароли!');
461 } 461 }
462 462
463 // Удаление профиля форма 463 // Удаление профиля форма
464 public function delete_profile() 464 public function delete_profile()
465 { 465 {
466 $login = Auth()->user()->email; 466 $login = Auth()->user()->email;
467 return view('workers.delete_profile', compact('login')); 467 return view('workers.delete_profile', compact('login'));
468 } 468 }
469 469
470 // Удаление профиля код 470 // Удаление профиля код
471 public function delete_profile_result(Request $request) { 471 public function delete_profile_result(Request $request) {
472 $Answer = $request->all(); 472 $Answer = $request->all();
473 $user_id = Auth()->user()->id; 473 $user_id = Auth()->user()->id;
474 $request->validate([ 474 $request->validate([
475 'password' => 'required|string', 475 'password' => 'required|string',
476 ]); 476 ]);
477 477
478 $credentials = $request->only('email', 'password'); 478 $credentials = $request->only('email', 'password');
479 if (Auth::attempt($credentials)) { 479 if (Auth::attempt($credentials)) {
480 Auth::logout(); 480 Auth::logout();
481 $it = User_Model::find($user_id); 481 $it = User_Model::find($user_id);
482 $it->delete(); 482 $it->delete();
483 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 483 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
484 } else { 484 } else {
485 return redirect()->route('worker.delete_profile') 485 return redirect()->route('worker.delete_profile')
486 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 486 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
487 } 487 }
488 } 488 }
489 489
490 // Регистрация соискателя 490 // Регистрация соискателя
491 public function register_worker(Request $request) 491 public function register_worker(Request $request)
492 { 492 {
493 $params = $request->all(); 493 $params = $request->all();
494 $params['is_worker'] = 1; 494 $params['is_worker'] = 1;
495 495
496 $rules = [ 496 $rules = [
497 'surname' => ['required', 'string', 'max:255'], 497 'surname' => ['required', 'string', 'max:255'],
498 'name_man' => ['required', 'string', 'max:255'], 498 'name_man' => ['required', 'string', 'max:255'],
499 'email' => ['required', 'email', 'max:255', 'unique:users'], 499 'email' => ['required', 'email', 'max:255', 'unique:users'],
500 'password' => ['required', 'string', 'min:6'] 500 'password' => ['required', 'string', 'min:6']
501 ]; 501 ];
502 502
503 $messages = [ 503 $messages = [
504 'required' => 'Укажите обязательное поле', 504 'required' => 'Укажите обязательное поле',
505 'min' => [ 505 'min' => [
506 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 506 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
507 'integer' => 'Поле «:attribute» должно быть :min или больше', 507 'integer' => 'Поле «:attribute» должно быть :min или больше',
508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
509 ], 509 ],
510 'max' => [ 510 'max' => [
511 'string' => 'Поле «:attribute» должно быть не больше :max символов', 511 'string' => 'Поле «:attribute» должно быть не больше :max символов',
512 'integer' => 'Поле «:attribute» должно быть :max или меньше', 512 'integer' => 'Поле «:attribute» должно быть :max или меньше',
513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
514 ] 514 ]
515 ]; 515 ];
516 516
517 $email = $request->get('email'); 517 $email = $request->get('email');
518 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 518 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
519 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 519 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
520 } 520 }
521 521
522 if ($request->get('password') !== $request->get('confirmed')){ 522 if ($request->get('password') !== $request->get('confirmed')){
523 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 523 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
524 } 524 }
525 525
526 if (strlen($request->get('password')) < 6) { 526 if (strlen($request->get('password')) < 6) {
527 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 527 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
528 } 528 }
529 529
530 /*$haystack = $request->get('password'); 530 /*$haystack = $request->get('password');
531 531
532 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 532 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
533 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 533 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
534 'X', 'C', 'V', 'B', 'N', 'M'); 534 'X', 'C', 'V', 'B', 'N', 'M');
535 $lenpwd_bool = true; 535 $lenpwd_bool = true;
536 $spec_bool = false; 536 $spec_bool = false;
537 $alpha_bool = false; 537 $alpha_bool = false;
538 538
539 if (strlen($haystack) < 8) $lenpwd_bool = false; 539 if (strlen($haystack) < 8) $lenpwd_bool = false;
540 540
541 foreach ($specsumbol as $it) { 541 foreach ($specsumbol as $it) {
542 if (strpos($haystack, $it) !== false) { 542 if (strpos($haystack, $it) !== false) {
543 $spec_bool = true; 543 $spec_bool = true;
544 } 544 }
545 } 545 }
546 546
547 foreach ($alpha as $it) { 547 foreach ($alpha as $it) {
548 if (strpos($haystack, $it) !== false) { 548 if (strpos($haystack, $it) !== false) {
549 $alpha_bool = true; 549 $alpha_bool = true;
550 } 550 }
551 } 551 }
552 552
553 if ((!$spec_bool) || (!$alpha_bool)) { 553 if ((!$spec_bool) || (!$alpha_bool)) {
554 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 554 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
555 }*/ 555 }*/
556 556
557 if (($request->has('politik')) && ($request->get('politik') == 1)) { 557 if (($request->has('politik')) && ($request->get('politik') == 1)) {
558 $validator = Validator::make($params, $rules, $messages); 558 $validator = Validator::make($params, $rules, $messages);
559 559
560 if ($validator->fails()) { 560 if ($validator->fails()) {
561 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 561 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
562 } else { 562 } else {
563 //dd($params); 563 //dd($params);
564 $user = $this->create($params); 564 $user = $this->create($params);
565 event(new Registered($user)); 565 event(new Registered($user));
566 Auth::guard()->login($user); 566 Auth::guard()->login($user);
567 } 567 }
568 if ($user) { 568 if ($user) {
569 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 569 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
570 } else { 570 } else {
571 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 571 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
572 } 572 }
573 573
574 } else { 574 } else {
575 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 575 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
576 } 576 }
577 } 577 }
578 578
579 // Звездная оценка и ответ 579 // Звездная оценка и ответ
580 public function stars_answer(Request $request) { 580 public function stars_answer(Request $request) {
581 $params = $request->all(); 581 $params = $request->all();
582 $rules = [ 582 $rules = [
583 'message' => ['required', 'string', 'max:255'], 583 'message' => ['required', 'string', 'max:255'],
584 ]; 584 ];
585 585
586 $messages = [ 586 $messages = [
587 'required' => 'Укажите обязательное поле', 587 'required' => 'Укажите обязательное поле',
588 'min' => [ 588 'min' => [
589 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 589 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
590 'integer' => 'Поле «:attribute» должно быть :min или больше', 590 'integer' => 'Поле «:attribute» должно быть :min или больше',
591 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 591 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
592 ], 592 ],
593 'max' => [ 593 'max' => [
594 'string' => 'Поле «:attribute» должно быть не больше :max символов', 594 'string' => 'Поле «:attribute» должно быть не больше :max символов',
595 'integer' => 'Поле «:attribute» должно быть :max или меньше', 595 'integer' => 'Поле «:attribute» должно быть :max или меньше',
596 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 596 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
597 ] 597 ]
598 ]; 598 ];
599 $response_worker = ResponseWork::create($params); 599 $response_worker = ResponseWork::create($params);
600 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 600 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
601 } 601 }
602 602
603 public function TestWorker() 603 public function TestWorker()
604 { 604 {
605 $Use = new User(); 605 $Use = new User();
606 606
607 $Code_user = $Use->create([ 607 $Code_user = $Use->create([
608 'name' => 'surname name_man', 608 'name' => 'surname name_man',
609 'name_man' => 'name_man', 609 'name_man' => 'name_man',
610 'surname' => 'surname', 610 'surname' => 'surname',
611 'surname2' => 'surname2', 611 'surname2' => 'surname2',
612 'subscribe_email' => '1', 612 'subscribe_email' => '1',
613 'email' => 'email@mail.com', 613 'email' => 'email@mail.com',
614 'telephone' => '1234567890', 614 'telephone' => '1234567890',
615 'password' => Hash::make('password'), 615 'password' => Hash::make('password'),
616 'pubpassword' => base64_encode('password'), 616 'pubpassword' => base64_encode('password'),
617 'email_verified_at' => Carbon::now(), 617 'email_verified_at' => Carbon::now(),
618 'is_worker' => 1, 618 'is_worker' => 1,
619 ]); 619 ]);
620 620
621 if ($Code_user->id > 0) { 621 if ($Code_user->id > 0) {
622 $Worker = new Worker(); 622 $Worker = new Worker();
623 $Worker->user_id = $Code_user->id; 623 $Worker->user_id = $Code_user->id;
624 $Worker->position_work = 1; //'job_titles'; 624 $Worker->position_work = 1; //'job_titles';
625 $Worker->email = 'email@email.com'; 625 $Worker->email = 'email@email.com';
626 $Worker->telephone = '1234567890'; 626 $Worker->telephone = '1234567890';
627 $status = $Worker->save(); 627 $status = $Worker->save();
628 628
629 $Title_Worker = new Title_worker(); 629 $Title_Worker = new Title_worker();
630 $Title_Worker->worker_id = $Worker->id; 630 $Title_Worker->worker_id = $Worker->id;
631 $Title_Worker->job_title_id = 1; 631 $Title_Worker->job_title_id = 1;
632 $Title_Worker->save(); 632 $Title_Worker->save();
633 } 633 }
634 } 634 }
635 635
636 // Создание пользователя 636 // Создание пользователя
637 protected function create(array $data) 637 protected function create(array $data)
638 { 638 {
639 $Use = new User(); 639 $Use = new User();
640 640
641 $Code_user = $Use->create([ 641 $Code_user = $Use->create([
642 'name' => $data['surname']." ".$data['name_man'], 642 'name' => $data['surname']." ".$data['name_man'],
643 'name_man' => $data['name_man'], 643 'name_man' => $data['name_man'],
644 'surname' => $data['surname'], 644 'surname' => $data['surname'],
645 'surname2' => $data['surname2'], 645 'surname2' => $data['surname2'],
646 'subscribe_email' => $data['email'], 646 'subscribe_email' => $data['email'],
647 'email' => $data['email'], 647 'email' => $data['email'],
648 'telephone' => $data['telephone'], 648 'telephone' => $data['telephone'],
649 'password' => Hash::make($data['password']), 649 'password' => Hash::make($data['password']),
650 'pubpassword' => base64_encode($data['password']), 650 'pubpassword' => base64_encode($data['password']),
651 'email_verified_at' => Carbon::now(), 651 'email_verified_at' => Carbon::now(),
652 'is_worker' => $data['is_worker'], 652 'is_worker' => $data['is_worker'],
653 ]); 653 ]);
654 654
655 if ($Code_user->id > 0) { 655 if ($Code_user->id > 0) {
656 $Worker = new Worker(); 656 $Worker = new Worker();
657 $Worker->user_id = $Code_user->id; 657 $Worker->user_id = $Code_user->id;
658 $Worker->position_work = $data['job_titles']; 658 $Worker->position_work = $data['job_titles'];
659 $Worker->email = $data['email']; 659 $Worker->email = $data['email'];
660 $Worker->telephone = $data['telephone']; 660 $Worker->telephone = $data['telephone'];
661 $Worker->save(); 661 $Worker->save();
662 662
663 if (isset($Worker->id)) { 663 if (isset($Worker->id)) {
664 $Title_Worker = new Title_worker(); 664 $Title_Worker = new Title_worker();
665 $Title_Worker->worker_id = $Worker->id; 665 $Title_Worker->worker_id = $Worker->id;
666 $Title_Worker->job_title_id = $data['job_titles']; 666 $Title_Worker->job_title_id = $data['job_titles'];
667 $Title_Worker->save(); 667 $Title_Worker->save();
668 } 668 }
669 669
670 return $Code_user; 670 return $Code_user;
671 } 671 }
672 } 672 }
673 673
674 // Вакансии избранные 674 // Вакансии избранные
675 public function colorado(Request $request) { 675 public function colorado(Request $request) {
676 $IP_address = RusDate::ip_addr_client(); 676 $IP_address = RusDate::ip_addr_client();
677 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 677 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
678 678
679 if ($Arr->count()) { 679 if ($Arr->count()) {
680 $A = Array(); 680 $A = Array();
681 foreach ($Arr as $it) { 681 foreach ($Arr as $it) {
682 $A[] = $it->code_record; 682 $A[] = $it->code_record;
683 } 683 }
684 684
685 $Query = Ad_employer::query()->whereIn('id', $A); 685 $Query = Ad_employer::query()->whereIn('id', $A);
686 } else { 686 } else {
687 $Query = Ad_employer::query()->where('id', '=', '0'); 687 $Query = Ad_employer::query()->where('id', '=', '0');
688 } 688 }
689 689
690 $Query = $Query->with('jobs')-> 690 $Query = $Query->with('jobs')->
691 with('cat')-> 691 with('cat')->
692 with('employer')-> 692 with('employer')->
693 whereHas('jobs_code', function ($query) use ($request) { 693 whereHas('jobs_code', function ($query) use ($request) {
694 if ($request->ajax()) { 694 if ($request->ajax()) {
695 if (null !== ($request->get('job'))) { 695 if (null !== ($request->get('job'))) {
696 $query->where('job_title_id', $request->get('job')); 696 $query->where('job_title_id', $request->get('job'));
697 } 697 }
698 } 698 }
699 })->select('ad_employers.*'); 699 })->select('ad_employers.*');
700 700
701 $Job_title = Job_title::query()->OrderBy('name')->get(); 701 $Job_title = Job_title::query()->OrderBy('name')->get();
702 702
703 $Query_count = $Query->count(); 703 $Query_count = $Query->count();
704 704
705 $Query = $Query->OrderBy('updated_at')->paginate(3); 705 $Query = $Query->OrderBy('updated_at')->paginate(3);
706 706
707 return view('workers.favorite', compact('Query',
707 708 'Query_count',
708 return view('workers.favorite', compact('Query', 709 'Job_title'));
709 'Query_count', 710
710 'Job_title')); 711 }
711 712
712 } 713 //Переписка
713 714 public function dialog(User_Model $user1, User_Model $user2, Request $request) {
714 //Переписка 715 // Получение параметров.
715 public function dialog(User_Model $user1, User_Model $user2, Request $request) { 716 if ($request->has('ad_employer')){
716 // Получение параметров. 717 $ad_employer = $request->get('ad_employer');
717 if ($request->has('ad_employer')){ 718 } else {
718 $ad_employer = $request->get('ad_employer'); 719 $ad_employer = 0;
719 } else { 720 }
720 $ad_employer = 0; 721
721 } 722 if (isset($user1->id)) {
722 723 $sender = User_Model::query()->with('workers')->
723 if (isset($user1->id)) { 724 with('employers')->
724 $sender = User_Model::query()->with('workers')-> 725 where('id', $user1->id)->first();
725 with('employers')-> 726 }
726 where('id', $user1->id)->first(); 727
727 } 728 if (isset($user2->id)) {
728 729 $companion = User_Model::query()->with('workers')->
729 if (isset($user2->id)) { 730 with('employers')->
730 $companion = User_Model::query()->with('workers')-> 731 where('id', $user2->id)->first();
731 with('employers')-> 732 }
732 where('id', $user2->id)->first(); 733
733 } 734 $Messages = Message::query()->
734 735 //with('response')->
735 $Messages = Message::query()-> 736 where(function($query) use ($user1, $user2) {
736 //with('response')-> 737 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
737 where(function($query) use ($user1, $user2) { 738 })->orWhere(function($query) use ($user1, $user2) {
738 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 739 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
739 })->orWhere(function($query) use ($user1, $user2) { 740 })->OrderBy('created_at')->get();
740 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 741
741 })->OrderBy('created_at')->get(); 742 $id_vac = null;
742 743 /*foreach ($Messages as $it) {
743 $id_vac = null; 744 if (isset($it->response)) {
744 /*foreach ($Messages as $it) { 745 foreach ($it->response as $r) {
745 if (isset($it->response)) { 746 if (isset($r->ad_employer_id)) {
746 foreach ($it->response as $r) { 747 $id_vac = $r->ad_employer_id;
747 if (isset($r->ad_employer_id)) { 748 break;
748 $id_vac = $r->ad_employer_id; 749 }
749 break; 750 }
750 } 751 }
751 } 752 if (!is_null($id_vac)) break;
752 } 753 }*/
753 if (!is_null($id_vac)) break; 754
754 }*/ 755 //$ad_employer = null;
755 756 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
756 //$ad_employer = null; 757
757 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 758 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
758 759 }
759 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 760
760 } 761 // Даунылоады
761 762 public function download(Worker $worker) {
762 // Даунылоады 763 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
763 public function download(Worker $worker) { 764 view()->share('house',$arr_house);
764 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 765 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
765 view()->share('house',$arr_house); 766 return $pdf->stream();
766 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 767 }
767 return $pdf->stream(); 768
768 } 769 // Поднятие анкеты
769 770 public function up(Worker $worker) {
770 // Поднятие анкеты 771 $worker->updated_at = Carbon::now();
771 public function up(Worker $worker) { 772 $worker->save();
772 $worker->updated_at = Carbon::now(); 773 // 0
773 $worker->save(); 774 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
774 // 0 775 }
775 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 776
776 } 777 // Форма сертификате
777 778 public function new_sertificate(Worker $worker) {
778 // Форма сертификате 779 return view('workers.sertificate_add', compact('worker'));
779 public function new_sertificate(Worker $worker) { 780 }
780 return view('workers.sertificate_add', compact('worker')); 781
781 } 782 // Добавление сертификата
782 783 public function add_serificate(SertificationRequest $request) {
783 // Добавление сертификата 784 $params = $request->all();
784 public function add_serificate(SertificationRequest $request) { 785
785 $params = $request->all(); 786 $Sertificate = new sertification();
786 787 $Sertificate->create($params);
787 $Sertificate = new sertification(); 788 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
788 $Sertificate->create($params); 789 return redirect()->route('worker.cabinet');
789 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 790 //return view('ajax.documents', compact('Docs'));
790 return redirect()->route('worker.cabinet'); 791 }
791 //return view('ajax.documents', compact('Docs')); 792
792 } 793 // Удалить сертификат
793 794 public function delete_sertificate(sertification $doc) {
794 // Удалить сертификат 795 $doc->delete();
795 public function delete_sertificate(sertification $doc) { 796
796 $doc->delete(); 797 return redirect()->route('worker.cabinet');
797 798 }
798 return redirect()->route('worker.cabinet'); 799
799 } 800 // Редактирование сертификата
800 801 public function edit_sertificate(Worker $worker, sertification $doc) {
801 // Редактирование сертификата 802 return view('workers.sertificate_edit', compact('doc', 'worker'));
802 public function edit_sertificate(Worker $worker, sertification $doc) { 803 }
803 return view('workers.sertificate_edit', compact('doc', 'worker')); 804
804 } 805 // Редактирование обновление сертификата
805 806 public function update_serificate(SertificationRequest $request, sertification $doc) {
806 // Редактирование обновление сертификата 807 $all = $request->all();
807 public function update_serificate(SertificationRequest $request, sertification $doc) { 808 $doc->worker_id = $all['worker_id'];
808 $all = $request->all(); 809 $doc->name = $all['name'];
809 $doc->worker_id = $all['worker_id']; 810 $doc->end_begin = $all['end_begin'];
810 $doc->name = $all['name']; 811 $doc->save();
811 $doc->end_begin = $all['end_begin']; 812
812 $doc->save(); 813 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
813 814 }
814 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 815
815 } 816 public function delete_add_diplom(Request $request, Worker $worker) {
816 817 $infoblok_id = $request->get('infoblok_id');
817 public function delete_add_diplom(Request $request, Worker $worker) { 818
818 $infoblok_id = $request->get('infoblok_id'); 819 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
819 820 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
820 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 821 else {
821 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 822 $params['infoblok_id'] = $infoblok_id;
822 else { 823 $params['worker_id'] = $worker->id;
823 $params['infoblok_id'] = $infoblok_id; 824 $params['status'] = $request->get('val');
824 $params['worker_id'] = $worker->id; 825 $id = Dop_info::create($params);
825 $params['status'] = $request->get('val'); 826 //$id = $worker->infobloks()->sync([$infoblok_id]);
826 $id = Dop_info::create($params); 827 }
827 //$id = $worker->infobloks()->sync([$infoblok_id]); 828
828 } 829 //$Infoblocks = infobloks::query()->get();
829 830 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
830 //$Infoblocks = infobloks::query()->get(); 831 }
831 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 832
832 } 833
833 834
834 835 // Добавление диплома
835 836 public function add_diplom_ajax(Request $request) {
836 // Добавление диплома 837 // конец
837 public function add_diplom_ajax(Request $request) { 838 $params = $request->all();
838 // конец 839 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
839 $params = $request->all(); 840
840 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 841 if ($count == 0) $dop_info = Dop_info::create($params);
841 842 $Infoblocks = infobloks::query()->get();
842 if ($count == 0) $dop_info = Dop_info::create($params); 843 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
843 $Infoblocks = infobloks::query()->get(); 844 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
844 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 845 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
845 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 846 }
846 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 847
847 } 848 // Добавление диплома без ajax
848 849 public function add_diplom(Worker $worker) {
849 // Добавление диплома без ajax 850 $worker_id = $worker->id;
850 public function add_diplom(Worker $worker) { 851 $Infoblocks = infobloks::query()->get();
851 $worker_id = $worker->id; 852 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
852 $Infoblocks = infobloks::query()->get(); 853 }
853 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 854 // Сохранить
854 } 855 // Сохраняю диплом
855 // Сохранить 856 public function add_diplom_save(Request $request) {
856 // Сохраняю диплом 857 $params = $request->all();
857 public function add_diplom_save(Request $request) { 858 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
858 $params = $request->all(); 859 if ($count == 0) $dop_info = Dop_info::create($params);
859 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 860 return redirect()->route('worker.cabinet');
860 if ($count == 0) $dop_info = Dop_info::create($params); 861 }
861 return redirect()->route('worker.cabinet'); 862
862 } 863 // Добавление стандартного документа
863 864 public function add_document(Worker $worker) {
864 // Добавление стандартного документа 865 return view('workers.docs', compact('worker'));
865 public function add_document(Worker $worker) { 866 }
866 return view('workers.docs', compact('worker')); 867
867 } 868 //Сохранение стандартого документа
868 869 public function add_document_save(DocumentsRequest $request) {
869 //Сохранение стандартого документа 870 $params = $request->all();
870 public function add_document_save(DocumentsRequest $request) { 871 $place_work = place_works::create($params);
871 $params = $request->all(); 872 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
872 $place_work = place_works::create($params); 873 }
873 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 874
874 } 875 // Редактирование документа
875 876 public function edit_document(place_works $doc, Worker $worker) {
876 // Редактирование документа 877 return view('workers.docs-edit', compact('doc', 'worker'));
877 public function edit_document(place_works $doc, Worker $worker) { 878 }
878 return view('workers.docs-edit', compact('doc', 'worker')); 879
879 } 880 //Сохранение отредактированного документа
880 881 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
881 //Сохранение отредактированного документа 882 $params = $request->all();
882 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 883 $doc->update($params);
883 $params = $request->all(); 884
884 $doc->update($params); 885 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
885 886 }
886 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 887
887 } 888 // Удаление документа
888 889 public function delete_document(place_works $doc) {
889 // Удаление документа 890 $doc->delete();
890 public function delete_document(place_works $doc) { 891 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
891 $doc->delete(); 892 }
892 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 893
893 } 894 //Отправка нового сообщения
894 895 public function new_message(Request $request) {
895 //Отправка нового сообщения 896 $params = $request->all();
896 public function new_message(Request $request) { 897
897 $params = $request->all(); 898 $id = $params['send_user_id'];
898 899 $message = new Message();
899 $id = $params['send_user_id']; 900 $message->user_id = $params['send_user_id'];
900 $message = new Message(); 901 $message->to_user_id = $params['send_to_user_id'];
901 $message->user_id = $params['send_user_id']; 902 $message->title = $params['send_title'];
902 $message->to_user_id = $params['send_to_user_id']; 903 $message->text = $params['send_text'];
903 $message->title = $params['send_title']; 904 $message->ad_employer_id = $params['send_vacancy'];
904 $message->text = $params['send_text']; 905 if ($request->has('send_file')) {
905 $message->ad_employer_id = $params['send_vacancy']; 906 $message->file = $request->file('send_file')->store("worker/$id", 'public');
906 if ($request->has('send_file')) { 907 }
907 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 908 $message->flag_new = 1;
908 } 909 $id_message = $message->save();
909 $message->flag_new = 1; 910
910 $id_message = $message->save(); 911 $data['message_id'] = $id_message;
911 912 $data['ad_employer_id'] = $params['send_vacancy'];
912 $data['message_id'] = $id_message; 913 $data['job_title_id'] = $params['send_job_title_id'];
913 $data['ad_employer_id'] = $params['send_vacancy']; 914 $data['flag'] = 1;
914 $data['job_title_id'] = $params['send_job_title_id']; 915 $ad_responce = ad_response::create($data);
915 $data['flag'] = 1; 916 return redirect()->route('worker.messages', ['type_message' => 'output']);
916 $ad_responce = ad_response::create($data); 917 }
917 return redirect()->route('worker.messages', ['type_message' => 'output']); 918
918 } 919
919 920 public function test123(Request $request) {
920 921 $params = $request->all();
921 public function test123(Request $request) { 922 $user1 = $params['user_id'];
922 $params = $request->all(); 923 $user2 = $params['to_user_id'];
923 $user1 = $params['user_id']; 924 $id_vacancy = $params['ad_employer_id'];
924 $user2 = $params['to_user_id']; 925 $ad_name = $params['ad_name'];
925 $id_vacancy = $params['ad_employer_id']; 926
926 $ad_name = $params['ad_name']; 927 $rules = [
927 928 'text' => 'required|min:1|max:150000',
928 $rules = [ 929 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
929 'text' => 'required|min:1|max:150000', 930 ];
930 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 931 $messages = [
931 ]; 932 'required' => 'Укажите обязательное поле',
932 $messages = [ 933 'min' => [
933 'required' => 'Укажите обязательное поле', 934 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
934 'min' => [ 935 'integer' => 'Поле «:attribute» должно быть :min или больше',
935 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 936 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
936 'integer' => 'Поле «:attribute» должно быть :min или больше', 937 ],
937 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 938 'max' => [
938 ], 939 'string' => 'Поле «:attribute» должно быть не больше :max символов',
939 'max' => [ 940 'integer' => 'Поле «:attribute» должно быть :max или меньше',
940 'string' => 'Поле «:attribute» должно быть не больше :max символов', 941 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
941 'integer' => 'Поле «:attribute» должно быть :max или меньше', 942 ]
942 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 943 ];
943 ] 944
944 ]; 945 $validator = Validator::make($request->all(), $rules, $messages);
945 946
946 $validator = Validator::make($request->all(), $rules, $messages); 947 if ($validator->fails()) {
947 948 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name])
948 if ($validator->fails()) { 949 ->withErrors($validator);
949 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) 950 } else {
950 ->withErrors($validator); 951 if ($request->has('file')) {
951 } else { 952 $params['file'] = $request->file('file')->store("messages", 'public');
952 if ($request->has('file')) { 953 }
953 $params['file'] = $request->file('file')->store("messages", 'public'); 954 Message::create($params);
954 } 955 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
955 Message::create($params); 956 return redirect()->route('worker.dialog',
956 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 957 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
957 return redirect()->route('worker.dialog', 958
958 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 959 }
959 960 }
960 } 961
961 } 962 // Информация о предыдущих компаниях
962 963 public function new_prev_company(Worker $worker) {
963 // Информация о предыдущих компаниях 964 return view('workers.prev_company_form', compact('worker'));
964 public function new_prev_company(Worker $worker) { 965 }
965 return view('workers.prev_company_form', compact('worker')); 966
966 } 967 // Добавление контакта компании
967 968 public function add_prev_company(PrevCompanyRequest $request) {
968 // Добавление контакта компании 969 // Возвращение параметров
969 public function add_prev_company(PrevCompanyRequest $request) { 970 $all = $request->all();
970 // Возвращение параметров 971 $PrevCompany = PrevCompany::create($all);
971 $all = $request->all(); 972
972 $PrevCompany = PrevCompany::create($all); 973 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
973 974 }
974 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 975
975 } 976 // Редактирование контакта компании
976 977 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
977 // Редактирование контакта компании 978 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
978 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 979 }
979 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 980
980 } 981 //Сохранение редактирования контакта компании
981 982 public function update_prev_company(PrevCompany $doc, Request $request){
982 //Сохранение редактирования контакта компании 983 $all = $request->all();
983 public function update_prev_company(PrevCompany $doc, Request $request){ 984 $doc->update($all);
984 $all = $request->all(); 985
985 $doc->update($all); 986 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
986 987 }
987 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 988
988 } 989 // Удаление контакта предыдущей компании
989 990 public function delete_prev_company(PrevCompany $doc) {
990 // Удаление контакта предыдущей компании 991 $doc->delete();
991 public function delete_prev_company(PrevCompany $doc) { 992 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
992 $doc->delete(); 993 }
993 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 994 }
994 } 995
995 } 996
996
app/Http/Requests/JobTitlesRequest.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Requests; 3 namespace App\Http\Requests;
4 4
5 use Illuminate\Foundation\Http\FormRequest; 5 use Illuminate\Foundation\Http\FormRequest;
6 6
7 class JobTitlesRequest extends FormRequest 7 class JobTitlesRequest extends FormRequest
8 { 8 {
9 /** 9 /**
10 * Determine if the user is authorized to make this request. 10 * Determine if the user is authorized to make this request.
11 * 11 *
12 * @return bool 12 * @return bool
13 */ 13 */
14 public function authorize() 14 public function authorize()
15 { 15 {
16 return true; 16 return true;
17 } 17 }
18 18
19 /** 19 /**
20 * Get the validation rules that apply to the request. 20 * Get the validation rules that apply to the request.
21 * 21 *
22 * @return array<string, mixed> 22 * @return array<string, mixed>
23 */ 23 */
24 public function rules() 24 public function rules()
25 { 25 {
26 return [ 26 return [
27 'name' => [ 27 'name' => [
28 'required', 28 'required',
29 'min:3', 29 'min:3',
30 'max:255', 30 'max:255',
31 ], 31 ],
32 'parent_id' => [ 32 'parent_id' => [
33 'numeric', 33 'numeric',
34 'min:0', 34 'min:0',
35 'max:9999999', 35 'max:9999999',
36 ], 36 ],
37 'sort' => [
38 'numeric',
39 'min:0',
40 'max:9999999',
41 ]
42
37 ]; 43 ];
38 } 44 }
39 45
40 public function messages() { 46 public function messages() {
41 return [ 47 return [
42 'required' => 'Поле «:attribute» обязательно для заполнения', 48 'required' => 'Поле «:attribute» обязательно для заполнения',
43 'unique' => 'Такое значение поля «:attribute» уже используется', 49 'unique' => 'Такое значение поля «:attribute» уже используется',
44 'min' => [ 50 'min' => [
45 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 51 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
46 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 52 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
47 ], 53 ],
48 'max' => [ 54 'max' => [
49 'string' => 'Поле «:attribute» должно быть не больше :max символов', 55 'string' => 'Поле «:attribute» должно быть не больше :max символов',
50 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 56 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
51 ], 57 ],
52 'mimes' => 'Файл «:attribute» должен иметь формат :values', 58 'mimes' => 'Файл «:attribute» должен иметь формат :values',
53 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999', 59 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999',
54 ]; 60 ];
55 61
56 } 62 }
57 } 63 }
58 64
resources/views/TITLE_TEXT.blade.php
File was created 1 <div class="numbers__item">
2 <b>555+</b>
3 <span>Резюме</span>
4 Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют
5 фракционных разногласий и призваны к ответу.
6 </div>
7 <div class="numbers__item">
8 <b>1 001+</b>
9 <span>Вакансий</span>
10 В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих
11 собственных рациональных ограничений.
12 </div>
13 <div class="numbers__item">
14 <b>265</b>
15 <span>Компаний</span>
16 Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных
17 ограничений.
18 </div>
1 <div class="numbers__item"> 19
resources/views/admin/answers/index.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Отзывы о работодателях']) 1 @extends('layout.admin', ['title' => 'Админка - Отзывы о работодателях'])
2 2
3 @section('script') 3 @section('script')
4 <script> 4 <script>
5 $(document).ready(function() { 5 $(document).ready(function() {
6 $(document).on('click', '.checkban', function () { 6 $(document).on('click', '.checkban', function () {
7 var this_ = $(this); 7 var this_ = $(this);
8 var value = this_.val(); 8 var value = this_.val();
9 var ajax_block = $('#ajax_block'); 9 var ajax_block = $('#ajax_block');
10 var bool = 0; 10 var bool = 0;
11 11
12 if(this.checked){ 12 if(this.checked){
13 bool = 1; 13 bool = 1;
14 } else { 14 } else {
15 bool = 0; 15 bool = 0;
16 } 16 }
17 var str ="id=" + value + "&is_moderate=" + bool; 17 var str ="id=" + value + "&is_moderate=" + bool;
18 console.log(str); 18 console.log(str);
19 $.ajax({ 19 $.ajax({
20 type: "GET", 20 type: "GET",
21 url: "{{ url()->full()}}", 21 url: "{{ url()->full()}}",
22 data: str, 22 data: str,
23 success: function (data) { 23 success: function (data) {
24 console.log('Обновление таблицы пользователей '); 24 console.log('Обновление таблицы пользователей ');
25 //data = JSON.parse(data); 25 //data = JSON.parse(data);
26 //console.log(data); 26 //console.log(data);
27 ajax_block.html(data); 27 ajax_block.html(data);
28 }, 28 },
29 headers: { 29 headers: {
30 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 30 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
31 }, 31 },
32 error: function (data) { 32 error: function (data) {
33 console.log('Error: ' + data); 33 console.log('Error: ' + data);
34 } 34 }
35 }); 35 });
36 }); 36 });
37 37
38 }); 38 });
39 </script> 39 </script>
40 @endsection 40 @endsection
41 41
42 @section('search') 42 @section('search')
43 <!--<div class="absolute inset-y-0 flex items-center pl-2"> 43 <!--<div class="absolute inset-y-0 flex items-center pl-2">
44 <svg 44 <svg
45 class="w-4 h-4" 45 class="w-4 h-4"
46 aria-hidden="true" 46 aria-hidden="true"
47 fill="currentColor" 47 fill="currentColor"
48 viewBox="0 0 20 20" 48 viewBox="0 0 20 20"
49 > 49 >
50 <path 50 <path
51 fill-rule="evenodd" 51 fill-rule="evenodd"
52 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" 52 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"
53 clip-rule="evenodd" 53 clip-rule="evenodd"
54 ></path> 54 ></path>
55 </svg> 55 </svg>
56 </div> 56 </div>
57 <form action="" method="POST"> 57 <form action="" method="POST">
58 <div style="float:left;"><input 58 <div style="float:left;"><input
59 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" 59 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"
60 style="width: 400px" 60 style="width: 400px"
61 type="text" 61 type="text"
62 placeholder="Искать..." 62 placeholder="Искать..."
63 aria-label="Search" 63 aria-label="Search"
64 /></div> 64 /></div>
65 <div style="float: left"> 65 <div style="float: left">
66 <button type="submit" class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple">Искать</button> 66 <button type="submit" class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple">Искать</button>
67 </div> 67 </div>
68 </form>--> 68 </form>-->
69 @endsection 69 @endsection
70 70
71 @section('content') 71 @section('content')
72 <style> 72 <style>
73 .col { 73 .col {
74 width: 250px; /* Ширина блока */ 74 width: 250px; /* Ширина блока */
75 word-wrap: break-word; /* Перенос слов */ 75 word-wrap: break-word; /* Перенос слов */
76 word-break: break-all; 76 word-break: break-all;
77 } 77 }
78 </style> 78 </style>
79 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 79 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
80 <div class="w-full overflow-x-auto"> 80 <div class="w-full overflow-x-auto">
81 <table class="w-full whitespace-no-wrap"> 81 <table class="w-full whitespace-no-wrap">
82 <thead> 82 <thead>
83 <tr 83 <tr
84 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" 84 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"
85 > 85 >
86 <th class="px-4 py-3">№</th> 86 <th class="px-4 py-3">№</th>
87 <th class="px-4 py-3">Название компании</th> 87 <th class="px-4 py-3">Название компании</th>
88 <th class="px-4 py-3">Комментатор</th> 88 <th class="px-4 py-3">Комментатор</th>
89 <th class="px-4 py-3">Заголовок/Текст</th> 89 <th class="px-4 py-3">Заголовок/Текст</th>
90 <th class="px-4 py-3">Дата коммента</th> 90 <th class="px-4 py-3">Дата коммента</th>
91 <th class="px-4 py-3">Разрешить</th> 91 <th class="px-4 py-3">Разрешить</th>
92 </tr> 92 </tr>
93 </thead> 93 </thead>
94 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 94 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
95 @foreach($answers as $answer) 95 @foreach($answers as $answer)
96 <tr class="text-gray-700 dark:text-gray-400"> 96 <tr class="text-gray-700 dark:text-gray-400">
97 <td class="px-4 py-3"> 97 <td class="px-4 py-3">
98 {{$answer->id}} 98 {{$answer->id}}
99 </td> 99 </td>
100 <td class="px-4 py-3"> 100 <td class="px-4 py-3">
101 @if (isset($answer->employer->name_company)) 101 @if (isset($answer->employer->name_company))
102 {{$answer->employer->name_company}}
103 @else
104 Не определено
105 @endif
102 {{$answer->employer->name_company}} 106 </td>
103 @else 107 <td class="px-4 py-3">
104 Не определено 108 {{$answer->user->name}}
105 @endif 109 </td>
106 </td> 110 <td class="px-4 py-3 col" >
107 <td class="px-4 py-3"> 111 <!--<div class="flex items-center text-sm">
108 {{$answer->user->name}} 112 <div >-->
109 </td> 113 <p class="font-semibold">{{$answer->title}}</p>
110 <td class="px-4 py-3 col" > 114 <textarea style="width:250px; height: 100px;" readonly="readonly" class="text-xs text-gray-600 dark:text-gray-400">{{ $answer->text }}</textarea>
111 <!--<div class="flex items-center text-sm"> 115 <!--</div>
112 <div >--> 116 </div>-->
113 <p class="font-semibold">{{$answer->title}}</p> 117 </td>
114 <textarea style="width:250px; height: 100px;" readonly="readonly" class="text-xs text-gray-600 dark:text-gray-400">{{ $answer->text }}</textarea> 118 <td class="px-4 py-3 text-sm">
115 <!--</div> 119 {{ $answer->created_at }}
116 </div>--> 120 </td>
117 </td> 121 <td class="px-4 py-3 text-sm">
118 <td class="px-4 py-3 text-sm"> 122 <input type="checkbox" class="checkban" value="{{$answer->id}}" name="moderate_{{$answer->id}}" {{ ($answer->is_moderate) ? "checked" : "" }}/>
119 {{ $answer->created_at }} 123 </td>
120 </td> 124 </tr>
121 <td class="px-4 py-3 text-sm"> 125 @endforeach
122 <input type="checkbox" class="checkban" value="{{$answer->id}}" name="moderate_{{$answer->id}}" {{ ($answer->is_moderate) ? "checked" : "" }}/> 126 </tbody>
123 </td> 127 </table>
124 </tr> 128 </div>
125 @endforeach 129
126 </tbody> 130 <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">
127 </table> 131 <?=$answers->appends($_GET)->links('admin.pagginate'); ?>
128 </div> 132 </div>
129 133 </div>
130 <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"> 134 @endsection
131 <?=$answers->appends($_GET)->links('admin.pagginate'); ?> 135
resources/views/admin/job_titles/form.blade.php
1 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> 1 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
2 <label class="block text-sm"> 2 <label class="block text-sm">
3 <span class="text-gray-700 dark:text-gray-400">Название должности</span> 3 <span class="text-gray-700 dark:text-gray-400">Название должности</span>
4 <input name="name" id="name" 4 <input name="name" id="name"
5 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" 5 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"
6 placeholder="Название должности" value="{{ old('name') ?? $job_title->name ?? '' }}" 6 placeholder="Название должности" value="{{ old('name') ?? $job_title->name ?? '' }}"
7 /> 7 />
8 @error('name') 8 @error('name')
9 <span class="text-xs text-red-600 dark:text-red-400"> 9 <span class="text-xs text-red-600 dark:text-red-400">
10 {{ $message }} 10 {{ $message }}
11 </span> 11 </span>
12 @enderror 12 @enderror
13 </label><br> 13 </label><br>
14 14
15 <label class="block text-sm"> 15 <label class="block text-sm">
16 <span class="text-gray-700 dark:text-gray-400">Родитель</span> 16 <span class="text-gray-700 dark:text-gray-400">Родитель</span>
17 17
18 @php 18 @php
19 $parent_id = old('parent_id') ?? $job_title->parent_id ?? 0; 19 $parent_id = old('parent_id') ?? $job_title->parent_id ?? 0;
20 @endphp 20 @endphp
21 <select name="parent_id" 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" 21 <select name="parent_id" 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"
22 title="Родитель"> 22 title="Родитель">
23 <option value="0">Без родителя</option> 23 <option value="0">Без родителя</option>
24 @include('admin.job_titles.parent_id', ['level' => -1, 'parent' => 0]) 24 @include('admin.job_titles.parent_id', ['level' => -1, 'parent' => 0])
25 </select> 25 </select>
26 </label><br> 26 </label><br>
27 27
28 <label class="block text-sm"> 28 <label class="block text-sm">
29 <span class="text-gray-700 dark:text-gray-400">Категория должности</span> 29 <span class="text-gray-700 dark:text-gray-400">Категория должности</span>
30 30
31 @php 31 @php
32 $category_id = old('position_id') ?? $job_title->position_id ?? 0; 32 $category_id = old('position_id') ?? $job_title->position_id ?? 0;
33 @endphp 33 @endphp
34 <select name="position_id" 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" 34 <select name="position_id" 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"
35 title="Родитель"> 35 title="Родитель">
36 <option value="">Без родителя</option> 36 <option value="">Без родителя</option>
37 @foreach ($category as $it) 37 @foreach ($category as $it)
38 <option value="{{ $it->id }}" @if ($it->id == $category_id) selected @endif>{{ $it->name }}</option> 38 <option value="{{ $it->id }}" @if ($it->id == $category_id) selected @endif>{{ $it->name }}</option>
39 @endforeach 39 @endforeach
40 </select> 40 </select>
41 </label><br> 41 </label><br>
42 42
43 <label class="block text-sm"> 43 <label class="block text-sm">
44 <span class="text-gray-700 dark:text-gray-400">Сортировка</span> 44 <span class="text-gray-700 dark:text-gray-400">Сортировка</span>
45 @php 45 @php
46 $sort_num = 100; 46 $sort_num = 100;
47 @endphp 47 @endphp
48 <select name="sort" 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" 48
49 <input name="sort" id="sort"
50 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"
51 placeholder="Сортировка" value="{{ old('sort') ?? $job_title->sort ?? '100' }}"
52 />
53 <!--<select name="sort" 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"
49 title="Сортировка"> 54 title="Сортировка">
50 @for($i = 1; $i <= 10; $i++) 55 for($i = 1; $i <= 10; $i++)
51 <option value="{{ $sort_num }}" @if (isset($job_title)) @if ($sort_num == $job_title->sort) selected @else @endif @endif>{{ $sort_num }}</option> 56 <option value="{ $sort_num }}" if (isset($job_title)) if ($sort_num == $job_title->sort) selected else endif endif>{ $sort_num }}</option>
52 @php $sort_num = $sort_num + 10; @endphp 57 php $sort_num = $sort_num + 10; endphp
53 @endfor 58 endfor
54 </select> 59 </select>-->
55 </label><br> 60 </label><br>
56 61
57 <label class="block text-sm"> 62 <label class="block text-sm">
58 <span class="text-gray-700 dark:text-gray-400">Видимость</span> 63 <span class="text-gray-700 dark:text-gray-400">Видимость</span>
59 64
60 <select name="is_bd" 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" 65 <select name="is_bd" 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"
61 title="Видимость"> 66 title="Видимость">
62 <option value="0" @if (isset($job_title)) @if ($job_title->is_bd == 0) selected @endif @endif>Работодатель</option> 67 <option value="0" @if (isset($job_title)) @if ($job_title->is_bd == 0) selected @endif @endif>Работодатель</option>
63 <option value="1" @if (isset($job_title)) @if ($job_title->is_bd == 1) selected @endif @endif>Работник</option> 68 <option value="1" @if (isset($job_title)) @if ($job_title->is_bd == 1) selected @endif @endif>Работник</option>
64 <option value="2" @if (isset($job_title)) @if ($job_title->is_bd == 2) selected @endif @endif>База данных</option> 69 <option value="2" @if (isset($job_title)) @if ($job_title->is_bd == 2) selected @endif @endif>База данных</option>
65 </select> 70 </select>
66 </label><br> 71 </label><br>
67 72
68 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> 73 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
69 <div> 74 <div>
70 <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"> 75 <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">
71 Сохранить 76 Сохранить
72 </button> 77 </button>
73 78
74 <a href="{{ route('admin.job-titles.index') }}" 79 <a href="{{ route('admin.job-titles.index') }}"
75 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" 80 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"
76 style="display: -webkit-inline-box; height: 30px!important;" 81 style="display: -webkit-inline-box; height: 30px!important;"
77 >Назад</a> 82 >Назад</a>
78 </div> 83 </div>
79 </div> 84 </div>
80 </div> 85 </div>
81 86
resources/views/admin/job_titles/index.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Справочник Должности']) 1 @extends('layout.admin', ['title' => 'Админка - Справочник Должности'])
2 2
3 @section('script') 3 @section('script')
4 <script>
5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this);
8 var val_ = this_.val();
9 console.log('sort items '+val_);
10
11 $.ajax({
12 type: "GET",
13 url: "{{ url()->current() }}",
14 data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif",
15 success: function (data) {
16 console.log('Выбор сортировки');
17 console.log(data);
18 history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
19 $('#main_ockar').html(data);
20 },
21 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 },
24 error: function (data) {
25 data = JSON.stringify(data);
26 console.log('Error: ' + data);
27 }
28 });
29 });
30 </script>
4 <script> 31 @endsection
5 console.log('Test system'); 32
6 $(document).on('change', '#sort_ajax', function() { 33 @section('search')
7 var this_ = $(this); 34
8 var val_ = this_.val(); 35 @endsection
9 console.log('sort items '+val_); 36
10 37 @section('content')
11 $.ajax({ 38 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
12 type: "GET", 39 <div class="w-full overflow-x-auto">
13 url: "{{ url()->current() }}", 40 <a 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" href="{{ route('admin.job-titles.create') }}">Создать должность</a><br><br>
14 data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif", 41 <table class="w-full whitespace-no-wrap">
15 success: function (data) { 42 <thead>
16 console.log('Выбор сортировки'); 43 <tr
17 console.log(data); 44 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"
18 history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 45 >
19 $('#main_ockar').html(data); 46 <th class="px-4 py-3">№</th>
20 }, 47 <th class="px-4 py-3">Родитель</th>
21 headers: { 48 <th class="px-4 py-3">Должность</th>
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 <th class="px-4 py-3">Видимость</th>
23 }, 50 <th class="px-4 py-3"><a id="sort_jobs" name="sort_jobs" @if(isset($_GET['sort'])) @if($_GET['sort']=='up') href="?sort=down" @else href="?sort=up" @endif @else href="?sort=down" @endif>Сортировка ↑↓</a></th>
24 error: function (data) { 51 <th class="px-4 py-3">Дата создания</th>
25 data = JSON.stringify(data); 52 <th class="px-4 py-3">Изменить</th>
26 console.log('Error: ' + data); 53 </tr>
27 } 54 </thead>
28 }); 55 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
29 }); 56 @foreach($Jobs as $job)
30 </script> 57 <tr class="text-gray-700 dark:text-gray-400">
31 @endsection 58 <td class="px-4 py-3 text-xs">
32 59 {{$job->id}}
33 @section('search') 60 </td>
34 61 <td class="px-4 py-3 text-xs">
35 @endsection 62 @if (empty($job->parent->id))
36 63 Не задан
37 @section('content') 64 @else
38 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 65 {{ mb_strimwidth($job->parent->name, 0, 35, "...") }}({{$job->parent->id}})
39 <div class="w-full overflow-x-auto"> 66 @endif
40 <a 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" href="{{ route('admin.job-titles.create') }}">Создать должность</a><br><br> 67 </td>
41 <table class="w-full whitespace-no-wrap"> 68 <td class="px-4 py-3 text-xs">
42 <thead> 69 {{ mb_strimwidth($job->name, 0, 35, "...") }}
43 <tr 70 </td>
44 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" 71 <td class="px-4 py-3 text-xs">
45 > 72 @switch ($job->is_bd)
46 <th class="px-4 py-3">№</th> 73 @case (0) Работодатель @break
47 <th class="px-4 py-3">Родитель</th> 74 @case (1) Работник @break
48 <th class="px-4 py-3">Должность</th> 75 @case (2) База данных @break
49 <th class="px-4 py-3">Видимость</th> 76 @default База данных @break
50 <th class="px-4 py-3"><a id="sort_jobs" name="sort_jobs" @if(isset($_GET['sort'])) @if($_GET['sort']=='up') href="?sort=down" @else href="?sort=up" @endif @else href="?sort=down" @endif>Сортировка ↑↓</a></th> 77 @endswitch
51 <th class="px-4 py-3">Дата создания</th> 78 </td>
52 <th class="px-4 py-3">Изменить</th> 79 <td class="px-4 py-3 text-xs">
53 </tr> 80 {{$job->sort}}
54 </thead> 81 </td>
55 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 82 <td class="px-4 py-3 text-sm text-xs">
56 @foreach($Jobs as $job) 83 {{ $job->created_at }}
57 <tr class="text-gray-700 dark:text-gray-400"> 84 </td>
58 <td class="px-4 py-3 text-xs"> 85 <td class="px-4 py-3 text-sm_ text-xs">
59 {{$job->id}} 86 <form action="{{ route('admin.job-titles.destroy', ['job_title' => $job->id]) }}" method="POST">
60 </td> 87 <a href="{{ route('admin.job-titles.edit', ['job_title' => $job->id]) }}">Изменить</a> |
61 <td class="px-4 py-3 text-xs"> 88 @csrf
62 @if (empty($job->parent->id)) 89 @method('DELETE')
63 Не задан 90 <input class="btn btn-danger" type="submit" value="Удалить"/>
64 @else 91 </form>
65 {{ mb_strimwidth($job->parent->name, 0, 35, "...") }}({{$job->parent->id}}) 92 </td>
66 @endif 93 </tr>
67 </td> 94 @endforeach
68 <td class="px-4 py-3 text-xs"> 95 </tbody>
69 {{ mb_strimwidth($job->name, 0, 35, "...") }} 96 </table>
70 </td> 97 </div>
71 <td class="px-4 py-3 text-xs"> 98
72 @switch ($job->is_bd) 99 <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">
73 @case (0) Работодатель @break 100 <?=$Jobs->appends($_GET)->links('admin.pagginate'); ?>
74 @case (1) Работник @break 101 </div>
75 @case (2) База данных @break 102 </div>
76 @default База данных @break 103 @endsection
77 @endswitch 104
resources/views/ajax/list_vacancies.blade.php
1 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 1 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
2 2
3 @foreach ($Query as $Q) 3 @foreach ($Query as $Q)
4 @foreach ($Reclama as $Rec) 4 @foreach ($Reclama as $Rec)
5 @if ($Rec->position == $i) 5 @if ($Rec->position == $i)
6 <div class="main__vacancies-thing"> 6 <div class="main__vacancies-thing">
7 @if (!empty($Rec->image)) 7 @if (!empty($Rec->image))
8 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 8 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
9 @else 9 @else
10 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 10 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
11 @endif 11 @endif
12 <div class="main__vacancies-thing-body"> 12 <div class="main__vacancies-thing-body">
13 <h2>{{ $Rec->title }}</h2> 13 <h2>{{ $Rec->title }}</h2>
14 <div class="main__vacancies-thing-scroll"> 14 <div class="main__vacancies-thing-scroll">
15 {!! $Rec->text !!} 15 {!! $Rec->text !!}
16 </div> 16 </div>
17 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 17 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
18 </div> 18 </div>
19 </div> 19 </div>
20 @endif 20 @endif
21 @endforeach 21 @endforeach
22 <div class="main__vacancies-item main__employer-page-two-item"> 22 <div class="main__vacancies-item main__employer-page-two-item">
23 23
24 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 24 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
25 <svg> 25 <svg>
26 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 26 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
27 </svg> 27 </svg>
28 <span> 28 <span>
29 Вернуться к списку вакансий 29 Вернуться к списку вакансий
30 </span> 30 </span>
31 </a> 31 </a>
32 32
33 <div class="main__employer-page-two-item-toper"> 33 <div class="main__employer-page-two-item-toper">
34 @if (!empty($Q->employer->logo)) 34 @if (!empty($Q->employer->logo))
35 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 35 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
36 @else 36 @else
37 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 37 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
38 @endif 38 @endif
39 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 39 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span>
40 </div> 40 </div>
41 41
42 <div class="main__employer-page-two-item-text"> 42 <div class="main__employer-page-two-item-text">
43 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 43 <div class="main__employer-page-two-item-text-name">
44 специалистов на следующие должности:</div> 44 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3>
45 <div class="main__employer-page-two-item-text-links">
46 @if (isset($Q->jobs))
47 @foreach ($Q->jobs as $key => $j)
48 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
49 @endforeach
50 @endif
51 </div> 45 </div>
46 <!--Судоходная компания ведет набор
47 специалистов на следующие должности:</div>
48 <div class="main__employer-page-two-item-text-links">
49 if (isset($Q->jobs))
50 foreach ($Q->jobs as $key => $j)
51 <a>“{ $j->name }}” <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)-->
52 <!-- </a>
53 endforeach
54 endif
55 </div>-->
52 </div> 56 </div>
53 57
54 <div class="main__employer-page-two-item-text"> 58 <div class="main__employer-page-two-item-text">
55 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 59 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
56 <div class="main__employer-page-two-item-text-body"> 60 <div class="main__employer-page-two-item-text-body">
57 {!! $Q->text !!} 61 {!! $Q->text !!}
58 </div> 62 </div>
59 </div> 63 </div>
60 <div class="main__employer-page-two-item-text"> 64 <!--<div class="main__employer-page-two-item-text">
61 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 65 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
62 <div class="main__employer-page-two-item-text-body"> 66 <div class="main__employer-page-two-item-text-body">
63 {!! $Q->description !!} 67 !! $Q->description !!}
64 </div> 68 </div>
65 </div> 69 </div>
66 <div class="main__employer-page-two-item-text"> 70 <div class="main__employer-page-two-item-text">
67 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 71 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
68 <div class="main__employer-page-two-item-text-body"> 72 <div class="main__employer-page-two-item-text-body">
69 {!! $Q->contacts_emails !!} 73 !! $Q->contacts_emails !!}
70 </div> 74 </div>
71 </div> 75 </div>
72 <div class="main__employer-page-two-item-text"> 76 <div class="main__employer-page-two-item-text">
73 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 77 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
74 <div class="main__employer-page-two-item-text-body"> 78 <div class="main__employer-page-two-item-text-body">
75 {!! $Q->contacts_telephones !!} 79 !! $Q->contacts_telephones !!}
76 </div> 80 </div>
77 </div> 81 </div>
82 -->
78 83
79 <div class="main__employer-page-two-item-tags"> 84 <div class="main__employer-page-two-item-tags">
80 @if (!empty($Q->jobs_code[0]->position_ship)) 85 @if (!empty($Q->jobs_code[0]->position_ship))
81 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 86 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
82 @else 87 @else
83 @if (isset($Q->jobs)) 88 @if (isset($Q->jobs))
84 @foreach ($Q->jobs as $key => $j) 89 @foreach ($Q->jobs as $key => $j)
85 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 90 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
86 @endforeach 91 @endforeach
87 @endif 92 @endif
88 @endif 93 @endif
89 </div> 94 </div>
95
90 <div class="main__employer-page-two-item-buttons"> 96 <div class="main__employer-page-two-item-buttons">
91 @guest 97 @guest
92 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 98 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
93 class="button main__employer-page-two-item-button">Откликнуться</button> 99 class="button main__employer-page-two-item-button">Откликнуться</button>
94 @else 100 @else
95 @if (App\Classes\StatusUser::Status()==1) 101 @if (App\Classes\StatusUser::Status()==1)
96 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 102 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
97 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 103 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
98 @else 104 @else
99 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 105 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
100 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 106 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
101 @endif 107 @endif
102 @endguest 108 @endguest
103 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 109 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
104 </div> 110 </div>
105 <div class="main__employer-page-two-item-bottom"> 111 <div class="main__employer-page-two-item-bottom">
106 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 112 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
107 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>"> 113 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>">
108 <svg> 114 <svg>
109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 115 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
110 </svg> 116 </svg>
111 </button> 117 </button>
112 </div> 118 </div>
113 </div> 119 </div>
resources/views/employers/list_vacancy.blade.php
1 @extends('layout.frontend', ['title' => 'Список вакансий - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Список вакансий - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ url()->current() }}", 13 url: "{{ url()->current() }}",
14 data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif", 14 data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 18 history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
19 $('#main_ockar').html(data); 19 $('#main_ockar').html(data);
20 }, 20 },
21 headers: { 21 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 }, 23 },
24 error: function (data) { 24 error: function (data) {
25 data = JSON.stringify(data); 25 data = JSON.stringify(data);
26 console.log('Error: ' + data); 26 console.log('Error: ' + data);
27 } 27 }
28 }); 28 });
29 }); 29 });
30 </script> 30 </script>
31 @endsection 31 @endsection
32 32
33 @section('content') 33 @section('content')
34 <section class="cabinet"> 34 <section class="cabinet">
35 <div class="container"> 35 <div class="container">
36 <ul class="breadcrumbs cabinet__breadcrumbs"> 36 <ul class="breadcrumbs cabinet__breadcrumbs">
37 <li><a href="{{ route('index') }}">Главная</a></li> 37 <li><a href="{{ route('index') }}">Главная</a></li>
38 <li><b>Личный кабинет</b></li> 38 <li><b>Личный кабинет</b></li>
39 </ul> 39 </ul>
40 <div class="cabinet__wrapper"> 40 <div class="cabinet__wrapper">
41 <div class="cabinet__side"> 41 <div class="cabinet__side">
42 <div class="cabinet__side-toper"> 42 <div class="cabinet__side-toper">
43 43
44 @include('employers.emblema') 44 @include('employers.emblema')
45 45
46 </div> 46 </div>
47 47
48 @include('employers.menu', ['item' => 3]) 48 @include('employers.menu', ['item' => 3])
49 </div> 49 </div>
50 <div class="cabinet__body"> 50 <div class="cabinet__body">
51 <div class="cabinet__body-item"> 51 <div class="cabinet__body-item">
52 <h2 class="title cabinet__title">Мои вакансии</h2> 52 <h2 class="title cabinet__title">Мои вакансии</h2>
53 </div> 53 </div>
54 <div class="cabinet__body-item"> 54 <div class="cabinet__body-item">
55 <div class="cabinet__filters"> 55 <div class="cabinet__filters">
56 <div class="cabinet__filters-item"> 56 <div class="cabinet__filters-item">
57 <form class="search" action="{{ url()->current() }}" method="GET"> 57 <form class="search" action="{{ url()->current() }}" method="GET">
58 <input type="search" name="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }}@endif"> 58 <input type="search" name="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }}@endif">
59 <button type="submit" class="button">Найти</button> 59 <button type="submit" class="button">Найти</button>
60 <span> 60 <span>
61 <svg> 61 <svg>
62 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 62 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
63 </svg> 63 </svg>
64 </span> 64 </span>
65 </form> 65 </form>
66 </div> 66 </div>
67 <div class="cabinet__filters-item"> 67 <div class="cabinet__filters-item">
68 <div class="select"> 68 <div class="select">
69 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 69 <select class="js-select2" id="sort_ajax" name="sort_ajax">
70 <option value="default" @if (isset($_GET['sort']) && ($_GET['sort'] == 'default')) selected @endif>От новых к старым (по умолчанию)</option> 70 <option value="default" @if (isset($_GET['sort']) && ($_GET['sort'] == 'default')) selected @endif>От новых к старым (по умолчанию)</option>
71 <option value="public" @if (isset($_GET['sort']) && ($_GET['sort'] == 'public')) selected @endif>Опубликовано</option> 71 <option value="public" @if (isset($_GET['sort']) && ($_GET['sort'] == 'public')) selected @endif>Опубликовано</option>
72 <option value="nopublic" @if (isset($_GET['sort']) && ($_GET['sort'] == 'nopublic')) selected @endif>Не опубликовано</option>
73 <!--<option value="name_up">По имени (возрастание)</option>
72 <option value="nopublic" @if (isset($_GET['sort']) && ($_GET['sort'] == 'nopublic')) selected @endif>Не опубликовано</option> 74 <option value="name_down">По имени (убывание)</option>
73 <!--<option value="name_up">По имени (возрастание)</option> 75 <option value="created_at_up">По дате (возрастание)</option>
74 <option value="name_down">По имени (убывание)</option> 76 <option value="created_at_down">По дате (убывание)</option>-->
75 <option value="created_at_up">По дате (возрастание)</option> 77 </select>
76 <option value="created_at_down">По дате (убывание)</option>--> 78 </div>
77 </select> 79 </div>
78 </div> 80 </div>
79 </div> 81
80 </div> 82 <div class="table table_spoiler" id="main_ockar" name="main_oskar">
81 83 @if ($vacancy_list->count())
82 <div class="table table_spoiler" id="main_ockar" name="main_oskar"> 84 <div class="table__scroll">
83 @if ($vacancy_list->count()) 85 <div class="table__body table__body_min-width">
84 <div class="table__scroll"> 86 <table>
85 <div class="table__body table__body_min-width"> 87 <thead>
86 <table> 88 <tr>
87 <thead> 89 <th>№</th>
88 <tr> 90 <th>Название</th>
89 <th>№</th> 91 <th>Дата добавления<br>/&nbsp;обновления</th>
90 <th>Название</th> 92 <th style="display:none">Должности</th>
91 <th>Дата добавления<br>/&nbsp;обновления</th> 93 <th>Статус</th>
92 <th style="display:none">Должности</th> 94 <th>Действия</th>
93 <th>Статус</th> 95 </tr>
94 <th>Действия</th> 96 </thead>
95 </tr> 97 <tbody>
96 </thead> 98 @foreach($vacancy_list as $it)
97 <tbody> 99 <tr>
98 @foreach($vacancy_list as $it) 100 <td>{{ $it->id }}</td>
99 <tr> 101 <td>{{ $it->name }}</td>
100 <td>{{ $it->id }}</td> 102 <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td>
101 <td>{{ $it->name }}</td> 103 <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
102 <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td> 104
103 <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a> 105 @if ($it->jobs->count())
104 106 @foreach ($it->jobs as $key => $it_um)
105 @if ($it->jobs->count()) 107 <p>@if (isset($it->jobs_code[$key]))
106 @foreach ($it->jobs as $key => $it_um) 108 <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
107 <p>@if (isset($it->jobs_code[$key])) 109 <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
108 <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> 110 @endif
109 <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> 111 </p>
110 @endif 112 @endforeach
111 </p> 113 @else
112 @endforeach 114 Нет связанных <br> с вакансией должностей
113 @else 115 @endif
114 Нет связанных <br> с вакансией должностей 116 </td>
115 @endif 117 <td>
116 </td> 118 @if ($it->active_is)
117 <td> 119 <span class="table__status green"><i></i>Опубликовано</span>
118 @if ($it->active_is) 120 @else
119 <span class="table__status green"><i></i>Опубликовано</span> 121 <span class="table__status"><i></i>Не опубликовано</span>
120 @else 122 @endif
121 <span class="table__status"><i></i>Не опубликовано</span> 123 </td>
122 @endif 124 <td>
123 </td> 125 <span class="table__controls">
124 <td> 126 <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
125 <span class="table__controls"> 127 <svg>
126 <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> 128 <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
127 <svg> 129 </svg>
128 <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> 130 </a>
129 </svg> 131 <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item">
130 </a> 132 <svg>
131 <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> 133 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
132 <svg> 134 </svg>
133 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 135 </a>
134 </svg> 136 <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
135 </a> 137 <svg>
136 <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> 138 <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
137 <svg> 139 </svg>
138 <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> 140 </a>
139 </svg> 141 @if ($it->active_is)
140 </a> 142 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item">
141 @if ($it->active_is) 143 <svg>
142 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> 144 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
143 <svg> 145 </svg>
144 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> 146 </a>
145 </svg> 147 @else
146 </a> 148 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item">
147 @else 149 <svg>
148 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> 150 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
149 <svg> 151 </svg>
150 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 152 </a>
151 </svg> 153 @endif
152 </a> 154 @if ($Employer->social_is == 1)
153 @endif 155 <a href="https://telegram.me/share/url?url={{ route('vacancie', ['vacancy' => $it->id]) }}&text={{ $it->text }}" class="table__controls-item">
154 @if ($Employer->social_is == 1) 156 <svg>
155 <a href="https://telegram.me/share/url?url={{ route('vacancie', ['vacancy' => $it->id]) }}&text={{ $it->text }}" class="table__controls-item"> 157 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
156 <svg> 158 </svg>
157 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 159 </a>
158 </svg> 160 @endif
159 </a> 161 <!--<a class="btn_telegram_share table__controls-item" href="https://telegram.me/share/url?url=ВАШ_URL&text={{ $it->name }}">
160 @endif 162 <svg>
161 <!--<a class="btn_telegram_share table__controls-item" href="https://telegram.me/share/url?url=ВАШ_URL&text={{ $it->name }}"> 163 <use xlink:href=" asset('images/sprite.svg#arrow-radius') }}"></use>
162 <svg> 164 </svg>
163 <use xlink:href=" asset('images/sprite.svg#arrow-radius') }}"></use> 165 </a>-->
164 </svg> 166
165 </a>--> 167 <!--<button type="button" class="table__controls-item">
166 168 <svg>
167 <!--<button type="button" class="table__controls-item"> 169 <use xlink:href=" asset('images/sprite.svg#tg') }}"></use>
168 <svg> 170 </svg>
169 <use xlink:href=" asset('images/sprite.svg#tg') }}"></use> 171 </button>
170 </svg> 172 -->
171 </button> 173 </span>
172 --> 174 </td>
173 </span> 175 </tr>
174 </td> 176 @endforeach
175 </tr> 177 </tbody>
176 @endforeach 178 </table>
177 </tbody> 179 </div><br>
178 </table> 180 {{ $vacancy_list->appends($_GET)->links('paginate') }}
179 </div><br> 181 </div>
180 {{ $vacancy_list->appends($_GET)->links('paginate') }} 182
181 </div> 183
182 184 @else
183 185
184 @else 186 <div class="notify">
185 187 <svg>
186 <div class="notify"> 188 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
187 <svg> 189 </svg>
188 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 190 <span>Вы ещё не разместили ни одной вакансии</span>
189 </svg> 191 </div>
190 <span>Вы ещё не разместили ни одной вакансии</span> 192 @endif
191 </div> 193 </div>
192 @endif 194 </div>
193 </div> 195 </div>
194 </div> 196 </div>
195 </div> 197 </div>
196 </div> 198 </section>
197 </div> 199 </div>
198 </section> 200 @endsection
199 </div> 201
resources/views/employers/subcribe.blade.php
1 @extends('layout.frontend', ['title' => 'Настройка уведомлений - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Настройка уведомлений - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('employers.emblema') 17 @include('employers.emblema')
18 </div> 18 </div>
19 19
20 20
21 @include('employers.menu', ['item' => 11]) 21 @include('employers.menu', ['item' => 11])
22 </div> 22 </div>
23 23
24 <div class="cabinet__body"> 24 <div class="cabinet__body">
25 <div class="cabinet__body-item"> 25 <div class="cabinet__body-item">
26 <h2 class="title cabinet__title">Настройки уведомлений</h2> 26 <h2 class="title cabinet__title">Настройки уведомлений</h2>
27 </div> 27 </div>
28 @include('messages_error') 28 @include('messages_error')
29 <div class="cabinet__body-item"> 29 <div class="cabinet__body-item">
30 <form class="cabinet__nots" action="{{ route('employer.save_subscribe') }}"> 30 <form class="cabinet__nots" action="{{ route('employer.save_subscribe') }}">
31 @csrf 31 @csrf
32 <p class="cabinet__text">Укажите адрес электронной почты для получения уведомлений</p> 32 <p class="cabinet__text">Укажите адрес электронной почты для получения уведомлений</p>
33 <input type="email" name="email" class="input" placeholder="info@rekamore.su" required> 33 <input type="email" name="email" class="input" placeholder="info@rekamore.su" required>
34 <label class="checkbox"> 34 <label class="checkbox">
35 <input type="checkbox" name="email_msg" class="checkbox__input"> 35 <input type="checkbox" name="email_msg" class="checkbox__input">
36 <span class="checkbox__icon"> 36 <span class="checkbox__icon">
37 <svg> 37 <svg>
38 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 38 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
39 </svg> 39 </svg>
40 </span> 40 </span>
41 <span class="checkbox__text"> 41 <span class="checkbox__text">
42 <span>Получать уведомления о новых сообщениях на почту</span> 42 <span>Получать уведомления о новых сообщениях на почту</span>
43 </span> 43 </span>
44 </label> 44 </label>
45 <button type="submit" class="button">Сохранить</button> 45 <button type="submit" class="button">Сохранить</button>
46 </form> 46 </form>
47 </div> 47 </div>
48 </div> 48 </div>
49 </div> 49 </div>
50 </div> 50 </div>
51 </section> 51 </section>
52 </div> 52 </div>
53 @endsection 53 @endsection
54 54
resources/views/index.blade.php
1 @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Главная страница РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 @include('messages_error') 8 @include('messages_error')
9 <section class="work"> 9 <section class="work">
10 <div class="container"> 10 <div class="container">
11 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> 11 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic">
12 <div class="work__body"> 12 <div class="work__body">
13 <div class="work__title"> 13 <div class="work__title">
14 <h4>Работа в море / 14 <h4>Работа в море /
15 <span class="br">Работа на реке</span></h4> 15 <span class="br">Работа на реке</span></h4>
16 </div> 16 </div>
17 <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — 17 <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас —
18 тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в 18 тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в
19 сложных, но очень интересных условиях. </div> 19 сложных, но очень интересных условиях. </div>
20 <div class="work__list"> 20 <div class="work__list">
21 <div>Тысячи соискателей увидят Ваше объявление</div> 21 <div>Тысячи соискателей увидят Ваше объявление</div>
22 <div>Десятки компаний выкладывают объявления каждый день</div> 22 <div>Десятки компаний выкладывают объявления каждый день</div>
23 </div> 23 </div>
24 <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET"> 24 <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET">
25 <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> 25 <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required>
26 <!--<div class="select select_search thing__select"> 26 <!--<div class="select select_search thing__select">
27 <div class="select__icon"> 27 <div class="select__icon">
28 <svg> 28 <svg>
29 <use xlink:href=" asset('images/sprite.svg#search') }}"></use> 29 <use xlink:href=" asset('images/sprite.svg#search') }}"></use>
30 </svg> 30 </svg>
31 </div> 31 </div>
32 <select class="js-select2 jobs" id="search" name="search"> 32 <select class="js-select2 jobs" id="search" name="search">
33 <option value="0">Выберите должность</option> 33 <option value="0">Выберите должность</option>
34 if ($Job_title->count()) 34 if ($Job_title->count())
35 foreach($Job_title as $JT) 35 foreach($Job_title as $JT)
36 <option value=" $JT->id }}" if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected endif> $JT->name }}</option> 36 <option value=" $JT->id }}" if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected endif> $JT->name }}</option>
37 endforeach 37 endforeach
38 endif 38 endif
39 </select> 39 </select>
40 </div>--> 40 </div>-->
41 <button type="submit" class="button button_light">Посмотреть вакансии</button> 41 <button type="submit" class="button button_light">Посмотреть вакансии</button>
42 <span> 42 <span>
43 <svg> 43 <svg>
44 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 44 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
45 </svg> 45 </svg>
46 </span> 46 </span>
47 </form> 47 </form>
48 @guest 48 @guest
49 <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> 49 <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a>
50 @else 50 @else
51 @if (Auth()->user()->is_lookin) 51 @if (Auth()->user()->is_lookin)
52 <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> 52 <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a>
53 @else 53 @else
54 <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> 54 <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a>
55 @endif 55 @endif
56 @endguest 56 @endguest
57 <div class="work__get"> 57 <div class="work__get">
58 <b>Скачать приложение</b> 58 <b>Скачать приложение</b>
59 <a href=""> 59 <a href="">
60 <img src="{{ asset('images/google.svg') }}" alt=""> 60 <img src="{{ asset('images/google.svg') }}" alt="">
61 </a> 61 </a>
62 <a href=""> 62 <a href="">
63 <img src="{{ asset('images/apple.svg') }}" alt=""> 63 <img src="{{ asset('images/apple.svg') }}" alt="">
64 </a> 64 </a>
65 </div> 65 </div>
66 </div> 66 </div>
67 </div> 67 </div>
68 </section> 68 </section>
69 <section class="numbers"> 69 <section class="numbers">
70 <div class="container"> 70 <div class="container">
71 <div class="numbers__body"> 71 <div class="numbers__body">
72 @include('TITLE_TEXT') 72 @include('TITLE_TEXT')
73 </div>
74 </div>
75 </section>
76 <!--<section class="vacancies">
77 <div class="container">
78 <div class="title"><h4>Новые вакансии</h4></div>
79 <div class="vacancies__body">
80 <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a>
81 <div class="vacancies__list">
82 _if ($categories->count())
83 _foreach ($categories as $cat)
84 <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item">
85 <span style="border-color:#F4C4C2">
86 <b> $cat->name }}</b>
87 <i>Вакансий: <span> $cat->cnt }}</span></i>
88 </span>
89 </a>
90 _endforeach 73 </div>
91 _else 74 </div>
92 Тут пока нет никаких вакансий 75 </section>
93 _endif 76 <!--<section class="vacancies">
94 </div> 77 <div class="container">
95 </div> 78 <div class="title"><h4>Новые вакансии</h4></div>
96 </div> 79 <div class="vacancies__body">
97 </section>--> 80 <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a>
98 81 <div class="vacancies__list">
99 <main class="main"> 82 _if ($categories->count())
100 <div class="container"> 83 _foreach ($categories as $cat)
101 <div class="main__vacancies"> 84 <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item">
102 <h2 class="main__vacancies-title">Категории вакансий</h2> 85 <span style="border-color:#F4C4C2">
103 <div class="vacancies__body"> 86 <b> $cat->name }}</b>
104 <div class="vacancies__list" id="block_ajax" name="block_ajax"> 87 <i>Вакансий: <span> $cat->cnt }}</span></i>
105 @foreach($Main_Job as $key => $it_main) 88 </span>
106 <div class="vacancies__list-col"> 89 </a>
107 @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) 90 _endforeach
108 </div> 91 _else
109 @endforeach 92 Тут пока нет никаких вакансий
110 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> 93 _endif
111 </div> 94 </div>
112 </div> 95 </div>
113 </div> 96 </div>
114 </div> 97 </section>-->
115 </main> 98
116 99 <main class="main">
117 <section class="employer"> 100 <div class="container">
118 <div class="container"> 101 <div class="main__vacancies">
119 <div class="title"><h4>Работодатели</h4></div> 102 <h2 class="main__vacancies-title">Категории вакансий</h2>
120 <!--<div class="swiper js-employer-swiper"> 103 <div class="vacancies__body">
121 <div class="swiper-wrapper"> 104 <div class="vacancies__list" id="block_ajax" name="block_ajax">
122 <div class="swiper-slide"> 105 @foreach($Main_Job as $key => $it_main)
123 <div class="employer__item"> 106 <div class="vacancies__list-col">
124 <a href="#"> 107 @include('block_real_new', ['it_main' => $it_main, 'category' => $key])
125 <img src="images/logos/1.jpg" alt=""> 108 </div>
126 </a> 109 @endforeach
127 <a href="#"> 110 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])-->
128 <img src="images/logos/5.jpg" alt=""> 111 </div>
129 </a> 112 </div>
130 <a href="#"> 113 </div>
131 <img src="images/logos/9.jpg" alt=""> 114 </div>
132 </a> 115 </main>
133 <a href="#"> 116
134 <img src="images/logos/13.jpg" alt=""> 117 <section class="employer">
135 </a> 118 <div class="container">
136 <a href="#"> 119 <div class="title"><h4>Работодатели</h4></div>
137 <img src="images/logos/17.jpg" alt=""> 120 <!--<div class="swiper js-employer-swiper">
138 </a> 121 <div class="swiper-wrapper">
139 </div> 122 <div class="swiper-slide">
140 </div> 123 <div class="employer__item">
141 <div class="swiper-slide"> 124 <a href="#">
142 <div class="employer__item"> 125 <img src="images/logos/1.jpg" alt="">
143 <a href="#"> 126 </a>
144 <img src="images/logos/2.jpg" alt=""> 127 <a href="#">
145 </a> 128 <img src="images/logos/5.jpg" alt="">
146 <a href="#"> 129 </a>
147 <img src="images/logos/6.jpg" alt=""> 130 <a href="#">
148 </a> 131 <img src="images/logos/9.jpg" alt="">
149 <a href="#"> 132 </a>
150 <img src="images/logos/10.jpg" alt=""> 133 <a href="#">
151 </a> 134 <img src="images/logos/13.jpg" alt="">
152 <a href="#"> 135 </a>
153 <img src="images/logos/14.jpg" alt=""> 136 <a href="#">
154 </a> 137 <img src="images/logos/17.jpg" alt="">
155 <a href="#"> 138 </a>
156 <img src="images/logos/18.jpg" alt=""> 139 </div>
157 </a> 140 </div>
158 </div> 141 <div class="swiper-slide">
159 </div> 142 <div class="employer__item">
160 <div class="swiper-slide"> 143 <a href="#">
161 <div class="employer__item"> 144 <img src="images/logos/2.jpg" alt="">
162 <a href="#"> 145 </a>
163 <img src="images/logos/3.jpg" alt=""> 146 <a href="#">
164 </a> 147 <img src="images/logos/6.jpg" alt="">
165 <a href="#"> 148 </a>
166 <img src="images/logos/7.jpg" alt=""> 149 <a href="#">
167 </a> 150 <img src="images/logos/10.jpg" alt="">
168 <a href="#"> 151 </a>
169 <img src="images/logos/11.jpg" alt=""> 152 <a href="#">
170 </a> 153 <img src="images/logos/14.jpg" alt="">
171 <a href="#"> 154 </a>
172 <img src="images/logos/15.jpg" alt=""> 155 <a href="#">
173 </a> 156 <img src="images/logos/18.jpg" alt="">
174 <a href="#"> 157 </a>
175 <img src="images/logos/19.jpg" alt=""> 158 </div>
176 </a> 159 </div>
177 </div> 160 <div class="swiper-slide">
178 </div> 161 <div class="employer__item">
179 <div class="swiper-slide"> 162 <a href="#">
180 <div class="employer__item"> 163 <img src="images/logos/3.jpg" alt="">
181 <a href="#"> 164 </a>
182 <img src="images/logos/4.jpg" alt=""> 165 <a href="#">
183 </a> 166 <img src="images/logos/7.jpg" alt="">
184 <a href="#"> 167 </a>
185 <img src="images/logos/8.jpg" alt=""> 168 <a href="#">
186 </a> 169 <img src="images/logos/11.jpg" alt="">
187 <a href="#"> 170 </a>
188 <img src="images/logos/12.jpg" alt=""> 171 <a href="#">
189 </a> 172 <img src="images/logos/15.jpg" alt="">
190 <a href="#"> 173 </a>
191 <img src="images/logos/16.jpg" alt=""> 174 <a href="#">
192 </a> 175 <img src="images/logos/19.jpg" alt="">
193 <a href="#"> 176 </a>
194 <img src="images/logos/20.jpg" alt=""> 177 </div>
195 </a> 178 </div>
196 </div> 179 <div class="swiper-slide">
197 </div> 180 <div class="employer__item">
198 </div> 181 <a href="#">
199 </div>--> 182 <img src="images/logos/4.jpg" alt="">
200 <!--<div class="employer__body"> 183 </a>
201 <a href="#"> 184 <a href="#">
202 <img src="images/logos/1.jpg" alt=""> 185 <img src="images/logos/8.jpg" alt="">
203 </a> 186 </a>
204 <a href="#"> 187 <a href="#">
205 <img src="images/logos/2.jpg" alt=""> 188 <img src="images/logos/12.jpg" alt="">
206 </a> 189 </a>
207 <a href="#"> 190 <a href="#">
208 <img src="images/logos/3.jpg" alt=""> 191 <img src="images/logos/16.jpg" alt="">
209 </a> 192 </a>
210 <a href="#"> 193 <a href="#">
211 <img src="images/logos/4.jpg" alt=""> 194 <img src="images/logos/20.jpg" alt="">
212 </a> 195 </a>
213 <a href="#"> 196 </div>
214 <img src="images/logos/5.jpg" alt=""> 197 </div>
215 </a> 198 </div>
216 <a href="#"> 199 </div>-->
217 <img src="images/logos/6.jpg" alt=""> 200 <!--<div class="employer__body">
218 </a> 201 <a href="#">
219 <a href="#"> 202 <img src="images/logos/1.jpg" alt="">
220 <img src="images/logos/7.jpg" alt=""> 203 </a>
221 </a> 204 <a href="#">
222 <a href="#"> 205 <img src="images/logos/2.jpg" alt="">
223 <img src="images/logos/8.jpg" alt=""> 206 </a>
224 </a> 207 <a href="#">
225 <a href="#"> 208 <img src="images/logos/3.jpg" alt="">
226 <img src="images/logos/9.jpg" alt=""> 209 </a>
227 </a> 210 <a href="#">
228 <a href="#"> 211 <img src="images/logos/4.jpg" alt="">
229 <img src="images/logos/10.jpg" alt=""> 212 </a>
230 </a> 213 <a href="#">
231 <a href="#"> 214 <img src="images/logos/5.jpg" alt="">
232 <img src="images/logos/11.jpg" alt=""> 215 </a>
233 </a> 216 <a href="#">
234 <a href="#"> 217 <img src="images/logos/6.jpg" alt="">
235 <img src="images/logos/12.jpg" alt=""> 218 </a>
236 </a> 219 <a href="#">
237 <a href="#"> 220 <img src="images/logos/7.jpg" alt="">
238 <img src="images/logos/13.jpg" alt=""> 221 </a>
239 </a> 222 <a href="#">
240 <a href="#"> 223 <img src="images/logos/8.jpg" alt="">
241 <img src="images/logos/14.jpg" alt=""> 224 </a>
242 </a> 225 <a href="#">
243 <a href="#"> 226 <img src="images/logos/9.jpg" alt="">
244 <img src="images/logos/15.jpg" alt=""> 227 </a>
245 </a> 228 <a href="#">
246 <a href="#"> 229 <img src="images/logos/10.jpg" alt="">
247 <img src="images/logos/16.jpg" alt=""> 230 </a>
248 </a> 231 <a href="#">
249 <a href="#"> 232 <img src="images/logos/11.jpg" alt="">
250 <img src="images/logos/17.jpg" alt=""> 233 </a>
251 </a> 234 <a href="#">
252 <a href="#"> 235 <img src="images/logos/12.jpg" alt="">
253 <img src="images/logos/18.jpg" alt=""> 236 </a>
254 </a> 237 <a href="#">
255 <a href="#"> 238 <img src="images/logos/13.jpg" alt="">
256 <img src="images/logos/19.jpg" alt=""> 239 </a>
257 </a> 240 <a href="#">
258 <a href="#"> 241 <img src="images/logos/14.jpg" alt="">
259 <img src="images/logos/20.jpg" alt=""> 242 </a>
260 </a> 243 <a href="#">
261 </div>--> 244 <img src="images/logos/15.jpg" alt="">
262 245 </a>
263 <div class="employer__body"> 246 <a href="#">
264 @if ($employers->count()) 247 <img src="images/logos/16.jpg" alt="">
265 @foreach($employers as $emp) 248 </a>
266 @if (!empty($emp->employer->logo)) 249 <a href="#">
267 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 250 <img src="images/logos/17.jpg" alt="">
268 <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> 251 </a>
269 </a> 252 <a href="#">
270 @else 253 <img src="images/logos/18.jpg" alt="">
271 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 254 </a>
272 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> 255 <a href="#">
273 </a> 256 <img src="images/logos/19.jpg" alt="">
274 @endif 257 </a>
275 @endforeach 258 <a href="#">
276 @else 259 <img src="images/logos/20.jpg" alt="">
277 <h5>Тут нет никаких записей</h5> 260 </a>
278 @endif 261 </div>-->
279 </div> 262
280 <!--if ($employers->count()) 263 <div class="employer__body">
281 php 264 @if ($employers->count())
282 $rec = 0; 265 @foreach($employers as $emp)
283 $count = $employers->count(); 266 @if (!empty($emp->employer->logo))
284 267 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
285 endphp 268 <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}">
286 269 </a>
287 foreach($employers as $emp) 270 @else
288 php $rec++ endphp 271 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
289 if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) 272 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}">
290 <div class="swiper-slide"> 273 </a>
291 <div class="employer__item"> 274 @endif
292 endif 275 @endforeach
293 if (!empty($emp->employer->logo)) 276 @else
294 <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> 277 <h5>Тут нет никаких записей</h5>
295 <img src=" asset(Storage::url($emp->employer->logo)) }}" alt=" $emp->employer->name_company }}"> 278 @endif
296 </a> 279 </div>
297 else 280 <!--if ($employers->count())
298 <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> 281 php
299 <img src=" asset('images/logo_emp.png') }}" alt=" $emp->employer->name_company }}"> 282 $rec = 0;
300 </a> 283 $count = $employers->count();
301 endif 284
302 if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) 285 endphp
303 </div> 286
304 </div> 287 foreach($employers as $emp)
305 endif 288 php $rec++ endphp
306 endforeach 289 if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17))
307 else 290 <div class="swiper-slide">
308 <h5>Тут нет никаких записей</h5> 291 <div class="employer__item">
309 endif--> 292 endif
310 </div> 293 if (!empty($emp->employer->logo))
311 <div class="swiper-pagination"></div> 294 <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}">
312 </div> 295 <img src=" asset(Storage::url($emp->employer->logo)) }}" alt=" $emp->employer->name_company }}">
313 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> 296 </a>
314 </div> 297 else
315 </section> 298 <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}">
316 <section class="about"> 299 <img src=" asset('images/logo_emp.png') }}" alt=" $emp->employer->name_company }}">
317 <div class="container"> 300 </a>
318 <div class="about__wrapper"> 301 endif
319 <div class="title about__title"><h4>О нас</h4></div> 302 if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count))
320 <div class="about__body"> 303 </div>
321 <div class="about__line"></div> 304 </div>
322 <div class="about__item"> 305 endif
323 <b>Для работодателей</b> 306 endforeach
324 <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие 307 else
325 сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> 308 <h5>Тут нет никаких записей</h5>
326 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> 309 endif-->
327 </div> 310 </div>
328 <div class="about__item"> 311 <div class="swiper-pagination"></div>
329 <b>Для сотрудников</b> 312 </div>
330 <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и 313 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a>
331 СНГ ищут сотрудников через наши ресурсы</span> 314 </div>
332 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> 315 </section>
333 </div> 316 <section class="about">
334 </div> 317 <div class="container">
335 </div> 318 <div class="about__wrapper">
336 </div> 319 <div class="title about__title"><h4>О нас</h4></div>
337 </section> 320 <div class="about__body">
338 321 <div class="about__line"></div>
339 @if ($news->count()) 322 <div class="about__item">
340 <section class="news"> 323 <b>Для работодателей</b>
341 <div class="container"> 324 <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие
342 <div class="news__toper"> 325 сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span>
343 <div class="title"><h4>Новости и статьи</h4></div> 326 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a>
344 <div class="navs"> 327 </div>
345 <button class="js-news-swiper-button-prev"> 328 <div class="about__item">
346 <svg class="rotate180"> 329 <b>Для сотрудников</b>
347 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 330 <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и
348 </svg> 331 СНГ ищут сотрудников через наши ресурсы</span>
349 </button> 332 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a>
350 <button class="js-news-swiper-button-next"> 333 </div>
351 <svg> 334 </div>
352 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 335 </div>
353 </svg> 336 </div>
354 </button> 337 </section>
355 </div> 338
356 </div> 339 @if ($news->count())
357 340 <section class="news">
358 <div class="swiper js-news-swiper"> 341 <div class="container">
359 <div class="swiper-wrapper"> 342 <div class="news__toper">
360 343 <div class="title"><h4>Новости и статьи</h4></div>
361 @foreach ($news as $new) 344 <div class="navs">
362 <div class="swiper-slide"> 345 <button class="js-news-swiper-button-prev">
363 <div class="news__item"> 346 <svg class="rotate180">
364 @if (empty($new->image)) 347 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
365 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> 348 </svg>
366 @else 349 </button>
367 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> 350 <button class="js-news-swiper-button-next">
368 @endif 351 <svg>
369 <div class="news__item-body"> 352 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
370 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> 353 </svg>
371 <span class="news__item-title">{{ $new->title }}</span> 354 </button>
372 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> 355 </div>
373 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> 356 </div>
374 </div> 357
375 </div> 358 <div class="swiper js-news-swiper">
376 </div> 359 <div class="swiper-wrapper">
377 @endforeach 360
378 361 @foreach ($news as $new)
379 </div> 362 <div class="swiper-slide">
380 <div class="swiper-pagination"></div> 363 <div class="news__item">
381 </div> 364 @if (empty($new->image))
382 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> 365 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic">
383 366 @else
384 </div> 367 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic">
385 </section> 368 @endif
386 @endif 369 <div class="news__item-body">
387 370 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time>
388 <section class="info"> 371 <span class="news__item-title">{{ $new->title }}</span>
389 <div class="container"> 372 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span>
390 <img src="images/5.png" alt="" class="info__pic"> 373 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a>
391 <div class="info__body"> 374 </div>
392 <div class="title info__title"><h4>Мы в социальных сетях</h4></div> 375 </div>
393 <div class="info__item"> 376 </div>
394 <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о 377 @endforeach
395 новых вакансиях прямо на свой смартфон</div> 378
396 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> 379 </div>
397 <svg> 380 <div class="swiper-pagination"></div>
398 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 381 </div>
399 </svg> 382 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a>
400 Телеграм 383
401 </a> 384 </div>
402 </div> 385 </section>
403 <div class="info__item"> 386 @endif
404 <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация 387
405 о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> 388 <section class="info">
406 <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> 389 <div class="container">
407 <svg> 390 <img src="images/5.png" alt="" class="info__pic">
408 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 391 <div class="info__body">
409 </svg> 392 <div class="title info__title"><h4>Мы в социальных сетях</h4></div>
410 ВКонтакте 393 <div class="info__item">
411 </a> 394 <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о
412 </div> 395 новых вакансиях прямо на свой смартфон</div>
413 </div> 396 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1">
414 </div> 397 <svg>
415 </section> 398 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
416 @endsection 399 </svg>
417 400 Телеграм
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 48
49 $(document).ready(function(){ 49 $(document).ready(function(){
50 var sel = $('#select2-sort_ajax-container'); 50 var sel = $('#select2-sort_ajax-container');
51 var key = getUrlParameter('sort'); 51 var key = getUrlParameter('sort');
52 if (key !=='') { 52 if (key !=='') {
53 console.log(key); 53 console.log(key);
54 switch (key) { 54 switch (key) {
55 case "default": sel.html('Сортировка (по умолчанию)'); break; 55 case "default": sel.html('Сортировка (по умолчанию)'); break;
56 case "name_up": sel.html('По имени (возрастание)'); break; 56 case "name_up": sel.html('По имени (возрастание)'); break;
57 case "name_down": sel.html('По дате (убывание)'); break; 57 case "name_down": sel.html('По дате (убывание)'); break;
58 case "created_at_up": sel.html('По дате (возрастание)'); break; 58 case "created_at_up": sel.html('По дате (возрастание)'); break;
59 case "created_at_down": sel.html('По дате (убывание)'); break; 59 case "created_at_down": sel.html('По дате (убывание)'); break;
60 } 60 }
61 61
62 } 62 }
63 }); 63 });
64 64
65 //end 65 //end
66 $(document).on('click', '.js_send_it_button', function() { 66 $(document).on('click', '.js_send_it_button', function() {
67 var this_ = $(this); 67 var this_ = $(this);
68 var code_user_id = this_.attr('data-uid'); 68 var code_user_id = this_.attr('data-uid');
69 var code_to_user_id = this_.attr('data-tuid'); 69 var code_to_user_id = this_.attr('data-tuid');
70 var code_vacancy = this_.attr('data-vacancy'); 70 var code_vacancy = this_.attr('data-vacancy');
71 var user_id = $('#send_user_id'); 71 var user_id = $('#send_user_id');
72 var to_user_id = $('#send_to_user_id'); 72 var to_user_id = $('#send_to_user_id');
73 var vacancy = $('#send_vacancy'); 73 var vacancy = $('#send_vacancy');
74 74
75 console.log('Клик на кнопки...'); 75 console.log('Клик на кнопки...');
76 76
77 user_id.val(code_user_id); 77 user_id.val(code_user_id);
78 to_user_id.val(code_to_user_id); 78 to_user_id.val(code_to_user_id);
79 vacancy.val(code_vacancy); 79 vacancy.val(code_vacancy);
80 }); 80 });
81 </script> 81 </script>
82 @include('js.favorite-vacancy-45') 82 @include('js.favorite-vacancy-45')
83 @endsection 83 @endsection
84 84
85 @section('content') 85 @section('content')
86 <section class="thing"> 86 <section class="thing">
87 <div class="container"> 87 <div class="container">
88 <div class="thing__body"> 88 <div class="thing__body">
89 <ul class="breadcrumbs thing__breadcrumbs"> 89 <ul class="breadcrumbs thing__breadcrumbs">
90 <li><a href="{{ route('index') }}">Главная</a></li> 90 <li><a href="{{ route('index') }}">Главная</a></li>
91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
93 </ul> 93 </ul>
94 @if ($company[0]->oficial_status == 1) 94 @if ($company[0]->oficial_status == 1)
95 <div class="thing__badge"> 95 <div class="thing__badge">
96 <svg> 96 <svg>
97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
98 </svg> 98 </svg>
99 Компания проверена 99 Компания проверена
100 </div> 100 </div>
101 @endif 101 @endif
102 102
103 @if (!empty($company[0]->logo)) 103 @if (!empty($company[0]->logo))
104 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 104 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
105 @else 105 @else
106 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 106 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
107 @endif 107 @endif
108 108
109 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 109 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
110 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 110 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
111 <div class="thing__buttons"> 111 <div class="thing__buttons">
112 <button type="button" class="button"> 112 <button type="button" class="button">
113 <svg> 113 <svg>
114 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 114 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
115 </svg> 115 </svg>
116 {{ $company[0]->ads->count() }} вакансии 116 {{ $company[0]->ads->count() }} вакансии
117 </button> 117 </button>
118 @if ($user_id == 0) 118 @if ($user_id == 0)
119 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 119 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
120 Написать сообщение 120 Написать сообщение
121 </a> 121 </a>
122 @else 122 @else
123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
124 Написать сообщение 124 Написать сообщение
125 </a> 125 </a>
126 @endif 126 @endif
127 </div> 127 </div>
128 </div> 128 </div>
129 </div> 129 </div>
130 </section> 130 </section>
131 <main class="main"> 131 <main class="main">
132 <div class="container"> 132 <div class="container">
133 <div class="main__employer-page"> 133 <div class="main__employer-page">
134 <h2 class="main__employer-page-title">О компании</h2> 134 <h2 class="main__employer-page-title">О компании</h2>
135 <div class="main__employer-page-info"> 135 <div class="main__employer-page-info">
136 <div class="main__employer-page-item"> 136 <div class="main__employer-page-item">
137 <b>Адрес компании</b> 137 <b>Адрес компании</b>
138 <span> 138 <span>
139 {{ $company[0]->address }} 139 {{ $company[0]->address }}
140 </span> 140 </span>
141 </div> 141 </div>
142 <div class="main__employer-page-item"> 142 <div class="main__employer-page-item">
143 <b>Сайт</b> 143 <b>Сайт</b>
144 <span> 144 <span>
145 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 145 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
146 </span> 146 </span>
147 </div> 147 </div>
148 <div class="main__employer-page-item"> 148 <div class="main__employer-page-item">
149 <b>Почта</b> 149 <b>Почта</b>
150 <span> 150 <span>
151 <a href="mailto:">{{ $company[0]->email }}</a> 151 <a href="mailto:">{{ $company[0]->email }}</a>
152 </span> 152 </span>
153 </div> 153 </div>
154 <div class="main__employer-page-item"> 154 <div class="main__employer-page-item">
155 <b>Телефон</b> 155 <b>Телефон</b>
156 <span> 156 <span>
157 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 157 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
158 </span> 158 </span>
159 </div> 159 </div>
160 </div> 160 </div>
161 161
162 <div class="main__employer-page-item"> 162 <div class="main__employer-page-item">
163 <b>Описание</b> 163 <b>Описание</b>
164 <span> 164 <span>
165 {!! $company[0]->text !!} 165 {!! $company[0]->text !!}
166 </span> 166 </span>
167 </div> 167 </div>
168 168
169 <div> 169 <div>
170 170
171 <div class="main__employer-page-tabs"> 171 <div class="main__employer-page-tabs">
172 <button type="button" class="main__employer-page-tabs-item active" 172 <button type="button" class="main__employer-page-tabs-item active"
173 data-tab="1">Флот</button> 173 data-tab="1">Флот</button>
174 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 174 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
175 </div> 175 </div>
176 176
177 <div class="main__employer-page-body"> 177 <div class="main__employer-page-body">
178 <div class="main__employer-page-body-item showed" data-body="1"> 178 <div class="main__employer-page-body-item showed" data-body="1">
179 <div class="main__employer-page-one"> 179 <div class="main__employer-page-one">
180 @if ($company[0]->flots->count()) 180 @if ($company[0]->flots->count())
181 @foreach ($company[0]->flots as $flot) 181 @foreach ($company[0]->flots as $flot)
182 <a href="" class="main__employer-page-one-item"> 182 <a href="" class="main__employer-page-one-item">
183 @if (!empty($flot->image)) 183 @if (!empty($flot->image))
184 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 184 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
185 @else 185 @else
186 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 186 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
187 @endif 187 @endif
188 <b>{{ $flot->name }}</b> 188 <b>{{ $flot->name }}</b>
189 <b>{{ $flot->region }}</b> 189 <b>{{ $flot->region }}</b>
190 <span><i>DWT</i> {{ $flot->DWT }}</span> 190 <span><i>DWT</i> {{ $flot->DWT }}</span>
191 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span> 191 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span>
192 <span><i>IMO</i> {{ $flot->IMO }}</span> 192 <span><i>IMO</i> {{ $flot->IMO }}</span>
193 <span>{{ $flot->power }}</span> 193 <span>{{ $flot->power }}</span>
194 </a> 194 </a>
195 @endforeach 195 @endforeach
196 @endif 196 @endif
197 </div> 197 </div>
198 </div> 198 </div>
199 199
200 <div class="main__employer-page-body-item" data-body="2"> 200 <div class="main__employer-page-body-item" data-body="2">
201 <div class="main__employer-page-two"> 201 <div class="main__employer-page-two">
202 @foreach ($ads as $job) 202 @foreach ($ads as $job)
203 <div class="main__employer-page-two-item"> 203 <div class="main__employer-page-two-item">
204 <div class="main__employer-page-two-item-toper"> 204 <div class="main__employer-page-two-item-toper">
205 @if (!empty($company[0]->logo)) 205 @if (!empty($company[0]->logo))
206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
207 @else 207 @else
208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
209 @endif 209 @endif
210 <span>{{ $job->name }}</span> 210 <span>{{ $company[0]->name_company }}</span>
211 </div> 211 </div>
212 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>--> 212 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
213 <div class="main__employer-page-two-item-text"> 213 <div class="main__employer-page-two-item-text">
214 @if ((isset($job->jobs)) && ($job->jobs->count())) 214 <h3>{{ $job->name }}</h3>
215 @foreach($job->jobs as $item) 215 <!--if ((isset($job->jobs)) && ($job->jobs->count()))
216 foreach($job->jobs as $item)
216 <a class="main__employer-page-two-item-text-name"> 217 <a class="main__employer-page-two-item-text-name">
217 {{ $item->name }} 218 { $item->name }}
218 </a> 219 </a>
219 @endforeach 220 endforeach
220 @endif 221 endif
222 -->
221 <span>Описание: 223 <span>Описание:
222 {!! $job->text !!} 224 {!! $job->text !!}
223 </span> 225 </span>
224 <!--<div class="main__employer-page-two-item-text-body"> 226 <!--<div class="main__employer-page-two-item-text-body">
225 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p> 227 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p>
226 <p>Контракт: $item->period }} мес.</p> 228 <p>Контракт: $item->period }} мес.</p>
227 </div>--> 229 </div>-->
228 </div> 230 </div>
229 <!--<div class="main__employer-page-two-item-text"> 231 <!--<div class="main__employer-page-two-item-text">
230 <div class="main__employer-page-two-item-text-name">Район работы</div> 232 <div class="main__employer-page-two-item-text-name">Район работы</div>
231 <div class="main__employer-page-two-item-text-body"> 233 <div class="main__employer-page-two-item-text-body">
232 <p> $item->region }}</p> 234 <p> $item->region }}</p>
233 </div> 235 </div>
234 </div> 236 </div>
235 <div class="main__employer-page-two-item-text"> 237 <div class="main__employer-page-two-item-text">
236 <div class="main__employer-page-two-item-text-name">Посадка</div> 238 <div class="main__employer-page-two-item-text-name">Посадка</div>
237 <div class="main__employer-page-two-item-text-body"> 239 <div class="main__employer-page-two-item-text-body">
238 <p> $item->start }}</p> 240 <p> $item->start }}</p>
239 !! $item->description !!} 241 !! $item->description !!}
240 </div> 242 </div>
241 </div>--> 243 </div>-->
242 244
243 <!--<div class="main__employer-page-two-item-text"> 245 <!--<div class="main__employer-page-two-item-text">
244 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на: 246 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
245 </div> 247 </div>
246 <div class="main__employer-page-two-item-text-body"> 248 <div class="main__employer-page-two-item-text-body">
247 <a href="tel: $job->telephone }}"> $job->telephone }}</a> 249 <a href="tel: $job->telephone }}"> $job->telephone }}</a>
248 </div> 250 </div>
249 </div> 251 </div>
250 <div class="main__employer-page-two-item-text"> 252 <div class="main__employer-page-two-item-text">
251 <div class="main__employer-page-two-item-text-name">Анкеты присылать на 253 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
252 почту: 254 почту:
253 </div> 255 </div>
254 <div class="main__employer-page-two-item-text-body"> 256 <div class="main__employer-page-two-item-text-body">
255 <a href="mailto: $job->email }}"> $job->email }}</a> 257 <a href="mailto: $job->email }}"> $job->email }}</a>
256 </div> 258 </div>
257 </div>--> 259 </div>-->
258 260
259 @if ((isset($job->jobs)) && ($job->jobs->count())) 261 @if ((isset($job->jobs)) && ($job->jobs->count()))
260 <div class="main__employer-page-two-item-tags"> 262 <div class="main__employer-page-two-item-tags">
261 @foreach ($job->jobs as $item) 263 @foreach ($job->jobs as $item)
262 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 264 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
263 @endforeach 265 @endforeach
264 </div> 266 </div>
265 @endif 267 @endif
266 <div class="main__employer-page-two-item-buttons"> 268 <div class="main__employer-page-two-item-buttons">
267 269
268 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 270 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
269 class="button main__employer-page-two-item-button js_send_it_button">Оставить 271 class="button main__employer-page-two-item-button js_send_it_button">Оставить
270 отклик...</button> 272 отклик...</button>
271 273
272 <!--<a href="#" 274 <!--<a href="#"
273 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 275 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
274 </div> 276 </div>
275 <div class="main__employer-page-two-item-bottom"> 277 <div class="main__employer-page-two-item-bottom">
276 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 278 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
277 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}" 279 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
278 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}"> 280 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
279 <svg> 281 <svg>
280 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 282 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
281 </svg> 283 </svg>
282 </button> 284 </button>
283 </div> 285 </div>
284 </div> 286 </div>
285 @endforeach 287 @endforeach
286 288
287 <div style="margin-top: 20px"> 289 <div style="margin-top: 20px">
288 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }} 290 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
289 </div> 291 </div>
290 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 292 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
291 <span>Показать ещё</span> 293 <span>Показать ещё</span>
292 <span>Скрыть</span> 294 <span>Скрыть</span>
293 </button>--> 295 </button>-->
294 </div> 296 </div>
295 </div> 297 </div>
296 </div> 298 </div>
297 </div> 299 </div>
298 </div> 300 </div>
299 </div> 301 </div>
300 </main> 302 </main>
301 @endsection 303 @endsection
302 304
resources/views/list_vacancies.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script> 8 <script>
9 console.log('Test system'); 9 console.log('Test system');
10 $(document).on('change', '#jobs', function() { 10 $(document).on('change', '#jobs', function() {
11 var val = $(this).val(); 11 var val = $(this).val();
12 var main_oskar = $('#main_ockar'); 12 var main_oskar = $('#main_ockar');
13 var ti_head = $('#title_head'); 13 var ti_head = $('#title_head');
14 14
15 console.log('Code='+val); 15 console.log('Code='+val);
16 console.log('Click change...'); 16 console.log('Click change...');
17 $.ajax({ 17 $.ajax({
18 type: "GET", 18 type: "GET",
19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
20 data: "job="+val, 20 data: "job="+val,
21 success: function (data) { 21 success: function (data) {
22 console.log('Выбор сделан!'); 22 console.log('Выбор сделан!');
23 23
24 main_oskar.html(data); 24 main_oskar.html(data);
25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
26 }, 26 },
27 headers: { 27 headers: {
28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
29 }, 29 },
30 error: function (data) { 30 error: function (data) {
31 data = JSON.stringify(data); 31 data = JSON.stringify(data);
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 35
36 if ((val == '') || (val == '0')) { 36 if ((val == '') || (val == '0')) {
37 title_head.html('Все категории'); 37 title_head.html('Все категории');
38 } else { 38 } else {
39 $.ajax({ 39 $.ajax({
40 type: "GET", 40 type: "GET",
41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", 41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
42 data: "job=" + val +"&title=1", 42 data: "job=" + val +"&title=1",
43 success: function (data) { 43 success: function (data) {
44 44
45 console.log(data); 45 console.log(data);
46 }, 46 },
47 47
48 headers: { 48 headers: {
49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
50 }, 50 },
51 51
52 error: function (data) { 52 error: function (data) {
53 data = JSON.stringify(data); 53 data = JSON.stringify(data);
54 console.log('Error: ' + data); 54 console.log('Error: ' + data);
55 } 55 }
56 }); 56 });
57 57
58 } 58 }
59 }); 59 });
60 60
61 $(document).on('click', '.js_send_it_button', function() { 61 $(document).on('click', '.js_send_it_button', function() {
62 var this_ = $(this); 62 var this_ = $(this);
63 var code_user_id = this_.attr('data-uid'); 63 var code_user_id = this_.attr('data-uid');
64 var code_to_user_id = this_.attr('data-tuid'); 64 var code_to_user_id = this_.attr('data-tuid');
65 var code_vacancy = this_.attr('data-vacancy'); 65 var code_vacancy = this_.attr('data-vacancy');
66 var user_id = $('#_user_id'); 66 var user_id = $('#_user_id');
67 var to_user_id = $('#_to_user_id'); 67 var to_user_id = $('#_to_user_id');
68 var vacancy = $('#_vacancy'); 68 var vacancy = $('#_vacancy');
69 69
70 console.log('Клик на кнопки...'); 70 console.log('Клик на кнопки...');
71 71
72 user_id.val(code_user_id); 72 user_id.val(code_user_id);
73 to_user_id.val(code_to_user_id); 73 to_user_id.val(code_to_user_id);
74 vacancy.val(code_vacancy); 74 vacancy.val(code_vacancy);
75 }); 75 });
76 76
77 $(document).on('click', '.js_send_for_emp', function() { 77 $(document).on('click', '.js_send_for_emp', function() {
78 var this_ = $(this); 78 var this_ = $(this);
79 var code_user_id = this_.attr('data-uid'); 79 var code_user_id = this_.attr('data-uid');
80 var code_to_user_id = this_.attr('data-tuid'); 80 var code_to_user_id = this_.attr('data-tuid');
81 var code_vacancy = this_.attr('data-vacancy'); 81 var code_vacancy = this_.attr('data-vacancy');
82 var user_id = $('#send_user_id'); 82 var user_id = $('#send_user_id');
83 var to_user_id = $('#send_to_user_id'); 83 var to_user_id = $('#send_to_user_id');
84 var vacancy = $('#send_vacancy'); 84 var vacancy = $('#send_vacancy');
85 85
86 console.log('code_to_user_id='+code_to_user_id); 86 console.log('code_to_user_id='+code_to_user_id);
87 console.log('code_user_id='+code_user_id); 87 console.log('code_user_id='+code_user_id);
88 console.log('code_vacancy='+code_vacancy); 88 console.log('code_vacancy='+code_vacancy);
89 console.log('Клик на кнопке...'); 89 console.log('Клик на кнопке...');
90 90
91 user_id.val(code_user_id); 91 user_id.val(code_user_id);
92 to_user_id.val(code_to_user_id); 92 to_user_id.val(code_to_user_id);
93 vacancy.val(code_vacancy); 93 vacancy.val(code_vacancy);
94 }); 94 });
95 95
96 $(document).on('change', '#sort_ajax', function() { 96 $(document).on('change', '#sort_ajax', function() {
97 var this_ = $(this); 97 var this_ = $(this);
98 var val_ = this_.val(); 98 var val_ = this_.val();
99 console.log('sort items '+val_); 99 console.log('sort items '+val_);
100 100
101 $.ajax({ 101 $.ajax({
102 type: "GET", 102 type: "GET",
103 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 103 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
104 data: "sort="+val_+"&block=1", 104 data: "sort="+val_+"&block=1",
105 success: function (data) { 105 success: function (data) {
106 console.log('Выбор сортировки'); 106 console.log('Выбор сортировки');
107 console.log(data); 107 console.log(data);
108 $('#main_ockar').html(data); 108 $('#main_ockar').html(data);
109 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 109 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
110 }, 110 },
111 headers: { 111 headers: {
112 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 112 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
113 }, 113 },
114 error: function (data) { 114 error: function (data) {
115 data = JSON.stringify(data); 115 data = JSON.stringify(data);
116 console.log('Error: ' + data); 116 console.log('Error: ' + data);
117 } 117 }
118 }); 118 });
119 }); 119 });
120 120
121 121
122 122
123 $(document).ready(function(){ 123 $(document).ready(function(){
124 var sel = $('#select2-sort_ajax-container'); 124 var sel = $('#select2-sort_ajax-container');
125 var key = getUrlParameter('sort'); 125 var key = getUrlParameter('sort');
126 console.log(sel); 126 console.log(sel);
127 console.log(key); 127 console.log(key);
128 128
129 if (key !=='') { 129 if (key !=='') {
130 console.log(key); 130 console.log(key);
131 switch (key) { 131 switch (key) {
132 case "default": sel.html('Сортировка (по умолчанию)'); break; 132 case "default": sel.html('Сортировка (по умолчанию)'); break;
133 case "name_up": sel.html('По имени (возрастание)'); break; 133 case "name_up": sel.html('По имени (возрастание)'); break;
134 case "name_down": sel.html('По дате (убывание)'); break; 134 case "name_down": sel.html('По дате (убывание)'); break;
135 case "created_at_up": sel.html('По дате (возрастание)'); break; 135 case "created_at_up": sel.html('По дате (возрастание)'); break;
136 case "created_at_down": sel.html('По дате (убывание)'); break; 136 case "created_at_down": sel.html('По дате (убывание)'); break;
137 } 137 }
138 138
139 } 139 }
140 }); 140 });
141 </script> 141 </script>
142 @include('js.favorite-vacancy-45') 142 @include('js.favorite-vacancy-45')
143 @endsection 143 @endsection
144 @section('content') 144 @section('content')
145 <section class="thing"> 145 <section class="thing">
146 <div class="container"> 146 <div class="container">
147 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> 147 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
148 <ul class="breadcrumbs thing__breadcrumbs"> 148 <ul class="breadcrumbs thing__breadcrumbs">
149 <li><a href="{{ route('index') }}">Главная</a></li> 149 <li><a href="{{ route('index') }}">Главная</a></li>
150 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 150 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
151 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 151 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
152 </ul> 152 </ul>
153 <h1 class="thing__title">Вакансии</h1> 153 <h1 class="thing__title">Вакансии</h1>
154 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 154 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
155 существующих финансовых и административных условий.</p> 155 существующих финансовых и административных условий.</p>
156 <div class="select select_search thing__select"> 156 <div class="select select_search thing__select">
157 <div class="select__icon"> 157 <div class="select__icon">
158 <svg> 158 <svg>
159 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 159 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
160 </svg> 160 </svg>
161 </div> 161 </div>
162 <select class="js-select2" id="jobs" name="jobs"> 162 <select class="js-select2" id="jobs" name="jobs">
163 <option value="0" selected>Выберите должность</option> 163 <option value="0" selected>Выберите должность</option>
164 @if ($Job_title->count()) 164 @if ($Job_title->count())
165 @foreach($Job_title as $JT) 165 @foreach($Job_title as $JT)
166 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 166 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
167 @endforeach 167 @endforeach
168 @endif 168 @endif
169 </select> 169 </select>
170 </div> 170 </div>
171 </form> 171 </form>
172 </div> 172 </div>
173 </section> 173 </section>
174 <main class="main"> 174 <main class="main">
175 <div class="container"> 175 <div class="container">
176 <div class="main__vacancies" > 176 <div class="main__vacancies" >
177 @if (isset($Name_categori[0]->name)) 177 @if (isset($Name_categori[0]->name))
178 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> 178 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2>
179 @else 179 @else
180 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 180 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
181 @endif 181 @endif
182 <div class="filters main__vacancies-filters"> 182 <div class="filters main__vacancies-filters">
183 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> 183 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
184 <div class="filters__body"> 184 <div class="filters__body">
185 <div class="select filters__select"> 185 <div class="select filters__select">
186 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 186 <select class="js-select2" id="sort_ajax" name="sort_ajax">
187 <option value="default">Сортировка (по умолчанию)</option> 187 <option value="default">Сортировка (по умолчанию)</option>
188 <option value="name_up">По имени (возрастание)</option> 188 <option value="name_up">По имени (возрастание)</option>
189 <option value="name_down">По имени (убывание)</option> 189 <option value="name_down">По имени (убывание)</option>
190 <option value="created_at_up">По дате (возрастание)</option> 190 <option value="created_at_up">По дате (возрастание)</option>
191 <option value="created_at_down">По дате (убывание)</option> 191 <option value="created_at_down">По дате (убывание)</option>
192 </select> 192 </select>
193 </div> 193 </div>
194 </div> 194 </div>
195 </div> 195 </div>
196 196
197 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 197 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
198 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 198 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
199 199
200 @foreach ($Query as $Q) 200 @foreach ($Query as $Q)
201 @foreach ($Reclama as $Rec) 201 @foreach ($Reclama as $Rec)
202 @if ($Rec->position == $i) 202 @if ($Rec->position == $i)
203 <div class="main__vacancies-thing"> 203 <div class="main__vacancies-thing">
204 @if (!empty($Rec->image)) 204 @if (!empty($Rec->image))
205 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 205 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
206 @else 206 @else
207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
208 @endif 208 @endif
209 <div class="main__vacancies-thing-body"> 209 <div class="main__vacancies-thing-body">
210 <h2>{{ $Rec->title }}</h2> 210 <h2>{{ $Rec->title }}</h2>
211 <div class="main__vacancies-thing-scroll"> 211 <div class="main__vacancies-thing-scroll">
212 {!! $Rec->text !!} 212 {!! $Rec->text !!}
213 </div> 213 </div>
214 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 214 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
215 </div> 215 </div>
216 </div> 216 </div>
217 @endif 217 @endif
218 @endforeach 218 @endforeach
219 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> 219 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
220 220
221 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 221 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
222 <svg> 222 <svg>
223 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 223 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
224 </svg> 224 </svg>
225 <span> 225 <span>
226 Вернуться к списку вакансий 123 226 Вернуться к списку вакансий 123
227 </span> 227 </span>
228 </a> 228 </a>
229 229
230 <div class="main__employer-page-two-item-toper"> 230 <div class="main__employer-page-two-item-toper">
231 @if (!empty($Q->employer->logo)) 231 @if (!empty($Q->employer->logo))
232 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 232 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
233 @else 233 @else
234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
235 @endif 235 @endif
236 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 236 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span>
237 </div> 237 </div>
238 238
239 <div class="main__employer-page-two-item-text"> 239 <div class="main__employer-page-two-item-text">
240 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 240 <div class="main__employer-page-two-item-text-name">
241 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3>
242 </div>
243 <!--Судоходная компания ведет набор
241 специалистов на следующие должности:</div> 244 специалистов на следующие должности:</div>
242 <div class="main__employer-page-two-item-text-links"> 245 <div class="main__employer-page-two-item-text-links">
243 @if (isset($Q->jobs)) 246 if (isset($Q->jobs))
244 @foreach ($Q->jobs as $key => $j) 247 foreach ($Q->jobs as $key => $j)
245 <a>“{{ $j->name }}” <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)--> 248 <a>“{ $j->name }}” <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)-->
246 </a> 249 <!-- </a>
247 @endforeach 250 endforeach
248 @endif 251 endif
249 </div> 252 </div>-->
250 </div> 253 </div>
251 254
252 <div class="main__employer-page-two-item-text"> 255 <div class="main__employer-page-two-item-text">
253 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 256 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
254 <div class="main__employer-page-two-item-text-body"> 257 <div class="main__employer-page-two-item-text-body">
255 {!! $Q->text !!} 258 {!! $Q->text !!}
256 </div> 259 </div>
257 </div> 260 </div>
258 <!--<div class="main__employer-page-two-item-text"> 261 <!--<div class="main__employer-page-two-item-text">
259 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 262 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
260 <div class="main__employer-page-two-item-text-body"> 263 <div class="main__employer-page-two-item-text-body">
261 !! $Q->description !!} 264 !! $Q->description !!}
262 </div> 265 </div>
263 </div> 266 </div>
264 <div class="main__employer-page-two-item-text"> 267 <div class="main__employer-page-two-item-text">
265 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 268 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
266 <div class="main__employer-page-two-item-text-body"> 269 <div class="main__employer-page-two-item-text-body">
267 !! $Q->contacts_emails !!} 270 !! $Q->contacts_emails !!}
268 </div> 271 </div>
269 </div> 272 </div>
270 <div class="main__employer-page-two-item-text"> 273 <div class="main__employer-page-two-item-text">
271 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 274 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
272 <div class="main__employer-page-two-item-text-body"> 275 <div class="main__employer-page-two-item-text-body">
273 !! $Q->contacts_telephones !!} 276 !! $Q->contacts_telephones !!}
274 </div> 277 </div>
275 </div>--> 278 </div>-->
276 279
277 <div class="main__employer-page-two-item-tags"> 280 <div class="main__employer-page-two-item-tags">
278 @if (!empty($Q->jobs_code[0]->position_ship)) 281 @if (!empty($Q->jobs_code[0]->position_ship))
279 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 282 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
280 @else 283 @else
281 @if (isset($Q->jobs)) 284 @if (isset($Q->jobs))
282 @foreach ($Q->jobs as $key => $j) 285 @foreach ($Q->jobs as $key => $j)
283 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 286 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
284 @endforeach 287 @endforeach
285 @endif 288 @endif
286 @endif 289 @endif
287 </div> 290 </div>
288 <div class="main__employer-page-two-item-buttons"> 291 <div class="main__employer-page-two-item-buttons">
289 @guest 292 @guest
290 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 293 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
291 class="button main__employer-page-two-item-button">Откликнуться</button> 294 class="button main__employer-page-two-item-button">Откликнуться</button>
292 @else 295 @else
293 @if (App\Classes\StatusUser::Status()==1) 296 @if (App\Classes\StatusUser::Status()==1)
294 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 297 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
295 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button> 298 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
296 @else 299 @else
297 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 300 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
298 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 301 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
299 @endif 302 @endif
300 @endguest 303 @endguest
301 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 304 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
302 </div> 305 </div>
303 <div class="main__employer-page-two-item-bottom"> 306 <div class="main__employer-page-two-item-bottom">
304 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 307 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
305 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> 308 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
306 <svg> 309 <svg>
307 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 310 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
308 </svg> 311 </svg>
309 </button> 312 </button>
310 </div> 313 </div>
311 </div> 314 </div>
312 @php $i++ @endphp 315 @php $i++ @endphp
313 @endforeach 316 @endforeach
314 <div style="margin-top: 20px"> 317 <div style="margin-top: 20px">
315 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }} 318 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }}
316 </div><!-- конец --> 319 </div><!-- конец -->
317 320
318 </div> 321 </div>
319 </div> 322 </div>
320 </div> 323 </div>
321 </main> 324 </main>
322 @endsection 325 @endsection
323 326
resources/views/pages.blade.php
1 @extends('layout.frontend', ['title' => $page->name.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => $page->name.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 @endsection 4 @endsection
5 5
6 @section('content') 6 @section('content')
7 <section class="thing"> 7 <section class="thing">
8 <div class="container"> 8 <div class="container">
9 <div class="thing__body"> 9 <div class="thing__body">
10 <ul class="breadcrumbs thing__breadcrumbs"> 10 <ul class="breadcrumbs thing__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>{{ $page->name }}</b></li> 12 <li><b>{{ $page->name }}</b></li>
13 </ul> 13 </ul>
14 @isset($page->image) 14 @isset($page->image)
15 <img src=" {{ asset(Storage::url($page->image)) }}" alt="" class="thing__pic thing__pic_two"> 15 <img src=" {{ asset(Storage::url($page->image)) }}" alt="" class="thing__pic thing__pic_two">
16 @endif 16 @endif
17 <h1 class="thing__title">{{ $page->name }}</h1> 17 <h1 class="thing__title">{{ $page->name }}</h1>
18 <p class="thing__text">{!! $page->anons !!}</p> 18 <p class="thing__text">{!! $page->anons !!}</p>
19 @if ($slug == 'Usloviya-razmescheniya')
20 <div class="thing__buttons">
21 <a href="{{ route('shipping_companies') }}" class="button">Список компаний</a>
22 </div>
23 @endif
19 @if ($slug == 'Usloviya-razmescheniya') 24 </div>
20 <div class="thing__buttons"> 25 </div>
21 <a href="{{ route('shipping_companies') }}" class="button">Список компаний</a> 26 </section>
22 </div> 27 @if ($page->slug !== 'Usloviya-razmescheniya')
23 @endif 28 <main class="main">
24 </div> 29 <div class="container">
25 </div> 30 <div class="main__content">
26 </section> 31 <div class="main__content-item">
27 @if ($page->slug !== 'Usloviya-razmescheniya') 32 {!! $page->text !!}
28 <main class="main"> 33 </div>
29 <div class="container"> 34 </div>
30 <div class="main__content"> 35 </div>
31 <div class="main__content-item"> 36 </main>
32 {!! $page->text !!} 37 @else
33 </div> 38 <main class="main">
34 </div> 39 <div class="container">
35 </div> 40 <div class="main__cond">
36 </main> 41 <div class="main__cond-label">
37 @else 42 На рынке мы с 2020 года.
38 <main class="main"> 43 <br>Мы молодая компания, которой важно сделать хороший и востребованный продукт!
39 <div class="container"> 44 </div>
40 <div class="main__cond"> 45 <div>
41 <div class="main__cond-label"> 46 <h3>За это время нам удалось:</h3>
42 На рынке мы с 2020 года. 47 <ul class="main__cond-icons">
43 <br>Мы молодая компания, которой важно сделать хороший и востребованный продукт! 48 <li>
44 </div> 49 <span><img src="{{ asset('images/svg/1.svg') }}" alt=""></span>
45 <div> 50 Создать самое крупное сообщество Вконтакте по поиску работы на речноми морском флоте
46 <h3>За это время нам удалось:</h3> 51 </li>
47 <ul class="main__cond-icons"> 52 <li>
48 <li> 53 <span><img src="{{ asset('images/svg/2.svg') }}" alt=""></span>
49 <span><img src="{{ asset('images/svg/1.svg') }}" alt=""></span> 54 Создать самый крупный телеграм канал по поиску работы на речноми морском флоте
50 Создать самое крупное сообщество Вконтакте по поиску работы на речноми морском флоте 55 </li>
51 </li> 56 <li>
52 <li> 57 <span><img src="{{ asset('images/svg/3.svg') }}" alt=""></span>
53 <span><img src="{{ asset('images/svg/2.svg') }}" alt=""></span> 58 Создать действительно эффективную и удобную базу анкет
54 Создать самый крупный телеграм канал по поиску работы на речноми морском флоте 59 </li>
55 </li> 60 <li>
56 <li> 61 <span><img src="{{ asset('images/svg/4.svg') }}" alt=""></span>
57 <span><img src="{{ asset('images/svg/3.svg') }}" alt=""></span> 62 Разместить свою рекламу во многих учебных заведениях нашей страны. Колледжи,вузы, утц, медицинские центры охотно размещают нашу рекламу в своих заведениях
58 Создать действительно эффективную и удобную базу анкет 63 </li>
59 </li> 64 <li>
60 <li> 65 <span><img src="{{ asset('images/svg/5.svg') }}" alt=""></span>
61 <span><img src="{{ asset('images/svg/4.svg') }}" alt=""></span> 66 Подключить к нашему сервису более 120 судоходных компаний России
62 Разместить свою рекламу во многих учебных заведениях нашей страны. Колледжи,вузы, утц, медицинские центры охотно размещают нашу рекламу в своих заведениях 67 </li>
63 </li> 68 <li>
64 <li> 69 <span><img src="{{ asset('images/svg/6.svg') }}" alt=""></span>
65 <span><img src="{{ asset('images/svg/5.svg') }}" alt=""></span> 70 Оправдать доверие и ожидание, так как компании заключившие с нами договорв первый раз в 95% случаев остаются довольны сотрудничеством и продлевают договор
66 Подключить к нашему сервису более 120 судоходных компаний России 71 </li>
67 </li> 72 </ul>
68 <li> 73 </div>
69 <span><img src="{{ asset('images/svg/6.svg') }}" alt=""></span> 74 <div>
70 Оправдать доверие и ожидание, так как компании заключившие с нами договорв первый раз в 95% случаев остаются довольны сотрудничеством и продлевают договор 75 <h3>Форма обратной связи</h3>
71 </li> 76 <p>Все поля обязательны для заполнения.</p>
72 </ul> 77 <form class="callback main__cond-callback" method="POST" action="{{ route('form_feedback') }}">
73 </div> 78 @csrf
74 <div> 79 <div class="callback__body">
75 <h3>Форма обратной связи</h3> 80 <input type="text" class="input" name="name" id="name" placeholder="Ваше имя" value="{{ old('name') ?? '' }}" required="">
76 <p>Все поля обязательны для заполнения.</p> 81 @error('name')
77 <form class="callback main__cond-callback" method="POST" action="{{ route('form_feedback') }}"> 82 <span class="text-xs text-red-600">
78 @csrf 83 {{ $message }}
79 <div class="callback__body"> 84 </span>
80 <input type="text" class="input" name="name" id="name" placeholder="Ваше имя" value="{{ old('name') ?? '' }}" required=""> 85 @enderror
81 @error('name') 86 <input type="text" class="input" name="name_company" id="name_company" value="{{ old('name_company') ?? '' }}" placeholder="Название судоходной компании" required="">
82 <span class="text-xs text-red-600"> 87 @error('name_company')
83 {{ $message }} 88 <span class="text-xs text-red-600">
84 </span> 89 {{ $message }}
85 @enderror 90 </span>
86 <input type="text" class="input" name="name_company" id="name_company" value="{{ old('name_company') ?? '' }}" placeholder="Название судоходной компании" required=""> 91 @enderror
87 @error('name_company') 92 <input type="tel" class="input" name="telephone" id="telephone" value="{{ old('teelphone') ?? '' }}" placeholder="Телефон" required="">
88 <span class="text-xs text-red-600"> 93 @error('telephone')
89 {{ $message }} 94 <span class="text-xs text-red-600">
90 </span> 95 {{ $message }}
91 @enderror 96 </span>
92 <input type="tel" class="input" name="telephone" id="telephone" value="{{ old('teelphone') ?? '' }}" placeholder="Телефон" required=""> 97 @enderror
93 @error('telephone') 98 <input type="email" class="input" name="email" id="email" value="{{ old('email') ?? '' }}" placeholder="Электронная почта" required="">
94 <span class="text-xs text-red-600"> 99 @error('email')
95 {{ $message }} 100 <span class="text-xs text-red-600">
96 </span> 101 {{ $message }}
97 @enderror 102 </span>
98 <input type="email" class="input" name="email" id="email" value="{{ old('email') ?? '' }}" placeholder="Электронная почта" required=""> 103 @enderror
99 @error('email') 104 </div>
100 <span class="text-xs text-red-600"> 105 <textarea class="textarea callback__textarea" name="text" id="text" placeholder="Текст сообщения" required="">{{ old('text') ?? '' }}</textarea>
101 {{ $message }} 106 <div class="callback__bottom">
102 </span> 107 <label class="checkbox">
103 @enderror 108 <input type="checkbox" name="politik" id="politik" class="checkbox__input" required="">
104 </div> 109 <span class="checkbox__icon">
105 <textarea class="textarea callback__textarea" name="text" id="text" placeholder="Текст сообщения" required="">{{ old('text') ?? '' }}</textarea> 110 <svg>
106 <div class="callback__bottom"> 111 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
107 <label class="checkbox"> 112 </svg>
108 <input type="checkbox" name="politik" id="politik" class="checkbox__input" required=""> 113 </span>
109 <span class="checkbox__icon"> 114 <span class="checkbox__text">
110 <svg> 115 <span>
111 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 116 Я согласен(на) с
112 </svg> 117 <a href="{{ route('page', ['pages' => 'Politika-konfidencialnosti']) }}">Политикой конфиденциальности</a>
113 </span> 118 </span>
114 <span class="checkbox__text"> 119 </span>
115 <span> 120 @error('politik')
116 Я согласен(на) с 121 <span class="text-xs text-red-600">
117 <a href="{{ route('page', ['pages' => 'Politika-konfidencialnosti']) }}">Политикой конфиденциальности</a> 122 {{ $message }}
118 </span> 123 </span>
119 </span> 124 @enderror
120 @error('politik') 125 </label>
121 <span class="text-xs text-red-600"> 126 <button type="submit" class="button">Отправить</button>
122 {{ $message }} 127 </div>
123 </span> 128 </form>
124 @enderror 129 </div>
125 </label> 130 </div>
126 <button type="submit" class="button">Отправить</button> 131 </div>
127 </div> 132 </main>
128 </form> 133 @endif
129 </div> 134 </div>
130 </div> 135 @endsection
131 </div> 136
resources/views/vacance-item.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => $title]) 5 @extends('layout.frontend', ['title' => $title])
6 6
7 @section('scripts') 7 @section('scripts')
8 <!--include('js.favorite-vacancy')--> 8 <!--include('js.favorite-vacancy')-->
9 <script> 9 <script>
10 $(document).on('click', '.js_send_it_button', function() { 10 $(document).on('click', '.js_send_it_button', function() {
11 var this_ = $(this); 11 var this_ = $(this);
12 var code_user_id = this_.attr('data-uid'); 12 var code_user_id = this_.attr('data-uid');
13 var code_to_user_id = this_.attr('data-tuid'); 13 var code_to_user_id = this_.attr('data-tuid');
14 var code_vacancy = this_.attr('data-vacancy'); 14 var code_vacancy = this_.attr('data-vacancy');
15 var user_id = $('#_user_id'); 15 var user_id = $('#_user_id');
16 var to_user_id = $('#_to_user_id'); 16 var to_user_id = $('#_to_user_id');
17 var vacancy = $('#_vacancy'); 17 var vacancy = $('#_vacancy');
18 18
19 console.log('Клик на кнопки...'); 19 console.log('Клик на кнопки...');
20 20
21 user_id.val(code_user_id); 21 user_id.val(code_user_id);
22 to_user_id.val(code_to_user_id); 22 to_user_id.val(code_to_user_id);
23 vacancy.val(code_vacancy); 23 vacancy.val(code_vacancy);
24 }); 24 });
25 </script> 25 </script>
26 <script> 26 <script>
27 $(document).on('click', '.js_send_for_emp', function() { 27 $(document).on('click', '.js_send_for_emp', function() {
28 var this_ = $(this); 28 var this_ = $(this);
29 var code_user_id = this_.attr('data-uid'); 29 var code_user_id = this_.attr('data-uid');
30 var code_to_user_id = this_.attr('data-tuid'); 30 var code_to_user_id = this_.attr('data-tuid');
31 var code_vacancy = this_.attr('data-vacancy'); 31 var code_vacancy = this_.attr('data-vacancy');
32 var user_id = $('#send_user_id'); 32 var user_id = $('#send_user_id');
33 var to_user_id = $('#send_to_user_id'); 33 var to_user_id = $('#send_to_user_id');
34 var vacancy = $('#send_vacancy'); 34 var vacancy = $('#send_vacancy');
35 35
36 console.log('code_to_user_id='+code_to_user_id); 36 console.log('code_to_user_id='+code_to_user_id);
37 console.log('code_user_id='+code_user_id); 37 console.log('code_user_id='+code_user_id);
38 console.log('code_vacancy='+code_vacancy); 38 console.log('code_vacancy='+code_vacancy);
39 console.log('Клик на кнопке...'); 39 console.log('Клик на кнопке...');
40 40
41 user_id.val(code_user_id); 41 user_id.val(code_user_id);
42 to_user_id.val(code_to_user_id); 42 to_user_id.val(code_to_user_id);
43 vacancy.val(code_vacancy); 43 vacancy.val(code_vacancy);
44 }); 44 });
45 </script> 45 </script>
46 @include('js.favorite-vacancy-45') 46 @include('js.favorite-vacancy-45')
47 @endsection 47 @endsection
48 48
49 @section('content') 49 @section('content')
50 <main class="main"> 50 <main class="main">
51 <div class="container"> 51 <div class="container">
52 <ul class="breadcrumbs main__breadcrumbs"> 52 <ul class="breadcrumbs main__breadcrumbs">
53 <li><a href="{{ route('index') }}">Главная</a></li> 53 <li><a href="{{ route('index') }}">Главная</a></li>
54 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 54 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
55 <li><b>{{ $title }}</b></li> 55 <li><b>{{ $title }}</b></li>
56 </ul> 56 </ul>
57 <div class="main__employer-page"> 57 <div class="main__employer-page">
58 58
59 @if (isset($Query[0]->employer)) 59 @if (isset($Query[0]->employer))
60 <h2 class="main__employer-page-title">О компании</h2> 60 <h2 class="main__employer-page-title">О компании</h2>
61 <div class="main__employer-page-two-item-toper"> 61 <div class="main__employer-page-two-item-toper">
62 @if (!empty($Query[0]->employer->logo)) 62 @if (!empty($Query[0]->employer->logo))
63 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 63 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
64 @else 64 @else
65 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 65 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
66 @endif 66 @endif
67 <span>{{ $Query[0]->employer->name_company }}</span> 67 <span>{{ $Query[0]->employer->name_company }}</span>
68 </div> 68 </div>
69 69
70 <div class="main__employer-page-info"> 70 <div class="main__employer-page-info">
71 <div class="main__employer-page-item"> 71 <div class="main__employer-page-item">
72 <b> Адрес компании</b> 72 <b> Адрес компании</b>
73 <span> 73 <span>
74 {{ $Query[0]->employer->address }} 74 {{ $Query[0]->employer->address }}
75 </span> 75 </span>
76 </div> 76 </div>
77 <div class="main__employer-page-item"> 77 <div class="main__employer-page-item">
78 <b>Сайт</b> 78 <b>Сайт</b>
79 <span> 79 <span>
80 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a> 80 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
81 </span> 81 </span>
82 </div> 82 </div>
83 <div class="main__employer-page-item"> 83 <div class="main__employer-page-item">
84 <b>Почта</b> 84 <b>Почта</b>
85 <span> 85 <span>
86 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a> 86 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
87 </span> 87 </span>
88 </div> 88 </div>
89 <div class="main__employer-page-item"> 89 <div class="main__employer-page-item">
90 <b>Телефон</b> 90 <b>Телефон</b>
91 <span> 91 <span>
92 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a> 92 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
93 </span> 93 </span>
94 </div> 94 </div>
95 </div> 95 </div>
96 @else 96 @else
97 <div class="main__employer-page-info"> 97 <div class="main__employer-page-info">
98 <div class="main__employer-page-item"> 98 <div class="main__employer-page-item">
99 <b>Ничего не найдено</b> 99 <b>Ничего не найдено</b>
100 <span> 100 <span>
101 Нет данных о компании 101 Нет данных о компании
102 </span> 102 </span>
103 </div> 103 </div>
104 </div> 104 </div>
105 @endif 105 @endif
106 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2> 106 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
107 <h3 class="main__employer-page-title_">Описание вакансии</h3> 107 <h3 class="main__employer-page-title_">Описание вакансии</h3>
108 108
109 </div> 109 </div>
110 110
111 @foreach ($Query as $Q) 111 @foreach ($Query as $Q)
112 <div class="main__vacancies-item-page main__employer-page-two-item"> 112 <div class="main__vacancies-item-page main__employer-page-two-item">
113 <div class="main__employer-page-two-item-text"> 113 <!--<div class="main__employer-page-two-item-text">
114 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 114 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
115 специалистов на следующие должности:</div> 115 специалистов на следующие должности:</div>
116 <div class="main__employer-page-two-item-text-links"> 116 <div class="main__employer-page-two-item-text-links">
117 @if (isset($Q->jobs)) 117 if (isset($Q->jobs))
118 @foreach ($Q->jobs as $key => $j) 118 foreach ($Q->jobs as $key => $j)
119 <a>“{{ $j->name }}” 119 <a>“{ $j->name }}”
120 <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)--> 120 <!-- з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)-->
121 </a> 121 <!--</a>
122 endforeach
123 endif
122 @endforeach 124 </div>
123 @endif 125 </div>-->
124 </div> 126 <div class="main__employer-page-two-item-text">
125 </div> 127 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
126 <div class="main__employer-page-two-item-text"> 128 <div class="main__employer-page-two-item-text-body">
127 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 129 {!! $Q->text !!}
128 <div class="main__employer-page-two-item-text-body"> 130 </div>
129 {!! $Q->text !!} 131 </div>
130 </div> 132 <!--<div class="main__employer-page-two-item-text">
131 </div> 133 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
132 <!--<div class="main__employer-page-two-item-text"> 134 <div class="main__employer-page-two-item-text-body">
133 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 135 !! $Q->description !!}
134 <div class="main__employer-page-two-item-text-body"> 136 </div>
135 !! $Q->description !!} 137 </div>
136 </div> 138 <div class="main__employer-page-two-item-text">
137 </div> 139 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
138 <div class="main__employer-page-two-item-text"> 140 <div class="main__employer-page-two-item-text-body">
139 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 141 !! $Q->contacts_emails !!}
140 <div class="main__employer-page-two-item-text-body"> 142 </div>
141 !! $Q->contacts_emails !!} 143 <div class="main__employer-page-two-item-text">
142 </div> 144 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
143 <div class="main__employer-page-two-item-text"> 145 <div class="main__employer-page-two-item-text-body">
144 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 146 !! $Q->contacts_telephones !!}
145 <div class="main__employer-page-two-item-text-body"> 147 </div>
146 !! $Q->contacts_telephones !!} 148 </div>-->
147 </div> 149
148 </div>--> 150 <div class="main__employer-page-two-item-tags">
149 151 @if (!empty($Q->jobs_code[0]->position_ship))
150 <div class="main__employer-page-two-item-tags"> 152 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
151 @if (!empty($Q->jobs_code[0]->position_ship)) 153 @else
152 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span> 154 @if (isset($Q->jobs))
153 @else 155 @foreach ($Q->jobs as $key => $j)
154 @if (isset($Q->jobs)) 156 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
155 @foreach ($Q->jobs as $key => $j) 157 @endforeach
156 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 158 @endif
157 @endforeach 159 @endif
158 @endif 160 </div>
159 @endif 161 <br>
160 </div> 162 <div class="main__employer-page-two-item-buttons">
161 <br> 163 @guest
162 <div class="main__employer-page-two-item-buttons"> 164 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
163 @guest 165 class="button main__employer-page-two-item-button">Откликнуться</button>
164 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 166 @else
165 class="button main__employer-page-two-item-button">Откликнуться</button> 167 @if (App\Classes\StatusUser::Status()==1)
166 @else 168 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
167 @if (App\Classes\StatusUser::Status()==1) 169 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
168 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 170 @else
169 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button> 171 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
170 @else 172 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
171 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 173 @endif
172 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 174 @endguest
173 @endif 175 </div>
174 @endguest 176 <div class="main__employer-page-two-item-bottom">
175 </div> 177 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
176 <div class="main__employer-page-two-item-bottom"> 178 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
177 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 179 <svg>
178 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> 180 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
179 <svg> 181 </svg>
180 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 182 </button>
181 </svg> 183 </div>
182 </button> 184
183 </div> 185 </div>
184 186
185 </div> 187 @endforeach
186 188
187 @endforeach 189 <a href="{{ redirect()->back()->getTargetUrl() }}" class="back">
188 190 <svg>
189 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back"> 191 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
190 <svg> 192 </svg>
191 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 193 <span>
192 </svg> 194 Вернуться к списку вакансий
193 <span> 195 </span>
194 Вернуться к списку вакансий 196 </a>
197 </div>
195 </span> 198 </main>
196 </a> 199 </div>
197 </main> 200 @endsection
198 </div> 201
resources/views/workers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 @include('js.favorite-vacancy-45') 4 @include('js.favorite-vacancy-45')
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 @include('workers.menu', ['item' => 3]) 20 @include('workers.menu', ['item' => 3])
21 </div> 21 </div>
22 22
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Избранные вакансии</h2> 25 <h2 class="title cabinet__title">Избранные вакансии</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <form class="search" action="{{ route('worker.colorado') }}" method="GET"> 30 <form class="search" action="{{ route('worker.colorado') }}" method="GET">
31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;"> 31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;">
32 <button type="submit" class="button">Найти</button> 32 <button type="submit" class="button">Найти</button>
33 <span> 33 <span>
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
36 </svg> 36 </svg>
37 </span> 37 </span>
38 </form> 38 </form>
39 </div> 39 </div>
40 <!--<div class="cabinet__filters-item"> 40 <!--<div class="cabinet__filters-item">
41 <div class="select"> 41 <div class="select">
42 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 42 <select class="js-select2" id="sort_ajax" name="sort_ajax">
43 <option value="default">Сортировка (по умолчанию)</option> 43 <option value="default">Сортировка (по умолчанию)</option>
44 <option value="name (asc)">По имени (возрастание)</option> 44 <option value="name (asc)">По имени (возрастание)</option>
45 <option value="name (desc)">По имени (убывание)</option> 45 <option value="name (desc)">По имени (убывание)</option>
46 <option value="created_at (asc)">По дате (возрастание)</option> 46 <option value="created_at (asc)">По дате (возрастание)</option>
47 <option value="created_at (desc)">По дате (убывание)</option> 47 <option value="created_at (desc)">По дате (убывание)</option>
48 </select> 48 </select>
49 </div> 49 </div>
50 </div>--> 50 </div>-->
51 </div> 51 </div>
52 @if ($Query->count()) 52 @if ($Query->count())
53 <div class="cabinet__vacs"> 53 <div class="cabinet__vacs">
54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;"> 54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;">
55 @foreach ($Query as $Q) 55 @foreach ($Query as $Q)
56 <div class="main__vacancies-item main__employer-page-two-item"> 56 <div class="main__vacancies-item main__employer-page-two-item">
57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back"> 57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
60 </svg> 60 </svg>
61 <span> 61 <span>
62 Вернуться к списку вакансий 62 Вернуться к списку вакансий
63 </span> 63 </span>
64 </a> 64 </a>
65 <div class="main__employer-page-two-item-toper"> 65 <div class="main__employer-page-two-item-toper">
66 @if (!empty($Q->employer->logo)) 66 @if (!empty($Q->employer->logo))
67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
68 @else 68 @else
69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic"> 69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic">
70 @endif 70 @endif
71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 71 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif </span>
72 </div> 72 </div>
73 <div class="main__employer-page-two-item-text"> 73 <div class="main__employer-page-two-item-text">
74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 74 <div class="main__employer-page-two-item-text-name">
75 <h2>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h2>
76 </div>
77 <!-- Судоходная компания ведет набор
75 специалистов на следующие должности:</div> 78 специалистов на следующие должности:</div>
76 <div class="main__employer-page-two-item-text-links"> 79 <div class="main__employer-page-two-item-text-links">
77 @if (isset($Q->jobs)) 80 if (isset($Q->jobs))
78 @foreach ($Q->jobs as $key => $j) 81 foreach ($Q->jobs as $key => $j)
79 <a>“{{ $j->name }}” 82 <a>“{ $j->name }}”
80 <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)--> 83 <!-- з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)-->
81 </a> 84 <!-- </a>
82 @endforeach 85 endforeach
86 endif
87 </div>-->
83 @endif 88 </div>
84 </div> 89 <div class="main__employer-page-two-item-text">
85 </div> 90 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
86 <div class="main__employer-page-two-item-text"> 91 <div class="main__employer-page-two-item-text-body">
87 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 92 {!! $Q->text !!}
88 <div class="main__employer-page-two-item-text-body"> 93 </div>
89 {!! $Q->text !!} 94 </div>
90 </div> 95 <!--<div class="main__employer-page-two-item-text">
91 </div> 96 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
92 <!--<div class="main__employer-page-two-item-text"> 97 <div class="main__employer-page-two-item-text-body">
93 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 98 !! $Q->description !!}
94 <div class="main__employer-page-two-item-text-body"> 99 </div>
95 !! $Q->description !!} 100 </div>
96 </div> 101 <div class="main__employer-page-two-item-text">
97 </div> 102 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
98 <div class="main__employer-page-two-item-text"> 103 <div class="main__employer-page-two-item-text-body">
99 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 104 !! $Q->contacts_emails !!}
100 <div class="main__employer-page-two-item-text-body"> 105 </div>
101 !! $Q->contacts_emails !!} 106 </div>
102 </div> 107 <div class="main__employer-page-two-item-text">
103 </div> 108 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
104 <div class="main__employer-page-two-item-text"> 109 <div class="main__employer-page-two-item-text-body">
105 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 110 !! $Q->contacts_telephones !!}
106 <div class="main__employer-page-two-item-text-body"> 111 </div>
107 !! $Q->contacts_telephones !!} 112 </div>-->
108 </div> 113 <div class="main__employer-page-two-item-tags">
109 </div>--> 114 @if (isset($Q->jobs))
110 <div class="main__employer-page-two-item-tags"> 115 @foreach ($Q->jobs as $key => $j)
111 @if (isset($Q->jobs)) 116 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
112 @foreach ($Q->jobs as $key => $j) 117 @endforeach
113 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 118 @endif
114 @endforeach 119 </div>
115 @endif 120 <div class="main__employer-page-two-item-buttons">
116 </div> 121 <!--<button type="button"
117 <div class="main__employer-page-two-item-buttons"> 122 class="button main__employer-page-two-item-button">Откликнуться</button>-->
118 <!--<button type="button" 123 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
119 class="button main__employer-page-two-item-button">Откликнуться</button>--> 124 </div>
120 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 125 <div class="main__employer-page-two-item-bottom">
121 </div> 126 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
122 <div class="main__employer-page-two-item-bottom"> 127 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>">
123 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div> 128 <svg>
124 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>"> 129 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
125 <svg> 130 </svg>
126 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 131 </button>
127 </svg> 132 </div>
128 </button> 133 </div>
129 </div> 134 @endforeach
130 </div> 135 <div style="margin-top: 20px">
131 @endforeach 136 {{ $Query->appends($_GET)->links('paginate') }}
132 <div style="margin-top: 20px"> 137 </div>
133 {{ $Query->appends($_GET)->links('paginate') }} 138 </div>
134 </div> 139 @else
135 </div> 140 <div class="notify">
136 @else 141 <svg>
137 <div class="notify"> 142 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
138 <svg> 143 </svg>
139 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 144 <span>Нет избранных вакансий</span>
140 </svg> 145 </div>
141 <span>Нет избранных вакансий</span> 146 @endif
142 </div> 147 </div>
143 @endif 148 </div>
144 </div> 149 </div>
145 </div> 150 </div>
146 </div> 151 </section>
147 </div> 152 </div>
148 </section> 153
149 </div> 154 @endsection
150 155