Guest User

Untitled

a guest
Aug 1st, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1. @extends('admin.index')
  2. @section('content')
  3. @if (Session::has('info'))
  4. <div class="alert alert-success" role="alert">
  5. {{ Session::get('info') }}
  6. </div>
  7. @endif
  8. <form action="/products/product/store" method="POST">
  9. {{ csrf_field() }}
  10. <?php
  11. use Illuminate\Support\MessageBag;
  12. /** @var MessageBag $errors */
  13. ?>
  14. <div class="p-4 mb-2"><h1>Создание товара</h1>
  15. <div class="form-group"><label for="inputDesription" class="col-xs-2 control-label">Введите описание(desription)</label>
  16. <div class="col-xs-10">
  17. <input type="text" name="description" class="form-control" placeholder="введите описание" id="description"></div
  18.  
  19. <? if($errors->first("description") != "") echo "<div class='alert'>".$errors->first("description")."</div>"; ?>
  20. </div>
  21. </div>
  22. <div class="form-group"><label for="inputPrice" class="col-xs-2 control-label">Введите цену</label>
  23. <div class="col-xs-10">
  24. <input type="text" name="price" class="form-control" placeholder="введите описание" id="price"></div
  25.  
  26. <? if($errors->first("price") != "") echo "<div class='alert'>".$errors->first("price")."</div>"; ?>
  27. </div>
  28. </div>
  29. {{-- <p><input type="file" class="my-pond" multiple name="product_image"/></p>--}}
  30. {{-- --}}
  31. {{-- <div class="form-group">--}}
  32. {{-- <label for="img">Выберите файл</label>--}}
  33. {{-- <input id="img" type="file" multiple name="file[]">--}}
  34. {{-- </div>--}}
  35.  
  36. <div class="container">
  37. <div class="row">
  38. <div class="col-md-8">
  39. <form action="{{route('product')}}" class="dropzone" method="post" enctype="multipart/form-data">@csrf</form>
  40. </div>
  41. </div>
  42. </div>
  43.  
  44. <div class="form-group"><label for="inputAuthorized_price" class="col-xs-2 control-label">Введите цену со скидкой</label>
  45. <div class="col-xs-10">
  46. <input type="text" name="authorized_price" class="form-control" placeholder="Введите цену со скидкой" id="authorized_price"></div
  47.  
  48. <? if($errors->first("authorized_price") != "") echo "<div class='alert'>".$errors->first("authorized_price")."</div>"; ?>
  49. </div>
  50. </div>
  51. <div><div class="form-group"><label for="inputshort_descriptionl" class="col-xs-2 control-label">Введите короткое описание товара</label>
  52. <div class="col-xs-10">
  53. <textarea rows="10" cols="45" name="short_description" placeholder="Введите короткое описание товара"></textarea></div>
  54. <? if($errors->first("short_description") != "") echo "<div class='alert'>".$errors->first("short_description")."</div>"; ?>
  55. </div>
  56. </div>
  57.  
  58. {{--product_image--}}
  59. <div> <label for="inputKeywords" class="col-xs-2 control-label">Введите keywords</label>
  60. <div class="col-xs-10">
  61. <input type="text" name="keywords" placeholder="введите ключевые слова" id="inputKeywords">
  62. <? if($errors->first("keywords") != "") echo "<div class='alert'>".$errors->first("keywords")."</div>"; ?>
  63. </div>
  64. </div>
  65.  
  66. <div> <div class="form-group"><label for="inputtitle" class="col-xs-2 control-label">Введите заголовок</label>
  67. <div class="col-xs-10">
  68. <input type="text" name="title" placeholder="введите заголовок" id="title"></div>
  69. <? if($errors->first("title") != "") echo "<div class='alert'>".$errors->first("title")."</div>"; ?>
  70. </div>
  71. </div>
  72.  
  73. {{-- <div class="form-group">--}}
  74. {{-- <label>Подкатегории</label>--}}
  75. {{-- <select class="form-control input-sm" name="category_id">--}}
  76. {{-- <option value="">--select--</option>--}}
  77. {{-- @foreach ($categories as $category)--}}
  78. {{-- <option value="{{$category->id}}">{{$category->title}}</option>--}}
  79. {{-- @if ($category->categories)--}}
  80. {{-- @foreach ($category->categories as $category)--}}
  81. {{-- <option value="{{$category->id}}">-----{{$category->title}}</option>--}}
  82. {{-- @endforeach--}}
  83. {{-- @endif--}}
  84. {{-- @endforeach--}}
  85. {{-- </select>--}}
  86. {{-- </div>--}}
  87. <div><div class="form-group"><label for="inputslug" class="col-xs-2 control-label">Введите урл страницы</label>
  88. <div class="col-xs-10">
  89. <input type="text" name="slug" placeholder="Укажите slug"></div>
  90. <? if($errors->first("slug") != "") echo "<div class='alert'>".$errors->first("slug")."</div>"; ?>
  91. </div>
  92. </div>
  93.  
  94. <div><div class="form-group"><label for="inputtextl" class="col-xs-2 control-label">Введите описание товара</label>
  95. <div class="col-xs-10">
  96. <textarea rows="10" cols="45" name="text" placeholder="введите пост статьи"></textarea></div>
  97. <? if($errors->first("text") != "") echo "<div class='alert'>".$errors->first("text")."</div>"; ?>
  98. </div>
  99. </div>
  100.  
  101. <label for="">Статус</label>
  102. <select class="form-control" name="published">
  103. <?php if(isset($products->id)): ?>
  104. <option value="0" <?php if($products->published == 0): ?> selected="" <?php endif; ?>>Не опубликовано</option>
  105. <option value="1" <?php if($products->published == 1): ?> selected="" <?php endif; ?>>Опубликовано</option>
  106. <?php else: ?>
  107. <option value="0">Не опубликовано</option>
  108. <option value="1">Опубликовано</option>
  109. <?php endif; ?>
  110. </select>
  111. <input type="submit" value="Отправить">
  112. </form>
  113. <script src="https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script>
  114. <script>
  115. CKEDITOR.replace( 'text' );
  116. </script>
  117. <script>
  118. CKEDITOR.replace( 'short_description' );
  119. </script>
  120.  
  121.  
  122. {{-- <!-- include jQuery library -->--}}
  123. {{-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>--}}
  124.  
  125. {{-- <!-- include FilePond library -->--}}
  126. {{-- <script src="https://unpkg.com/filepond/dist/filepond.min.js"></script>--}}
  127.  
  128. {{-- <!-- include FilePond plugins -->--}}
  129. {{-- <script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.js"></script>--}}
  130.  
  131. {{-- <!-- include FilePond jQuery adapter -->--}}
  132. {{-- <script src="https://unpkg.com/jquery-filepond/filepond.jquery.js"></script>--}}
  133.  
  134. {{-- <script>--}}
  135. {{-- $(function(){--}}
  136.  
  137. {{-- // First register any plugins--}}
  138. {{-- $.fn.product_image.registerPlugin(FilePondPluginImagePreview);--}}
  139.  
  140. {{-- // Turn input element into a pond--}}
  141. {{-- $('.my-pond').product_image();--}}
  142.  
  143. {{-- // Set allowMultiple property to true--}}
  144. {{-- $('.my-pond').product_image('allowMultiple', true);--}}
  145.  
  146. {{-- // Listen for addfile event--}}
  147. {{-- $('.my-pond').on('FilePond:addfile', function(e) {--}}
  148. {{-- console.log('file added event', e);--}}
  149. {{-- });--}}
  150.  
  151. {{-- // Manually add a file using the addfile method--}}
  152. {{-- $('.my-pond').first().product_image('addFile', 'index.html').then(function(file){--}}
  153. {{-- console.log('file added', file);--}}
  154. {{-- });--}}
  155.  
  156. {{-- });--}}
  157. {{-- </script>--}}
  158.  
  159.  
  160.  
  161. <!-- Scripts -->
  162. <script src="{{ asset('js/dropzone.js') }}" defer></script>
  163.  
  164. <!-- Styles -->
  165. <link href="{{ asset('css/dropzone.css') }}" rel="stylesheet">
  166. @endsection
  167.  
Add Comment
Please, Sign In to add comment