Commit c32d1a96ec71a69ddf46bfecca920f4589fd7e1d
1 parent
0fc30621f7
Exists in
master
and in
1 other branch
Работа по почтовым сообщениям и странице условия
Showing 11 changed files with 337 additions and 2 deletions Side-by-side Diff
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/PagesController.php
- app/Http/Requests/RequestSendAdmin.php
- app/Mail/MailAdminy.php
- public/css/telegram.css
- resources/views/emails/send_adminy.blade.php
- resources/views/employers/list_vacancy.blade.php
- resources/views/employers/send_all_danger.blade.php
- resources/views/layout/frontend.blade.php
- resources/views/pages.blade.php
- routes/web.php
app/Http/Controllers/EmployerController.php
... | ... | @@ -736,7 +736,12 @@ class EmployerController extends Controller |
736 | 736 | |
737 | 737 | // Рассылка сообщений |
738 | 738 | public function send_all_messages() { |
739 | - return view('employers.send_all'); | |
739 | + $id = Auth()->user()->id; | |
740 | + $sending = Employer::query()->where('id', '=', "$id")->first(); | |
741 | + if ($sending->sending_is) | |
742 | + return view('employers.send_all'); | |
743 | + else | |
744 | + return view('employers.send_all_danger'); | |
740 | 745 | } |
741 | 746 | |
742 | 747 | // Отправка сообщений для информации |
app/Http/Controllers/PagesController.php
... | ... | @@ -2,8 +2,12 @@ |
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | +use App\Http\Requests\RequestSendAdmin; | |
6 | +use App\Mail\MailAdminy; | |
7 | +use App\Mail\MailRepair; | |
5 | 8 | use App\Models\pages; |
6 | 9 | use Illuminate\Http\Request; |
10 | +use Illuminate\Support\Facades\Mail; | |
7 | 11 | use Illuminate\Support\Facades\Redis; |
8 | 12 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
9 | 13 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
... | ... | @@ -16,6 +20,16 @@ class PagesController extends Controller |
16 | 20 | return view('pages', compact('page')); |
17 | 21 | } |
18 | 22 | |
23 | + public function form_feedback(RequestSendAdmin $request){ | |
24 | + $all = $request->all(); | |
25 | + | |
26 | + foreach ([$request->get('email')] as $recipient) { | |
27 | + Mail::to($recipient)->send(new MailAdminy($all)); | |
28 | + } | |
29 | + | |
30 | + return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); | |
31 | + } | |
32 | + | |
19 | 33 | public function redis() { |
20 | 34 | $redis = Redis::connection(); |
21 | 35 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); |
app/Http/Requests/RequestSendAdmin.php
... | ... | @@ -0,0 +1,30 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Http\Requests; | |
4 | + | |
5 | +use Illuminate\Foundation\Http\FormRequest; | |
6 | + | |
7 | +class RequestSendAdmin 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 | + // | |
28 | + ]; | |
29 | + } | |
30 | +} |
app/Mail/MailAdminy.php
... | ... | @@ -0,0 +1,66 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Mail; | |
4 | + | |
5 | +use Illuminate\Bus\Queueable; | |
6 | +use Illuminate\Contracts\Queue\ShouldQueue; | |
7 | +use Illuminate\Mail\Mailable; | |
8 | +use Illuminate\Mail\Mailables\Content; | |
9 | +use Illuminate\Mail\Mailables\Envelope; | |
10 | +use Illuminate\Queue\SerializesModels; | |
11 | + | |
12 | +class MailAdminy extends Mailable | |
13 | +{ | |
14 | + use Queueable, SerializesModels; | |
15 | + | |
16 | + protected $data; | |
17 | + /** | |
18 | + * Create a new message instance. | |
19 | + * | |
20 | + * @return void | |
21 | + */ | |
22 | + public function __construct($data) | |
23 | + { | |
24 | + $this->data = $data; | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * Get the message envelope. | |
29 | + * | |
30 | + * @return \Illuminate\Mail\Mailables\Envelope | |
31 | + */ | |
32 | + public function envelope() | |
33 | + { | |
34 | + return new Envelope( | |
35 | + subject: 'Mail Adminy', | |
36 | + ); | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * Get the message content definition. | |
41 | + * | |
42 | + * @return \Illuminate\Mail\Mailables\Content | |
43 | + */ | |
44 | + public function content() | |
45 | + { | |
46 | + return new Content( | |
47 | + view: 'emails.send_adminy', | |
48 | + ); | |
49 | + } | |
50 | + | |
51 | + public function build() | |
52 | + { | |
53 | + // Вернуть все данные | |
54 | + return $this->view('emails.send_adminy', ['data' => $this->data]); | |
55 | + } | |
56 | + | |
57 | + /** | |
58 | + * Get the attachments for the message. | |
59 | + * | |
60 | + * @return array | |
61 | + */ | |
62 | + public function attachments() | |
63 | + { | |
64 | + return []; | |
65 | + } | |
66 | +} |
public/css/telegram.css
... | ... | @@ -0,0 +1,46 @@ |
1 | +.btn_telegram_share { | |
2 | + display: inline-block; | |
3 | + text-align: center; | |
4 | + vertical-align: middle; | |
5 | + margin-right: 7px; | |
6 | + padding: 3px 10px; | |
7 | + border: 1px solid #54aaeb; | |
8 | + border-radius: 50px; | |
9 | + background: #54aaeb; | |
10 | + background: -webkit-gradient(linear, left top, left bottom, from(#54aaeb), to(#54aaeb)); | |
11 | + background: -moz-linear-gradient(top, #54aaeb, #54aaeb); | |
12 | + background: linear-gradient(to bottom, #54aaeb, #54aaeb); | |
13 | + font: normal normal normal 16px arial; | |
14 | + color: #ffffff; | |
15 | + text-decoration: none; | |
16 | +} | |
17 | +/*.btn_telegram_share:focus*/ | |
18 | +.btn_telegram_share:hover | |
19 | +{ | |
20 | + border: 1px solid #61c4ff; | |
21 | + background: #65ccff; | |
22 | + background: -webkit-gradient(linear, left top, left bottom, from(#65ccff), to(#65ccff)); | |
23 | + background: -moz-linear-gradient(top, #65ccff, #65ccff); | |
24 | + background: linear-gradient(to bottom, #65ccff, #65ccff); | |
25 | + color: #ffffff; | |
26 | + text-decoration: none; | |
27 | +} | |
28 | +.btn_telegram_share:active { | |
29 | + background: #32668d; | |
30 | + background: -webkit-gradient(linear, left top, left bottom, from(#32668d), to(#54aaeb)); | |
31 | + background: -moz-linear-gradient(top, #32668d, #54aaeb); | |
32 | + background: linear-gradient(to bottom, #32668d, #54aaeb); | |
33 | +} | |
34 | +.btn_telegram_share:before{ | |
35 | + content: "\0000a0"; | |
36 | + display: inline-block; | |
37 | + height: 24px; | |
38 | + width: 24px; | |
39 | + line-height: 24px; | |
40 | + margin: 0 4px -6px -4px; | |
41 | + position: relative; | |
42 | + top: 0px; | |
43 | + left: 0px; | |
44 | + background: url("http://Втавляем ссылку на свою картинку.png") no-repeat left center transparent; | |
45 | + background-size: 100% 100%; | |
46 | +} |
resources/views/emails/send_adminy.blade.php
resources/views/employers/list_vacancy.blade.php
... | ... | @@ -149,6 +149,11 @@ |
149 | 149 | </svg> |
150 | 150 | </a> |
151 | 151 | @endif |
152 | + <!--<a class="btn_telegram_share table__controls-item" href="https://telegram.me/share/url?url=ВАШ_URL&text={{ $it->name }}"> | |
153 | + <svg> | |
154 | + <use xlink:href=" asset('images/sprite.svg#arrow-radius') }}"></use> | |
155 | + </svg> | |
156 | + </a>--> | |
152 | 157 | |
153 | 158 | <!--<button type="button" class="table__controls-item"> |
154 | 159 | <svg> |
resources/views/employers/send_all_danger.blade.php
... | ... | @@ -0,0 +1,60 @@ |
1 | +@extends('layout.frontend', ['title' => 'База данных - РекаМоре']) | |
2 | + | |
3 | +@section('scripts') | |
4 | + <script> | |
5 | + console.log('Test system'); | |
6 | + $(document).on('click', '.die_black', function() { | |
7 | + var this_ = $(this); | |
8 | + var ajax_ = $('#ajax_flot_div'); | |
9 | + var id_ = this_.attr('data-test'); | |
10 | + var url_ = this_.attr('data-link'); | |
11 | + | |
12 | + console.log(url_); | |
13 | + $.ajax({ | |
14 | + type: "GET", | |
15 | + url: url_, | |
16 | + success: function (data) { | |
17 | + console.log('Ответка'); | |
18 | + ajax_.html(data); | |
19 | + }, | |
20 | + headers: { | |
21 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
22 | + }, | |
23 | + error: function (data) { | |
24 | + console.log('Error: ' + data); | |
25 | + } | |
26 | + }); | |
27 | + }); | |
28 | + </script> | |
29 | +@endsection | |
30 | + | |
31 | +@section('content') | |
32 | + <section class="cabinet"> | |
33 | + <div class="container"> | |
34 | + <ul class="breadcrumbs cabinet__breadcrumbs"> | |
35 | + <li><a href="{{ route('index') }}">Главная</a></li> | |
36 | + <li><b>Личный кабинет</b></li> | |
37 | + </ul> | |
38 | + <div class="cabinet__wrapper"> | |
39 | + <div class="cabinet__side"> | |
40 | + <div class="cabinet__side-toper"> | |
41 | + @include('employers.emblema') | |
42 | + </div> | |
43 | + @include('employers.menu', ['item' => 8]) | |
44 | + </div> | |
45 | + <div class="cabinet__body"> | |
46 | + <div class="cabinet__body-item"> | |
47 | + <h2 class="title cabinet__title">Рассылка сообщений</h2> | |
48 | + </div> | |
49 | + <div class="cabinet__body-item"> | |
50 | + <div class="cabinet__table-header"> | |
51 | + <div><!--_if (isset($it->workers[0]->job_titles[0]->name)) _ $it->workers[0]->job_titles[0]->name }}_else Не указано _endif--> | |
52 | + Данные нельзя просмотреть, прочтите инструкцию | |
53 | + <a style="text-decoration:underline" href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}">Условия размещения</a> | |
54 | + </div> | |
55 | + </div> | |
56 | + </div> | |
57 | + </div> | |
58 | + </section> | |
59 | + </div> | |
60 | +@endsection |
resources/views/layout/frontend.blade.php
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | <meta name="theme-color" content="#377D87"> |
9 | 9 | <script src="{{ asset('js/jquery.js') }}"></script> |
10 | 10 | <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> |
11 | + <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> | |
11 | 12 | <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> |
12 | 13 | <link rel="stylesheet" href="{{ asset('css/style.css') }}"> |
13 | 14 | <style> |
resources/views/pages.blade.php
... | ... | @@ -19,14 +19,112 @@ |
19 | 19 | </div> |
20 | 20 | </div> |
21 | 21 | </section> |
22 | + @if ($page->slug !== 'Usloviya-razmescheniya') | |
22 | 23 | <main class="main"> |
23 | 24 | <div class="container"> |
24 | 25 | <div class="main__content"> |
25 | 26 | <div class="main__content-item"> |
26 | - {!! $page->text !!} | |
27 | + {!! $page->text !!} | |
27 | 28 | </div> |
28 | 29 | </div> |
29 | 30 | </div> |
30 | 31 | </main> |
32 | + @else | |
33 | + <main class="main"> | |
34 | + <div class="container"> | |
35 | + <div class="main__cond"> | |
36 | + <div class="main__cond-label"> | |
37 | + На рынке мы с 2020 года. | |
38 | + <br>Мы молодая компания, которой важно сделать хороший и востребованный продукт! | |
39 | + </div> | |
40 | + <div> | |
41 | + <h3>За это время нам удалось:</h3> | |
42 | + <ul class="main__cond-icons"> | |
43 | + <li> | |
44 | + <span><img src="{{ asset('images/svg/1.svg') }}" alt=""></span> | |
45 | + Создать самое крупное сообщество Вконтакте по поиску работы на речноми морском флоте | |
46 | + </li> | |
47 | + <li> | |
48 | + <span><img src="{{ asset('images/svg/2.svg') }}" alt=""></span> | |
49 | + Создать самый крупный телеграм канал по поиску работы на речноми морском флоте | |
50 | + </li> | |
51 | + <li> | |
52 | + <span><img src="{{ asset('images/svg/3.svg') }}" alt=""></span> | |
53 | + Создать действительно эффективную и удобную базу анкет | |
54 | + </li> | |
55 | + <li> | |
56 | + <span><img src="{{ asset('images/svg/4.svg') }}" alt=""></span> | |
57 | + Разместить свою рекламу во многих учебных заведениях нашей страны. Колледжи,вузы, утц, медицинские центры охотно размещают нашу рекламу в своих заведениях | |
58 | + </li> | |
59 | + <li> | |
60 | + <span><img src="{{ asset('images/svg/5.svg') }}" alt=""></span> | |
61 | + Подключить к нашему сервису более 120 судоходных компаний России | |
62 | + </li> | |
63 | + <li> | |
64 | + <span><img src="{{ asset('images/svg/6.svg') }}" alt=""></span> | |
65 | + Оправдать доверие и ожидание, так как компании заключившие с нами договорв первый раз в 95% случаев остаются довольны сотрудничеством и продлевают договор | |
66 | + </li> | |
67 | + </ul> | |
68 | + </div> | |
69 | + <div> | |
70 | + <h3>Форма обратной связи</h3> | |
71 | + <p>Все поля обязательны для заполнения.</p> | |
72 | + <form class="callback main__cond-callback" method="POST" action="{{ route('form_feedback') }}"> | |
73 | + @csrf | |
74 | + <div class="callback__body"> | |
75 | + <input type="text" class="input" name="name" id="name" placeholder="Ваше имя" value="{{ old('name') ?? '' }}" required=""> | |
76 | + @error('name') | |
77 | + <span class="text-xs text-red-600"> | |
78 | + {{ $message }} | |
79 | + </span> | |
80 | + @enderror | |
81 | + <input type="text" class="input" name="name_company" id="name_company" value="{{ old('name_company') ?? '' }}" placeholder="Название судоходной компании" required=""> | |
82 | + @error('name_company') | |
83 | + <span class="text-xs text-red-600"> | |
84 | + {{ $message }} | |
85 | + </span> | |
86 | + @enderror | |
87 | + <input type="tel" class="input" name="telephone" id="telephone" value="{{ old('teelphone') ?? '' }}" placeholder="Телефон" required=""> | |
88 | + @error('telephone') | |
89 | + <span class="text-xs text-red-600"> | |
90 | + {{ $message }} | |
91 | + </span> | |
92 | + @enderror | |
93 | + <input type="email" class="input" name="email" id="email" value="{{ old('email') ?? '' }}" placeholder="Электронная почта" required=""> | |
94 | + @error('email') | |
95 | + <span class="text-xs text-red-600"> | |
96 | + {{ $message }} | |
97 | + </span> | |
98 | + @enderror | |
99 | + </div> | |
100 | + <textarea class="textarea callback__textarea" name="text" id="text" placeholder="Текст сообщения" required="">{{ old('text') ?? '' }}</textarea> | |
101 | + <div class="callback__bottom"> | |
102 | + <label class="checkbox"> | |
103 | + <input type="checkbox" name="politik" id="politik" class="checkbox__input" required=""> | |
104 | + <span class="checkbox__icon"> | |
105 | + <svg> | |
106 | + <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> | |
107 | + </svg> | |
108 | + </span> | |
109 | + <span class="checkbox__text"> | |
110 | + <span> | |
111 | + Я согласен(на) с | |
112 | + <a href="{{ route('page', ['pages' => 'Politika-konfidencialnosti']) }}">Политикой конфиденциальности</a> | |
113 | + </span> | |
114 | + </span> | |
115 | + @error('politik') | |
116 | + <span class="text-xs text-red-600"> | |
117 | + {{ $message }} | |
118 | + </span> | |
119 | + @enderror | |
120 | + </label> | |
121 | + <button type="submit" class="button">Отправить</button> | |
122 | + </div> | |
123 | + </form> | |
124 | + </div> | |
125 | + </div> | |
126 | + </div> | |
127 | + </main> | |
128 | + @endif | |
31 | 129 | </div> |
32 | 130 | @endsection |
routes/web.php
... | ... | @@ -405,6 +405,9 @@ Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
405 | 405 | // Страницы с произвольным контентом |
406 | 406 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
407 | 407 | |
408 | +// Форма обратной связи | |
409 | +Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); | |
410 | + | |
408 | 411 | // Публичные страницы соискателя |
409 | 412 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
410 | 413 |