createCopy.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. @component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])
  2. @slot('style')
  3. @endslot
  4. @slot('subject')
  5. <h1><i class="fa fa-users"></i> ثبت محصول جدید </h1>
  6. <p>ثبت محصول جدید در فروشگاه.</p>
  7. @endslot
  8. @slot('breadcrumb')
  9. <li class="breadcrumb-item">محصولات</li>
  10. @endslot
  11. @slot('content')
  12. <div class="auth-background h-auto py-5">
  13. <div class="container py-5">
  14. <div class="row align-items-center ">
  15. <div class="col-lg-12 col-md-12 mx-auto">
  16. <div class="card">
  17. <div class="card-header">
  18. <strong>{{ __('ثبت محصول جدید') }}</strong>
  19. </div>
  20. @component('product::packages.product.src.views.components.message')
  21. @endcomponent
  22. <div class="card-body mx-lg-5 px-lg-3">
  23. <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
  24. @csrf
  25. <input type="hidden" name="draft_id" value="{{ $draft->id }}">
  26. <div class="form-group">
  27. <label for="title">{{ __('product.title') }}</label><i class="required">&nbsp; *</i>
  28. <input id="title" type="text" class="form-control @error('title') is-invalid @enderror" name="title" value="{{ old('title') }}" autocomplete="title" autofocus>
  29. @error('title')
  30. <span class="invalid-feedback" role="alert">
  31. <strong>{{ $message }}</strong>
  32. </span>
  33. @enderror
  34. </div>
  35. <div class="form-row">
  36. <div class="form-group col-lg-4">
  37. <label for="slug">{{ __('product.slug') }}</label>
  38. <input type="text" name="slug" class="form-control @error('slug') is-invalid @enderror" value="{{old('slug')}}" autocomplete="slug" autofocus>
  39. @error('slug')
  40. <div class="alert alert-danger">{{$message}}</div>
  41. @enderror
  42. </div>
  43. <div class="form-group col-lg-4">
  44. <label for="sku">{{ __('product.sku') }}</label>
  45. <input id="sku" type="text" class="form-control @error('sku') is-invalid @enderror" name="sku"
  46. autocomplete="sku" value="{{ old('sku') }}" autofocus>
  47. @error('sku')
  48. <span class="invalid-feedback" role="alert">
  49. <strong>{{ $message }}</strong>
  50. </span>
  51. @enderror
  52. </div>
  53. <div class="form-group col-lg-4">
  54. <label for="type">{{ __('product.type') }}</label></label><i class="required"> *</i>
  55. <select id="type" type="text" class="form-control @error('type') is-invalid @enderror" name="type" value="{{ old('type') }}" autocomplete="type">
  56. <option value="">انتخاب کنید</option>
  57. <option value="0" {{ (old('type') == '0') ? 'selected' : '' }}>ساده</option>
  58. <option value="1" {{ (old('type') == '1') ? 'selected' : '' }}>متغیر</option>
  59. <option value="2" {{ (old('type') == '2') ? 'selected' : '' }}>باندل</option>
  60. </select>
  61. @error('type')
  62. <span class="invalid-feedback" role="alert">
  63. <strong>{{ $message }}</strong>
  64. </span>
  65. @enderror
  66. </div>
  67. </div>
  68. <div class="form-row ">
  69. <div class="form-group col-lg-4">
  70. <label for="title">{{ __('product.price') }}</label><i class="required">&nbsp;*</i>
  71. <input id="input.price" type="text" class="form-control price @error('price') is-invalid @enderror" name="price" value="{{ old('price') }}" autocomplete="price" autofocus>
  72. @error('price')
  73. <span class="invalid-feedback" role="alert">
  74. <strong>{{ $message }}</strong>
  75. </span>
  76. @enderror
  77. </div>
  78. <div class="form-group col-lg-4">
  79. <label for="sale_price">@lang('product.sale_price')</label>
  80. <input id="sale_price" type="text" class="form-control price @error('sale_price') is-invalid @enderror" name="sale_price" value="{{ old('sale_price') }}" autocomplete="sale_price" autofocus>
  81. @error('sale_price')
  82. <span class="invalid-feedback" role="alert">
  83. <strong>{{ $message }}</strong>
  84. </span>
  85. @enderror
  86. </div>
  87. <div class="form-group col-lg-4">
  88. <label for="status">{{ __('product.status') }}</label><i class="required">&nbsp;*</i>
  89. <select id="status" type="text" class="form-control @error('status') is-invalid @enderror" name="status" autocomplete="status">
  90. <option value="">انتخاب کنید</option>
  91. <option value="1" {{ (old('status') == '1') ? 'selected' : '' }}>موجود</option>
  92. <option value="0" {{ (old('status') == '0') ? 'selected' : '' }}>ناموجود</option>
  93. </select>
  94. @error('status')
  95. <span class="invalid-feedback" role="alert">
  96. <strong>{{ $message }}</strong>
  97. </span>
  98. @enderror
  99. </div>
  100. <div class="form-group col-lg-4">
  101. <label for="status">{{ __('product.ReleaseStatus') }}</label><i class="required">&nbsp; *</i>
  102. <select id="ReleaseStatus" type="text" class="form-control @error('ReleaseStatus') is-invalid @enderror" name="ReleaseStatus" value="{{ old('ReleaseStatus') }}" autocomplete="ReleaseStatus">
  103. {{-- <option value="">انتخاب کنید</option>--}}
  104. <option value="draft" {{ (old('ReleaseStatus') == 'draft') ? 'selected' : '' }}>پیشنویس</option>
  105. <option value="pending" {{ (old('ReleaseStatus') == 'pending') ? 'selected' : '' }}>در انتظار انتشار</option>
  106. <option value="published" {{ (old('ReleaseStatus') == 'published') ? 'selected' : '' }}>منتشر شده</option>
  107. </select>
  108. @error('ReleaseStatus')
  109. <span class="invalid-feedback" role="alert">
  110. <strong>{{ $message }}</strong>
  111. </span>
  112. @enderror
  113. </div>
  114. </div>
  115. <div class="form-group">
  116. <label for="discription">{{ __('product.discription') }}</label></label><i class="required">&nbsp;*</i>
  117. <textarea id="discription" type="text"class="form-control editor @error('discription') is-invalid @enderror" name="discription" autocomplete="discription" autofocus>
  118. {{ old('discription') }}
  119. </textarea>
  120. @error('discription')
  121. <span class="invalid-feedback" role="alert">
  122. <strong>{{ $message }}</strong>
  123. </span>
  124. @enderror
  125. </div>
  126. <div class="form-group">
  127. <label for="categories">{{ __('product.categories') }}</label><i class="required">&nbsp;*</i>
  128. <select name="categories[]" class="form-control select2 @error('categories[]') is-invalid @enderror" multiple>
  129. <option value="0">--</option>
  130. {!! category_select_options( $categories, old( 'categories[]' ) ) !!}
  131. </select>
  132. @error('categories')
  133. <span class="invalid-feedback" role="alert">
  134. <strong>{{ $message }}</strong>
  135. </span>
  136. @enderror
  137. </div>
  138. <div class="">
  139. <div class="form-group col-md-8 ">
  140. <div class="attachment_upload">
  141. <span class="btn btn-primary btn-file " >
  142. <input type="file" id="uploadImages" name="featured_image" accept="image/*" class="form-control photo browse @error('featured_image') is-invalid @enderror" value="{{old('featured_image')}}" autocomplete="featured_image" autofocus>
  143. <label for="title">{{ __('product.featured_image') }}</label> <i class="required">&nbsp;*</i>
  144. </span>
  145. <div class="hide-element" id="previewImages">
  146. <div class="media">
  147. <div class="media-left ">
  148. <a href="" role="button" class="btn btn-danger pull-right" id="delete">
  149. <i class="icon fa fa-close"></i>
  150. </a>
  151. <img class="media-object img-thumbnail" src="" alt="" id="0" title="" data-toggle="modal" data-target="#individualImagePreview" style="width: 250px; height: 150px;" >
  152. </div>
  153. <div class="media-body">
  154. <p>
  155. <label for="featureDescription">توضیحات: </label>
  156. <input type="text" class="form-control" value="" name="featureDescription" id="featureDescription">
  157. </p>
  158. <p>
  159. <label for="featureCaption">عنوان: </label>
  160. <input type="text" class="form-control" value="" name="featureCaption" id="featureCaption">
  161. </p>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. @error('featured_image')
  167. <span class="invalid-feedback" role="alert">
  168. <strong>{{ $message }}</strong>
  169. </span>
  170. @enderror
  171. </div>
  172. <div class="form-row attachment_upload_gallery">
  173. <div class="upload-widget GalleryImageChoice ">
  174. <div class="select ">
  175. <span class="btn btn-primary btn-file">
  176. <input class="files attachment_upload_gallery" type="file" name="gallery_image[]" value="{{old('gallery_image[]')}}" multiple>
  177. <label for="title">
  178. {{ __('product.gallery_image') }}
  179. </label>
  180. </span>
  181. <output class="list row " >
  182. </output>
  183. </div>
  184. <div class="dropZone col-3">
  185. </div>
  186. </div>
  187. </div>
  188. <div class="form-group mb-0">
  189. <div class="">
  190. <button type="submit" class="btn btn-primary" >
  191. {{ __('ثبت محصول') }}
  192. </button>
  193. <a href="{{ route('products.index') }}" type="button" class="btn btn-warning" > انصراف</a>
  194. </div>
  195. </div>
  196. </div>
  197. </form>
  198. </div>
  199. <div class="card-footer">
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. @endslot
  207. @slot('script')
  208. @endslot
  209. @endcomponent