Blame view

resources/views/admin/goods/form.blade.php 9.2 KB
1bd0c6ebe   Андрей Ларионов   Админка, товары. ...
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
  @csrf
  
  @isset($good)
      @method('PUT')
  @endisset
  
  <label class="form__label" for="title">Заголовок товара
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('title')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="title" name="title" placeholder="Введите заголовок" required value="{{ old('title') ?? $good->title ?? '' }}"><br><br>
  
  <label class="form__label" for="category_id">Категория
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  
  <div class="form-group">
      @php
          $parent_id = old('category_id') ?? $good->category_id ?? 0;
      @endphp
      <select name="category_id" class="form-control" title="Категория">
          <option value="0">Без родителя</option>
          @include('admin.part.category_id', ['level' => -1, 'parent' => 0])
      </select>
  </div>
  
  <label class="form__label" for="price">Цена
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('price')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="price" name="price" placeholder="Введите цену" required value="{{ old('price') ?? $good->price ?? '' }}"><br><br>
  
  <label class="form__label" for="price_old">Цена старая
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('price_old')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="price_old" name="price_old" placeholder="Введите цену" value="{{ old('price_old') ?? $good->price_old ?? '' }}"><br><br>
  
  <label class="form__label" for="manufacturer">Производитель
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('manufacturer')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="manufacturer" name="manufacturer" placeholder="Введите производителя" required value="{{ old('manufacturer') ?? $good->manufacturer ?? '' }}"><br><br>
  
  <label class="form__label" for="country">Страна
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('country')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="country" name="country" placeholder="Введите страну" required value="{{ old('country') ?? $good->country ?? '' }}"><br><br>
  
  <label class="form__label" for="size">Размер-габарит
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('size')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="size" name="size" placeholder="Введите размер-габарит"  value="{{ old('size') ?? $good->size ?? '' }}"><br><br>
  
  <label class="form__label" for="power">Мощность
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('power')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="power" name="power" placeholder="Введите мощность"  value="{{ old('power') ?? $good->power ?? '' }}"><br><br>
  
  <label class="form__label" for="description">Описание товара
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('description')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <textarea class="form-input " id="description" name="description" placeholder="Введите описание"
            required>{{ old('description') ?? $good->description ?? '' }}</textarea><br><br>
  
  <label class="form__label" for="feature">Характеристики
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('feature')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <textarea class="form-input " id="feature" name="feature" placeholder="Введите характеристики"
            required>{{ old('feature') ?? $good->feature ?? '' }}</textarea><br><br>
  
  <label class="form__label" for="equipment">Комплектация
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('equipment')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <textarea class="form-input " id="equipment" name="equipment" placeholder="Введите комплектацию"
            required>{{ old('equipment') ?? $good->equipment ?? '' }}</textarea><br><br>
  
  <div class="form-group">
      <label class="form__label" for="accessory_id">Аксессуары
          <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
      </label><br>
      @php
          $current_id = old('accessory_id') ?? $good->accessory_id ?? 0;
      @endphp
      <select name="accessory_id" class="form-control" title="Аксессуары">
          <option value="0">Без родителя</option>
          @include('admin.part.goods')
      </select>
  </div>
  
  <div class="form-group">
      <label class="form__label" for="tooling_id">Оснастка
          <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
      </label><br>
      @php
          $current_id = old('tooling_id') ?? $good->tooling_id ?? 0;
      @endphp
      <select name="tooling_id" class="form-control" title="Оснастка">
          <option value="0">Без родителя</option>
          @include('admin.part.goods')
      </select>
  </div>
  
  <label class="form__label" for="weight">Вес
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('weight')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="weight" name="weight" placeholder="Введите вес"  value="{{ old('weight') ?? $good->weight ?? '' }}"><br><br>
  
  <label class="form__label" for="stock_count">Количество на складе
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('stock_count')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="stock_count" name="stock_count" placeholder="Введите кол-во"  value="{{ old('stock_count') ?? $good->stock_count ?? '' }}"><br><br>
  
  <label class="form__label" for="type_good">Тип товара
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('type_good')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <input class="form-input " type="text" id="type_good" name="type_good" placeholder="Введите тип товара"  value="{{ old('type_good') ?? $good->type_good ?? '' }}"><br><br>
  
  <label class="form__label" for="new">Новинка
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('new')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <select name="new" id="new" class="form-control">
      <option value="1"
              @isset($good)
              @if($good->new == '1')
              selected
          @endif
          @endisset
      >Есть</option>
      <option value="0"
              @isset($good)
              @if($good->new == '0')
              selected
          @endif
          @endisset
      >Нет</option>
  </select><br>
  
  <label class="form__label" for="demo">Демо-зал
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('demo')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <select name="demo" id="demo" class="form-control">
      <option value="1"
              @isset($good)
              @if($good->demo == '1')
              selected
          @endif
          @endisset
      >Есть</option>
      <option value="0"
              @isset($good)
              @if($good->demo == '0')
              selected
          @endif
          @endisset
      >Нет</option>
  </select><br>
  
  <label class="form__label" for="way">В пути
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  @error('way')
  <div class="alert alert-danger">{{ $message }}</div>
  @enderror
  <select name="way" id="way" class="form-control">
      <option value="1"
              @isset($good)
              @if($good->way == '1')
              selected
          @endif
          @endisset
      >Есть</option>
      <option value="0"
              @isset($good)
              @if($good->way == '0')
              selected
          @endif
          @endisset
      >Нет</option>
  </select><br>
  
  
  <label class="form__label" for="image">Картинка
      <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
  </label><br>
  <input type="file" class="form-input form-control-file " name="image" id="image" accept="image/png, image/jpeg">
  @isset($category->image)
      <div class="form-group form-check">
          <img src="<?=asset(Storage::url($category->image))?>" width="100px"/>
      </div>
  @endisset
  
  
  <<div class="parts-content-form-bottom modal-auth-bottom">
      <button class="parts-content-form-bottom__button" type="submit">Сохранить</button>
  </div>