Commit b018ecae4771c8ef641dbe9e4659af2333ad32ac

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

Сохранение резульатат

Showing 38 changed files Side-by-side Diff

app/Classes/StatusUser.php
... ... @@ -0,0 +1,17 @@
  1 +<?php
  2 +
  3 +
  4 +namespace App\Classes;
  5 +
  6 +
  7 +class StatusUser
  8 +{
  9 + public static function Status() {
  10 + if (isset(Auth()->user()->id)) {
  11 + $is_worker = Auth()->user()->is_worker;
  12 + return $is_worker;
  13 + } else {
  14 + return false;
  15 + }
  16 + }
  17 +}
app/Http/Controllers/CompanyController.php
... ... @@ -9,7 +9,7 @@ class CompanyController extends Controller
9 9 {
10 10 public function shipping_companies(Request $request) {
11 11 $emps = Employer::query()->with('ads');
12   - if ($request->get('search')) {
  12 + if (($request->has('search')) && (!empty($request->get('search')))) {
13 13 $search = $request->get('search');
14 14 $emps = $emps->where('name_company', 'LIKE', "%$search%");
15 15 }
... ... @@ -41,9 +41,10 @@ class CompanyController extends Controller
41 41 }
42 42  
43 43 public function info_company(Employer $company) {
44   - $company = Employer::with('ads')->with('flots')
  44 + $user_id = Auth()->user()->id;
  45 + $company = Employer::with('ads')->with('flots')->with('users')
45 46 ->where('id', '=', $company->id)->get();
46 47 $title = $company[0]->name_company;
47   - return view('info_company', compact('company', 'title'));
  48 + return view('info_company', compact('company', 'user_id', 'title'));
48 49 }
49 50 }
app/Http/Controllers/MainController.php
... ... @@ -12,6 +12,7 @@ use App\Models\reclame;
12 12 use Illuminate\Http\Request;
13 13 use Illuminate\Support\Facades\Auth;
14 14 use Illuminate\Support\Facades\Validator;
  15 +use App\Classes\StatusUser;
15 16  
16 17 class MainController extends Controller
17 18 {
... ... @@ -70,24 +71,42 @@ class MainController extends Controller
70 71  
71 72 //Вакансии категория детальная
72 73 public function list_vacancies(Category $categories, Request $request) {
  74 + if (isset(Auth()->user()->id))
  75 + $uid = Auth()->user()->id;
  76 + else
  77 + $uid = 0;
73 78  
74 79 $Query = Ad_employer::with('jobs')->
75 80 with('cat')->
76 81 with('employer')->
77 82 whereHas('jobs_code', function ($query) use ($request) {
78 83 if ($request->ajax()) {
79   - if (null !== ($request->get('job'))) {
  84 + if (null !== ($request->get('job')) && ($request->get('job') !== 0)) {
80 85 $query->where('job_title_id', $request->get('job'));
81 86 }
82 87 }
83 88 })
84 89 ->select('ad_employers.*');
85 90  
  91 +
  92 +
86 93 if ($categories->id > 0) {
87 94 $Query = $Query->where('category_id', '=', $categories->id);
88 95 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
89 96 }
90 97  
  98 + if ($request->get('sort')) {
  99 + $sort = $request->get('sort');
  100 + switch ($sort) {
  101 + case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
  102 + case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
  103 + case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
  104 + case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
  105 + case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
  106 + default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
  107 + }
  108 + }
  109 +
91 110 $Job_title = Job_title::query()->OrderBy('name')->get();
92 111  
93 112 $Query_count = $Query->count();
... ... @@ -99,7 +118,12 @@ class MainController extends Controller
99 118  
100 119  
101 120 if ($request->ajax()) {
102   - return view('ajax.list_vacancies', compact('Query', 'Query_count', 'Name_categori', 'Reclama', 'categories'));
  121 + return view('ajax.list_vacancies', compact('Query',
  122 + 'Query_count',
  123 + 'Name_categori',
  124 + 'Reclama',
  125 + 'categories',
  126 + 'uid'));
103 127 } else {
104 128 //Вернуть все
105 129 return view('list_vacancies', compact('Query',
... ... @@ -107,20 +131,38 @@ class MainController extends Controller
107 131 'Reclama',
108 132 'Name_categori',
109 133 'categories',
110   - 'Job_title'));
  134 + 'Job_title',
  135 + 'uid'));
111 136 }
112 137 }
113 138  
114 139 // Образование
115 140 public function education(Request $request) {
116 141 $educations = Education::query();
117   - if ($request->has('search')) {
118   - $search = trim($request->has('search'));
  142 + if (($request->has('search')) && (!empty($request->get('search')))) {
  143 + $search = trim($request->get('search'));
119 144 $educations = $educations->where('name', 'LIKE', "%$search%");
120 145 }
  146 +
  147 + if ($request->get('sort')) {
  148 + $sort = $request->get('sort');
  149 + switch ($sort) {
  150 + case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
  151 + case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
  152 + case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
  153 + case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
  154 + case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
  155 + default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
  156 + }
  157 + }
  158 +
121 159 $count_edu = $educations->count();
122 160 $educations = $educations->paginate(6);
123   - return view('education', compact('educations', 'count_edu'));
  161 + if ($request->ajax()) {
  162 + return view('ajax.education', compact('educations'));
  163 + } else {
  164 + return view('education', compact('educations', 'count_edu'));
  165 + }
124 166 }
125 167  
126 168 // Контакты
app/Http/Controllers/WorkerController.php
... ... @@ -3,12 +3,18 @@
3 3 namespace App\Http\Controllers;
4 4  
5 5 use App\Classes\RusDate;
  6 +use App\Http\Requests\DocumentsRequest;
6 7 use App\Models\Ad_employer;
  8 +use App\Models\ad_response;
7 9 use App\Models\Category;
  10 +use App\Models\Dop_info;
8 11 use App\Models\Employer;
  12 +use App\Models\infobloks;
9 13 use App\Models\Job_title;
10 14 use App\Models\Message;
  15 +use App\Models\place_works;
11 16 use App\Models\reclame;
  17 +use App\Models\sertification;
12 18 use App\Models\Static_worker;
13 19 use App\Models\User;
14 20 use App\Models\User as User_Model;
... ... @@ -20,6 +26,7 @@ use Illuminate\Http\JsonResponse;
20 26 use Illuminate\Http\Request;
21 27 use Illuminate\Support\Facades\Auth;
22 28 use Illuminate\Support\Facades\Hash;
  29 +use Illuminate\Support\Facades\Storage;
23 30 use Illuminate\Support\Facades\Validator;
24 31  
25 32 class WorkerController extends Controller
... ... @@ -88,19 +95,90 @@ class WorkerController extends Controller
88 95 public function cabinet()
89 96 {
90 97 $id = Auth()->user()->id;
91   - $Worker = Worker::query()->with('sertificate')->
  98 + $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
92 99 with('infobloks')->with('place_worker')->
93 100 WhereHas('users',
94 101 function (Builder $query) use ($id) {$query->Where('id', $id);
95 102 })->get();
96   - dd($Worker);
97   - return view('workers.cabinet', compact('Worker'));
  103 +
  104 + $Job_titles = Job_title::query()->OrderBy('name')->get();
  105 + $Infoblocks = infobloks::query()->OrderBy('name')->get();
  106 +
  107 + return view('workers.cabinet', compact('Worker', 'Job_titles', 'Infoblocks'));
98 108 }
99 109  
100 110 // Сохранение данных
101 111 public function cabinet_save(Worker $worker, Request $request)
102 112 {
  113 + $id = $worker->id;
  114 + $params = $request->all();
  115 +
  116 + $job_title_id = $request->get('job_title_id');
  117 +
  118 + unset($params['new_diplom']);
  119 + unset($params['new_data_begin']);
  120 + unset($params['new_data_end']);
  121 + unset($params['new_job_title']);
  122 + unset($params['new_teplohod']);
  123 + unset($params['new_GWT']);
  124 + unset($params['new_KBT']);
  125 + unset($params['new_Begin_work']);
  126 + unset($params['new_End_work']);
  127 + unset($params['new_name_company']);
  128 +
  129 + $rules = [
  130 + 'surname' => ['required', 'string', 'max:255'],
  131 + 'name_man' => ['required', 'string', 'max:255'],
  132 + 'email' => ['required', 'string', 'email', 'max:255'],
  133 +
  134 + ];
103 135  
  136 + $messages = [
  137 + 'required' => 'Укажите обязательное поле',
  138 + 'min' => [
  139 + 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
  140 + 'integer' => 'Поле «:attribute» должно быть :min или больше',
  141 + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
  142 + ],
  143 + 'max' => [
  144 + 'string' => 'Поле «:attribute» должно быть не больше :max символов',
  145 + 'integer' => 'Поле «:attribute» должно быть :max или меньше',
  146 + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
  147 + ]
  148 + ];
  149 +
  150 + $validator = Validator::make($params, $rules, $messages);
  151 +
  152 + if ($validator->fails()) {
  153 + return redirect()->route('worker.cabinet')->withErrors($validator);
  154 + } else {
  155 +
  156 + if ($request->has('photo')) {
  157 + if (!empty($Worker->photo)) {
  158 + Storage::delete($Worker->photo);
  159 + }
  160 + $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
  161 + }
  162 +
  163 + if ($request->has('file')) {
  164 + if (!empty($Worker->file)) {
  165 + Storage::delete($Worker->file);
  166 + }
  167 + $params['file'] = $request->file('file')->store("worker/$id", 'public');
  168 + }
  169 +
  170 + $id_wor = $worker->update($params);
  171 +
  172 + $use = User_Model::find($id_wor);
  173 + $use->surname = $request->get('surname');
  174 + $use->name_man = $request->get('name_man');
  175 + $use->surname2 = $request->get('surname2');
  176 +
  177 + $use->save();
  178 + $worker->job_titles()->sync($job_title_id);
  179 +
  180 + return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
  181 + }
104 182 }
105 183  
106 184 // Сообщения данные
... ... @@ -133,11 +211,9 @@ class WorkerController extends Controller
133 211 // Избранный
134 212 public function favorite()
135 213 {
136   - dd('dgfghfghfgh');
137 214 return view('workers.favorite');
138 215 }
139 216  
140   -
141 217 // Сменить пароль
142 218 public function new_password()
143 219 {
... ... @@ -360,5 +436,119 @@ class WorkerController extends Controller
360 436  
361 437 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
362 438 }
  439 +
  440 + // Даунлоады
  441 + public function download(Worker $worker) {
  442 +
  443 + }
  444 +
  445 + // Поднятие анкеты
  446 + public function up(Worker $worker) {
  447 + $worker->updated_at = Carbon::now();
  448 + $worker->save();
  449 + return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
  450 + }
  451 +
  452 + // Добавление сертификата
  453 + public function add_serificate(Request $request) {
  454 + $params = $request->all();
  455 + $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin']));
  456 + $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin']));
  457 + $Sertificate = new sertification();
  458 + $Sertificate->create($params);
  459 + $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
  460 + return view('ajax.documents', compact('Docs'));
  461 + }
  462 +
  463 +
  464 + // Удалить сертификат
  465 + public function delete_sertificate(sertification $doc) {
  466 + $doc->delete();
  467 +
  468 + return redirect()->route('worker.cabinet');
  469 + }
  470 +
  471 + // Добавление диплома
  472 + public function add_diplom_ajax(Request $request) {
  473 + // конец
  474 + $params = $request->all();
  475 + $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
  476 +
  477 + if ($count == 0) $dop_info = Dop_info::create($params);
  478 + $Infoblocks = infobloks::query()->get();
  479 + $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
  480 + $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
  481 + return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
  482 + }
  483 +
  484 + // Добавление диплома без ajax
  485 + public function add_diplom(Worker $worker) {
  486 + $worker_id = $worker->id;
  487 + $Infoblocks = infobloks::query()->get();
  488 + return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
  489 + }
  490 + // Сохранить
  491 + // Сохраняю диплом
  492 + public function add_diplom_save(Request $request) {
  493 + $params = $request->all();
  494 + $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
  495 + if ($count == 0) $dop_info = Dop_info::create($params);
  496 + return redirect()->route('worker.cabinet');
  497 + }
  498 +
  499 + // Добавление стандартного документа
  500 + public function add_document(Worker $worker) {
  501 + return view('workers.docs', compact('worker'));
  502 + }
  503 +
  504 + //Сохранение стандартого документа
  505 + public function add_document_save(DocumentsRequest $request) {
  506 + $params = $request->all();
  507 + $place_work = place_works::create($params);
  508 + return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
  509 + }
  510 +
  511 + // Редактирование документа
  512 + public function edit_document(place_works $doc, Worker $worker) {
  513 + return view('workers.docs-edit', compact('doc', 'worker'));
  514 + }
  515 +
  516 + //Сохранение отредактированного документа
  517 + public function edit_document_save(DocumentsRequest $request, place_works $doc) {
  518 + $params = $request->all();
  519 + $doc->update($params);
  520 +
  521 + return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
  522 + }
  523 +
  524 + // Удаление документа
  525 + public function delete_document(place_works $doc) {
  526 + $doc->delete();
  527 + return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
  528 + }
  529 +
  530 + //Отправка нового сообщения
  531 + public function new_message(Request $request) {
  532 + $params = $request->all();
  533 +
  534 + $id = $params['send_user_id'];
  535 + $message = new Message();
  536 + $message->user_id = $params['send_user_id'];
  537 + $message->to_user_id = $params['send_to_user_id'];
  538 + $message->title = $params['send_title'];
  539 + $message->text = $params['send_text'];
  540 + if ($request->has('send_file')) {
  541 + $message->file = $request->file('send_file')->store("worker/$id", 'public');
  542 + }
  543 + $message->flag_new = 1;
  544 + $id_message = $message->save();
  545 +
  546 + $data['message_id'] = $id_message;
  547 + $data['ad_employer_id'] = $params['send_vacancy'];
  548 + $data['job_title_id'] = $params['send_job_title_id'];
  549 + $data['flag'] = 1;
  550 + $ad_responce = ad_response::create($data);
  551 + return redirect()->route('worker.messages', ['type_message' => 'output']);
  552 + }
363 553 }
364 554  
app/Http/Requests/DocumentsRequest.php
... ... @@ -0,0 +1,47 @@
  1 +<?php
  2 +
  3 +namespace App\Http\Requests;
  4 +
  5 +use Illuminate\Foundation\Http\FormRequest;
  6 +
  7 +class DocumentsRequest extends FormRequest
  8 +{
  9 + /**
  10 + * Determine if the user is authorized to make this request.
  11 + *
  12 + * @return bool
  13 + */
  14 + public function authorize()
  15 + {
  16 + return true;
  17 + }
  18 +
  19 + /**
  20 + * Get the validation rules that apply to the request.
  21 + *
  22 + * @return array<string, mixed>
  23 + */
  24 + public function rules()
  25 + {
  26 + return [
  27 + 'job_title' => ['required', 'string', 'max:255'],
  28 + 'teplohod' => ['required', 'string', 'max:255'],
  29 + 'name_company' => ['required', 'string', 'max:255'],
  30 + ];
  31 + }
  32 +
  33 + public function messages() {
  34 + return [
  35 + 'required' => 'Укажите обязательное поле «:attribute»',
  36 + 'min' => [
  37 + 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
  38 + 'integer' => 'Поле «:attribute» должно быть :min или больше',
  39 + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
  40 + ],
  41 + 'max' => [
  42 + 'string' => 'Поле «:attribute» должно быть не больше :max символов',
  43 + 'integer' => 'Поле «:attribute» должно быть :max или меньше',
  44 + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
  45 + ]];
  46 + }
  47 +}
app/Http/Requests/VacansiaRequiest.php
... ... @@ -48,14 +48,33 @@ class VacansiaRequiest extends FormRequest
48 48 ],
49 49  
50 50 'salary' => [
  51 + 'numeric',
51 52 'min:3',
52 53 'max:255',
53 54 ],
54 55  
  56 + 'min_salary' => [
  57 + 'numeric',
  58 + 'min:0',
  59 + 'max:9999999',
  60 + ],
  61 +
  62 + 'max_salary' => [
  63 + 'numeric',
  64 + 'min:0',
  65 + 'max:9999999',
  66 + ],
  67 +
55 68 'city' => [
56 69 'min:3',
57 70 'max:255',
58 71 ],
  72 +
  73 + 'job_title_id' => [
  74 + 'numeric',
  75 + 'min:1',
  76 + 'max:9999999'
  77 + ]
59 78 ];
60 79 }
61 80  
app/Models/Dop_info.php
... ... @@ -0,0 +1,19 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +
  8 +class Dop_info extends Model
  9 +{
  10 + use HasFactory;
  11 +
  12 + public $table = 'dop_info';
  13 +
  14 + public $fillable = [
  15 + 'worker_id',
  16 + 'infoblok_id',
  17 + 'text'
  18 + ];
  19 +}
app/Models/Title_worker.php
... ... @@ -0,0 +1,11 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +
  8 +class Title_worker extends Model
  9 +{
  10 + use HasFactory;
  11 +}
app/Models/Worker.php
... ... @@ -62,7 +62,7 @@ class Worker extends Model
62 62  
63 63 // Связь Работника с должностями (0-0 - 1)
64 64 public function job_titles() {
65   - return $this->hasMany(Job_title::class, 'id');
  65 + return $this->belongsToMany(Job_title::class, 'title_workers');
66 66 }
67 67  
68 68 //Связь Работника с опытом работы (1 - 0-0)
app/Models/place_works.php
... ... @@ -8,4 +8,16 @@ use Illuminate\Database\Eloquent\Model;
8 8 class place_works extends Model
9 9 {
10 10 use HasFactory;
  11 +
  12 + public $fillable = [
  13 + 'job_title',
  14 + 'tanker',
  15 + 'teplohod',
  16 + 'GWT',
  17 + 'KBT',
  18 + 'Begin_work',
  19 + 'End_work',
  20 + 'name_company',
  21 + 'worker_id'
  22 + ];
11 23 }
app/Models/sertification.php
... ... @@ -8,4 +8,12 @@ use Illuminate\Database\Eloquent\Model;
8 8 class sertification extends Model
9 9 {
10 10 use HasFactory;
  11 +
  12 + protected $fillable = [
  13 + 'date_begin',
  14 + 'end_begin',
  15 + 'worker_id',
  16 + 'name',
  17 + 'education'
  18 + ];
11 19 }
app/Providers/MyServiceProvider.php
... ... @@ -76,14 +76,14 @@ class MyServiceProvider extends ServiceProvider
76 76 }
77 77 );
78 78  
79   - $views3 = ['layout.frontend'];
  79 + $views3 = ['layout.frontend', 'index'];
80 80  
81 81 View::composer($views3,
82 82 function($view){
83 83 $id = Auth::user();
84 84 $companies = Company::query()->limit(1)->get();
85   -
86   - $view->with(['UserId' => $id, 'companies' => $companies]);
  85 + $jobs = Job_title::query()->get();
  86 + $view->with(['UserId' => $id, 'companies' => $companies, 'jobs' => $jobs]);
87 87 }
88 88 );
89 89  
database/migrations/2024_03_05_100903_create_title_workers_table.php
... ... @@ -0,0 +1,33 @@
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +return new class extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('title_workers', function (Blueprint $table) {
  17 + $table->id();
  18 + $table->bigInteger('worker_id')->nullable(false);
  19 + $table->bigInteger('jib_title_id')->nullable(false);
  20 + $table->timestamps();
  21 + });
  22 + }
  23 +
  24 + /**
  25 + * Reverse the migrations.
  26 + *
  27 + * @return void
  28 + */
  29 + public function down()
  30 + {
  31 + Schema::dropIfExists('title_workers');
  32 + }
  33 +};
resources/views/ajax/companies.blade.php
... ... @@ -3,8 +3,12 @@
3 3 @foreach($emps as $emp)
4 4 <div class="main__employers-item">
5 5 <span class="main__employers-item-inner">
6   - <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
7   - <span class="main__employers-item-body">
  6 + @if (!empty($emp->logo))
  7 + <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  8 + @else
  9 + <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  10 + @endif
  11 + <span class="main__employers-item-body">
8 12 <b>{{ $emp->name_company }}</b>
9 13 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
10 14 </span>
resources/views/ajax/companies2.blade.php
... ... @@ -3,7 +3,11 @@
3 3 @foreach($emps as $emp)
4 4 <div class="main__employers-item">
5 5 <span class="main__employers-item-inner">
6   - <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  6 + @if (!empty($emp->logo))
  7 + <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  8 + @else
  9 + <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  10 + @endif
7 11 <span class="main__employers-item-body">
8 12 <b>{{ $emp->name_company }}</b>
9 13 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
resources/views/ajax/documents.blade.php
... ... @@ -0,0 +1,37 @@
  1 +@if ($Docs->count())
  2 + @php $i = 0; @endphp
  3 + @foreach($Docs as $it)
  4 + <div style="margin-bottom: 20px" class="cabinet__body-item">
  5 + @if ($i == 0)
  6 + <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
  7 + @endif
  8 + <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4>
  9 + <div class="cabinet__inputs">
  10 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  11 + <label class="form-group__label">Название сертификата</label>
  12 + <div class="form-group__item">
  13 + <input type="text" class="input" value="{{ $it->name }}" disabled>
  14 + </div>
  15 + </div>
  16 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  17 + <label class="form-group__label">Название сертификата</label>
  18 + <div class="form-group__item">
  19 + <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled>
  20 + </div>
  21 + </div>
  22 + <button type="button" class="button button_light">
  23 + <svg>
  24 + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
  25 + </svg>
  26 + Удалить
  27 + </button>
  28 + </div>
  29 + </div>
  30 + @php $i++ @endphp
  31 + @endforeach
  32 +@else
  33 + <div style="margin-bottom: 20px" class="cabinet__body-item">
  34 + <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
  35 + Нет сертификатов
  36 + </div>
  37 +@endif
resources/views/ajax/dop_info.blade.php
... ... @@ -0,0 +1,51 @@
  1 +<h4 class="cabinet__h4">Дополнительная информация</h4>
  2 +<div class="cabinet__inputs">
  3 + <div class="cabinet__inputs-item form-group">
  4 + <label class="form-group__label">Верю</label>
  5 + <div class="form-group__item">
  6 + <div class="select">
  7 + <select class="js-select2 sertificates_js">
  8 + <option value="0">Нет</option>
  9 + <option value="1" selected>Да</option>
  10 + </select>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + @if (isset($Worker[0]->infobloks))
  15 + @if ($Worker[0]->infobloks->count())
  16 + @php $i = 1; @endphp
  17 + @foreach ($Worker[0]->infobloks as $info)
  18 + <div class="cabinet__inputs-item form-group">
  19 + <label class="form-group__label">{{ $info->name }}</label>
  20 + <div class="form-group__item">
  21 + <div class="select">
  22 + <select class="js-select2 sertificates_js">
  23 + <option value="0">Нет</option>
  24 + <option value="1" selected>Да</option>
  25 + </select>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + @php $i++; @endphp
  30 + @endforeach
  31 + @endif
  32 + @endif
  33 +
  34 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  35 + <label class="form-group__label">Образцы дипломов и документов</label>
  36 + <div class="form-group__item">
  37 + <div class="select">
  38 + <select class="js-select2" id="documents" name="documents">
  39 + @if ($Infoblocks->count())
  40 + @foreach ($Infoblocks as $it)
  41 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  42 + @endforeach
  43 + @endif
  44 + </select>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + <div name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light">
  49 + Добавить документ
  50 + </div>
  51 +</div>
resources/views/ajax/education.blade.php
... ... @@ -0,0 +1,25 @@
  1 +<div class="main__ads" id="block" name="block">
  2 + @if ($educations->count())
  3 + @foreach($educations as $edu)
  4 + <div class="main__ads-item">
  5 + <div class="main__ads-item-pic">
  6 + <img src="@if (!empty($edu->image)) {{ asset(Storage::url($edu->image)) }} @else {{ asset('images/education.jpg') }} @endif" alt="{{ $edu->name }}">
  7 + <span>
  8 + <svg>
  9 + <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
  10 + </svg>
  11 + </span>
  12 + </div>
  13 + <div class="main__ads-item-body">
  14 + <b>{{ $edu->name }}</b>
  15 + <span>{{ $edu->program_education->count() }} учебных направлений</span>
  16 + <a href="" class="button button_light">Читать далее</a>
  17 + </div>
  18 + </div>
  19 + @endforeach
  20 +
  21 + {{ $educations->appends($_GET)->links('paginate') }}
  22 + @else
  23 + <H2>Нет данных</H2>
  24 + @endif
  25 +</div>
resources/views/companies.blade.php
... ... @@ -78,7 +78,7 @@
78 78 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
79 79 существующих финансовых и административных условий.</p>
80 80 <div class="search thing__search">
81   - <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя" required>
  81 + <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя">
82 82 <button type="submit" class="button">Найти</button>
83 83 <span>
84 84 <svg>
... ... @@ -122,7 +122,11 @@
122 122 @foreach($emps as $emp)
123 123 <div class="main__employers-item">
124 124 <span class="main__employers-item-inner">
125   - <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  125 + @if (!empty($emp->logo))
  126 + <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  127 + @else
  128 + <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  129 + @endif
126 130 <span class="main__employers-item-body">
127 131 <b>{{ $emp->name_company }}</b>
128 132 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
... ... @@ -153,7 +157,11 @@
153 157 @foreach($emps as $emp)
154 158 <div class="main__employers-item">
155 159 <span class="main__employers-item-inner">
156   - <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  160 + @if (!empty($emp->logo))
  161 + <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  162 + @else
  163 + <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
  164 + @endif
157 165 <span class="main__employers-item-body">
158 166 <b>{{ $emp->name_company }}</b>
159 167 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
resources/views/education.blade.php
... ... @@ -10,31 +10,13 @@
10 10  
11 11 $.ajax({
12 12 type: "GET",
13   - url: "{{ route('shipping_companies') }}",
  13 + url: "{{ route('education') }}",
14 14 data: "sort="+val_+"&block=1",
15 15 success: function (data) {
16 16 console.log('Выбор сортировки');
17 17 console.log(data);
18   - $('#block_1').html(data);
19   - },
20   - headers: {
21   - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22   - },
23   - error: function (data) {
24   - data = JSON.stringify(data);
25   - console.log('Error: ' + data);
26   - }
27   - });
28   -
29   - $.ajax({
30   - type: "GET",
31   - url: "{{ route('shipping_companies') }}",
32   - data: "sort="+val_+"&block=2",
33   - success: function (data) {
34   - console.log('Выбор сортировки2');
35   - console.log(data);
36   - history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37   - $('#block_2').html(data);
  18 + $('#block').html(data);
  19 + history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
38 20 },
39 21 headers: {
40 22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
... ... @@ -49,6 +31,8 @@
49 31 $(document).ready(function(){
50 32 var sel = $('#select2-sort_ajax-container');
51 33 var key = getUrlParameter('sort');
  34 + console.log(sel);
  35 + console.log(key);
52 36  
53 37 if (key !=='') {
54 38 console.log(key);
... ... @@ -103,8 +87,10 @@
103 87 </div>
104 88 </div>
105 89 </div>
106   - @if ($educations->count())
107   - <div class="main__ads">
  90 +
  91 +
  92 + <div class="main__ads" id="block" name="block">
  93 + @if ($educations->count())
108 94 @foreach($educations as $edu)
109 95 <div class="main__ads-item">
110 96 <div class="main__ads-item-pic">
... ... @@ -123,11 +109,12 @@
123 109 </div>
124 110 @endforeach
125 111  
  112 + {{ $educations->appends($_GET)->links('paginate') }}
  113 + @else
  114 + <H2>Нет данных</H2>
  115 + @endif
126 116 </div>
127   - {{ $educations->appends($_GET)->links('paginate') }}
128   - @else
129   - <H2>Нет данных</H2>
130   - @endif
  117 +
131 118 <!--<div class="pagination">
132 119 <a href="#" class="pagination__nav pagination__nav_prev">
133 120 <svg>
resources/views/employers/messages.blade.php
... ... @@ -67,7 +67,7 @@
67 67  
68 68 <div class="cabinet__body">
69 69 <div class="cabinet__body-item">
70   - <h2 class="title cabinet__title">Сообщения123</h2>
  70 + <h2 class="title cabinet__title">Сообщения</h2>
71 71 </div>
72 72 <div class="cabinet__body-item">
73 73 <div class="cabinet__filters">
resources/views/index.blade.php
1 1 @extends('layout.frontend', ['title' => 'Главная страница РекаМоре'])
2 2  
3 3 @section('scripts')
4   - <script>
5   - console.log('Test system');
6   - $(document).on('click', '#button_send', function() {
7   - var field_login = $('#email');
8   - var field_pwd = $('#password');
9   - var login_val = field_login.val();
10   - var pwd_val = field_pwd.val();
11 4  
12   - console.log('login: '+login_val+' password: '+pwd_val);
13   -
14   - $.ajax({
15   - type: "GET",
16   - url: "{{ route('login') }}",
17   - data: "email="+login_val+"&password="+pwd_val,
18   - success: function (data) {
19   - console.log('Вход в систему');
20   - let d = JSON.parse(data);
21   - if(typeof d['REDIRECT'] !== "undefined") {
22   - location.href = d['REDIRECT'];
23   - }
24   - if (typeof d['ERROR'] !== "undefined") {
25   - $('#message_error').html(d['ERROR']);
26   - }
27   - console.log(d['REDIRECT']);
28   - //$('#block_1').html(data);
29   - },
30   - headers: {
31   - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
32   - },
33   - error: function (data) {
34   - data = JSON.stringify(data);
35   - console.log('Error: ' + data);
36   - }
37   - });
38   - });
39   -
40   - $(document).on('click', '#button_reg_worker', function() {
41   - var field_login = $('#email_worker');
42   - var field_pwd = $('#password_worker');
43   - var field_confirm_pwd = $('#password_confirmation_worker');
44   - var field_politik_worker = $('#politik_worker');
45   - var field_telephone_worker = $('#telephone_worker');
46   - var field_job_titles_worker = $('#job_titles_worker');
47   - var field_surname_worker = $('#surname_worker');
48   - var field_name_man = $('#name_man_worker');
49   - var field_surname2_worker = $('#surname2_worker');
50   -
51   - var login = field_login.val();
52   - var pwd = field_pwd.val();
53   - var confirm_pwd = field_confirm_pwd.val();
54   - var politik = field_politik_worker.val();
55   - var telephone = field_telephone_worker.val();
56   - var job_titles = field_job_titles_worker.val();
57   - var surname = field_surname_worker.val();
58   - var name_man = field_name_man.val();
59   - var surname2 = field_surname2_worker.val();
60   -
61   -
62   - console.log('login: '+login+' password: '+pwd);
63   -
64   - $.ajax({
65   - type: "GET",
66   - url: "{{ route('register_worker') }}",
67   - data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
68   - "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+
69   - "&surname2="+surname2+"&subscribe_email="+login,
70   - success: function (data) {
71   - console.log('Вход в систему');
72   - let d = JSON.parse(data);
73   - if(typeof d['REDIRECT'] !== "undefined") {
74   - console.log(d['REDIRECT']);
75   - location.href = d['REDIRECT'];
76   - }
77   - if (typeof d['ERROR'] !== "undefined") {
78   - console.log(d['ERROR']);
79   - $('#block-info').css({'display': 'block'});
80   - $('#messages_error_reg').html(d['ERROR']);
81   - }
82   - console.log(d['REDIRECT']);
83   -
84   - },
85   - headers: {
86   - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
87   - },
88   - error: function (data) {
89   - data = JSON.stringify(data);
90   - console.log('Error: ' + data);
91   - }
92   - });
93   -
94   - return false;
95   - });
96   -
97   - $(document).on('click', '#button_reg_employer', function() {
98   - var field_login = $('#email_employer');
99   - var field_pwd = $('#password_employer');
100   - var field_confirm_pwd = $('#password_confirmation_employer');
101   - var field_politik_employer = $('#politik_employer');
102   - var field_telephone_employer = $('#telephone_employer');
103   - var field_company_employer = $('#company_employer');
104   - var field_surname_employer = $('#surname_employer');
105   - var field_name_man_employer = $('#name_man_employer');
106   - var field_surname2_employer = $('#surname2_employer');
107   -
108   - var login = field_login.val();
109   - var pwd = field_pwd.val();
110   - var confirm_pwd = field_confirm_pwd.val();
111   - var politik = field_politik_employer.val();
112   - var telephone = field_telephone_employer.val();
113   - var company_employer = field_company_employer.val();
114   - var surname = field_surname_employer.val();
115   - var name_man = field_name_man_employer.val();
116   - var surname2 = field_surname2_employer.val();
117   -
118   -
119   - console.log('login: '+login+' password: '+pwd);
120   -
121   -
122   - $.ajax({
123   - type: "GET",
124   - url: "{{ route('register_employer') }}",
125   - data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
126   - "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+
127   - "&surname2="+surname2+"&subscribe_email="+login,
128   - success: function (data) {
129   - console.log('Вход в систему');
130   - let d = JSON.parse(data);
131   - if(typeof d['REDIRECT'] !== "undefined") {
132   - console.log(d['REDIRECT']);
133   - location.href = d['REDIRECT'];
134   - }
135   - if (typeof d['ERROR'] !== "undefined") {
136   - console.log(d['ERROR']);
137   - $('#block-info').css({'display': 'block'});
138   - $('#messages_error_reg').html(d['ERROR']);
139   - }
140   - console.log(d['REDIRECT']);
141   -
142   - },
143   - headers: {
144   - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
145   - },
146   - error: function (data) {
147   - data = JSON.stringify(data);
148   - console.log('Error: ' + data);
149   - }
150   - });
151   -
152   - return false;
153   - });
154   - </script>
155 5 @endsection
156 6  
157 7 @section('content')
... ... @@ -348,9 +198,9 @@
348 198 <div class="info__item">
349 199 <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о
350 200 новых вакансиях прямо на свой смартфон</div>
351   - <a href="#" class="info__link" style="background:#20A0E1">
  201 + <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1">
352 202 <svg>
353   - <use xlink:href="images/sprite.svg#tg"></use>
  203 + <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
354 204 </svg>
355 205 Телеграм
356 206 </a>
... ... @@ -358,9 +208,9 @@
358 208 <div class="info__item">
359 209 <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация
360 210 о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div>
361   - <a href="#" class="info__link" style="background:#2787F5">
  211 + <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5">
362 212 <svg>
363   - <use xlink:href="images/sprite.svg#vk"></use>
  213 + <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
364 214 </svg>
365 215 ВКонтакте
366 216 </a>
resources/views/info_company.blade.php
... ... @@ -62,6 +62,23 @@
62 62  
63 63 }
64 64 });
  65 +
  66 + //end
  67 + $(document).on('click', '.js_send_it_button', function() {
  68 + var this_ = $(this);
  69 + var code_user_id = this_.attr('data-uid');
  70 + var code_to_user_id = this_.attr('data-tuid');
  71 + var code_vacancy = this_.attr('data-vacancy');
  72 + var user_id = $('#send_user_id');
  73 + var to_user_id = $('#send_to_user_id');
  74 + var vacancy = $('#send_vacancy');
  75 +
  76 + console.log('Клик на кнопки...');
  77 +
  78 + user_id.val(code_user_id);
  79 + to_user_id.val(code_to_user_id);
  80 + vacancy.val(code_vacancy);
  81 + });
65 82 </script>
66 83 @endsection
67 84  
... ... @@ -93,7 +110,7 @@
93 110 </svg>
94 111 {{ $company[0]->ads->count() }} вакансии
95 112 </button>
96   - <a href="" class="button">
  113 + <a data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
97 114 Написать сообщение
98 115 </a>
99 116 </div>
resources/views/js/modals.blade.php
... ... @@ -0,0 +1,154 @@
  1 +<script>
  2 + console.log('Test system');
  3 + $(document).on('click', '#button_send', function() {
  4 + var field_login = $('#email');
  5 + var field_pwd = $('#password');
  6 + var login_val = field_login.val();
  7 + var pwd_val = field_pwd.val();
  8 +
  9 + console.log('login: '+login_val+' password: '+pwd_val);
  10 +
  11 + $.ajax({
  12 + type: "GET",
  13 + url: "{{ route('login') }}",
  14 + data: "email="+login_val+"&password="+pwd_val,
  15 + success: function (data) {
  16 + console.log('Вход в систему');
  17 + let d = JSON.parse(data);
  18 + if(typeof d['REDIRECT'] !== "undefined") {
  19 + location.href = d['REDIRECT'];
  20 + console.log(d['REDIRECT']);
  21 + }
  22 + if (typeof d['ERROR'] !== "undefined") {
  23 + console.log(d['ERROR']);
  24 + $('#message_error').html(d['ERROR']);
  25 + }
  26 + console.log(d['REDIRECT']);
  27 + //$('#block_1').html(data);
  28 + },
  29 + headers: {
  30 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  31 + },
  32 + error: function (data) {
  33 + data = JSON.stringify(data);
  34 + console.log('Error: ' + data);
  35 + }
  36 + });
  37 + });
  38 +
  39 + $(document).on('click', '#button_reg_worker', function() {
  40 + var field_login = $('#email_worker');
  41 + var field_pwd = $('#password_worker');
  42 + var field_confirm_pwd = $('#password_confirmation_worker');
  43 + var field_politik_worker = $('#politik_worker');
  44 + var field_telephone_worker = $('#telephone_worker');
  45 + var field_job_titles_worker = $('#job_titles_worker');
  46 + var field_surname_worker = $('#surname_worker');
  47 + var field_name_man = $('#name_man_worker');
  48 + var field_surname2_worker = $('#surname2_worker');
  49 +
  50 + var login = field_login.val();
  51 + var pwd = field_pwd.val();
  52 + var confirm_pwd = field_confirm_pwd.val();
  53 + var politik = field_politik_worker.val();
  54 + var telephone = field_telephone_worker.val();
  55 + var job_titles = field_job_titles_worker.val();
  56 + var surname = field_surname_worker.val();
  57 + var name_man = field_name_man.val();
  58 + var surname2 = field_surname2_worker.val();
  59 +
  60 +
  61 + console.log('login: '+login+' password: '+pwd);
  62 +
  63 + $.ajax({
  64 + type: "GET",
  65 + url: "{{ route('register_worker') }}",
  66 + data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
  67 + "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+
  68 + "&surname2="+surname2+"&subscribe_email="+login,
  69 + success: function (data) {
  70 + console.log('Вход в систему');
  71 + let d = JSON.parse(data);
  72 + if(typeof d['REDIRECT'] !== "undefined") {
  73 + console.log(d['REDIRECT']);
  74 + location.href = d['REDIRECT'];
  75 + }
  76 + if (typeof d['ERROR'] !== "undefined") {
  77 + console.log(d['ERROR']);
  78 + $('#block-info').css({'display': 'block'});
  79 + $('#messages_error_reg').html(d['ERROR']);
  80 + }
  81 + console.log(d['REDIRECT']);
  82 +
  83 + },
  84 + headers: {
  85 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  86 + },
  87 + error: function (data) {
  88 + data = JSON.stringify(data);
  89 + console.log('Error: ' + data);
  90 + }
  91 + });
  92 +
  93 + return false;
  94 + });
  95 +
  96 + $(document).on('click', '#button_reg_employer', function() {
  97 + var field_login = $('#email_employer');
  98 + var field_pwd = $('#password_employer');
  99 + var field_confirm_pwd = $('#password_confirmation_employer');
  100 + var field_politik_employer = $('#politik_employer');
  101 + var field_telephone_employer = $('#telephone_employer');
  102 + var field_company_employer = $('#company_employer');
  103 + var field_surname_employer = $('#surname_employer');
  104 + var field_name_man_employer = $('#name_man_employer');
  105 + var field_surname2_employer = $('#surname2_employer');
  106 +
  107 + var login = field_login.val();
  108 + var pwd = field_pwd.val();
  109 + var confirm_pwd = field_confirm_pwd.val();
  110 + var politik = field_politik_employer.val();
  111 + var telephone = field_telephone_employer.val();
  112 + var company_employer = field_company_employer.val();
  113 + var surname = field_surname_employer.val();
  114 + var name_man = field_name_man_employer.val();
  115 + var surname2 = field_surname2_employer.val();
  116 +
  117 +
  118 + console.log('login: '+login+' password: '+pwd);
  119 +
  120 +
  121 + $.ajax({
  122 + type: "GET",
  123 + url: "{{ route('register_employer') }}",
  124 + data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
  125 + "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+
  126 + "&surname2="+surname2+"&subscribe_email="+login,
  127 + success: function (data) {
  128 + console.log('Вход в систему');
  129 + let d = JSON.parse(data);
  130 + if(typeof d['REDIRECT'] !== "undefined") {
  131 + console.log(d['REDIRECT']);
  132 + location.href = d['REDIRECT'];
  133 + }
  134 + if (typeof d['ERROR'] !== "undefined") {
  135 + console.log(d['ERROR']);
  136 + $('#block-info').css({'display': 'block'});
  137 + $('#messages_error_reg').html(d['ERROR']);
  138 + }
  139 + console.log(d['REDIRECT']);
  140 +
  141 + },
  142 + headers: {
  143 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  144 + },
  145 + error: function (data) {
  146 + data = JSON.stringify(data);
  147 + console.log('Error: ' + data);
  148 + }
  149 + });
  150 +
  151 + return false;
  152 + });
  153 +
  154 +</script>
resources/views/layout/frontend.blade.php
... ... @@ -9,6 +9,11 @@
9 9 <script src="{{ asset('js/jquery.js') }}"></script>
10 10 <script type="text/javascript" src="{{ asset('js/jquery.cookie.js') }}"></script>
11 11 <link rel="stylesheet" href="{{ asset('css/style.css') }}">
  12 + <style>
  13 + .err_red {
  14 + border: red 2px solid;
  15 + }
  16 + </style>
12 17 </head>
13 18  
14 19 <body id="body">
... ... @@ -227,9 +232,12 @@
227 232 </div> <!-- END BOTTOM WRAPPER -->
228 233  
229 234 <div hidden> <!-- BEGIN MODALS WRAPPER -->
230   - <!-- Отправить сообщение соискателю -->
  235 + <!-- Соискатель отправляет сообщение работодателю -->
231 236 @include('modals.send_worker')
232 237  
  238 + <!-- Работодатель отправляет сообщение соискателю -->
  239 + @include('modals.send_employer')
  240 +
233 241 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
234 242 @include('modals.send_message_noaut')
235 243  
... ... @@ -248,41 +256,18 @@
248 256 <!-- Благодарность по отправке сообщения менеджеру -->
249 257 @include('modals.thank_you_send_manager')
250 258  
  259 + <!-- Благодарность после регистрации -->
  260 + @include('modals.thank_you_send_for_employer')
251 261  
252   - <div id="thanks-3" class="modal modal_bg">
253   - <div class="modal__body">
254   - <div class="modal__title">Спасибо!</div>
255   - <div class="modal__text">Вы успешно зарегистрировались</div>
256   - <div class="modal__text left"><span>Ваш аккаунт требует подтверждение администратора сайта. Администратор сайта должен изменить статус работодателя, чтобы вы смогли авторизоваться в системе.</span></div>
257   - <div class="modal__text left"><span>После подтверждения администратором, вам прейдет сообщение на электронную почту, о подтверждении регистрации.</span></div>
258   - <a href="#" class="button button_light modal__button">Войти</a>
259   - </div>
260   - </div>
  262 + <!-- Благодарность после регистрации для работника -->
  263 + @include('modals.thank_you_send_for_worker')
  264 +
  265 + <!-- Подтверждение удаления профиля -->
  266 + @include('modals.delete_profile')
  267 +
  268 + <!-- Подверждение об удалении профиля -->
  269 + @include('modals.success_delete_profile')
261 270  
262   - <div id="thanks-4" class="modal modal_bg">
263   - <div class="modal__body">
264   - <div class="modal__title">Спасибо!</div>
265   - <div class="modal__text">Ваше сообщение успешно отправлено администратору сайта на подтверждение.</div>
266   - <a href="#" class="button button_light modal__button">На главную</a>
267   - </div>
268   - </div>
269   - <div id="delete" class="modal modal_bg">
270   - <div class="modal__body">
271   - <div class="modal__title">Удалить профиль?</div>
272   - <div class="modal__text">Вы действительно хотите удалить свой профиль?</div>
273   - <div class="modal__buttons">
274   - <button href="button" class="button">Да</button>
275   - <button href="button" class="button button_light">Нет</button>
276   - </div>
277   - </div>
278   - </div>
279   - <div id="is-deleted" class="modal modal_bg">
280   - <div class="modal__body">
281   - <div class="modal__title">Профиль удален</div>
282   - <div class="modal__text">Вы успешно удалили свой профиль.</div>
283   - <a href="#" class="button button_light modal__button">На главную</a>
284   - </div>
285   - </div>
286 271 </div> <!-- END MODALS WRAPPER -->
287 272  
288 273  
... ... @@ -306,5 +291,7 @@
306 291 };
307 292 </script>
308 293 @yield('scripts')
  294 +
  295 +@include('js.modals')
309 296 </body>
310 297 </html>
resources/views/list_vacancies.blade.php
  1 +@php
  2 + use App\Classes\StatusUser;
  3 +@endphp
  4 +
1 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
2 6  
3 7 @section('scripts')
... ... @@ -17,6 +21,7 @@
17 21 console.log('Выбор сделан!');
18 22 console.log(data);
19 23 main_oskar.html(data);
  24 + history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
20 25 },
21 26 headers: {
22 27 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
... ... @@ -27,13 +32,75 @@
27 32 }
28 33 });
29 34 });
  35 +
  36 + $(document).on('click', '.js_send_it_button', function() {
  37 + var this_ = $(this);
  38 + var code_user_id = this_.attr('data-uid');
  39 + var code_to_user_id = this_.attr('data-tuid');
  40 + var code_vacancy = this_.attr('data-vacancy');
  41 + var user_id = $('#send_user_id');
  42 + var to_user_id = $('#send_to_user_id');
  43 + var vacancy = $('#send_vacancy');
  44 +
  45 + console.log('Клик на кнопки...');
  46 +
  47 + user_id.val(code_user_id);
  48 + to_user_id.val(code_to_user_id);
  49 + vacancy.val(code_vacancy);
  50 + });
  51 +
  52 + $(document).on('change', '#sort_ajax', function() {
  53 + var this_ = $(this);
  54 + var val_ = this_.val();
  55 + console.log('sort items '+val_);
  56 +
  57 + $.ajax({
  58 + type: "GET",
  59 + url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
  60 + data: "sort="+val_+"&block=1",
  61 + success: function (data) {
  62 + console.log('Выбор сортировки');
  63 + console.log(data);
  64 + $('#main_ockar').html(data);
  65 + history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
  66 + },
  67 + headers: {
  68 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  69 + },
  70 + error: function (data) {
  71 + data = JSON.stringify(data);
  72 + console.log('Error: ' + data);
  73 + }
  74 + });
  75 + });
  76 +
  77 +
  78 +
  79 + $(document).ready(function(){
  80 + var sel = $('#select2-sort_ajax-container');
  81 + var key = getUrlParameter('sort');
  82 + console.log(sel);
  83 + console.log(key);
  84 +
  85 + if (key !=='') {
  86 + console.log(key);
  87 + switch (key) {
  88 + case "default": sel.html('Сортировка (по умолчанию)'); break;
  89 + case "name_up": sel.html('По имени (возрастание)'); break;
  90 + case "name_down": sel.html('По дате (убывание)'); break;
  91 + case "created_at_up": sel.html('По дате (возрастание)'); break;
  92 + case "created_at_down": sel.html('По дате (убывание)'); break;
  93 + }
  94 +
  95 + }
  96 + });
30 97 </script>
31 98 @include('js.favorite-vacancy')
32 99 @endsection
33 100 @section('content')
34 101 <section class="thing">
35 102 <div class="container">
36   - <form class="thing__body">
  103 + <form class="thing__body" action="{{ route('list-vacancies', ['categories' => $Name_categori[0]->id]) }}" method="POST">
37 104 <ul class="breadcrumbs thing__breadcrumbs">
38 105 <li><a href="{{ route('index') }}">Главная</a></li>
39 106 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
... ... @@ -49,7 +116,7 @@
49 116 </svg>
50 117 </div>
51 118 <select class="js-select2" id="jobs" name="jobs">
52   - <option value="0" disabled selected>Выберите должность</option>
  119 + <option value="0" selected>Выберите должность</option>
53 120 @if ($Job_title->count())
54 121 @foreach($Job_title as $JT)
55 122 <option value="{{ $JT->id }}">{{ $JT->name }}</option>
... ... @@ -74,14 +141,15 @@
74 141 <div class="select filters__select">
75 142 <select class="js-select2" id="sort_ajax" name="sort_ajax">
76 143 <option value="default">Сортировка (по умолчанию)</option>
77   - <option value="name (asc)">По имени (возрастание)</option>
78   - <option value="name (desc)">По имени (убывание)</option>
79   - <option value="created_at (asc)">По дате (возрастание)</option>
80   - <option value="created_at (desc)">По дате (убывание)</option>
  144 + <option value="name_up">По имени (возрастание)</option>
  145 + <option value="name_down">По имени (убывание)</option>
  146 + <option value="created_at_up">По дате (возрастание)</option>
  147 + <option value="created_at_down">По дате (убывание)</option>
81 148 </select>
82 149 </div>
83 150 </div>
84 151 </div>
  152 +
85 153 <div id="main_ockar" class="main__vacancies" name="main_ockar" style="width:100%;">
86 154 @foreach ($Query as $Q)
87 155 <div class="main__vacancies-item main__employer-page-two-item">
... ... @@ -142,8 +210,18 @@
142 210 @endif
143 211 </div>
144 212 <div class="main__employer-page-two-item-buttons">
145   - <button type="button"
146   - class="button main__employer-page-two-item-button">Откликнуться</button>
  213 + @guest
  214 + <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
  215 + class="button main__employer-page-two-item-button">Откликнуться</button>
  216 + @else
  217 + @if (App\Classes\StatusUser::Status()==1)
  218 + <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}'
  219 + class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
  220 + @else
  221 + <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}'
  222 + class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
  223 + @endif
  224 + @endguest
147 225 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
148 226 </div>
149 227 <div class="main__employer-page-two-item-bottom">
... ... @@ -159,7 +237,6 @@
159 237 <div style="margin-top: 20px">
160 238 {{ $Query->appends($_GET)->links('paginate') }}
161 239 </div>
162   -
163 240 </div><!-- конец -->
164 241 </div>
165 242 </div>
resources/views/modals/delete_profile.blade.php
... ... @@ -0,0 +1,10 @@
  1 +<div id="delete" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__title">Удалить профиль?</div>
  4 + <div class="modal__text">Вы действительно хотите удалить свой профиль?</div>
  5 + <div class="modal__buttons">
  6 + <button href="button" class="button">Да</button>
  7 + <button href="button" class="button button_light">Нет</button>
  8 + </div>
  9 + </div>
  10 +</div>
resources/views/modals/send_employer.blade.php
1   -<div id="send" class="modal">
  1 +<div id="send2" class="modal">
2 2 <div class="modal__body">
3   - <div class="modal__title">Отправить сообщение "Наяда"</div>
4   - <div class="modal__text">Если у вас возникли вопросы насчет вакансии, вы можете задать их работодателю</div>
  3 + <div class="modal__title">Отправить сообщение соискателю</div>
  4 + <div class="modal__text">Если у вас есть предложение для соискателя, вы можете сделать предложение</div>
5 5 <form class="modal__form">
6 6 <div class="modal__form-item error">
7 7 <input id="i1" type="text" class="input" placeholder="Тема" required>
resources/views/modals/send_message_noaut.blade.php
... ... @@ -3,8 +3,8 @@
3 3 <div class="modal__title">Отправить сообщение "Наяда"</div>
4 4 <div class="modal__text">Вы должны быть авторизованы, чтобы отправить личное сообщение</div>
5 5 <div class="modal__buttons">
6   - <a href="#" class="button">Войти</a>
7   - <a href="#" class="button button_light">Зарегистрироваться</a>
  6 + <a data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}' class="button">Войти</a>
  7 + <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}' class="button button_light">Зарегистрироваться</a>
8 8 </div>
9 9 </div>
10 10 </div>
resources/views/modals/send_worker.blade.php
  1 +<script>
  2 + console.log('Сообщение работнику');
  3 + $("#form_worker" ).submit(function(event) {
  4 + var val = $(this).val();
  5 + var send_title = $('#send_title');
  6 + var send_title_val = send_title.val();
  7 +
  8 + console.log('Click form.');
  9 + });
  10 +
  11 + $(document).on('change', '#btn_send_file', function() {
  12 +
  13 + var send_name = $('#send_name');
  14 + var send_name_val = send_name.val();
  15 + var send_name_file = $('#send_name_file');
  16 +
  17 + console.log(send_name_val);
  18 + send_name_file.html(send_name_val);
  19 +
  20 + });
  21 +</script>
1 22 <div id="send" class="modal">
2 23 <div class="modal__body">
3   - <div class="modal__title">Отправить сообщение соискателю</div>
4   - <div class="modal__text">Если у вас есть предложение для данного работника, напишите ему письмо</div>
5   - <form class="modal__form" id="form_worker" name="form_worker">
6   - <div class="modal__form-item error">
7   - <input id="title" name="title" type="text" class="input" placeholder="Тема" required>
  24 + <div class="modal__title">Отправить сообщение работодателю</div>
  25 + <div class="modal__text">Если вы готовы владеете компитентыми навыками, напишите данному работодателю письмо</div>
  26 + <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST">
  27 + @csrf
  28 + <div class="modal__form-item">
  29 + Отправитель сообщения:
  30 + <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value="">
  31 + Получатель сообщения:
  32 + <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value="">
  33 + Вакансия:
  34 + <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
  35 + </div>
  36 + <div class="modal__form-item send_title_div error_">
  37 + <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
8 38 <label for="title">Не заполнено поле</label>
9 39 </div>
10   - <div class="modal__form-item">
11   - <textarea id="i2" class="textarea" id="text" name="text" placeholder="Напишите текст с предложением о работе" required></textarea>
  40 + <div class="modal__form-item send_title_div error_">
  41 + <select class="js-select2" name="send_job_title_id" id="send_job_title_id">
  42 + @if ($jobs->count())
  43 + @foreach($jobs as $j)
  44 + <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option>
  45 + @endforeach
  46 + @endif
  47 + </select>
  48 + <label for="title">Не заполнено поле</label>
  49 + </div>
  50 + <div class="modal__form-item send_text_div">
  51 + <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea>
12 52 <label for="i2">Не заполнено поле</label>
13 53 </div>
14 54 <div class="modal__form-item">
15 55 <div class="file">
16   - <label class="file__input">
17   - <input type="file" name="file" id="name">
  56 + <label class="file__input" id="btn_send_file" name="btn_send_file">
  57 + <input type="file" name="send_file" id="send_name">
18 58 <span class="button button_light">
19 59 <svg>
20 60 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
... ... @@ -23,13 +63,13 @@
23 63 </span>
24 64 </label>
25 65  
26   - <div class="file__list">
  66 + <div class="file__list" id="div_file" name="div_file">
27 67 <div class="file__list-item">
28 68 <div class="file__list-item-left">
29 69 <svg>
30 70 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
31 71 </svg>
32   - <span id="name_file" name="name_file">123</span>
  72 + <span id="send_name_file" name="send_name_file"></span>
33 73 </div>
34 74 <button type="button" class="file__list-item-right js-parent-remove">
35 75 <svg>
... ... @@ -41,7 +81,7 @@
41 81 </div>
42 82 </div>
43 83 <div class="modal__form-item">
44   - <button type="submit" class="button">Отправить</button>
  84 + <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button>
45 85 </div>
46 86 </form>
47 87 </div>
resources/views/modals/success_delete_profile.blade.php
... ... @@ -0,0 +1,7 @@
  1 +<div id="is-deleted" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__title">Профиль удален</div>
  4 + <div class="modal__text">Вы успешно удалили свой профиль.</div>
  5 + <a href="#" class="button button_light modal__button">На главную</a>
  6 + </div>
  7 +</div>
resources/views/modals/thank_you_send_for_employer.blade.php
... ... @@ -0,0 +1,9 @@
  1 +<div id="thanks-3" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__title">Спасибо!</div>
  4 + <div class="modal__text">Вы успешно зарегистрировались</div>
  5 + <div class="modal__text left"><span>Ваш аккаунт требует подтверждение администратора сайта. Администратор сайта должен изменить статус работодателя, чтобы вы смогли авторизоваться в системе.</span></div>
  6 + <div class="modal__text left"><span>После подтверждения администратором, вам прейдет сообщение на электронную почту, о подтверждении регистрации.</span></div>
  7 + <a href="#" class="button button_light modal__button">Войти</a>
  8 + </div>
  9 +</div>
resources/views/modals/thank_you_send_for_worker.blade.php
... ... @@ -0,0 +1,7 @@
  1 +<div id="thanks-4" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__title">Спасибо!</div>
  4 + <div class="modal__text">Ваше сообщение успешно отправлено администратору сайта на подтверждение.</div>
  5 + <a href="#" class="button button_light modal__button">На главную</a>
  6 + </div>
  7 +</div>
resources/views/workers/cabinet.blade.php
1 1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
2 2  
3 3 @section('scripts')
  4 + <script>
  5 + console.log('Test system');
  6 + $(document).on('click', '#button_new_doc', function() {
  7 + var this_ = $(this);
  8 + var val_ = this_.attr('data-val');
  9 + var new_diplom = $('#new_diplom');
  10 + var new_diplom_val = new_diplom.val();
  11 + var new_data_begin = $('#new_data_begin');
  12 + var new_data_begin_val = new_data_begin.val();
  13 + var new_data_end = $('#new_data_end');
  14 + var new_data_end_val = new_data_end.val();
  15 + var education = $('#education');
  16 + var education_val = education.val();
  17 + var worker_id = $('#new_id');
  18 + var worker_val = worker_id.val();
4 19  
  20 + console.log('sort items ' + val_);
  21 +
  22 + if (new_diplom_val == '') {
  23 + new_diplom.addClass('err_red');
  24 + console.log('Border Up');
  25 + } else {
  26 + $.ajax({
  27 + type: "GET",
  28 + url: "{{ route('worker.add_serificate') }}",
  29 + data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val,
  30 + success: function (data) {
  31 + console.log('Блокировка...');
  32 + console.log(data);
  33 + $('#sertificate').html(data);
  34 + if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red');
  35 + },
  36 + headers: {
  37 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  38 + },
  39 + error: function (data) {
  40 + data = JSON.stringify(data);
  41 + console.log('Error: ' + data);
  42 + }
  43 + });
  44 + }
  45 + });
  46 +
  47 + $(document).on('click', '#btn_new_diplom123', function() {
  48 + var this_ = $(this);
  49 + var val_ = this_.attr('data-val');
  50 + var documents = $('#documents');
  51 + var doc_val = documents.val();
  52 + var block = $('#ajax_dop_diplomi');
  53 +
  54 + console.log('worker_id='+val_+'it_infoblock='+ doc_val);
  55 +
  56 + $.ajax({
  57 + type: "GET",
  58 + url: "",
  59 + data: "worker_id="+val_+"&infoblok_id="+doc_val,
  60 + success: function (data) {
  61 + location.url = data;
  62 + console.log('Добавление документа-диплома');
  63 + console.log(data);
  64 + block.html(data);
  65 + },
  66 + headers: {
  67 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  68 + },
  69 + error: function (data) {
  70 + data = JSON.stringify(data);
  71 + console.log('Error: ' + data);
  72 + }
  73 + });
  74 + });
  75 +
  76 + $(document).on('click', '#new_work', function() {
  77 + var this_ = $(this);
  78 + var val_ = this_.attr('data-val');
  79 + var new_diplom = $('#new_diplom').val();
  80 + var new_data_begin = $('#new_data_begin').val();
  81 + var new_data_end = $('#new_data_end').val();
  82 + var new_job_title = $('#new_job_title').val();
  83 + var new_teplohod = $('#new_teplohod').val();
  84 + var new_GWT = $('#new_GWT').val();
  85 + var new_KBT = $('#new_KBT').val();
  86 + var new_Begin_work = $('#new_Begin_work').val();
  87 + var new_End_work = $('#new_End_work').val();
  88 + var new_name_company = $('#new_name_company').val();
  89 +
  90 + console.log('worker_id='+val_+'it_infoblock='+ doc_val);
  91 +
  92 + $.ajax({
  93 + type: "GET",
  94 + url: "",
  95 + data: "worker_id="+val_+"&infoblok_id="+doc_val,
  96 + success: function (data) {
  97 + location.url = data;
  98 + console.log('Добавление документа-диплома');
  99 + console.log(data);
  100 + block.html(data);
  101 + },
  102 + headers: {
  103 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  104 + },
  105 + error: function (data) {
  106 + data = JSON.stringify(data);
  107 + console.log('Error: ' + data);
  108 + }
  109 + });
  110 + });
  111 + </script>
5 112 @endsection
6 113  
7 114 @section('content')
... ... @@ -20,15 +127,17 @@
20 127  
21 128 @include('workers.menu', ['item' => 1])
22 129 </div>
23   - <form class="cabinet__body">
  130 + <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST">
  131 + @csrf
  132 + @include('messages_error')
24 133 <div class="cabinet__body-item">
25 134 <div class="cabinet__anketa">
26 135 <h2 class="title cabinet__title">Моя анкета</h2>
27 136 <div class="cabinet__anketa-buttons">
28   - <button type="button" class="button">Поднять резюме</button>
29   - <a href="#" class="button">
  137 + <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a>
  138 + <a href="{{ route('worker.download', ['worker' => $Worker[0]->id]) }}" class="button">
30 139 <svg>
31   - <use xlink:href="images/sprite.svg#share"></use>
  140 + <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
32 141 </svg>
33 142 Скачать резюме
34 143 </a>
... ... @@ -41,22 +150,22 @@
41 150 <div class="cabinet__stats-body">
42 151 <div class="cabinet__stats-item">
43 152 <svg>
44   - <use xlink:href="images/sprite.svg#eye-3"></use>
  153 + <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
45 154 </svg>
46 155 <span>Просмотров:</span>
47   - <b>23</b>
  156 + <b>@if (isset($Worker[0]->users->static_user)) 1 @else 0 @endif</b>
48 157 </div>
49 158 <div class="cabinet__stats-item">
50 159 <svg>
51   - <use xlink:href="images/sprite.svg#warning"></use>
  160 + <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use>
52 161 </svg>
53 162 <span>Отзывов:</span>
54   - <b>12</b>
  163 + <b>@if (isset($Worker[0]->users->static_user)) 1 @else 0 @endif</b>
55 164 </div>
56 165 </div>
57   - <div class="cabinet__stats-subtitle">Анкета заполнена на 20%</div>
  166 + <div class="cabinet__stats-subtitle">Анкета заполнена на @if (!empty($Worker[0]->persent_anketa)) {{ $Worker[0]->persent_anketa }}% @else 0% @endif</div>
58 167 <div class="cabinet__stats-line">
59   - <span style="width:20%"></span>
  168 + <span style="width:@if (!empty($Worker[0]->persent_anketa)) {{ $Worker[0]->persent_anketa }}% @else 0% @endif"></span>
60 169 </div>
61 170 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div>
62 171 </div>
... ... @@ -65,23 +174,29 @@
65 174 <h3 class="cabinet__subtitle">Профиль</h3>
66 175 <div class="cabinet__avatar">
67 176 <div class="cabinet__avatar-pic">
  177 +
  178 + @if (!empty($Worker[0]->photo))
  179 + <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/>
  180 + @else
68 181 <svg>
69   - <use xlink:href="images/sprite.svg#pic"></use>
  182 + <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
70 183 </svg>
  184 + @endif
71 185 </div>
72 186 <div class="cabinet__avatar-form">
73 187 <label class="file">
74 188 <span class="file__input">
75   - <input type="file">
  189 + <input type="file" name="photo" id="photo">
  190 +
76 191 <span class="button">
77 192 <svg>
78   - <use xlink:href="images/sprite.svg#plus"></use>
  193 + <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
79 194 </svg>
80 195 Загрузить
81 196 </span>
82 197 </span>
83 198 </label>
84   - <p class="cabinet__text">Загрузите фотографию в формате svg.</p>
  199 + <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p>
85 200 </div>
86 201 </div>
87 202 </div>
... ... @@ -90,21 +205,47 @@
90 205 <div class="cabinet__inputs-item form-group">
91 206 <label class="form-group__label">Электронная почта *</label>
92 207 <div class="form-group__item">
93   - <input type="email" class="input" placeholder="info@rekamore.su" required>
  208 + <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required>
94 209 </div>
95 210 </div>
96 211 <div class="cabinet__inputs-item form-group">
  212 + <label class="form-group__label">Статус</label>
  213 + <div class="form-group__item">
  214 + <div class="select">
  215 + <select class="js-select2" name="status_work" id="status_work">
  216 + <option value="1" @if ($Worker[0]->status_work == 1) selected @endif>Не указано</option>
  217 + <option value="2" @if ($Worker[0]->status_work == 2) selected @endif>Не ищу работу</option>
  218 + <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option>
  219 + </select>
  220 + </div>
  221 + </div>
  222 + </div>
  223 + <!--<div class="cabinet__inputs-item form-group">
97 224 <label class="form-group__label">Статус *</label>
98 225 <div class="form-group__item">
99 226 <input type="text" class="input" required>
100 227 </div>
  228 + </div>-->
  229 + @if (isset($Worker[0]->users))
  230 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  231 + <label class="form-group__label">Фамилия *</label>
  232 + <div class="form-group__item">
  233 + <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required>
  234 + </div>
101 235 </div>
102 236 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
103   - <label class="form-group__label">ФИО *</label>
  237 + <label class="form-group__label">Имя *</label>
104 238 <div class="form-group__item">
105   - <input type="text" class="input" placeholder="Филиппов Егор Алексеевич" required>
  239 + <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required>
106 240 </div>
107 241 </div>
  242 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  243 + <label class="form-group__label">Отчество *</label>
  244 + <div class="form-group__item">
  245 + <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич">
  246 + </div>
  247 + </div>
  248 + @endif
108 249 </div>
109 250 </div>
110 251 <div class="cabinet__body-item">
... ... @@ -113,319 +254,211 @@
113 254 <div class="cabinet__inputs-item cabinet__inputs-item_min form-group">
114 255 <label class="form-group__label">Возраст</label>
115 256 <div class="form-group__item">
116   - <input type="number" class="input" placeholder="0" required>
  257 + <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required>
117 258 </div>
118 259 </div>
119 260 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group">
120   - <label class="form-group__label">Возраст</label>
  261 + <label class="form-group__label">Желаемые вакансии</label>
121 262 <div class="form-group__item">
122 263 <div class="select">
123   - <select class="js-select2" multiple="multiple">
124   - <option selected>Капитан</option>
125   - <option selected>Старший помощник капитана</option>
126   - <option>Сортировка 1</option>
127   - <option>Сортировка 2</option>
128   - <option>Сортировка 3</option>
129   - <option>Сортировка 4</option>
130   - <option>Сортировка 5</option>
131   - <option>Сортировка 6</option>
  264 + <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
  265 + @if ($Job_titles->count())
  266 + @foreach($Job_titles as $it)
  267 + @if (isset($Worker[0]->job_titles))
  268 + @if ($Worker[0]->job_titles->count())
  269 + @foreach($Worker[0]->job_titles as $select)
  270 + <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option>
  271 + @endforeach
  272 + @else
  273 + <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
  274 + @endif
  275 + @else
  276 + <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
  277 + @endif
  278 + @endforeach
  279 + @endif
132 280 </select>
133 281 </div>
134 282 </div>
135 283 </div>
136 284 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
137   - <label class="form-group__label">ФИО *</label>
  285 + <label class="form-group__label">Город</label>
138 286 <div class="form-group__item">
139   - <input type="text" class="input" placeholder="Челябинск" required>
  287 + <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required>
140 288 </div>
141 289 </div>
142 290 <div class="cabinet__inputs-item form-group">
143 291 <label class="form-group__label">Опыт работы</label>
144 292 <div class="form-group__item">
145 293 <div class="select">
146   - <select class="js-select2">
147   - <option>1 год</option>
148   - <option>Сортировка 1</option>
149   - <option>Сортировка 2</option>
150   - <option>Сортировка 3</option>
151   - <option>Сортировка 4</option>
152   - <option>Сортировка 5</option>
153   - <option>Сортировка 6</option>
154   - </select>
155   - </div>
156   - </div>
157   - </div>
158   - <div class="cabinet__inputs-item form-group">
159   - <label class="form-group__label">Кому хотите отправить сообщение</label>
160   - <div class="form-group__item">
161   - <div class="select">
162   - <select class="js-select2">
163   - <option>Не указано</option>
164   - <option>Сортировка 1</option>
165   - <option>Сортировка 2</option>
166   - <option>Сортировка 3</option>
167   - <option>Сортировка 4</option>
168   - <option>Сортировка 5</option>
169   - <option>Сортировка 6</option>
  294 + <select class="js-select2" id="experience" name="experience">
  295 + <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option>
  296 + <option value="меньше 1 года" @if ($Worker[0]->experience == 'меньше 1 года') selected @endif>меньше 1 года</option>
  297 + <option value="от 1 года до 3 лет" @if ($Worker[0]->experience == 'от 1 года до 3 лет') selected @endif>от 1 года до 3 лет</option>
  298 + <option value="от 3 до 5 лет" @if ($Worker[0]->experience == 'от 3 до 5 лет') selected @endif>от 3 до 5 лет</option>
  299 + <option value="от 5 до 10 лет" @if ($Worker[0]->experience == 'от 5 до 10 лет') selected @endif>от 5 до 10 лет</option>
  300 + <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option>
170 301 </select>
171 302 </div>
172 303 </div>
173 304 </div>
  305 +
174 306 <div class="cabinet__inputs-item form-group">
175   - <label class="form-group__label">Электронная почта</label>
  307 + <label class="form-group__label">Номер телефона 1</label>
176 308 <div class="form-group__item">
177   - <input type="email" class="input" placeholder="info@rekamore.su" required>
  309 + <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required>
178 310 </div>
179 311 </div>
180 312 <div class="cabinet__inputs-item form-group">
181   - <label class="form-group__label">Номер телефона</label>
  313 + <label class="form-group__label">Номер телефона 2</label>
182 314 <div class="form-group__item">
183   - <input type="tel" class="input" placeholder="+7 (___) ___-__-__" required>
  315 + <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__">
184 316 </div>
185 317 </div>
186 318 </div>
187 319 </div>
188   - <div class="cabinet__body-item">
189   - <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
190   - <h4 class="cabinet__h4">Сертификат 1</h4>
191   - <div class="cabinet__inputs">
192   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
193   - <label class="form-group__label">Название сертификата</label>
194   - <div class="form-group__item">
195   - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич" disabled>
  320 +
  321 + <div id="sertificate" name="sertificate">
  322 + @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0))
  323 + @php $i = 0; @endphp
  324 + @foreach($Worker[0]->sertificate as $it)
  325 + <div style="margin-bottom: 20px" class="cabinet__body-item">
  326 + @if ($i == 0)
  327 + <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
  328 + @endif
  329 + <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4>
  330 + <div class="cabinet__inputs">
  331 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  332 + <label class="form-group__label">Название сертификата</label>
  333 + <div class="form-group__item">
  334 + <input type="text" class="input" value="{{ $it->name }}" disabled>
  335 + </div>
  336 + </div>
  337 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  338 + <label class="form-group__label">Название сертификата</label>
  339 + <div class="form-group__item">
  340 + <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled>
  341 + </div>
  342 + </div>
  343 + <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light">
  344 + <svg>
  345 + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
  346 + </svg>
  347 + Удалить
  348 + </a>
196 349 </div>
197 350 </div>
198   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
199   - <label class="form-group__label">Название сертификата</label>
200   - <div class="form-group__item">
201   - <input type="text" class="input" value="04.11.26" disabled>
202   - </div>
  351 + @php $i++ @endphp
  352 + @endforeach
  353 + @else
  354 + <div style="margin-bottom: 20px" class="cabinet__body-item">
  355 + <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
  356 + Нет сертификатов
203 357 </div>
204   - <button type="button" class="button button_light">
205   - <svg>
206   - <use xlink:href="images/sprite.svg#del"></use>
207   - </svg>
208   - Удалить
209   - </button>
210   - </div>
  358 + @endif
211 359 </div>
  360 +
212 361 <div class="cabinet__body-item">
213   - <h4 class="cabinet__h4">Сертификат 2</h4>
  362 + <h4 class="cabinet__h4">Добавить сертификат</h4>
214 363 <div class="cabinet__inputs">
215   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  364 + <input type="hidden" name="new_id" id="new_id" class="input" value="{{ $Worker[0]->id }}">
  365 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
216 366 <label class="form-group__label">Название сертификата</label>
217 367 <div class="form-group__item">
218   - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич" disabled>
  368 + <input type="text" name="new_diplom" id="new_diplom" class="input" value="Диплом о дополнительном образовании">
219 369 </div>
220 370 </div>
221 371 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
222   - <label class="form-group__label">Название сертификата</label>
  372 + <label class="form-group__label">Дата поступления</label>
223 373 <div class="form-group__item">
224   - <input type="text" class="input" value="04.11.26" disabled>
  374 + <input type="text" name="new_data_begin" id="new_data_begin" class="input" value="01.09.23">
225 375 </div>
226 376 </div>
227   - <button type="button" class="button button_light">
228   - <svg>
229   - <use xlink:href="images/sprite.svg#del"></use>
230   - </svg>
231   - Удалить
232   - </button>
233   - </div>
234   - </div>
235   - <div class="cabinet__body-item">
236   - <h4 class="cabinet__h4">Добавить сертификат</h4>
237   - <div class="cabinet__inputs">
238 377 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
239   - <label class="form-group__label">Название сертификата</label>
  378 + <label class="form-group__label">Дата окончания</label>
240 379 <div class="form-group__item">
241   - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич">
  380 + <input type="text" name="new_data_end" id="new_data_end" class="input" value="04.11.26">
242 381 </div>
243 382 </div>
244 383 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
245   - <label class="form-group__label">Название сертификата</label>
  384 + <label class="form-group__label">Дата окончания</label>
246 385 <div class="form-group__item">
247   - <input type="text" class="input" value="04.11.26">
  386 + <input type="text" name="education" id="education" class="input" value="Учебное заведение">
248 387 </div>
249 388 </div>
250   - <button type="button" class="button button_light">
  389 + <div class="button button_light" data-val="{{ $Worker[0]->id }}" id="button_new_doc" name="button_new_doc">
251 390 Добавить сертификат
252   - </button>
  391 + </div>
253 392 </div>
254 393 </div>
255   - <div class="cabinet__body-item">
  394 +
  395 + <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
256 396 <h4 class="cabinet__h4">Дополнительная информация</h4>
257   - <div class="cabinet__inputs">
258   - <div class="cabinet__inputs-item form-group">
259   - <label class="form-group__label">Загран паспорт</label>
260   - <div class="form-group__item">
261   - <div class="select">
262   - <select class="js-select2">
263   - <option>Не указано</option>
264   - <option>Сортировка 1</option>
265   - <option>Сортировка 2</option>
266   - <option>Сортировка 3</option>
267   - <option>Сортировка 4</option>
268   - <option>Сортировка 5</option>
269   - <option>Сортировка 6</option>
270   - </select>
271   - </div>
272   - </div>
273   - </div>
274   - <div class="cabinet__inputs-item form-group">
275   - <label class="form-group__label">МК</label>
276   - <div class="form-group__item">
277   - <div class="select">
278   - <select class="js-select2">
279   - <option>Не указано</option>
280   - <option>Сортировка 1</option>
281   - <option>Сортировка 2</option>
282   - <option>Сортировка 3</option>
283   - <option>Сортировка 4</option>
284   - <option>Сортировка 5</option>
285   - <option>Сортировка 6</option>
286   - </select>
287   - </div>
288   - </div>
289   - </div>
290   - <div class="cabinet__inputs-item form-group">
291   - <label class="form-group__label">ВВП</label>
292   - <div class="form-group__item">
293   - <div class="select">
294   - <select class="js-select2">
295   - <option>Не указано</option>
296   - <option>Сортировка 1</option>
297   - <option>Сортировка 2</option>
298   - <option>Сортировка 3</option>
299   - <option>Сортировка 4</option>
300   - <option>Сортировка 5</option>
301   - <option>Сортировка 6</option>
302   - </select>
303   - </div>
304   - </div>
305   - </div>
306   - <div class="cabinet__inputs-item form-group">
307   - <label class="form-group__label">УЛМ</label>
308   - <div class="form-group__item">
309   - <div class="select">
310   - <select class="js-select2">
311   - <option>Не указано</option>
312   - <option>Сортировка 1</option>
313   - <option>Сортировка 2</option>
314   - <option>Сортировка 3</option>
315   - <option>Сортировка 4</option>
316   - <option>Сортировка 5</option>
317   - <option>Сортировка 6</option>
318   - </select>
319   - </div>
320   - </div>
321   - </div>
322   - <div class="cabinet__inputs-item form-group">
323   - <label class="form-group__label">Речной диплом</label>
324   - <div class="form-group__item">
325   - <div class="select">
326   - <select class="js-select2">
327   - <option>Не указано</option>
328   - <option>Сортировка 1</option>
329   - <option>Сортировка 2</option>
330   - <option>Сортировка 3</option>
331   - <option>Сортировка 4</option>
332   - <option>Сортировка 5</option>
333   - <option>Сортировка 6</option>
334   - </select>
335   - </div>
336   - </div>
337   - </div>
338   - <div class="cabinet__inputs-item form-group">
339   - <label class="form-group__label">Морской диплом</label>
340   - <div class="form-group__item">
341   - <div class="select">
342   - <select class="js-select2">
343   - <option>Не указано</option>
344   - <option>Сортировка 1</option>
345   - <option>Сортировка 2</option>
346   - <option>Сортировка 3</option>
347   - <option>Сортировка 4</option>
348   - <option>Сортировка 5</option>
349   - <option>Сортировка 6</option>
350   - </select>
351   - </div>
352   - </div>
353   - </div>
354   - <div class="cabinet__inputs-item form-group">
355   - <label class="form-group__label">МПСС 72</label>
356   - <div class="form-group__item">
357   - <div class="select">
358   - <select class="js-select2">
359   - <option>Не указано</option>
360   - <option>Сортировка 1</option>
361   - <option>Сортировка 2</option>
362   - <option>Сортировка 3</option>
363   - <option>Сортировка 4</option>
364   - <option>Сортировка 5</option>
365   - <option>Сортировка 6</option>
366   - </select>
367   - </div>
368   - </div>
369   - </div>
370   - <div class="cabinet__inputs-item form-group">
371   - <label class="form-group__label">ГМССБ</label>
372   - <div class="form-group__item">
373   - <div class="select">
374   - <select class="js-select2">
375   - <option>Не указано</option>
376   - <option>Сортировка 1</option>
377   - <option>Сортировка 2</option>
378   - <option>Сортировка 3</option>
379   - <option>Сортировка 4</option>
380   - <option>Сортировка 5</option>
381   - <option>Сортировка 6</option>
382   - </select>
  397 + <div class="cabinet__inputs" >
  398 + @if (isset($Worker[0]->infobloks))
  399 + @if ($Worker[0]->infobloks->count())
  400 + @php $i = 1; @endphp
  401 + @foreach ($Worker[0]->infobloks as $info)
  402 + <div class="cabinet__inputs-item form-group">
  403 + <label class="form-group__label">{{ $info->name }}</label>
  404 + <div class="form-group__item">
  405 + <div class="select">
  406 + <select class="js-select2 sertificates_js">
  407 + <option value="0">Нет</option>
  408 + <option value="1" selected>Да</option>
  409 + </select>
  410 + </div>
  411 + </div>
383 412 </div>
384   - </div>
385   - </div>
386   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
387   - <label class="form-group__label">Образование</label>
  413 + @php $i++; @endphp
  414 + @endforeach
  415 + @endif
  416 + @endif
  417 +
  418 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  419 + <label class="form-group__label">Образцы дипломов и документов</label>
388 420 <div class="form-group__item">
389 421 <div class="select">
390   - <select class="js-select2">
391   - <option>Не указано</option>
392   - <option>Сортировка 1</option>
393   - <option>Сортировка 2</option>
394   - <option>Сортировка 3</option>
395   - <option>Сортировка 4</option>
396   - <option>Сортировка 5</option>
397   - <option>Сортировка 6</option>
  422 + <select class="js-select2" id="documents" name="documents">
  423 + @if ($Infoblocks->count())
  424 + @foreach ($Infoblocks as $it)
  425 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  426 + @endforeach
  427 + @endif
398 428 </select>
399 429 </div>
400 430 </div>
401 431 </div>
402   - <button type="button" class="button button_light">
403   - Добавить сертификат
404   - </button>
  432 + <a href="{{ route('worker.add_diplom', ['worker' => $Worker[0]->id]) }}" name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light">
  433 + Добавить документ
  434 + </a>
405 435 </div>
406 436 </div>
407 437 <div class="cabinet__body-item">
408 438 <div class="cabinet__works">
  439 + @if (isset($Worker[0]->place_worker))
  440 + @php $i = 1; @endphp
  441 + @foreach($Worker[0]->place_worker as $company)
409 442 <div class="cabinet__works-item">
410 443 <div class="cabinet__works-spoiler active">
411 444 <div class="cabinet__works-spoiler-left">
412 445 <div class="cabinet__works-spoiler-buttons">
413   - <button type="button" class="button button_light js-works-remove">
  446 + <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
414 447 <svg>
415   - <use xlink:href="images/sprite.svg#del"></use>
  448 + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
416 449 </svg>
417   - </button>
418   - <button type="button" class="button button_light js-works-edit">
  450 + </a>
  451 + <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $Worker[0]->id]) }}" type="button" class="button button_light js-works-edit">
419 452 <svg>
420   - <use xlink:href="images/sprite.svg#pencil"></use>
  453 + <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
421 454 </svg>
422   - </button>
  455 + </a>
423 456 </div>
424   - <div class="cabinet__works-spoiler-text">Место работы 1</div>
  457 + <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div>
425 458 </div>
426 459 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
427 460 <svg>
428   - <use xlink:href="images/sprite.svg#arrow-bold"></use>
  461 + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
429 462 </svg>
430 463 </button>
431 464 </div>
... ... @@ -434,74 +467,66 @@
434 467 <div class="cabinet__inputs-item form-group">
435 468 <label class="form-group__label">Должность</label>
436 469 <div class="form-group__item">
437   - <input type="text" class="input" value="Не указано">
  470 + <input type="text" class="input" value="{{ $company->job_title }}">
438 471 </div>
439 472 </div>
440 473 <div class="cabinet__inputs-item form-group">
441 474 <label class="form-group__label">Опыт работы в танкерном флоте</label>
442 475 <div class="form-group__item">
443   - <input type="text" class="input" value="Не указано">
  476 + <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif">
444 477 </div>
445 478 </div>
446 479 <div class="cabinet__inputs-item form-group">
447 480 <label class="form-group__label">Название теплохода</label>
448 481 <div class="form-group__item">
449   - <input type="text" class="input" value="Не указано">
  482 + <input type="text" class="input" value="{{ $company->teplohod }}">
450 483 </div>
451 484 </div>
452 485 <div class="cabinet__inputs-item form-group">
453 486 <label class="form-group__label">Тип (GWT)</label>
454 487 <div class="form-group__item">
455   - <input type="text" class="input" value="Не указано">
  488 + <input type="text" class="input" value="{{ $company->GWT }}">
456 489 </div>
457 490 </div>
458 491 <div class="cabinet__inputs-item form-group">
459 492 <label class="form-group__label">ГД (кВТ)</label>
460 493 <div class="form-group__item">
461   - <input type="text" class="input" value="Не указано">
  494 + <input type="text" class="input" value="{{ $company->KBT }}">
462 495 </div>
463 496 </div>
464 497 <div class="cabinet__inputs-item form-group">
465 498 <label class="form-group__label">Начало контракта</label>
466 499 <div class="form-group__item">
467   - <input type="text" class="input" value="Не указано">
  500 + <input type="text" class="input" value="{{ $company->begin_work }}">
468 501 </div>
469 502 </div>
470 503 <div class="cabinet__inputs-item form-group">
471 504 <label class="form-group__label">Окончание контракта</label>
472 505 <div class="form-group__item">
473   - <input type="text" class="input" value="Не указано">
  506 + <input type="text" class="input" value="{{ $company->end_work }}">
474 507 </div>
475 508 </div>
476 509 <div class="cabinet__inputs-item form-group">
477 510 <label class="form-group__label">Название компании</label>
478 511 <div class="form-group__item">
479   - <input type="text" class="input" value="Не указано">
  512 + <input type="text" class="input" value="{{ $company->name_company }}">
480 513 </div>
481 514 </div>
482 515 </div>
483 516 </div>
484 517 </div>
485   - <div class="cabinet__works-item">
  518 + @php $i++ @endphp
  519 + @endforeach
  520 + @endif
  521 +
  522 + <!--<div class="cabinet__works-item">
486 523 <div class="cabinet__works-spoiler">
487 524 <div class="cabinet__works-spoiler-left">
488   - <div class="cabinet__works-spoiler-buttons">
489   - <button type="button" class="button button_light js-works-remove">
490   - <svg>
491   - <use xlink:href="images/sprite.svg#del"></use>
492   - </svg>
493   - </button>
494   - <button type="button" class="button button_light js-works-edit">
495   - <svg>
496   - <use xlink:href="images/sprite.svg#pencil"></use>
497   - </svg>
498   - </button>
499   - </div>
500   - <div class="cabinet__works-spoiler-text">Место работы 2</div>
  525 + <div class="cabinet__works-spoiler-text">Новая работа</div>
501 526 </div>
502 527 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
503 528 <svg>
504   - <use xlink:href="images/sprite.svg#arrow-bold"></use>
  529 + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
505 530 </svg>
506 531 </button>
507 532 </div>
... ... @@ -510,66 +535,70 @@
510 535 <div class="cabinet__inputs-item form-group">
511 536 <label class="form-group__label">Должность</label>
512 537 <div class="form-group__item">
513   - <input type="text" class="input" value="Не указано">
  538 + <input type="text" name="new_job_title" id="new_job_title" class="input" value="Не указано">
514 539 </div>
515 540 </div>
516 541 <div class="cabinet__inputs-item form-group">
517 542 <label class="form-group__label">Опыт работы в танкерном флоте</label>
518 543 <div class="form-group__item">
519   - <input type="text" class="input" value="Не указано">
  544 + <select class="js-select2" name="new_job_title" id="new_job_title">
  545 + <option value="0">Нет</option>
  546 + <option value="1">Да</option>
  547 + </select>
520 548 </div>
521 549 </div>
522 550 <div class="cabinet__inputs-item form-group">
523 551 <label class="form-group__label">Название теплохода</label>
524 552 <div class="form-group__item">
525   - <input type="text" class="input" value="Не указано">
  553 + <input type="text" name="new_teplohod" id="new_teplohod" class="input" value="Не указано">
526 554 </div>
527 555 </div>
528 556 <div class="cabinet__inputs-item form-group">
529 557 <label class="form-group__label">Тип (GWT)</label>
530 558 <div class="form-group__item">
531   - <input type="text" class="input" value="Не указано">
  559 + <input type="text" name="new_GWT" id="new_GWT" class="input" value="Не указано">
532 560 </div>
533 561 </div>
534 562 <div class="cabinet__inputs-item form-group">
535 563 <label class="form-group__label">ГД (кВТ)</label>
536 564 <div class="form-group__item">
537   - <input type="text" class="input" value="Не указано">
  565 + <input type="text" name="new_KBT" id="new_KBT" class="input" value="Не указано">
538 566 </div>
539 567 </div>
540 568 <div class="cabinet__inputs-item form-group">
541 569 <label class="form-group__label">Начало контракта</label>
542 570 <div class="form-group__item">
543   - <input type="text" class="input" value="Не указано">
  571 + <input type="text" name="new_Begin_work" id="new_Begin_work" class="input" value="Не указано">
544 572 </div>
545 573 </div>
546 574 <div class="cabinet__inputs-item form-group">
547 575 <label class="form-group__label">Окончание контракта</label>
548 576 <div class="form-group__item">
549   - <input type="text" class="input" value="Не указано">
  577 + <input type="text" name="new_End_work" id="new_End_work" class="input" value="Не указано">
550 578 </div>
551 579 </div>
552 580 <div class="cabinet__inputs-item form-group">
553 581 <label class="form-group__label">Название компании</label>
554 582 <div class="form-group__item">
555   - <input type="text" class="input" value="Не указано">
  583 + <input type="text" name="new_name_company" id="new_name_company" class="input" value="Не указано">
556 584 </div>
557 585 </div>
558 586 </div>
559 587 </div>
560   - </div>
561   - <button type="button" class="button button_light cabinet__works-add">Добавить место работы</button>
  588 + </div>-->
  589 + <a href="{{ route('worker.add_document', ['worker' => $Worker[0]->id]) }}" id="new_work" name="new_work" class="button button_light cabinet__works-add">Новое место работы</a>
562 590 </div>
563 591 </div>
  592 +
564 593 <div class="cabinet__body-item">
565 594 <h4 class="cabinet__h4">О себе</h4>
566   - <textarea class="textarea" placeholder="Не указано"></textarea>
  595 + <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea>
567 596 <div class="cabinet__buttons">
568 597 <button type="submit" class="button">Сохранить</button>
569 598 <label class="file">
570 599 <span class="file__input">
571   - <input type="file">
572   - <span class="button button_light">Прикрепить резюме</span>
  600 + <input type="file" name="file" id="file">
  601 + <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else {{ $Worker[0]->file }}@endif</span>
573 602 </span>
574 603 </label>
575 604 </div>
resources/views/workers/docs-edit.blade.php
... ... @@ -0,0 +1,101 @@
  1 +@extends('layout.frontend', ['title' => 'Редактирование стандартного документа - РекаМоре'])
  2 +
  3 +@section('scripts')
  4 +
  5 +@endsection
  6 +
  7 +@section('content')
  8 + <section class="cabinet">
  9 + <div class="container">
  10 + <ul class="breadcrumbs cabinet__breadcrumbs">
  11 + <li><a href="{{ route('index') }}">Главная</a></li>
  12 + <li><b>Личный кабинет</b></li>
  13 + </ul>
  14 + <div class="cabinet__wrapper">
  15 + <div class="cabinet__side">
  16 + <div class="cabinet__side-toper">
  17 + @include('workers.emblema')
  18 +
  19 + </div>
  20 +
  21 + @include('workers.menu', ['item' => 1])
  22 + </div>
  23 +
  24 + <form class="cabinet__body" action="{{ route('worker.edit_document_save', ['doc' => $doc->id]) }}" method="POST">
  25 + @csrf
  26 + <div class="cabinet__works-item">
  27 + @include('messages_error')
  28 + <div class="cabinet__works-spoiler active">
  29 + <div class="cabinet__works-spoiler-left">
  30 + <div class="cabinet__works-spoiler-text">Редактирование работы</div>
  31 + </div>
  32 + <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
  33 + <svg>
  34 + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
  35 + </svg>
  36 + </button>
  37 + </div>
  38 + <div class="cabinet__works-body">
  39 + <div class="cabinet__inputs">
  40 + <input type="hidden" name="worker_id" id="worker_id" value="{{ $worker->id }}"/>
  41 + <div class="cabinet__inputs-item form-group">
  42 + <label class="form-group__label">Должность</label>
  43 + <div class="form-group__item">
  44 + <input type="text" name="job_title" id="job_title" class="input" value="{{ old('job_title') ?? $doc->job_title ?? '' }}">
  45 + </div>
  46 + </div>
  47 + <div class="cabinet__inputs-item form-group">
  48 + <label class="form-group__label">Опыт работы в танкерном флоте</label>
  49 + <div class="form-group__item">
  50 + <select class="js-select2" name="tanker" id="tanker">
  51 + <option value="0" @if ($doc->tanker == 0) seleted @endif>Нет</option>
  52 + <option value="1" @if ($doc->tanker == 1) seleted @endif>Да</option>
  53 + </select>
  54 + </div>
  55 + </div>
  56 + <div class="cabinet__inputs-item form-group">
  57 + <label class="form-group__label">Название теплохода</label>
  58 + <div class="form-group__item">
  59 + <input type="text" name="teplohod" id="teplohod" class="input" value="{{ old('teplohod') ?? $doc->teplohod ?? '' }}">
  60 + </div>
  61 + </div>
  62 + <div class="cabinet__inputs-item form-group">
  63 + <label class="form-group__label">Тип (GWT)</label>
  64 + <div class="form-group__item">
  65 + <input type="text" name="GWT" id="GWT" class="input" value="{{ old('GWT') ?? $doc->GWT ?? '' }}">
  66 + </div>
  67 + </div>
  68 + <div class="cabinet__inputs-item form-group">
  69 + <label class="form-group__label">ГД (кВТ)</label>
  70 + <div class="form-group__item">
  71 + <input type="text" name="KBT" id="KBT" class="input" value="{{ old('KBT') ?? $doc->KBT ?? '' }}">
  72 + </div>
  73 + </div>
  74 + <div class="cabinet__inputs-item form-group">
  75 + <label class="form-group__label">Начало контракта</label>
  76 + <div class="form-group__item">
  77 + <input type="text" name="Begin_work" id="Begin_work" class="input" value="{{ old('begin_work') ?? $doc->begin_work ?? '' }}">
  78 + </div>
  79 + </div>
  80 + <div class="cabinet__inputs-item form-group">
  81 + <label class="form-group__label">Окончание контракта</label>
  82 + <div class="form-group__item">
  83 + <input type="text" name="End_work" id="End_work" class="input" value="{{ old('end_work') ?? $doc->end_work ?? '' }}">
  84 + </div>
  85 + </div>
  86 + <div class="cabinet__inputs-item form-group">
  87 + <label class="form-group__label">Название компании</label>
  88 + <div class="form-group__item">
  89 + <input type="text" name="name_company" id="name_company" class="input" value="{{ old('name_company') ?? $doc->name_company ?? '' }}">
  90 + </div>
  91 + </div>
  92 + <button type="submit" class="button">Сохранить</button>
  93 + </div>
  94 + </div>
  95 + </div>
  96 + </form>
  97 + </div>
  98 + </div>
  99 + </section>
  100 + </div>
  101 +@endsection
resources/views/workers/docs.blade.php
... ... @@ -0,0 +1,102 @@
  1 +@extends('layout.frontend', ['title' => 'Добавление стандартного документа - РекаМоре'])
  2 +
  3 +@section('scripts')
  4 +
  5 +@endsection
  6 +
  7 +@section('content')
  8 + <section class="cabinet">
  9 + <div class="container">
  10 + <ul class="breadcrumbs cabinet__breadcrumbs">
  11 + <li><a href="{{ route('index') }}">Главная</a></li>
  12 + <li><b>Личный кабинет</b></li>
  13 + </ul>
  14 + <div class="cabinet__wrapper">
  15 + <div class="cabinet__side">
  16 + <div class="cabinet__side-toper">
  17 + @include('workers.emblema')
  18 +
  19 + </div>
  20 +
  21 + @include('workers.menu', ['item' => 1])
  22 + </div>
  23 +
  24 + <form class="cabinet__body" action="{{ route('worker.add_document_save') }}" method="POST">
  25 + @csrf
  26 + <div class="cabinet__works-item">
  27 + @include('messages_error')
  28 + <div class="cabinet__works-spoiler active">
  29 + <div class="cabinet__works-spoiler-left">
  30 + <div class="cabinet__works-spoiler-text">Новая работа</div>
  31 + </div>
  32 + <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
  33 + <svg>
  34 + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
  35 + </svg>
  36 + </button>
  37 + </div>
  38 + <div class="cabinet__works-body">
  39 + <div class="cabinet__inputs">
  40 + <input type="hidden" name="worker_id" id="worker_id" value="{{ $worker->id }}"/>
  41 + <div class="cabinet__inputs-item form-group">
  42 + <label class="form-group__label">Должность</label>
  43 + <div class="form-group__item">
  44 + <input type="text" name="job_title" id="job_title" class="input" value="Не указано">
  45 + </div>
  46 + </div>
  47 + <div class="cabinet__inputs-item form-group">
  48 + <label class="form-group__label">Опыт работы в танкерном флоте</label>
  49 + <div class="form-group__item">
  50 + <select class="js-select2" name="tanker" id="tanker">
  51 + <option value="0">Нет</option>
  52 + <option value="1">Да</option>
  53 + </select>
  54 + </div>
  55 + </div>
  56 + <div class="cabinet__inputs-item form-group">
  57 + <label class="form-group__label">Название теплохода</label>
  58 + <div class="form-group__item">
  59 + <input type="text" name="teplohod" id="teplohod" class="input" value="Не указано">
  60 + </div>
  61 + </div>
  62 + <div class="cabinet__inputs-item form-group">
  63 + <label class="form-group__label">Тип (GWT)</label>
  64 + <div class="form-group__item">
  65 + <input type="text" name="GWT" id="GWT" class="input" value="Не указано">
  66 + </div>
  67 + </div>
  68 + <div class="cabinet__inputs-item form-group">
  69 + <label class="form-group__label">ГД (кВТ)</label>
  70 + <div class="form-group__item">
  71 + <input type="text" name="KBT" id="KBT" class="input" value="Не указано">
  72 + </div>
  73 + </div>
  74 + <div class="cabinet__inputs-item form-group">
  75 + <label class="form-group__label">Начало контракта</label>
  76 + <div class="form-group__item">
  77 + <input type="text" name="Begin_work" id="Begin_work" class="input" value="Не указано">
  78 + </div>
  79 + </div>
  80 + <div class="cabinet__inputs-item form-group">
  81 + <label class="form-group__label">Окончание контракта</label>
  82 + <div class="form-group__item">
  83 + <input type="text" name="End_work" id="End_work" class="input" value="Не указано">
  84 + </div>
  85 + </div>
  86 + <div class="cabinet__inputs-item form-group">
  87 + <label class="form-group__label">Название компании</label>
  88 + <div class="form-group__item">
  89 + <input type="text" name="name_company" id="name_company" class="input" value="Не указано">
  90 + </div>
  91 + </div>
  92 + <button type="submit" class="button">Сохранить</button>
  93 + <a href="{{ route('worker.cabinet') }}" class="button">Назад</a>
  94 + </div>
  95 + </div>
  96 + </div>
  97 + </form>
  98 + </div>
  99 + </div>
  100 + </section>
  101 + </div>
  102 +@endsection
resources/views/workers/dop_info.blade.php
... ... @@ -0,0 +1,59 @@
  1 +@extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
  2 +
  3 +@section('scripts')
  4 +
  5 +@endsection
  6 +
  7 +@section('content')
  8 +<section class="cabinet">
  9 + <div class="container">
  10 + <ul class="breadcrumbs cabinet__breadcrumbs">
  11 + <li><a href="{{ route('index') }}">Главная</a></li>
  12 + <li><b>Личный кабинет</b></li>
  13 + </ul>
  14 + <div class="cabinet__wrapper">
  15 + <div class="cabinet__side">
  16 + <div class="cabinet__side-toper">
  17 + @include('workers.emblema')
  18 +
  19 + </div>
  20 +
  21 + @include('workers.menu', ['item' => 1])
  22 + </div>
  23 + <form class="cabinet__body" action="{{ route('worker.dop_info_save') }}" method="POST">
  24 + @csrf
  25 + @include('messages_error')
  26 + <input type="hidden" id="worker_id" name="worker_id" value="{{ $worker_id }}"/>
  27 + <div class="cabinet__body-item">
  28 + <div class="cabinet__anketa">
  29 + <h2 class="title cabinet__title">Добавление диплома</h2>
  30 + </div>
  31 + </div>
  32 + <div class="form-group__item">
  33 + <div class="select">
  34 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  35 + <label class="form-group__label">Образцы дипломов и документов</label>
  36 + </div>
  37 + <select class="js-select2" id="infoblok_id" name="infoblok_id">
  38 + @if ($Infoblocks->count())
  39 + @foreach ($Infoblocks as $it)
  40 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  41 + @endforeach
  42 + @endif
  43 + </select>
  44 + </div>
  45 + </div>
  46 + <div class="cabinet__body-item">
  47 + <h4 class="cabinet__h4">Описание-комментарий</h4>
  48 + <textarea class="textarea" name="text" id="text" placeholder="Не указано"></textarea>
  49 + <div class="cabinet__buttons">
  50 + <button type="submit" class="button">Сохранить</button>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + </form>
  55 + </div>
  56 + </div>
  57 +</section>
  58 +</div>
  59 +@endsection
... ... @@ -438,7 +438,7 @@ Route::get(&#39;logout&#39;, [EmployerController::class, &#39;logout&#39;])-&gt;name(&#39;logout&#39;);
438 438 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
439 439 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
440 440  
441   -// Борьба против колорадских жуков и их геориевской ленточки
  441 +// Борьба против колорадских жуков
442 442 Route::get('clear_cookie', function() {
443 443 \App\Classes\Cookies_vacancy::clear_vacancy();
444 444 return redirect()->route('index');
... ... @@ -452,7 +452,7 @@ Route::group([
452 452 ], function() {
453 453 // 1 страница - Моя анкета
454 454 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
455   - Route::get('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
  455 + Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
456 456  
457 457 // 2 страница - Сообщения
458 458 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
... ... @@ -470,8 +470,29 @@ Route::group([
470 470 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
471 471 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
472 472  
473   - // 6 страница - Выход
  473 + // Резюме -pdf
  474 + Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
474 475  
  476 + // Поднятие анкеты
  477 + Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
  478 +
  479 + // Добавление сертификата
  480 + Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
  481 + Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
  482 +
  483 + // Добавление документа-диплома
  484 + Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
  485 + Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
  486 +
  487 + // Добавление стандартного диплома
  488 + Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
  489 + Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
  490 + Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
  491 + Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
  492 + Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
  493 +
  494 + // Отправка сообщения работодателю от соискателя
  495 + Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
475 496 });
476 497  
477 498 // Личный кабинет работодателя