Commit c43fb80f6f267e367675c992381941d69a5c88a1
Exists in
master
uncommited files
Showing 3 changed files Inline Diff
app/Http/Controllers/Admin/EmployersController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Http\Requests\FlotRequest; | 6 | use App\Http\Requests\FlotRequest; |
7 | use App\Models\Ad_employer; | 7 | use App\Models\Ad_employer; |
8 | use App\Models\Answer; | 8 | use App\Models\Answer; |
9 | use App\Models\CategoryEmp; | 9 | use App\Models\CategoryEmp; |
10 | use App\Models\Employer; | 10 | use App\Models\Employer; |
11 | use App\Models\Flot; | 11 | use App\Models\Flot; |
12 | use App\Models\Static_ad; | 12 | use App\Models\Static_ad; |
13 | use App\Models\User; | 13 | use App\Models\User; |
14 | use Illuminate\Http\Request; | 14 | use Illuminate\Http\Request; |
15 | use Illuminate\Support\Facades\DB; | ||
16 | use Illuminate\Support\Facades\Storage; | 15 | use Illuminate\Support\Facades\Storage; |
17 | use Illuminate\Support\Facades\Validator; | 16 | use Illuminate\Support\Facades\Validator; |
18 | 17 | ||
19 | class EmployersController extends Controller | 18 | class EmployersController extends Controller |
20 | { | 19 | { |
21 | public function index(Request $request) { | 20 | public function index(Request $request) { |
22 | //$all_employer = User::where('is_worker', '0')->count(); | ||
23 | $all_public = -1; | ||
24 | $all_status = -1; | ||
25 | if ($request->ajax()) { | 21 | if ($request->ajax()) { |
26 | $user = User::find($request->id); | 22 | $user = User::find($request->id); |
27 | $request->offsetUnset('id'); | 23 | $request->offsetUnset('id'); |
28 | $user->update($request->all()); | 24 | $user->update($request->all()); |
29 | } | 25 | } |
30 | 26 | ||
31 | $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', | 27 | $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', |
32 | 'emp.code as code_id', 'emp.logo as emp_logo', 'emp.name_company as name_company', 'emp.*' | 28 | 'emp.code as code_id', 'emp.logo as emp_logo', 'emp.name_company as name_company', 'emp.*' |
33 | ]) | 29 | ]) |
34 | ->join('employers as emp','emp.user_id','users.id') | 30 | ->join('employers as emp','emp.user_id','users.id') |
35 | ->where('users.is_worker', '0') | 31 | ->where('users.is_worker', '0') |
36 | ->orderByDesc('emp.id') | 32 | ->orderByDesc('emp.id') |
37 | ->Realuser(); | 33 | ->Realuser(); |
38 | $all_employer = $users->count(); | 34 | $all_employer = $users->count(); |
39 | 35 | ||
40 | $all_public = Employer::where('status_hidden', '=', '0')-> | 36 | $all_public = Employer::where('status_hidden', '=', '0')-> |
41 | count(); | 37 | count(); |
42 | 38 | ||
43 | $all_status = Employer::where(function($query) { | 39 | $all_status = Employer::where(function($query) { |
44 | $query->Where('category', '=', 'Не оплачен') | 40 | $query->Where('category', '=', 'Не оплачен') |
45 | ->orWhere('category', '=', 'Не определен') | 41 | ->orWhere('category', '=', 'Не определен') |
46 | ->orWhere('category', '=', 'Согласование'); | 42 | ->orWhere('category', '=', 'Согласование'); |
47 | })->count(); | 43 | })->count(); |
48 | 44 | ||
49 | $find_cat = ""; | 45 | $find_cat = ""; |
50 | if (isset($request->category)) { | 46 | if (isset($request->category)) { |
51 | if ($request->category != 'Все категории') { | 47 | if ($request->category != 'Все категории') { |
52 | $users = $users->where('category', '=', $request->category); | 48 | $users = $users->where('category', '=', $request->category); |
53 | $find_cat = $request->category; | 49 | $find_cat = $request->category; |
54 | } | 50 | } |
55 | } | 51 | } |
56 | $find_key = ""; | 52 | $find_key = ""; |
57 | 53 | ||
58 | if (isset($request->find)) { | 54 | if (isset($request->find)) { |
59 | $find_key = $request->find; | 55 | $find_key = $request->find; |
60 | $users = $users->where(function($query) use($find_key) { | 56 | $users = $users->where(function($query) use($find_key) { |
61 | $query->Where('users.name', 'LIKE', "%$find_key%") | 57 | $query->where('users.name', 'LIKE', "%$find_key%") |
62 | ->orWhere('emp.email', 'LIKE', "%$find_key%") | 58 | ->orWhere('emp.email', 'LIKE', "%$find_key%") |
63 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); | 59 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%") |
60 | ->orWhere('emp.name_company', 'LIKE', "%$find_key%") | ||
61 | ; | ||
64 | }); | 62 | }); |
65 | } | 63 | } |
66 | 64 | ||
67 | //DB::enableQueryLog(); | ||
68 | $all_current = $users->count(); | 65 | $all_current = $users->count(); |
69 | $users = $users->paginate(15); | 66 | $users = $users->paginate(15); |
70 | //dd(DB::getQueryLog()); | ||
71 | 67 | ||
72 | $select_category = CategoryEmp::query()->active()->get(); | 68 | $select_category = CategoryEmp::query()->active()->get(); |
73 | 69 | ||
74 | if ($request->ajax()) { | 70 | if ($request->ajax()) { |
75 | return view('admin.employer.index_ajax', compact('users')); | 71 | return view('admin.employer.index_ajax', compact('users')); |
76 | } else { | 72 | } else { |
77 | return view('admin.employer.index', compact('users', | 73 | return view('admin.employer.index', compact('users', 'find_key', 'find_cat', 'all_employer', |
78 | 'find_key', | 74 | 'all_public', 'all_status', 'all_current', 'select_category' |
79 | 'find_cat', | 75 | )); |
80 | 'all_employer', | ||
81 | 'all_public', | ||
82 | 'all_status', | ||
83 | 'all_current', | ||
84 | 'select_category')); | ||
85 | } | 76 | } |
86 | } | 77 | } |
87 | 78 | ||
88 | public function comment_read(Employer $employer) { | 79 | public function comment_read(Employer $employer) { |
89 | return view('admin.employer.comment', compact('employer')); | 80 | return view('admin.employer.comment', compact('employer')); |
90 | } | 81 | } |
91 | 82 | ||
92 | // Форма обновления | 83 | // Форма обновления |
93 | public function form_update_employer(Employer $employer) { | 84 | public function form_update_employer(Employer $employer) { |
94 | // данные | 85 | // данные |
95 | $select_category = CategoryEmp::query()->active()->get(); | 86 | $select_category = CategoryEmp::query()->active()->get(); |
96 | $flots = Flot::query()->where('employer_id', '=', $employer->id)->get(); | 87 | $flots = Flot::query()->where('employer_id', '=', $employer->id)->get(); |
97 | return view('admin.employer.edit', compact('employer', 'select_category', 'flots')); | 88 | return view('admin.employer.edit', compact('employer', 'select_category', 'flots')); |
98 | } | 89 | } |
99 | 90 | ||
100 | public function edit_flot(Flot $flot, Employer $employer) { | 91 | public function edit_flot(Flot $flot, Employer $employer) { |
101 | return view('admin.flot.edit', compact('flot', 'employer')); | 92 | return view('admin.flot.edit', compact('flot', 'employer')); |
102 | } | 93 | } |
103 | 94 | ||
104 | public function add_flot(Employer $employer) { | 95 | public function add_flot(Employer $employer) { |
105 | return view('admin.flot.add', compact('employer')); | 96 | return view('admin.flot.add', compact('employer')); |
106 | } | 97 | } |
107 | 98 | ||
108 | public function save_add_flot(FlotRequest $request) { | 99 | public function save_add_flot(FlotRequest $request) { |
109 | $params = $request->all(); | 100 | $params = $request->all(); |
110 | $params['image'] = $request->file('image')->store("flot", 'public'); | 101 | $params['image'] = $request->file('image')->store("flot", 'public'); |
111 | Flot::create($params); | 102 | Flot::create($params); |
112 | return redirect()->route('admin.employer-profile', ['employer' => $params['employer_id']]) | 103 | return redirect()->route('admin.employer-profile', ['employer' => $params['employer_id']]) |
113 | ->with('success', 'Данные были успешно сохранены'); | 104 | ->with('success', 'Данные были успешно сохранены'); |
114 | } | 105 | } |
115 | 106 | ||
116 | public function delete_flot(Flot $flot, $employer_id) { | 107 | public function delete_flot(Flot $flot, $employer_id) { |
117 | $flot->delete(); | 108 | $flot->delete(); |
118 | return redirect()->route('admin.employer-profile', ['employer' => $employer_id]) | 109 | return redirect()->route('admin.employer-profile', ['employer' => $employer_id]) |
119 | ->with('success', 'Данные были успешно сохранены'); | 110 | ->with('success', 'Данные были успешно сохранены'); |
120 | } | 111 | } |
121 | 112 | ||
122 | 113 | ||
123 | public function edit_save_flot(Flot $flot, FlotRequest $request) { | 114 | public function edit_save_flot(Flot $flot, FlotRequest $request) { |
124 | $params = $request->all(); | 115 | $params = $request->all(); |
125 | 116 | ||
126 | if ($request->has('image')) { | 117 | if ($request->has('image')) { |
127 | if (!empty($flot->image)) { | 118 | if (!empty($flot->image)) { |
128 | Storage::delete($flot->image); | 119 | Storage::delete($flot->image); |
129 | } | 120 | } |
130 | $params['image'] = $request->file('image')->store("flot", 'public'); | 121 | $params['image'] = $request->file('image')->store("flot", 'public'); |
131 | } else { | 122 | } else { |
132 | if (!empty($flot->image)) $params['image'] = $flot->image; | 123 | if (!empty($flot->image)) $params['image'] = $flot->image; |
133 | } | 124 | } |
134 | 125 | ||
135 | $flot->update($params); | 126 | $flot->update($params); |
136 | 127 | ||
137 | return redirect()->route('admin.employer-profile', ['employer' => $params['employer_id']]) | 128 | return redirect()->route('admin.employer-profile', ['employer' => $params['employer_id']]) |
138 | ->with('success', 'Данные были успешно сохранены'); | 129 | ->with('success', 'Данные были успешно сохранены'); |
139 | 130 | ||
140 | } | 131 | } |
141 | 132 | ||
142 | public function update_employer(Employer $employer, Request $request) | 133 | public function update_employer(Employer $employer, Request $request) |
143 | { | 134 | { |
144 | $params = $request->all(); | 135 | $params = $request->all(); |
145 | unset($params['logo']); | 136 | unset($params['logo']); |
146 | unset($params['telephone']); | 137 | unset($params['telephone']); |
147 | unset($params['email']); | 138 | unset($params['email']); |
148 | unset($params['address']); | 139 | unset($params['address']); |
149 | unset($params['site']); | 140 | unset($params['site']); |
150 | unset($params['status_hidden']); | 141 | unset($params['status_hidden']); |
151 | unset($params['oficial_status']); | 142 | unset($params['oficial_status']); |
152 | unset($params['social_is']); | 143 | unset($params['social_is']); |
153 | unset($params['sending_is']); | 144 | unset($params['sending_is']); |
154 | unset($params['category']); | 145 | unset($params['category']); |
155 | unset($params['comment_admin']); | 146 | unset($params['comment_admin']); |
156 | 147 | ||
157 | $rules = [ | 148 | $rules = [ |
158 | 'name' => 'required|string|max:255', | 149 | 'name' => 'required|string|max:255', |
159 | ]; | 150 | ]; |
160 | 151 | ||
161 | $messages = [ | 152 | $messages = [ |
162 | 'required' => 'Укажите обязательное поле «:attribute»', | 153 | 'required' => 'Укажите обязательное поле «:attribute»', |
163 | 'confirmed' => 'Пароли не совпадают', | 154 | 'confirmed' => 'Пароли не совпадают', |
164 | 'email' => 'Введите корректный email', | 155 | 'email' => 'Введите корректный email', |
165 | 'min' => [ | 156 | 'min' => [ |
166 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 157 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
167 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 158 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
168 | ], | 159 | ], |
169 | 'max' => [ | 160 | 'max' => [ |
170 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 161 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
171 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 162 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
172 | ], | 163 | ], |
173 | ]; | 164 | ]; |
174 | 165 | ||
175 | $validator = Validator::make($params, $rules, $messages); | 166 | $validator = Validator::make($params, $rules, $messages); |
176 | 167 | ||
177 | if ($validator->fails()) { | 168 | if ($validator->fails()) { |
178 | return back()->withErrors($validator)->withInput(); //->route('admin.register') | 169 | return back()->withErrors($validator)->withInput(); //->route('admin.register') |
179 | 170 | ||
180 | } else { | 171 | } else { |
181 | 172 | ||
182 | //$user = User::find($employer->user_id); | 173 | //$user = User::find($employer->user_id); |
183 | $user_id = $employer->user_id; | 174 | $user_id = $employer->user_id; |
184 | $employer->telephone = $request->telephone; | 175 | $employer->telephone = $request->telephone; |
185 | $employer->email = $request->email; | 176 | $employer->email = $request->email; |
186 | $employer->address = $request->address; | 177 | $employer->address = $request->address; |
187 | $employer->site = $request->site; | 178 | $employer->site = $request->site; |
188 | $employer->text = $request->text; | 179 | $employer->text = $request->text; |
189 | $employer->status_hidden = $request->status_hidden; | 180 | $employer->status_hidden = $request->status_hidden; |
190 | $employer->oficial_status = $request->oficial_status; | 181 | $employer->oficial_status = $request->oficial_status; |
191 | $employer->social_is = $request->social_is; | 182 | $employer->social_is = $request->social_is; |
192 | $employer->sending_is = $request->sending_is; | 183 | $employer->sending_is = $request->sending_is; |
193 | $employer->category = $request->category; | 184 | $employer->category = $request->category; |
194 | $employer->comment_admin = $request->comment_admin; | 185 | $employer->comment_admin = $request->comment_admin; |
195 | 186 | ||
196 | if ($request->has('logo')) { | 187 | if ($request->has('logo')) { |
197 | if (!empty($employer->logo)) { | 188 | if (!empty($employer->logo)) { |
198 | Storage::delete($employer->logo); | 189 | Storage::delete($employer->logo); |
199 | } | 190 | } |
200 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); | 191 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); |
201 | } | 192 | } |
202 | $employer->save(); | 193 | $employer->save(); |
203 | 194 | ||
204 | $user = User::find($user_id); | 195 | $user = User::find($user_id); |
205 | $user->update($params); | 196 | $user->update($params); |
206 | 197 | ||
207 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) | 198 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) |
208 | ->with('success', 'Данные были успешно сохранены'); | 199 | ->with('success', 'Данные были успешно сохранены'); |
209 | } | 200 | } |
210 | } | 201 | } |
211 | 202 | ||
212 | // Удаление работодателя, вакансий и профиля юзера | 203 | // Удаление работодателя, вакансий и профиля юзера |
213 | public function delete_employer(Employer $employer, User $user) { | 204 | public function delete_employer(Employer $employer, User $user) { |
214 | try { | 205 | try { |
215 | if (!empty($employer)) { | 206 | if (!empty($employer)) { |
216 | if (!empty($employer->logo)) { | 207 | if (!empty($employer->logo)) { |
217 | Storage::delete($employer->logo); | 208 | Storage::delete($employer->logo); |
218 | } | 209 | } |
219 | 210 | ||
220 | foreach($employer->ads as $ad) { | 211 | foreach($employer->ads as $ad) { |
221 | $ads = Ad_employer::find($ad->id); | 212 | $ads = Ad_employer::find($ad->id); |
222 | $ads->employer_id = 2; | 213 | $ads->employer_id = 2; |
223 | $ads->is_remove = 1; | 214 | $ads->is_remove = 1; |
224 | $ads->save(); | 215 | $ads->save(); |
225 | } | 216 | } |
226 | 217 | ||
227 | $employer->delete(); | 218 | $employer->delete(); |
228 | } | 219 | } |
229 | } finally { | 220 | } finally { |
230 | $user->delete(); | 221 | $user->delete(); |
231 | } | 222 | } |
232 | 223 | ||
233 | return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе'); | 224 | return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе'); |
234 | } | 225 | } |
235 | 226 | ||
236 | // кабинет - отзывы о работодателе для модерации | 227 | // кабинет - отзывы о работодателе для модерации |
237 | public function answers(Request $request) { | 228 | public function answers(Request $request) { |
238 | if ($request->ajax()) { | 229 | if ($request->ajax()) { |
239 | $user = Answer::find($request->id); | 230 | $user = Answer::find($request->id); |
240 | $request->offsetUnset('id'); | 231 | $request->offsetUnset('id'); |
241 | $user->update($request->all()); | 232 | $user->update($request->all()); |
242 | } | 233 | } |
243 | 234 | ||
244 | $answers = Answer::query()->orderByDesc('id')->paginate(15); | 235 | $answers = Answer::query()->orderByDesc('id')->paginate(15); |
245 | 236 | ||
246 | if ($request->ajax()) { | 237 | if ($request->ajax()) { |
247 | return view('admin.answers.index_ajax', compact('answers')); | 238 | return view('admin.answers.index_ajax', compact('answers')); |
248 | } else { | 239 | } else { |
249 | return view('admin.answers.index', compact('answers')); | 240 | return view('admin.answers.index', compact('answers')); |
250 | } | 241 | } |
251 | } | 242 | } |
252 | 243 | ||
253 | // кабинет - статистика вакансий работодателя | 244 | // кабинет - статистика вакансий работодателя |
254 | public function static_ads(Request $request) { | 245 | public function static_ads(Request $request) { |
255 | $stat = Static_ad::with('ads'); | 246 | $stat = Static_ad::with('ads'); |
256 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); | 247 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); |
257 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); | 248 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); |
258 | if ($request->ajax()) { | 249 | if ($request->ajax()) { |
259 | if (isset($request->ad_employer_id)) | 250 | if (isset($request->ad_employer_id)) |
260 | if (!$request->ad_employer_id == "0") | 251 | if (!$request->ad_employer_id == "0") |
261 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); | 252 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); |
262 | if (isset($request->year_month)) { | 253 | if (isset($request->year_month)) { |
263 | if (!$request->year_month == "0") | 254 | if (!$request->year_month == "0") |
264 | $stat = $stat->Where('year_month', '=', $request->year_month); | 255 | $stat = $stat->Where('year_month', '=', $request->year_month); |
265 | } | 256 | } |
266 | } | 257 | } |
267 | 258 | ||
268 | $stat = $stat->OrderByDesc('year_month'); | 259 | $stat = $stat->OrderByDesc('year_month'); |
269 | $stat = $stat->paginate(15); | 260 | $stat = $stat->paginate(15); |
270 | 261 | ||
271 | if ($request->ajax()) | 262 | if ($request->ajax()) |
272 | return view('admin.static.index_ads_ajax', compact('stat')); | 263 | return view('admin.static.index_ads_ajax', compact('stat')); |
273 | else | 264 | else |
274 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); | 265 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); |
275 | } | 266 | } |
app/Http/Controllers/MainController.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\Mail\MailRegistration; | 7 | use App\Mail\MailRegistration; |
8 | use App\Mail\MailRepair; | 8 | use App\Mail\MailRepair; |
9 | use App\Models\Ad_employer; | 9 | use App\Models\Ad_employer; |
10 | use App\Models\Ad_jobs; | 10 | use App\Models\Ad_jobs; |
11 | use App\Models\Category; | 11 | use App\Models\Category; |
12 | use App\Models\Education; | 12 | use App\Models\Education; |
13 | use App\Models\employers_main; | 13 | use App\Models\employers_main; |
14 | use App\Models\Job_title; | 14 | use App\Models\Job_title; |
15 | use App\Models\Like_vacancy; | 15 | use App\Models\Like_vacancy; |
16 | use App\Models\Like_worker; | 16 | use App\Models\Like_worker; |
17 | use App\Models\News; | 17 | use App\Models\News; |
18 | use App\Models\Positions; | 18 | use App\Models\Positions; |
19 | use App\Models\reclame; | 19 | use App\Models\reclame; |
20 | use App\Models\User; | 20 | use App\Models\User; |
21 | use Illuminate\Http\Request; | 21 | use Illuminate\Http\Request; |
22 | use Illuminate\Support\Facades\Auth; | 22 | use Illuminate\Support\Facades\Auth; |
23 | use Illuminate\Support\Facades\DB; | 23 | use Illuminate\Support\Facades\DB; |
24 | use Illuminate\Support\Facades\Hash; | 24 | use Illuminate\Support\Facades\Hash; |
25 | use Illuminate\Support\Facades\Mail; | 25 | use Illuminate\Support\Facades\Mail; |
26 | use Illuminate\Support\Facades\Validator; | 26 | use Illuminate\Support\Facades\Validator; |
27 | use App\Models\PageContent; | 27 | use App\Models\PageContent; |
28 | use App\Enums\MainPageCounters; | 28 | use App\Enums\MainPageCounters; |
29 | 29 | ||
30 | class MainController extends Controller | 30 | class MainController extends Controller |
31 | { | 31 | { |
32 | // Главная страница публичной части | 32 | // Главная страница публичной части |
33 | public function index() { | 33 | public function index() { |
34 | $news = News::query()->orderByDesc('id')->limit(6)->get(); | 34 | $news = News::query()->orderByDesc('id')->limit(6)->get(); |
35 | 35 | ||
36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
38 | ->OrderByDesc('created_at') | 38 | ->OrderByDesc('created_at') |
39 | ->GroupBy('categories.id') | 39 | ->GroupBy('categories.id') |
40 | ->get(); | 40 | ->get(); |
41 | 41 | ||
42 | //$Position = Category::query()->where('is_remove', '=', '0')->get(); | ||
43 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> | 42 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> |
44 | where('is_bd', '=', '0')->orderBy('name')->get(); | 43 | where('is_bd', '=', '0')->orderBy('name')->get(); |
45 | 44 | ||
46 | /*$BigFlot = Array(); | ||
47 | foreach ($Position as $position) { | ||
48 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | ||
49 | orderBy('job_titles.sort')-> | ||
50 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
51 | where('position_ship', "$position->name")-> | ||
52 | groupby('job_title_id','position_ship')-> | ||
53 | get(); | ||
54 | } | ||
55 | $BigFlot = Array(); | ||
56 | foreach ($Position as $position) { | ||
57 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { | ||
58 | $query->OrderBy('sort'); | ||
59 | }])->whereHas('job_title', function ($query) use ($position) { | ||
60 | $query->where('position_id', $position->id); | ||
61 | })-> | ||
62 | distinct('job_title_id')-> | ||
63 | get(); | ||
64 | }*/ | ||
65 | /*$BigFlot = Array(); | ||
66 | foreach ($Position as $position) { | ||
67 | $BigFlot[$position->id] = DB::table('ad_jobs')-> | ||
68 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name, job_titles.position_id')-> | ||
69 | orderByDesc('job_titles.sort')-> | ||
70 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
71 | where('job_titles.position_id', $position->id)-> | ||
72 | groupby('job_title_id')-> | ||
73 | get(); | ||
74 | }*/ | ||
75 | $Data = DB::table('job_titles')-> | 45 | $Data = DB::table('job_titles')-> |
76 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> | 46 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> |
77 | where('categories.is_remove', '=', '0')-> | 47 | where('categories.is_remove', '=', '0')-> |
78 | where('job_titles.is_remove', '=', '0')-> | 48 | where('job_titles.is_remove', '=', '0')-> |
79 | where('job_titles.is_bd', '=' , '0')-> | 49 | where('job_titles.is_bd', '=' , '0')-> |
80 | leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> | 50 | leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> |
81 | join('categories', 'categories.id', '=', 'job_titles.position_id')-> | 51 | join('categories', 'categories.id', '=', 'job_titles.position_id')-> |
82 | groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> | 52 | groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> |
83 | orderByDesc('job_titles.sort')->get()->toArray(); | 53 | orderByDesc('job_titles.sort')->get()->toArray(); |
84 | 54 | ||
85 | $Main_Job = array(); | 55 | $Main_Job = array(); |
86 | $name_cat = ''; | 56 | $name_cat = ''; |
87 | foreach ($Data as $it) { | 57 | foreach ($Data as $it) { |
88 | $it_arr = (array)$it; | 58 | $it_arr = (array)$it; |
89 | if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; | 59 | if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; |
90 | $Main_Job[$name_cat][] = $it_arr; | 60 | $Main_Job[$name_cat][] = $it_arr; |
91 | } | 61 | } |
92 | 62 | ||
93 | $employers = employers_main::query()->with('employer')-> | 63 | $employers = employers_main::query()->with('employer')-> |
94 | whereHas('employer', function ($query) { | 64 | whereHas('employer', function ($query) { |
95 | $query->where('status_hidden', '=', '0'); | 65 | $query->where('status_hidden', '=', '0'); |
96 | })-> | 66 | })-> |
97 | orderBy('sort')->get(); | 67 | orderBy('sort')->get(); |
98 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); | 68 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); |
99 | 69 | ||
100 | $block_names = MainPageCounters::values();; | 70 | $block_names = MainPageCounters::values();; |
101 | $blocks_counters = PageContent::select('name', 'title', 'description', 'extra') | 71 | $blocks_counters = PageContent::select('name', 'title', 'description', 'extra') |
102 | ->whereIn('name', $block_names) | 72 | ->whereIn('name', $block_names) |
103 | ->orderBy('name', 'asc') | 73 | ->orderBy('name', 'asc') |
104 | ->get() | 74 | ->get() |
105 | ->keyBy('name') | 75 | ->keyBy('name') |
106 | ->toArray(); | 76 | ->toArray(); |
107 | 77 | ||
108 | return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters')); | 78 | return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters')); |
109 | } | 79 | } |
110 | 80 | ||
111 | public function search_vacancies(Request $request) { | 81 | public function search_vacancies(Request $request) { |
112 | if ($request->has('search')) { | 82 | if ($request->has('search')) { |
113 | $search = $request->get('search'); | 83 | $search = $request->get('search'); |
114 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); | 84 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); |
115 | if (isset($job_titles->id)) | 85 | if (isset($job_titles->id)) |
116 | if ($job_titles->id > 0) | 86 | if ($job_titles->id > 0) |
117 | return redirect()->route('vacancies', ['job' => $job_titles->id]); | 87 | return redirect()->route('vacancies', ['job' => $job_titles->id]); |
118 | } | 88 | } |
119 | } | 89 | } |
120 | 90 | ||
121 | // Лайк вакансии | 91 | // Лайк вакансии |
122 | public function like_vacancy(Request $request) { | 92 | public function like_vacancy(Request $request) { |
123 | $IP_address = RusDate::ip_addr_client(); | 93 | $IP_address = RusDate::ip_addr_client(); |
124 | 94 | ||
125 | if ($request->has('code_record')) { | 95 | if ($request->has('code_record')) { |
126 | if ($request->has('delete')) { | 96 | if ($request->has('delete')) { |
127 | $code = $request->get('code_record'); | 97 | $code = $request->get('code_record'); |
128 | $atomic_era = Like_vacancy::select('id')-> | 98 | $atomic_era = Like_vacancy::select('id')-> |
129 | where('code_record', '=', $code)->toSql(); | 99 | where('code_record', '=', $code)->toSql(); |
130 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); | 100 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); |
131 | 101 | ||
132 | } else { | 102 | } else { |
133 | $params = $request->all(); | 103 | $params = $request->all(); |
134 | $params['ip_address'] = $IP_address; | 104 | $params['ip_address'] = $IP_address; |
135 | Like_vacancy::create($params); | 105 | Like_vacancy::create($params); |
136 | } | 106 | } |
137 | } | 107 | } |
138 | } | 108 | } |
139 | 109 | ||
140 | // Лайк соискателю. | 110 | // Лайк соискателю. |
141 | public function like_worker(Request $request) { | 111 | public function like_worker(Request $request) { |
142 | $IP_address = RusDate::ip_addr_client(); | 112 | $IP_address = RusDate::ip_addr_client(); |
143 | 113 | ||
144 | if ($request->has('code_record')) { | 114 | if ($request->has('code_record')) { |
145 | if ($request->has('delete')) { | 115 | if ($request->has('delete')) { |
146 | $atomic_era = Like_worker::select('id')-> | 116 | $atomic_era = Like_worker::select('id')-> |
147 | where('code_record', '=', $request-> | 117 | where('code_record', '=', $request-> |
148 | get('code_record'))->first(); | 118 | get('code_record'))->first(); |
149 | 119 | ||
150 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); | 120 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); |
151 | 121 | ||
152 | return "Вот и результат удаления!"; | 122 | return "Вот и результат удаления!"; |
153 | 123 | ||
154 | } else { | 124 | } else { |
155 | $params = $request->all(); | 125 | $params = $request->all(); |
156 | $params['ip_address'] = $IP_address; | 126 | $params['ip_address'] = $IP_address; |
157 | Like_worker::create($params); | 127 | Like_worker::create($params); |
158 | } | 128 | } |
159 | } | 129 | } |
160 | } | 130 | } |
161 | 131 | ||
162 | public function vacancies(Request $request) { | 132 | public function vacancies(Request $request) { |
163 | //должности | 133 | //должности |
164 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> | 134 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> |
165 | where('is_bd', '=', '0')->orderByDesc('sort')-> | 135 | where('is_bd', '=', '0')->orderByDesc('sort')-> |
166 | orderBy('name')->get(); | 136 | orderBy('name')->get(); |
167 | 137 | ||
168 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 138 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
169 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') | 139 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') |
170 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 140 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
171 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); | 141 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); |
172 | 142 | ||
173 | //категории и вакансии | 143 | //категории и вакансии |
174 | if (($request->has('job')) && ($request->get('job') > 0)) { | 144 | if (($request->has('job')) && ($request->get('job') > 0)) { |
175 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); | 145 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); |
176 | } | 146 | } |
177 | 147 | ||
178 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); | 148 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); |
179 | 149 | ||
180 | //$Position = Category::query()->where('is_remove', '=', '0')->get(); | ||
181 | |||
182 | |||
183 | /*$BigFlot = Array(); | ||
184 | foreach ($Position as $position) { | ||
185 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | ||
186 | orderBy('job_titles.sort')-> | ||
187 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
188 | where('position_ship', "$position->name"); | ||
189 | if (($request->has('job')) && ($request->get('job') > 0)) { | ||
190 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); | ||
191 | } | ||
192 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); | ||
193 | $BigFlot[] = $War_flot; | ||
194 | }*/ | ||
195 | /* | ||
196 | $BigFlot = Array(); | ||
197 | foreach ($Position as $position) { | ||
198 | $WarFlot = DB::table('ad_jobs')-> | ||
199 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | ||
200 | orderByDesc('job_titles.sort')-> | ||
201 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
202 | where('job_titles.position_id', $position->id); | ||
203 | if (($request->has('job')) && ($request->get('job') > 0)) { | ||
204 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); | ||
205 | } | ||
206 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); | ||
207 | $BigFlot[] = $WarFlot; | ||
208 | } | ||
209 | */ | ||
210 | 150 | $Data = DB::table('job_titles')-> | |
211 | $Data = DB::table('job_titles')-> | 151 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> |
212 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> | 152 | where('categories.is_remove', '=', '0')-> |
213 | where('categories.is_remove', '=', '0')-> | 153 | where('job_titles.is_bd', '=' , '0')-> |
214 | where('job_titles.is_bd', '=' , '0')-> | 154 | where('job_titles.is_remove', '=', '0'); |
215 | where('job_titles.is_remove', '=', '0'); | 155 | if (($request->has('job')) && ($request->get('job') > 0)) { |
216 | if (($request->has('job')) && ($request->get('job') > 0)) { | 156 | $Data = $Data->where('job_title_id', $request->get('job')); |
217 | $Data = $Data->where('job_title_id', $request->get('job')); | 157 | } |
218 | } | 158 | $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> |
219 | $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> | 159 | join('categories', 'categories.id', '=', 'job_titles.position_id')-> |
220 | join('categories', 'categories.id', '=', 'job_titles.position_id')-> | 160 | groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> |
221 | groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> | 161 | orderByDesc('job_titles.sort')->get()->toArray(); |
222 | orderByDesc('job_titles.sort')->get()->toArray(); | 162 | |
223 | 163 | $Main_Job = array(); | |
224 | $Main_Job = array(); | 164 | $name_cat = ''; |
225 | $name_cat = ''; | 165 | foreach ($Data as $it) { |
226 | foreach ($Data as $it) { | 166 | $it_arr = (array)$it; |
227 | $it_arr = (array)$it; | 167 | if ($name_cat != $it_arr['catname']) |
228 | if ($name_cat != $it_arr['catname']) | 168 | $name_cat = $it_arr['catname']; |
229 | $name_cat = $it_arr['catname']; | 169 | $Main_Job[$name_cat][] = $it_arr; |
230 | $Main_Job[$name_cat][] = $it_arr; | 170 | } |
231 | } | 171 | |
232 | 172 | if ($request->ajax()) { | |
233 | if ($request->ajax()) { | 173 | return view('ajax.new_sky', compact('categories', 'Main_Job')); |
234 | return view('ajax.new_sky', compact('categories', 'Main_Job')); | 174 | } else { |
235 | } else { | 175 | return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); |
236 | return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); | 176 | } |
237 | } | 177 | } |
238 | } | 178 | |
239 | 179 | //Вакансии категория детальная | |
240 | //Вакансии категория детальная | 180 | public function list_vacancies(Category $categories, Request $request) { |
241 | public function list_vacancies(Category $categories, Request $request) { | 181 | if (isset(Auth()->user()->id)) |
242 | if (isset(Auth()->user()->id)) | 182 | $uid = Auth()->user()->id; |
243 | $uid = Auth()->user()->id; | 183 | else |
244 | else | 184 | $uid = 0; |
245 | $uid = 0; | 185 | |
246 | 186 | if ($request->get('job') == 0) | |
247 | if ($request->get('job') == 0) | 187 | $job_search = ''; |
248 | $job_search = ''; | 188 | else |
249 | else | 189 | $job_search = $request->get('job'); |
250 | $job_search = $request->get('job'); | 190 | |
251 | 191 | $Query = Ad_employer::with('jobs')-> | |
252 | $Query = Ad_employer::with('jobs')-> | 192 | with('cat')-> |
253 | with('cat')-> | 193 | with('employer')-> |
254 | with('employer')-> | 194 | whereHas('jobs_code', function ($query) use ($job_search) { |
255 | whereHas('jobs_code', function ($query) use ($job_search) { | 195 | if (!empty($job_search)) { |
256 | if (!empty($job_search)) { | 196 | $query->where('job_title_id', $job_search); |
257 | $query->where('job_title_id', $job_search); | 197 | } |
258 | } | 198 | })->select('ad_employers.*'); |
259 | })->select('ad_employers.*'); | 199 | |
260 | 200 | if (isset($categories->id) && ($categories->id > 0)) { | |
261 | if (isset($categories->id) && ($categories->id > 0)) { | 201 | $Query = $Query->where('category_id', '=', $categories->id); |
262 | $Query = $Query->where('category_id', '=', $categories->id); | 202 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); |
263 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); | 203 | } else { |
264 | } else { | 204 | $Name_categori = ''; |
265 | $Name_categori = ''; | 205 | } |
266 | } | 206 | |
267 | 207 | if ($request->get('sort')) { | |
268 | if ($request->get('sort')) { | 208 | $sort = $request->get('sort'); |
269 | $sort = $request->get('sort'); | 209 | switch ($sort) { |
270 | switch ($sort) { | 210 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; |
271 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; | 211 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; |
272 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; | 212 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
273 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 213 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
274 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 214 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
275 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 215 | default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; |
276 | default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; | 216 | } |
277 | } | 217 | } |
278 | } | 218 | |
279 | 219 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> | |
280 | $Job_title = Job_title::query()->where('is_remove', '=', '0')-> | 220 | where('is_bd', '=', '0')->orderByDesc('sort')-> |
281 | where('is_bd', '=', '0')->orderByDesc('sort')-> | 221 | orderBy('name')->get(); |
282 | orderBy('name')->get(); | 222 | |
283 | 223 | $Query_count = $Query->count(); | |
284 | $Query_count = $Query->count(); | 224 | |
285 | 225 | $Query = $Query->OrderByDesc('updated_at')->paginate(10); | |
286 | $Query = $Query->OrderByDesc('updated_at')->paginate(3); | 226 | |
287 | 227 | $Reclama = reclame::query()->get(); | |
288 | $Reclama = reclame::query()->get(); | 228 | |
289 | 229 | if ($request->ajax()) { | |
290 | if ($request->ajax()) { | 230 | if ($request->has('title')) { |
291 | if ($request->has('title')) { | 231 | return view('ajax.list_category', compact( |
292 | return view('ajax.list_category', compact( | 232 | 'Name_categori' |
293 | 'Name_categori' | 233 | )); |
294 | )); | 234 | } else { |
295 | } else { | 235 | return view('ajax.list_vacancies', compact('Query', |
296 | return view('ajax.list_vacancies', compact('Query', | 236 | 'Query_count', |
297 | 'Query_count', | 237 | 'Name_categori', |
298 | 'Name_categori', | 238 | 'Reclama', |
299 | 'Reclama', | 239 | 'categories', |
300 | 'categories', | 240 | 'Job_title', |
301 | 'Job_title', | 241 | 'uid')); |
302 | 'uid')); | 242 | } |
303 | } | 243 | } else { |
304 | } else { | 244 | //Вернуть все |
305 | //Вернуть все | 245 | return view('list_vacancies', compact('Query', |
306 | return view('list_vacancies', compact('Query', | 246 | 'Query_count', |
307 | 'Query_count', | 247 | 'Reclama', |
308 | 'Reclama', | 248 | 'Name_categori', |
309 | 'Name_categori', | 249 | 'categories', |
310 | 'categories', | 250 | 'Job_title', |
311 | 'Job_title', | 251 | 'uid')); |
312 | 'uid')); | 252 | } |
313 | } | 253 | } |
314 | } | 254 | |
315 | 255 | // Контакты | |
316 | // Контакты | 256 | public function contacts() { |
317 | public function contacts() { | 257 | return view('contacts'); |
318 | return view('contacts'); | 258 | } |
319 | } | 259 | |
320 | 260 | // Вход в личный кабинет | |
321 | // Вход в личный кабинет | 261 | public function input_login(Request $request) |
322 | public function input_login(Request $request) | 262 | { |
323 | { | 263 | $params = $request->all(); |
324 | $params = $request->all(); | 264 | |
325 | 265 | ||
326 | 266 | $rules = [ | |
327 | $rules = [ | 267 | 'email' => 'required|string|email', |
328 | 'email' => 'required|string|email', | 268 | 'password' => 'required|string|min:3|max:25', |
329 | 'password' => 'required|string|min:3|max:25', | 269 | ]; |
330 | ]; | 270 | |
331 | 271 | $messages = [ | |
332 | $messages = [ | 272 | 'required' => 'Укажите обязательное поле «:attribute»', |
333 | 'required' => 'Укажите обязательное поле «:attribute»', | 273 | 'email' => 'Введите корректный email', |
334 | 'email' => 'Введите корректный email', | 274 | 'min' => [ |
335 | 'min' => [ | 275 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
336 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 276 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
337 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 277 | ], |
338 | ], | 278 | 'max' => [ |
339 | 'max' => [ | 279 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
340 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 280 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
341 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 281 | ], |
342 | ], | 282 | ]; |
343 | ]; | 283 | $validator = Validator::make($request->all(), $rules, $messages); |
344 | $validator = Validator::make($request->all(), $rules, $messages); | 284 | if ($validator->fails()) { |
345 | if ($validator->fails()) { | 285 | if (Auth::check()) |
346 | if (Auth::check()) | 286 | $user_id = $request->user()->id; |
347 | $user_id = $request->user()->id; | 287 | else |
348 | else | 288 | $user_id = 0; |
349 | $user_id = 0; | 289 | |
350 | 290 | if ($user_id > 0) | |
351 | if ($user_id > 0) | 291 | return json_encode(Array("ERROR" => "Email или пароль невалидный!")); |
352 | return json_encode(Array("ERROR" => "Email или пароль невалидный!")); | 292 | else |
353 | else | 293 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); |
354 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); | 294 | } else { |
355 | } else { | 295 | $credentials = $request->only('email', 'password'); |
356 | $credentials = $request->only('email', 'password'); | 296 | |
357 | 297 | if (Auth::attempt($credentials, $request->has('remember'))) { | |
358 | if (Auth::attempt($credentials, $request->has('remember'))) { | 298 | |
359 | 299 | if (is_null(Auth::user()->email_verified_at)) { | |
360 | if (is_null(Auth::user()->email_verified_at)) { | 300 | Auth::logout(); |
361 | Auth::logout(); | 301 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); |
362 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); | 302 | } |
363 | } | 303 | |
364 | 304 | if (Auth::user()->is_worker) { | |
365 | if (Auth::user()->is_worker) { | 305 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); |
366 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); | 306 | } else { |
367 | } else { | 307 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); |
368 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); | 308 | } |
369 | } | 309 | |
370 | 310 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); | |
371 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); | 311 | //->route('index') |
372 | //->route('index') | 312 | //->with('success', 'Вы вошли в личный кабинет.'); |
373 | //->with('success', 'Вы вошли в личный кабинет.'); | 313 | } else { |
374 | } else { | 314 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); |
375 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); | 315 | } |
376 | } | 316 | } |
377 | } | 317 | } |
378 | } | 318 | |
379 | 319 | // Восстановление пароля | |
380 | // Восстановление пароля | 320 | public function repair_password(Request $request) { |
381 | public function repair_password(Request $request) { | 321 | $rules = [ |
382 | $rules = [ | 322 | 'email' => 'required|string|email', |
383 | 'email' => 'required|string|email', | 323 | ]; |
384 | ]; | 324 | |
385 | 325 | $messages = [ | |
386 | $messages = [ | 326 | 'required' => 'Укажите обязательное поле «:attribute»', |
387 | 'required' => 'Укажите обязательное поле «:attribute»', | 327 | 'email' => 'Введите корректный email', |
388 | 'email' => 'Введите корректный email', | 328 | 'min' => [ |
389 | 'min' => [ | 329 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
390 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 330 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
391 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 331 | ], |
392 | ], | 332 | 'max' => [ |
393 | 'max' => [ | 333 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
394 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 334 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
395 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 335 | ], |
396 | ], | 336 | ]; |
397 | ]; | 337 | |
398 | 338 | $validator = Validator::make($request->all(), $rules, $messages); | |
399 | $validator = Validator::make($request->all(), $rules, $messages); | 339 | |
400 | 340 | if ($validator->fails()) { | |
401 | if ($validator->fails()) { | 341 | return redirect()->back()->with('Error', "Email невалидный"); |
402 | return redirect()->back()->with('Error', "Email невалидный"); | 342 | } else { |
403 | } else { | 343 | $new_password = Tools::generator_id(10); |
404 | $new_password = Tools::generator_id(10); | 344 | $hash_password = Hash::make($new_password); |
405 | $hash_password = Hash::make($new_password); | 345 | $user = User::query()->where('email', $request->get('email'))->first(); |
406 | $user = User::query()->where('email', $request->get('email'))->first(); | 346 | $EditRec = User::find($user->id); |
407 | $EditRec = User::find($user->id); | 347 | $EditRec->password = $hash_password; |
408 | $EditRec->password = $hash_password; | 348 | $EditRec->save(); |
409 | $EditRec->save(); | 349 | |
410 | 350 | foreach ([$request->get('email')] as $recipient) { | |
411 | foreach ([$request->get('email')] as $recipient) { | 351 | Mail::to($recipient)->send(new MailRepair($new_password)); |
412 | Mail::to($recipient)->send(new MailRepair($new_password)); | 352 | } |
413 | } | 353 | return redirect()->route('index'); |
414 | return redirect()->route('index'); | 354 | |
415 | 355 | } | |
416 | } | 356 | |
417 | 357 | } | |
418 | } | 358 | |
419 | 359 | // Вывод новостей | |
420 | // Вывод новостей | 360 | public function news(Request $request) { |
421 | public function news(Request $request) { | 361 | $Query = News::query(); |
422 | $Query = News::query(); | 362 | if ($request->has('search')) { |
423 | if ($request->has('search')) { | 363 | $search = $request->get('search'); |
424 | $search = $request->get('search'); | 364 | $Query = $Query->where('title', 'LIKE', "%$search%")-> |
425 | $Query = $Query->where('title', 'LIKE', "%$search%")-> | 365 | orWhere('text', 'LIKE', "%$search%"); |
426 | orWhere('text', 'LIKE', "%$search%"); | 366 | } |
427 | } | 367 | |
428 | 368 | if ($request->ajax()) { | |
429 | if ($request->ajax()) { | 369 | if ($request->get('sort')) { |
430 | if ($request->get('sort')) { | 370 | $sort = $request->get('sort'); |
431 | $sort = $request->get('sort'); | 371 | switch ($sort) { |
432 | switch ($sort) { | 372 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; |
433 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; | 373 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; |
434 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; | 374 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
435 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 375 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
436 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 376 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
437 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 377 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
438 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 378 | } |
439 | } | 379 | } |
440 | } | 380 | } |
441 | } | 381 | $Query_count = $Query->count(); |
442 | $Query_count = $Query->count(); | 382 | $Query = $Query->paginate(6); |
443 | $Query = $Query->paginate(6); | 383 | |
444 | 384 | if ($request->ajax()) { | |
445 | if ($request->ajax()) { | 385 | return view('ajax.news-list', compact('Query', 'Query_count')); |
446 | return view('ajax.news-list', compact('Query', 'Query_count')); | 386 | } else { |
447 | } else { | 387 | return view('news-list', compact('Query', 'Query_count')); |
448 | return view('news-list', compact('Query', 'Query_count')); | 388 | } |
449 | } | 389 | } |
450 | } | 390 | |
451 | 391 | //Детальная новость | |
452 | //Детальная новость | 392 | public function detail_new(News $new) { |
453 | public function detail_new(News $new) { | 393 | // Наборка |
454 | // Наборка | 394 | $Query = News::query()->where('id', $new->id)->get(); |
455 | $Query = News::query()->where('id', $new->id)->get(); | 395 | $title = $Query[0]->title; |
456 | $title = $Query[0]->title; | 396 | $All_Query = News::query()->paginate(8); |
457 | $All_Query = News::query()->paginate(8); | 397 | return view('detail_new', compact('Query', 'All_Query', 'title')); |
458 | return view('detail_new', compact('Query', 'All_Query', 'title')); | 398 | } |
459 | } | 399 | } |
460 | } | 400 | |
461 |
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="work__form width100 flex" action="{{ route('vacancies') }}" method="GET"> |
25 | <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> | 25 | |
26 | <!--<div class="select select_search thing__select"> | 26 | <div class="select select_search width100"> |
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="job" name="job"> |
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 | |
42 | <span> | 42 | <button type="submit" class="button button_light" style="height: 50px;">Посмотреть вакансии</button> |
43 | <svg> | ||
44 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | ||
45 | </svg> | ||
46 | </span> | ||
47 | </form> | 43 | </form> |
48 | @guest | 44 | @guest |
49 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> | 45 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> |
50 | @else | 46 | @else |
51 | @if (Auth()->user()->is_lookin) | 47 | @if (Auth()->user()->is_lookin) |
52 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> | 48 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> |
53 | @else | 49 | @else |
54 | <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> | 50 | <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> |
55 | @endif | 51 | @endif |
56 | @endguest | 52 | @endguest |
57 | <div class="work__get"> | 53 | <div class="work__get"> |
58 | <b>Скачать приложение</b> | 54 | <b>Скачать приложение</b> |
59 | <a href=""> | 55 | <a href=""> |
60 | <img src="{{ asset('images/google.svg') }}" alt=""> | 56 | <img src="{{ asset('images/google.svg') }}" alt=""> |
61 | </a> | 57 | </a> |
62 | <a href=""> | 58 | <a href=""> |
63 | <img src="{{ asset('images/apple.svg') }}" alt=""> | 59 | <img src="{{ asset('images/apple.svg') }}" alt=""> |
64 | </a> | 60 | </a> |
65 | </div> | 61 | </div> |
66 | </div> | 62 | </div> |
67 | </div> | 63 | </div> |
68 | </section> | 64 | </section> |
69 | 65 | ||
70 | @if ($blocks_counters) | 66 | @if ($blocks_counters) |
71 | <section class="numbers"> | 67 | <section class="numbers"> |
72 | <div class="container"> | 68 | <div class="container"> |
73 | <div class="numbers__body"> | 69 | <div class="numbers__body"> |
74 | @foreach($blocks_counters as $block_counter) | 70 | @foreach($blocks_counters as $block_counter) |
75 | <div class="numbers__item"> | 71 | <div class="numbers__item"> |
76 | <b>{{$block_counter['extra']}}</b> | 72 | <b>{{$block_counter['extra']}}</b> |
77 | <span>{{$block_counter['title']}}</span> | 73 | <span>{{$block_counter['title']}}</span> |
78 | {{$block_counter['description']}} | 74 | {{$block_counter['description']}} |
79 | </div> | 75 | </div> |
80 | @endforeach | 76 | @endforeach |
81 | </div> | 77 | </div> |
82 | </div> | 78 | </div> |
83 | </section> | 79 | </section> |
84 | @endif | 80 | @endif |
85 | 81 | ||
86 | <!--<section class="vacancies"> | 82 | <!--<section class="vacancies"> |
87 | <div class="container"> | 83 | <div class="container"> |
88 | <div class="title"><h4>Новые вакансии</h4></div> | 84 | <div class="title"><h4>Новые вакансии</h4></div> |
89 | <div class="vacancies__body"> | 85 | <div class="vacancies__body"> |
90 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> | 86 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> |
91 | <div class="vacancies__list"> | 87 | <div class="vacancies__list"> |
92 | _if ($categories->count()) | 88 | _if ($categories->count()) |
93 | _foreach ($categories as $cat) | 89 | _foreach ($categories as $cat) |
94 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> | 90 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> |
95 | <span style="border-color:#F4C4C2"> | 91 | <span style="border-color:#F4C4C2"> |
96 | <b> $cat->name }}</b> | 92 | <b> $cat->name }}</b> |
97 | <i>Вакансий: <span> $cat->cnt }}</span></i> | 93 | <i>Вакансий: <span> $cat->cnt }}</span></i> |
98 | </span> | 94 | </span> |
99 | </a> | 95 | </a> |
100 | _endforeach | 96 | _endforeach |
101 | _else | 97 | _else |
102 | Тут пока нет никаких вакансий | 98 | Тут пока нет никаких вакансий |
103 | _endif | 99 | _endif |
104 | </div> | 100 | </div> |
105 | </div> | 101 | </div> |
106 | </div> | 102 | </div> |
107 | </section>--> | 103 | </section>--> |
108 | 104 | ||
109 | <main class="main"> | 105 | <main class="main"> |
110 | <div class="container"> | 106 | <div class="container"> |
111 | <div class="main__vacancies"> | 107 | <div class="main__vacancies"> |
112 | <h2 class="main__vacancies-title">Категории вакансий</h2> | 108 | <h2 class="main__vacancies-title">Категории вакансий</h2> |
113 | <div class="vacancies__body"> | 109 | <div class="vacancies__body"> |
114 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> | 110 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> |
115 | @foreach($Main_Job as $key => $it_main) | 111 | @foreach($Main_Job as $key => $it_main) |
116 | <div class="vacancies__list-col"> | 112 | <div class="vacancies__list-col"> |
117 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) | 113 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) |
118 | </div> | 114 | </div> |
119 | @endforeach | 115 | @endforeach |
120 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> | 116 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> |
121 | </div> | 117 | </div> |
122 | </div> | 118 | </div> |
123 | </div> | 119 | </div> |
124 | </div> | 120 | </div> |
125 | </main> | 121 | </main> |
126 | 122 | ||
127 | <section class="employer"> | 123 | <section class="employer"> |
128 | <div class="container"> | 124 | <div class="container"> |
129 | <div class="title"><h4>Работодатели</h4></div> | 125 | <div class="title"><h4>Работодатели</h4></div> |
130 | <!--<div class="swiper js-employer-swiper"> | 126 | <!--<div class="swiper js-employer-swiper"> |
131 | <div class="swiper-wrapper"> | 127 | <div class="swiper-wrapper"> |
132 | <div class="swiper-slide"> | 128 | <div class="swiper-slide"> |
133 | <div class="employer__item"> | 129 | <div class="employer__item"> |
134 | <a href="#"> | 130 | <a href="#"> |
135 | <img src="images/logos/1.jpg" alt=""> | 131 | <img src="images/logos/1.jpg" alt=""> |
136 | </a> | 132 | </a> |
137 | <a href="#"> | 133 | <a href="#"> |
138 | <img src="images/logos/5.jpg" alt=""> | 134 | <img src="images/logos/5.jpg" alt=""> |
139 | </a> | 135 | </a> |
140 | <a href="#"> | 136 | <a href="#"> |
141 | <img src="images/logos/9.jpg" alt=""> | 137 | <img src="images/logos/9.jpg" alt=""> |
142 | </a> | 138 | </a> |
143 | <a href="#"> | 139 | <a href="#"> |
144 | <img src="images/logos/13.jpg" alt=""> | 140 | <img src="images/logos/13.jpg" alt=""> |
145 | </a> | 141 | </a> |
146 | <a href="#"> | 142 | <a href="#"> |
147 | <img src="images/logos/17.jpg" alt=""> | 143 | <img src="images/logos/17.jpg" alt=""> |
148 | </a> | 144 | </a> |
149 | </div> | 145 | </div> |
150 | </div> | 146 | </div> |
151 | <div class="swiper-slide"> | 147 | <div class="swiper-slide"> |
152 | <div class="employer__item"> | 148 | <div class="employer__item"> |
153 | <a href="#"> | 149 | <a href="#"> |
154 | <img src="images/logos/2.jpg" alt=""> | 150 | <img src="images/logos/2.jpg" alt=""> |
155 | </a> | 151 | </a> |
156 | <a href="#"> | 152 | <a href="#"> |
157 | <img src="images/logos/6.jpg" alt=""> | 153 | <img src="images/logos/6.jpg" alt=""> |
158 | </a> | 154 | </a> |
159 | <a href="#"> | 155 | <a href="#"> |
160 | <img src="images/logos/10.jpg" alt=""> | 156 | <img src="images/logos/10.jpg" alt=""> |
161 | </a> | 157 | </a> |
162 | <a href="#"> | 158 | <a href="#"> |
163 | <img src="images/logos/14.jpg" alt=""> | 159 | <img src="images/logos/14.jpg" alt=""> |
164 | </a> | 160 | </a> |
165 | <a href="#"> | 161 | <a href="#"> |
166 | <img src="images/logos/18.jpg" alt=""> | 162 | <img src="images/logos/18.jpg" alt=""> |
167 | </a> | 163 | </a> |
168 | </div> | 164 | </div> |
169 | </div> | 165 | </div> |
170 | <div class="swiper-slide"> | 166 | <div class="swiper-slide"> |
171 | <div class="employer__item"> | 167 | <div class="employer__item"> |
172 | <a href="#"> | 168 | <a href="#"> |
173 | <img src="images/logos/3.jpg" alt=""> | 169 | <img src="images/logos/3.jpg" alt=""> |
174 | </a> | 170 | </a> |
175 | <a href="#"> | 171 | <a href="#"> |
176 | <img src="images/logos/7.jpg" alt=""> | 172 | <img src="images/logos/7.jpg" alt=""> |
177 | </a> | 173 | </a> |
178 | <a href="#"> | 174 | <a href="#"> |
179 | <img src="images/logos/11.jpg" alt=""> | 175 | <img src="images/logos/11.jpg" alt=""> |
180 | </a> | 176 | </a> |
181 | <a href="#"> | 177 | <a href="#"> |
182 | <img src="images/logos/15.jpg" alt=""> | 178 | <img src="images/logos/15.jpg" alt=""> |
183 | </a> | 179 | </a> |
184 | <a href="#"> | 180 | <a href="#"> |
185 | <img src="images/logos/19.jpg" alt=""> | 181 | <img src="images/logos/19.jpg" alt=""> |
186 | </a> | 182 | </a> |
187 | </div> | 183 | </div> |
188 | </div> | 184 | </div> |
189 | <div class="swiper-slide"> | 185 | <div class="swiper-slide"> |
190 | <div class="employer__item"> | 186 | <div class="employer__item"> |
191 | <a href="#"> | 187 | <a href="#"> |
192 | <img src="images/logos/4.jpg" alt=""> | 188 | <img src="images/logos/4.jpg" alt=""> |
193 | </a> | 189 | </a> |
194 | <a href="#"> | 190 | <a href="#"> |
195 | <img src="images/logos/8.jpg" alt=""> | 191 | <img src="images/logos/8.jpg" alt=""> |
196 | </a> | 192 | </a> |
197 | <a href="#"> | 193 | <a href="#"> |
198 | <img src="images/logos/12.jpg" alt=""> | 194 | <img src="images/logos/12.jpg" alt=""> |
199 | </a> | 195 | </a> |
200 | <a href="#"> | 196 | <a href="#"> |
201 | <img src="images/logos/16.jpg" alt=""> | 197 | <img src="images/logos/16.jpg" alt=""> |
202 | </a> | 198 | </a> |
203 | <a href="#"> | 199 | <a href="#"> |
204 | <img src="images/logos/20.jpg" alt=""> | 200 | <img src="images/logos/20.jpg" alt=""> |
205 | </a> | 201 | </a> |
206 | </div> | 202 | </div> |
207 | </div> | 203 | </div> |
208 | </div> | 204 | </div> |
209 | </div>--> | 205 | </div>--> |
210 | <!--<div class="employer__body"> | 206 | <!--<div class="employer__body"> |
211 | <a href="#"> | 207 | <a href="#"> |
212 | <img src="images/logos/1.jpg" alt=""> | 208 | <img src="images/logos/1.jpg" alt=""> |
213 | </a> | 209 | </a> |
214 | <a href="#"> | 210 | <a href="#"> |
215 | <img src="images/logos/2.jpg" alt=""> | 211 | <img src="images/logos/2.jpg" alt=""> |
216 | </a> | 212 | </a> |
217 | <a href="#"> | 213 | <a href="#"> |
218 | <img src="images/logos/3.jpg" alt=""> | 214 | <img src="images/logos/3.jpg" alt=""> |
219 | </a> | 215 | </a> |
220 | <a href="#"> | 216 | <a href="#"> |
221 | <img src="images/logos/4.jpg" alt=""> | 217 | <img src="images/logos/4.jpg" alt=""> |
222 | </a> | 218 | </a> |
223 | <a href="#"> | 219 | <a href="#"> |
224 | <img src="images/logos/5.jpg" alt=""> | 220 | <img src="images/logos/5.jpg" alt=""> |
225 | </a> | 221 | </a> |
226 | <a href="#"> | 222 | <a href="#"> |
227 | <img src="images/logos/6.jpg" alt=""> | 223 | <img src="images/logos/6.jpg" alt=""> |
228 | </a> | 224 | </a> |
229 | <a href="#"> | 225 | <a href="#"> |
230 | <img src="images/logos/7.jpg" alt=""> | 226 | <img src="images/logos/7.jpg" alt=""> |
231 | </a> | 227 | </a> |
232 | <a href="#"> | 228 | <a href="#"> |
233 | <img src="images/logos/8.jpg" alt=""> | 229 | <img src="images/logos/8.jpg" alt=""> |
234 | </a> | 230 | </a> |
235 | <a href="#"> | 231 | <a href="#"> |
236 | <img src="images/logos/9.jpg" alt=""> | 232 | <img src="images/logos/9.jpg" alt=""> |
237 | </a> | 233 | </a> |
238 | <a href="#"> | 234 | <a href="#"> |
239 | <img src="images/logos/10.jpg" alt=""> | 235 | <img src="images/logos/10.jpg" alt=""> |
240 | </a> | 236 | </a> |
241 | <a href="#"> | 237 | <a href="#"> |
242 | <img src="images/logos/11.jpg" alt=""> | 238 | <img src="images/logos/11.jpg" alt=""> |
243 | </a> | 239 | </a> |
244 | <a href="#"> | 240 | <a href="#"> |
245 | <img src="images/logos/12.jpg" alt=""> | 241 | <img src="images/logos/12.jpg" alt=""> |
246 | </a> | 242 | </a> |
247 | <a href="#"> | 243 | <a href="#"> |
248 | <img src="images/logos/13.jpg" alt=""> | 244 | <img src="images/logos/13.jpg" alt=""> |
249 | </a> | 245 | </a> |
250 | <a href="#"> | 246 | <a href="#"> |
251 | <img src="images/logos/14.jpg" alt=""> | 247 | <img src="images/logos/14.jpg" alt=""> |
252 | </a> | 248 | </a> |
253 | <a href="#"> | 249 | <a href="#"> |
254 | <img src="images/logos/15.jpg" alt=""> | 250 | <img src="images/logos/15.jpg" alt=""> |
255 | </a> | 251 | </a> |
256 | <a href="#"> | 252 | <a href="#"> |
257 | <img src="images/logos/16.jpg" alt=""> | 253 | <img src="images/logos/16.jpg" alt=""> |
258 | </a> | 254 | </a> |
259 | <a href="#"> | 255 | <a href="#"> |
260 | <img src="images/logos/17.jpg" alt=""> | 256 | <img src="images/logos/17.jpg" alt=""> |
261 | </a> | 257 | </a> |
262 | <a href="#"> | 258 | <a href="#"> |
263 | <img src="images/logos/18.jpg" alt=""> | 259 | <img src="images/logos/18.jpg" alt=""> |
264 | </a> | 260 | </a> |
265 | <a href="#"> | 261 | <a href="#"> |
266 | <img src="images/logos/19.jpg" alt=""> | 262 | <img src="images/logos/19.jpg" alt=""> |
267 | </a> | 263 | </a> |
268 | <a href="#"> | 264 | <a href="#"> |
269 | <img src="images/logos/20.jpg" alt=""> | 265 | <img src="images/logos/20.jpg" alt=""> |
270 | </a> | 266 | </a> |
271 | </div>--> | 267 | </div>--> |
272 | 268 | ||
273 | <div class="employer__body"> | 269 | <div class="employer__body"> |
274 | @if ($employers->count()) | 270 | @if ($employers->count()) |
275 | @foreach($employers as $emp) | 271 | @foreach($employers as $emp) |
276 | @if (!empty($emp->employer->logo)) | 272 | @if (!empty($emp->employer->logo)) |
277 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> | 273 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> |
278 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> | 274 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> |
279 | </a> | 275 | </a> |
280 | @else | 276 | @else |
281 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> | 277 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> |
282 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> | 278 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> |
283 | </a> | 279 | </a> |
284 | @endif | 280 | @endif |
285 | @endforeach | 281 | @endforeach |
286 | @else | 282 | @else |
287 | <h5>Тут нет никаких записей</h5> | 283 | <h5>Тут нет никаких записей</h5> |
288 | @endif | 284 | @endif |
289 | </div> | 285 | </div> |
290 | <!--if ($employers->count()) | 286 | <!--if ($employers->count()) |
291 | php | 287 | php |
292 | $rec = 0; | 288 | $rec = 0; |
293 | $count = $employers->count(); | 289 | $count = $employers->count(); |
294 | 290 | ||
295 | endphp | 291 | endphp |
296 | 292 | ||
297 | foreach($employers as $emp) | 293 | foreach($employers as $emp) |
298 | php $rec++ endphp | 294 | php $rec++ endphp |
299 | if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) | 295 | if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) |
300 | <div class="swiper-slide"> | 296 | <div class="swiper-slide"> |
301 | <div class="employer__item"> | 297 | <div class="employer__item"> |
302 | endif | 298 | endif |
303 | if (!empty($emp->employer->logo)) | 299 | if (!empty($emp->employer->logo)) |
304 | <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 300 | <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
305 | <img src=" asset(Storage::url($emp->employer->logo)) }}" alt=" $emp->employer->name_company }}"> | 301 | <img src=" asset(Storage::url($emp->employer->logo)) }}" alt=" $emp->employer->name_company }}"> |
306 | </a> | 302 | </a> |
307 | else | 303 | else |
308 | <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 304 | <a href=" route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
309 | <img src=" asset('images/logo_emp.png') }}" alt=" $emp->employer->name_company }}"> | 305 | <img src=" asset('images/logo_emp.png') }}" alt=" $emp->employer->name_company }}"> |
310 | </a> | 306 | </a> |
311 | endif | 307 | endif |
312 | if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) | 308 | if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) |
313 | </div> | 309 | </div> |
314 | </div> | 310 | </div> |
315 | endif | 311 | endif |
316 | endforeach | 312 | endforeach |
317 | else | 313 | else |
318 | <h5>Тут нет никаких записей</h5> | 314 | <h5>Тут нет никаких записей</h5> |
319 | endif--> | 315 | endif--> |
320 | </div> | 316 | </div> |
321 | <div class="swiper-pagination"></div> | 317 | <div class="swiper-pagination"></div> |
322 | </div> | 318 | </div> |
323 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> | 319 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> |
324 | </div> | 320 | </div> |
325 | </section> | 321 | </section> |
326 | <section class="about"> | 322 | <section class="about"> |
327 | <div class="container"> | 323 | <div class="container"> |
328 | <div class="about__wrapper"> | 324 | <div class="about__wrapper"> |
329 | <div class="title about__title"><h4>О нас</h4></div> | 325 | <div class="title about__title"><h4>О нас</h4></div> |
330 | <div class="about__body"> | 326 | <div class="about__body"> |
331 | <div class="about__line"></div> | 327 | <div class="about__line"></div> |
332 | <div class="about__item"> | 328 | <div class="about__item"> |
333 | <b>Для работодателей</b> | 329 | <b>Для работодателей</b> |
334 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие | 330 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие |
335 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> | 331 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> |
336 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> | 332 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> |
337 | </div> | 333 | </div> |
338 | <div class="about__item"> | 334 | <div class="about__item"> |
339 | <b>Для сотрудников</b> | 335 | <b>Для сотрудников</b> |
340 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и | 336 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и |
341 | СНГ ищут сотрудников через наши ресурсы</span> | 337 | СНГ ищут сотрудников через наши ресурсы</span> |
342 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> | 338 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> |
343 | </div> | 339 | </div> |
344 | </div> | 340 | </div> |
345 | </div> | 341 | </div> |
346 | </div> | 342 | </div> |
347 | </section> | 343 | </section> |
348 | 344 | ||
349 | @if ($news->count()) | 345 | @if ($news->count()) |
350 | <section class="news"> | 346 | <section class="news"> |
351 | <div class="container"> | 347 | <div class="container"> |
352 | <div class="news__toper"> | 348 | <div class="news__toper"> |
353 | <div class="title"><h4>Новости и статьи</h4></div> | 349 | <div class="title"><h4>Новости и статьи</h4></div> |
354 | <div class="navs"> | 350 | <div class="navs"> |
355 | <button class="js-news-swiper-button-prev"> | 351 | <button class="js-news-swiper-button-prev"> |
356 | <svg class="rotate180"> | 352 | <svg class="rotate180"> |
357 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 353 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
358 | </svg> | 354 | </svg> |
359 | </button> | 355 | </button> |
360 | <button class="js-news-swiper-button-next"> | 356 | <button class="js-news-swiper-button-next"> |
361 | <svg> | 357 | <svg> |
362 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 358 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
363 | </svg> | 359 | </svg> |
364 | </button> | 360 | </button> |
365 | </div> | 361 | </div> |
366 | </div> | 362 | </div> |
367 | 363 | ||
368 | <div class="swiper js-news-swiper"> | 364 | <div class="swiper js-news-swiper"> |
369 | <div class="swiper-wrapper"> | 365 | <div class="swiper-wrapper"> |
370 | 366 | ||
371 | @foreach ($news as $new) | 367 | @foreach ($news as $new) |
372 | <div class="swiper-slide"> | 368 | <div class="swiper-slide"> |
373 | <div class="news__item"> | 369 | <div class="news__item"> |
374 | @if (empty($new->image)) | 370 | @if (empty($new->image)) |
375 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> | 371 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> |
376 | @else | 372 | @else |
377 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> | 373 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> |
378 | @endif | 374 | @endif |
379 | <div class="news__item-body"> | 375 | <div class="news__item-body"> |
380 | <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> | 376 | <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> |
381 | <span class="news__item-title">{{ $new->title }}</span> | 377 | <span class="news__item-title">{{ $new->title }}</span> |
382 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> | 378 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> |
383 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> | 379 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> |
384 | </div> | 380 | </div> |
385 | </div> | 381 | </div> |
386 | </div> | 382 | </div> |
387 | @endforeach | 383 | @endforeach |
388 | 384 | ||
389 | </div> | 385 | </div> |
390 | <div class="swiper-pagination"></div> | 386 | <div class="swiper-pagination"></div> |
391 | </div> | 387 | </div> |
392 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> | 388 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> |
393 | 389 | ||
394 | </div> | 390 | </div> |
395 | </section> | 391 | </section> |
396 | @endif | 392 | @endif |
397 | 393 | ||
398 | <section class="info"> | 394 | <section class="info"> |
399 | <div class="container"> | 395 | <div class="container"> |
400 | <img src="images/5.png" alt="" class="info__pic"> | 396 | <img src="images/5.png" alt="" class="info__pic"> |
401 | <div class="info__body"> | 397 | <div class="info__body"> |
402 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> | 398 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> |
403 | <div class="info__item"> | 399 | <div class="info__item"> |
404 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о | 400 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о |
405 | новых вакансиях прямо на свой смартфон</div> | 401 | новых вакансиях прямо на свой смартфон</div> |
406 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> | 402 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> |
407 | <svg> | 403 | <svg> |
408 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 404 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
409 | </svg> | 405 | </svg> |
410 | Телеграм | 406 | Телеграм |
411 | </a> | 407 | </a> |
412 | </div> | 408 | </div> |
413 | <div class="info__item"> | 409 | <div class="info__item"> |
414 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация | 410 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация |
415 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> | 411 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> |
416 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> | 412 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> |
417 | <svg> | 413 | <svg> |
418 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 414 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
419 | </svg> | 415 | </svg> |
420 | ВКонтакте | 416 | ВКонтакте |
421 | </a> | 417 | </a> |
422 | </div> | 418 | </div> |
423 | </div> | 419 | </div> |
424 | </div> | 420 | </div> |
425 | </section> | 421 | </section> |
426 | @endsection | 422 | @endsection |
427 | 423 |