outlets.blade.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. @extends('layouts.app')
  2. @section('page-title')| Outlets @endsection
  3. @section('css')
  4. <link href="{!! env('APP_ASSETS') !!}css/outlets.css" rel="stylesheet" type="text/css">
  5. @endsection
  6. @section('content')
  7. <style>
  8. @-webkit-keyframes special {
  9. from { background-color: rgba(255, 121, 77, 0.27); }
  10. to { background-color: inherit; }
  11. }
  12. @-moz-keyframes special {
  13. from { background-color: rgba(255, 121, 77, 0.27);; }
  14. to { background-color: inherit; }
  15. }
  16. @-o-keyframes special {
  17. from { background-color: rgba(255, 121, 77, 0.27);; }
  18. to { background-color: inherit; }
  19. }
  20. @keyframes special {
  21. from { background-color: rgba(255, 121, 77, 0.27);; }
  22. to { background-color: inherit; }
  23. }
  24. .special {
  25. -webkit-animation: special 1s infinite; /* Safari 4+ */
  26. -moz-animation: special 1s infinite; /* Fx 5+ */
  27. -o-animation: special 1s infinite; /* Opera 12+ */
  28. animation: special 1s infinite; /* IE 10+ */
  29. }
  30. .btn-toggle.btn-sm,.btn-toggle.btn-sm > .handle{
  31. border-radius: 16px;
  32. }
  33. </style>
  34. <!-- Content Wrapper. Contains page content -->
  35. @php
  36. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  37. $lang = $resto->default_lang;
  38. app()->setLocale($lang);
  39. if(session('app_lang') !==null){
  40. $lang = session('app_lang');
  41. app()->setLocale($lang);
  42. }
  43. @endphp
  44. <div class="content-wrapper">
  45. <div class="container-full">
  46. <!-- Main content -->
  47. <section class="content">
  48. <div class="row ">
  49. <div class="col-md-6">
  50. <div class="m-15">
  51. <h3 class="title">{{__('label.outlets')}}</h3>
  52. <p>{{__('label.add_and_manage_your_outlets')}}</p>
  53. </div>
  54. </div>
  55. <div class="col-md-5">
  56. <a href="{!! env('APP_URL') !!}new/outlet" class="form-control btn btn-primary btn-md add-outlet text-center">
  57. <i class="fa fa-plus mr-2"></i>
  58. <!-- <i class="mdi mdi-plus-circle"></i> --> {{__('label.add_outlet')}}
  59. </a>
  60. </div>
  61. </div>
  62. <div class="row mt-15">
  63. <div class="col-md-12 pt-5">
  64. <div class="d-flex justify-content-between align-items-center">
  65. <h4 class="orange_text p-5" style="margin-left: 10px">{!! $outlets->count() !!} {{__('label.outlets')}}</h4>
  66. <div class="form-group has-search">
  67. <span class="fa fa-search form-control-feedback"></span>
  68. <input type="text" class="form-control" placeholder="{{__('label.search_outlet')}}">
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="row">
  74. <div class="col-12 mt-4">
  75. <div class="table-responsive">
  76. <table class="table table-striped">
  77. <thead>
  78. <tr>
  79. <th scope="col">{{__('label.status')}}</th>
  80. <th scope="col">{{__('label.name')}}</th>
  81. <th scope="col">{{__('label.delivery')}}</th>
  82. <th scope="col">{{__('label.pickup')}}</th>
  83. <th></th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. @php
  88. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  89. @endphp
  90. @if(isset($outlets) && $outlets->count() > 0)
  91. @foreach($outlets as $outlet)
  92. <tr>
  93. <td>
  94. <button type="button" data-on-text="Open" data-off-text="Closed" class="btn btn-toggle btn-sm btn-success @if($outlet->active=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->active=="1") true @else false @endif" autocomplete="off">
  95. <div class="handle"></div>
  96. </button> {{__('label.active')}}
  97. </td>
  98. <td >
  99. <h5>{!! $outlet->name !!}</h5>
  100. <p class="text-cover">{!! $resto->name !!} | {!! $resto->address !!}</p>
  101. </td>
  102. <td>
  103. @if($outlet->is_delivery=="1")<span class="gdot"></span> {{__('label.on')}} @else <span class="rdot"></span> {{__('label.off')}} @endif
  104. </td>
  105. <td>
  106. @if($outlet->is_pickup=="1")<span class="gdot"></span> {{__('label.on')}} @else <span class="rdot"></span> {{__('label.off')}} @endif
  107. </td>
  108. <td>
  109. <a href="{!! env('APP_URL') !!}outlet/edit/{!! $outlet->unique_key !!}" type="button" class="waves-effect waves-circle btn btn-circle btn-primary btn-xs mb-5"><i class="mdi mdi-tooltip-edit"></i></a>
  110. <a type="button" data-id="{!! $outlet->unique_key !!}" class="waves-effect waves-circle btn btn-circle delete-outlet btn-danger btn-xs mb-5"><i class="mdi mdi-delete"></i></a>
  111. </td>
  112. </tr>
  113. @endforeach
  114. @endif
  115. </tbody>
  116. </table>
  117. </div>
  118. </div>
  119. </div>
  120. </section>
  121. <!-- /.content -->
  122. </div>
  123. </div>
  124. <!-- /.content-wrapper -->
  125. @endsection
  126. @section('js')
  127. <script>
  128. $(function () {
  129. $('.table').DataTable({
  130. paging: true,
  131. bLengthChange:false,
  132. searching: false,
  133. language: {
  134. @if($lang=='ar')
  135. url:`{{asset('public/assets/js/dataTablear.json')}}`,
  136. @endif
  137. },
  138. });
  139. $("body").on("click",".delete-outlet",function () {
  140. var id = $(this).data('id');
  141. var _this = $(this);
  142. _this.parents('tr').remove();
  143. $.ajax({
  144. url:'{!! env('APP_URL') !!}outlet/delete/'+id,
  145. success:function (response) {
  146. $.toast({
  147. heading: 'Outlet Status',
  148. text: 'Outlet is delete successfully.',
  149. position: 'top-right',
  150. loaderBg: '#ff6849',
  151. icon: 'success',
  152. hideAfter: 3000,
  153. stack: 1
  154. });
  155. }
  156. });
  157. });
  158. $("body").on("click",".switch-me",function () {
  159. var is_active = $(this).attr("aria-pressed");
  160. var id = $(this).data('id');
  161. is_active = $.trim(is_active);
  162. var status = 0;
  163. if(is_active=="false"){
  164. status = 0;
  165. }else{
  166. status = 1;
  167. }
  168. $.ajax({
  169. url:"{!! env('APP_URL') !!}outlet/update/status",
  170. type:"POST",
  171. data:{
  172. id:id,
  173. status:status,
  174. "_token":'{!! csrf_token() !!}'
  175. },
  176. success:function () {
  177. if(is_active=="false"){
  178. $.toast({
  179. heading: 'Outlet Status',
  180. text: 'Outlet is deactive',
  181. position: 'top-right',
  182. loaderBg: '#ff6849',
  183. icon: 'error',
  184. hideAfter: 3000,
  185. stack: 1
  186. });
  187. }else{
  188. $.toast({
  189. heading: 'Outlet Status',
  190. text: 'Outlet is deactive.',
  191. position: 'top-right',
  192. loaderBg: '#ff6849',
  193. icon: 'success',
  194. hideAfter: 3000,
  195. stack: 1
  196. });
  197. }
  198. }
  199. });
  200. });
  201. })
  202. </script>
  203. @endsection