cabinet.blade.php
13.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
@extends('layout.frontend', ['title' => 'Образование и образовательные программы - РекаМоре'])
@section('scripts')
<script>
console.log('Test system');
$(document).on('click', '.die_black', function() {
var this_ = $(this);
var ajax_ = $('#ajax_flot_div');
var id_ = this_.attr('data-test');
var url_ = this_.attr('data-link');
console.log(url_);
$.ajax({
type: "GET",
url: url_,
success: function (data) {
console.log('Ответка');
ajax_.html(data);
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
console.log('Error: ' + data);
}
});
});
</script>
@endsection
@section('content')
<section class="cabinet">
<div class="container">
<ul class="breadcrumbs cabinet__breadcrumbs">
<li><a href="{{ route('index') }}">Главная</a></li>
<li><b>Личный кабинет</b></li>
</ul>
<div class="cabinet__wrapper">
<div class="cabinet__side">
<div class="cabinet__side-toper">
<div class="cabinet__side-toper-pic">
@if (isset($Employer[0]->logo))
<img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}">
@else
<img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/>
@endif
</div>
<b>{{ $Employer[0]->name_company }}</b>
</div>
@include('employers.menu')
</div>
<div class="cabinet__body">
@include('messages_error')
<form action="{{ route('employer.cabinet_save', ['Employer' => $Employer[0]->id]) }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="cabinet__body-item">
<div class="cabinet__descr">
<h2 class="title cabinet__title">Мой профиль</h2>
<p class="cabinet__text">Все поля обязательны для заполнения *</p>
</div>
<div class="cabinet__avatar">
<div class="cabinet__avatar-pic">
@if (isset($Employer[0]->logo))
<img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}">
@else
<img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/>
@endif
</div>
<div class="cabinet__avatar-form">
<label class="file">
<span class="file__input">
<input type="file" name="logo">
<span class="button">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
</svg>
Загрузить
</span>
</span>
</label>
<p class="cabinet__text">Загрузите логотип в формате .svg, .jpg, .png или .jpeg</p>
</div>
</div>
<div class="cabinet__inputs">
<div class="cabinet__inputs-item form-group">
<label class="form-group__label">Название судоходной компании</label>
<div class="form-group__item">
<input type="text" class="input" name="name_company" id="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company ?? '' }}" required>
@error('name_company')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item form-group">
<label class="form-group__label">Электронная почта</label>
<div class="form-group__item">
<input type="email" name="email" class="input" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" required>
@error('email')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item form-group">
<label class="form-group__label">Номер телефона</label>
<div class="form-group__item">
<input type="tel" name="telephone" class="input" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" required>
@error('telephone')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item form-group">
<label class="form-group__label">Адрес компании</label>
<div class="form-group__item">
<input type="text" name="address" class="input" value="{{ old('address') ?? $Employer[0]->address ?? '' }}" placeholder="692904, Приморский край, г. Находка, ул. Портовая 3А, 5 этаж" required>
@error('address')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">Ссылка на сайт</label>
<div class="form-group__item">
<input type="url" name="site" class="input" value="{{ old('site') ?? $Employer[0]->site ?? '' }}" placeholder="https://rekamore.su" required>
@error('site')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">О компании</label>
<div class="form-group__item">
<textarea name="text" class="textarea" required>{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea>
@error('text')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
</div>
</div><br>
<button type="submit" class="button cabinet__submit">Сохранить изменения</button>
</form>
<div class="cabinet__body-item">
<div class="cabinet__descr">
<h2 class="title cabinet__title">Мой флот</h2>
</div>
<form action="{{ route('employer.save_add_flot') }}" method="POST" class="cabinet__add" enctype="multipart/form-data">
@csrf
<label class="cabinet__add-pic" style="vertical-align: top">
<input type="file" name="image" id="image">
<input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer[0]->id }}"/>
<svg>
<use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
</svg>
<span>
<svg>
<use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
</svg>
Загрузить фото
</span>
</label>
<div class="cabinet__add-body">
<div class="form-group">
<label class="form-group__label">Название корабля</label>
<div class="form-group__item">
<input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required>
</div>
</div>
<div class="form-group">
<label class="form-group__label">Описание</label>
<div class="form-group__item">
<input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." required>
</div>
</div>
<div class="form-group">
<label class="form-group__label">Регион</label>
<div class="form-group__item">
<input type="text" name="region" id="region" class="input" placeholder="Мурманск" required>
</div>
</div>
<div class="form-group">
<label class="form-group__label">Мощность</label>
<div class="form-group__item">
<input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" required>
</div>
</div>
<button type="submit" class="button" id="ajax_flot" name="ajax_flot">Добавить флот</button>
</div>
</form>
<div class="cabinet__fleet" id="ajax_flot_div" name="ajax_flot_div">
@if (isset($Employer[0]->flots))
@if ($Employer[0]->flots->count())
@foreach ($Employer[0]->flots as $it)
<div class="cabinet__fleet-item main__employer-page-one-item">
<div class="del die_black" data-test="{{ $it->id }}" data-link="{{ route('employer.delete_flot', ['Flot' => $it->id]) }}">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
</svg>
</div>
@if (!empty($it->image))
<img src="{{ asset(Storage::url($it->image)) }}" alt="{{ $it->name }}">
@else
<img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $it->name }}"/>
@endif
<b>{{ $it->name }}</b>
<span>{{ $it->text }}</span>
</div>
@endforeach
@endif
@endif
</div>
</div>
</div>
</div>
</div>
</section>
</div> <!-- END TOP WRAPPER -->
@endsection