new-outlets.blade.php_1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. @extends('layouts.app')
  2. @if(isset($outlet))
  3. @section('page-title')| {!! isset($outlet)?$outlet->name:"" !!}@endsection
  4. @else
  5. @section('page-title')| New Outlet @endsection
  6. @endif
  7. @section('content')
  8. <link href="{!! env('APP_ASSETS') !!}/vendor_components/dropzone/dropzone.css" rel="stylesheet"/>
  9. <link href="{!! env('APP_ASSETS') !!}/vendor_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet"/>
  10. <link href="{!! env('APP_ASSETS') !!}css/outlets-inner-section.css" rel="stylesheet" type="text/css">
  11. <style>
  12. body {
  13. padding: 0px !important;
  14. }
  15. .vtabs .tabs-vertical {
  16. width: 229px;
  17. }
  18. .bootstrap-tagsinput {
  19. min-height: 60px; width: 100%;
  20. }
  21. h4{ margin-top: 40px}
  22. </style>
  23. <style type="text/css">
  24. .bootstrap-tagsinput{
  25. border: 1px solid #E4E6EB;
  26. }
  27. .bootstrap-tagsinput .label-info{
  28. background-color: #ffab00 !important;
  29. }
  30. .theme-primary [type=checkbox].filled-in:checked.chk-col-primary + label:after{
  31. border: 1px solid #ffab00;
  32. background-color: #ffab00 !important;
  33. }
  34. #image-preview {
  35. width: 100%;
  36. border-radius: 20px;
  37. height: 341px;
  38. position: relative;
  39. overflow: hidden;
  40. background-color: #f9f9f9;
  41. color: #ecf0f1;
  42. background-position: center !important;
  43. background-size: cover !important;
  44. }
  45. #image-preview input {
  46. line-height: 200px;
  47. font-size: 200px;
  48. position: absolute;
  49. opacity: 0;
  50. z-index: 10;
  51. }
  52. #image-preview label {
  53. position: absolute;
  54. z-index: 5;
  55. opacity: 0.8;
  56. cursor: pointer;
  57. background-color: #bdc3c7;
  58. width: 200px;
  59. height: 50px;
  60. font-size: 20px;
  61. line-height: 50px;
  62. text-transform: uppercase;
  63. top: 0;
  64. left: 0;
  65. right: 0;
  66. bottom: 0;
  67. margin: auto;
  68. text-align: center;
  69. }
  70. </style>
  71. <!-- Content Wrapper. Contains page content -->
  72. <div class="content-wrapper">
  73. <div class="container-full">
  74. <!-- Content Header (Page header) -->
  75. {{-- <div class="content-header">
  76. <div class="d-flex align-items-center">
  77. <div class="me-auto">
  78. <h4 class="page-title">Outlets</h4>
  79. <div class="d-inline-block align-items-center">
  80. <nav>
  81. <ol class="breadcrumb">
  82. <li class="breadcrumb-item"><a href="{!! env('APP_URL') !!}dashboard"><i
  83. class="mdi mdi-home-outline"></i></a></li>
  84. <li class="breadcrumb-item active" aria-current="page">Outlets</li>
  85. </ol>
  86. </nav>
  87. </div>
  88. </div>
  89. </div>
  90. </div>--}}
  91. <!-- Main content -->
  92. <section class="content">
  93. <div class="row">
  94. <div class="col-4" style="padding-right: 0;background-color: #F5F5F5">
  95. @include('outlets.outlet-sidebar')
  96. </div>
  97. <div class="col-8">
  98. <form id="save-outlet" method="POST" action="{!! env('APP_URL') !!}save/outlet" enctype="multipart/form-data">
  99. <input type="hidden" name="id" value="{!! isset($outlet)?$outlet->id:"" !!}" />
  100. @php
  101. //$resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  102. $image = null;
  103. if(isset($outlet)){
  104. $image = \App\Photos::where('resto_id',\App\Helpers\CommonMethods::getRestuarantID())->where('branch_id',$outlet->id)->first();
  105. }
  106. @endphp
  107. @csrf
  108. <div class="outlet-info-section">
  109. <h2 style="margin-top: 0">Basic information</h2>
  110. <p style="font-size: 14px">Cover Image</p>
  111. <div id="image-preview" @if(isset($image) && !empty($image->file_name)) style="background: url({!! $image->file_name !!})" @endif>
  112. <label for="image-upload" id="image-label">Choose File</label>
  113. <input type="file" name="image" id="image-upload" />
  114. </div>
  115. <p class="text-danger text-end">Max of 5MB, at least 854 x 400 pixels and only JPEG and PNG are allowed.</p>
  116. <div class="row mt-4">
  117. <div class="col-12">
  118. <div class="form-group">
  119. <label>Outlet name</label>
  120. <input type="text" value="{!! isset($outlet)?$outlet->name:"" !!}" class="form-control" name="outlet_name"
  121. required/>
  122. </div>
  123. <h4>Contact information</h4>
  124. <div class="form-group">
  125. <label>Email</label> <br />
  126. <input type="text" placeholder="Enter valid email address" name="email" value="{!! isset($outlet)?$outlet->email:"" !!}" class="form-control" data-role="tagsinput" />
  127. </div>
  128. <div class="form-group">
  129. <label>Phone</label> <br />
  130. <input type="text" class="form-control" name="phone" value="{!! isset($outlet)?$outlet->phone_number:"" !!}" required />
  131. </div>
  132. <h4>Order Settings</h4>
  133. <p>Select the dates customers can place orders for</p>
  134. <div class="row">
  135. <div class="col-sm-12">
  136. <input type="checkbox" id="md_checkbox_21" class="filled-in chk-col-primary" checked />
  137. <label for="md_checkbox_21">Same Day</label> <br />
  138. <input type="checkbox" id="md_checkbox_21" class="filled-in chk-col-primary" checked />
  139. <label for="md_checkbox_21">Next Day</label>
  140. </div>
  141. </div>
  142. <a href="#!" class="btn btn-primary save-changes mt-4">Save Changes</a>
  143. </div>
  144. </div>
  145. </div>
  146. </form>
  147. </div>
  148. <!-- /.box -->
  149. </div>
  150. </section>
  151. <!-- /.content -->
  152. </div>
  153. </div>
  154. <!-- /.content-wrapper -->
  155. <div class="modal fade" id="crop-image" tabindex="-1" role="dialog" >
  156. <div class="modal-dialog" role="document">
  157. <div class="modal-content">
  158. <div class="modal-header">
  159. <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
  160. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  161. <span aria-hidden="true">&times;</span>
  162. </button>
  163. </div>
  164. <div class="modal-body">
  165. ...
  166. </div>
  167. <div class="modal-footer">
  168. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  169. <button type="button" class="btn btn-primary">Save changes</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. @endsection
  175. @section('js')
  176. <script src="{!! env('APP_ASSETS') !!}/vendor_components/dropzone/dropzone.js"></script>
  177. <script src="{!! env('APP_ASSETS') !!}/vendor_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
  178. <script type="text/javascript">
  179. $(document).ready(function() {
  180. $.uploadPreview({
  181. input_field: "#image-upload", // Default: .image-upload
  182. preview_box: "#image-preview", // Default: .image-preview
  183. label_field: "#image-label", // Default: .image-label
  184. label_default: "Choose File", // Default: Choose File
  185. label_selected: "Change File", // Default: Change File
  186. no_label: true ,
  187. success_callback: function() {
  188. // alert();
  189. $("#crop-image").modal();
  190. }// Default: false
  191. });
  192. $("body").on("click",".save-changes",function () {
  193. /*$.toast({
  194. heading: 'Welcome to my Riday Admin',
  195. text: 'Use the predefined ones, or specify a custom position object.',
  196. position: 'top-right',
  197. loaderBg: '#ff6849',
  198. icon: 'info',
  199. hideAfter: 3000,
  200. stack: 6
  201. });*/
  202. if($("#save-outlet").valid()){
  203. $("#save-outlet").ajaxForm(function (response) {
  204. response = $.parseJSON(response);
  205. if(response.type=="success"){
  206. $.toast({
  207. heading: 'Outlet Update.',
  208. text: response.message,
  209. position: 'top-right',
  210. loaderBg: '#ff6849',
  211. icon: 'success',
  212. hideAfter: 3000,
  213. stack: 1
  214. });
  215. setTimeout(function () {
  216. window.location = "{!! env('APP_URL') !!}outlet/edit/"+response.unique_key
  217. },2000);
  218. }else{
  219. $.toast({
  220. heading: 'Outlet Update.',
  221. text: response.message,
  222. position: 'top-right',
  223. loaderBg: '#ff6849',
  224. icon: 'error',
  225. hideAfter: 3000,
  226. stack: 1
  227. });
  228. }
  229. }).submit();
  230. }
  231. });
  232. });
  233. </script>
  234. @endsection