From c32d1a96ec71a69ddf46bfecca920f4589fd7e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Sat, 27 Apr 2024 16:22:25 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=87=D1=82=D0=BE=D0=B2=D1=8B=D0=BC=20=D1=81=D0=BE?= =?UTF-8?q?=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=D0=BC=20=D0=B8=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D1=83=D1=81=D0=BB=D0?= =?UTF-8?q?=BE=D0=B2=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/EmployerController.php | 7 +- app/Http/Controllers/PagesController.php | 14 +++ app/Http/Requests/RequestSendAdmin.php | 30 ++++++ app/Mail/MailAdminy.php | 66 +++++++++++++ public/css/telegram.css | 46 +++++++++ resources/views/emails/send_adminy.blade.php | 7 ++ resources/views/employers/list_vacancy.blade.php | 5 + .../views/employers/send_all_danger.blade.php | 60 ++++++++++++ resources/views/layout/frontend.blade.php | 1 + resources/views/pages.blade.php | 100 +++++++++++++++++++- routes/web.php | 3 + 11 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 app/Http/Requests/RequestSendAdmin.php create mode 100644 app/Mail/MailAdminy.php create mode 100644 public/css/telegram.css create mode 100644 resources/views/emails/send_adminy.blade.php create mode 100644 resources/views/employers/send_all_danger.blade.php diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index dfcd177..9bb19a4 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -736,7 +736,12 @@ class EmployerController extends Controller // Рассылка сообщений public function send_all_messages() { - return view('employers.send_all'); + $id = Auth()->user()->id; + $sending = Employer::query()->where('id', '=', "$id")->first(); + if ($sending->sending_is) + return view('employers.send_all'); + else + return view('employers.send_all_danger'); } // Отправка сообщений для информации diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index e2df9e6..f9b6ecf 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -2,8 +2,12 @@ namespace App\Http\Controllers; +use App\Http\Requests\RequestSendAdmin; +use App\Mail\MailAdminy; +use App\Mail\MailRepair; use App\Models\pages; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Redis; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; @@ -16,6 +20,16 @@ class PagesController extends Controller return view('pages', compact('page')); } + public function form_feedback(RequestSendAdmin $request){ + $all = $request->all(); + + foreach ([$request->get('email')] as $recipient) { + Mail::to($recipient)->send(new MailAdminy($all)); + } + + return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); + } + public function redis() { $redis = Redis::connection(); $redis->set('User:CompanyName', 'РЕКАМОРЕ'); diff --git a/app/Http/Requests/RequestSendAdmin.php b/app/Http/Requests/RequestSendAdmin.php new file mode 100644 index 0000000..a113586 --- /dev/null +++ b/app/Http/Requests/RequestSendAdmin.php @@ -0,0 +1,30 @@ + + */ + public function rules() + { + return [ + // + ]; + } +} diff --git a/app/Mail/MailAdminy.php b/app/Mail/MailAdminy.php new file mode 100644 index 0000000..b7375b6 --- /dev/null +++ b/app/Mail/MailAdminy.php @@ -0,0 +1,66 @@ +data = $data; + } + + /** + * Get the message envelope. + * + * @return \Illuminate\Mail\Mailables\Envelope + */ + public function envelope() + { + return new Envelope( + subject: 'Mail Adminy', + ); + } + + /** + * Get the message content definition. + * + * @return \Illuminate\Mail\Mailables\Content + */ + public function content() + { + return new Content( + view: 'emails.send_adminy', + ); + } + + public function build() + { + // Вернуть все данные + return $this->view('emails.send_adminy', ['data' => $this->data]); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments() + { + return []; + } +} diff --git a/public/css/telegram.css b/public/css/telegram.css new file mode 100644 index 0000000..680f0a1 --- /dev/null +++ b/public/css/telegram.css @@ -0,0 +1,46 @@ +.btn_telegram_share { + display: inline-block; + text-align: center; + vertical-align: middle; + margin-right: 7px; + padding: 3px 10px; + border: 1px solid #54aaeb; + border-radius: 50px; + background: #54aaeb; + background: -webkit-gradient(linear, left top, left bottom, from(#54aaeb), to(#54aaeb)); + background: -moz-linear-gradient(top, #54aaeb, #54aaeb); + background: linear-gradient(to bottom, #54aaeb, #54aaeb); + font: normal normal normal 16px arial; + color: #ffffff; + text-decoration: none; +} +/*.btn_telegram_share:focus*/ +.btn_telegram_share:hover +{ + border: 1px solid #61c4ff; + background: #65ccff; + background: -webkit-gradient(linear, left top, left bottom, from(#65ccff), to(#65ccff)); + background: -moz-linear-gradient(top, #65ccff, #65ccff); + background: linear-gradient(to bottom, #65ccff, #65ccff); + color: #ffffff; + text-decoration: none; +} +.btn_telegram_share:active { + background: #32668d; + background: -webkit-gradient(linear, left top, left bottom, from(#32668d), to(#54aaeb)); + background: -moz-linear-gradient(top, #32668d, #54aaeb); + background: linear-gradient(to bottom, #32668d, #54aaeb); +} +.btn_telegram_share:before{ + content: "\0000a0"; + display: inline-block; + height: 24px; + width: 24px; + line-height: 24px; + margin: 0 4px -6px -4px; + position: relative; + top: 0px; + left: 0px; + background: url("http://Втавляем ссылку на свою картинку.png") no-repeat left center transparent; + background-size: 100% 100%; +} diff --git a/resources/views/emails/send_adminy.blade.php b/resources/views/emails/send_adminy.blade.php new file mode 100644 index 0000000..19e296e --- /dev/null +++ b/resources/views/emails/send_adminy.blade.php @@ -0,0 +1,7 @@ +
+ Пользователь написал вам: {{ $data['name'] }}
+ Email: {{ $data['email'] }}
+ Название компании: {{ $data['name_company'] }} + Телефон: {{ $data['telephone'] }}
+ Текст сообщения: {{ $data['text'] }}
+
diff --git a/resources/views/employers/list_vacancy.blade.php b/resources/views/employers/list_vacancy.blade.php index 3aba2d5..78f1dcd 100644 --- a/resources/views/employers/list_vacancy.blade.php +++ b/resources/views/employers/list_vacancy.blade.php @@ -149,6 +149,11 @@ @endif + + Данные нельзя просмотреть, прочтите инструкцию + Условия размещения + + + + + + +@endsection diff --git a/resources/views/layout/frontend.blade.php b/resources/views/layout/frontend.blade.php index e9594a8..89f1d04 100644 --- a/resources/views/layout/frontend.blade.php +++ b/resources/views/layout/frontend.blade.php @@ -8,6 +8,7 @@ +