outlets-pause-orders.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. @extends('layouts.app')
  2. @section('page-title')| {{__('label.outlet_pause_orders')}} @endsection
  3. @section('css')
  4. <link href="{!! env('APP_ASSETS') !!}css/outlets.css?v=1.3" 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. table.dataTable {
  34. clear: both;
  35. margin-top: 6px !important;
  36. margin-bottom: 6px !important;
  37. max-width: none !important;
  38. border-collapse: collapse !important;
  39. font-family: 'Open Sans';
  40. }
  41. .theme-primary .paging_simple_numbers .pagination .paginate_button.active a,.theme-primary .pagination li a:hover,.theme-primary .paging_simple_numbers .pagination .paginate_button:hover a{
  42. color: white !important;
  43. background: #ffa505 !important;
  44. }
  45. .search-outlet{
  46. width: 400px;
  47. background-color: white;
  48. }
  49. .search-buttom{
  50. top: 8px;
  51. right: 15px;
  52. font-size: 20px;
  53. color: #e1e1e1;
  54. }
  55. .btn-toggle.btn-sm:focus, .btn-toggle.btn-sm.focus, .btn-toggle.btn-sm:focus.active, .btn-toggle.btn-sm.focus.active{
  56. box-shadow: none;
  57. }
  58. .btn-outlet{
  59. }
  60. .btn-toggle.active{
  61. color: white !important;
  62. background: #ffa505;
  63. }
  64. .rdot {
  65. height: 10px;
  66. width: 10px;
  67. background-color: red;
  68. border-radius: 0%;
  69. display: inline-block;
  70. }
  71. .gdot {
  72. height: 10px;
  73. width: 10px;
  74. background-color: green;
  75. border-radius: 0%;
  76. display: inline-block;
  77. }
  78. .pause-order{
  79. padding: 10px; background-color: #fff8ec; margin-bottom: 30px;
  80. }
  81. .list-inline li{
  82. margin-right: 30px;
  83. }
  84. @media (max-width:641px) {
  85. .list-inline li{
  86. margin-right: 5px;
  87. }
  88. }
  89. </style>
  90. @php
  91. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  92. $lang = $resto->default_lang;
  93. app()->setLocale($lang);
  94. if(session('app_lang') !==null){
  95. $lang = session('app_lang');
  96. app()->setLocale($lang);
  97. }
  98. @endphp
  99. @php
  100. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  101. $restuarant1 = $resto;
  102. $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null;
  103. //dump($resto_meta);
  104. $resto_metas = [];
  105. $billing = [];
  106. if(isset($resto_meta)){
  107. foreach($resto_meta as $meta){
  108. if($meta->outlet_id!=""){
  109. continue;
  110. }
  111. $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
  112. // dump($meta->resto_meta_defs);
  113. if($index_name=="BILLING_GATEWAY"){
  114. // dump($meta->resto_meta_defs->meta_def_name);
  115. // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
  116. $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
  117. }
  118. $resto_metas[$index_name] = $meta->meta_val;
  119. }
  120. }
  121. $resto_metas['BILLING_GATEWAY'] = $billing;
  122. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  123. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?trim($resto_metas['BUSSINESS_TYPE']):"Restaurants";
  124. @endphp
  125. <!-- Content Wrapper. Contains page content -->
  126. <div class="content-wrapper">
  127. <div class="container-full">
  128. <!-- Main content -->
  129. <section class="content">
  130. <div class="row ">
  131. <div class="col-md-6">
  132. <div class="m-15">
  133. <h3 class="title">{{__('label.pause_orders')}}</h3>
  134. </div>
  135. </div>
  136. </div>
  137. @php
  138. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  139. @endphp
  140. @if(isset($outlets) && $outlets->count() > 0)
  141. @foreach($outlets as $outlet)
  142. <div class="pause-order">
  143. <div class="row">
  144. <div class="col-md-6"><p class="fw-normal m-0">{!! $resto->name !!}</p>
  145. <h5 class="m-0 fw-bold">{!! $outlet->name !!}</h5>
  146. </div>
  147. <div class="col-md-6 text-end">
  148. <ul class="list-inline">
  149. <li> @if($outlet->is_delivery=="1") <span class="gdot"></span>{{__('label.delivery')}} @else<span class="rdot"></span> {{__('label.delivery_pause')}} @endif</li>
  150. <li> @if($outlet->is_pickup=="1") <span class="gdot"></span> {{__('label.pickup')}} @else <span class="rdot"></span>{{__('label.pickup_pause')}} @endif</li>
  151. @if($business_type=="Restaurants")
  152. <li> @if($outlet->is_contactless_dining=="1") <span class="gdot"></span> {{__('label.dine_in')}} @else <span class="rdot"></span> {{__('label.dine_in_pause')}} @endif</li>
  153. @endif
  154. </ul>
  155. </div>
  156. </div>
  157. <div class="row mt-30">
  158. <div class="col-md-4">
  159. <button type="button" data-on-text="Open" data-type="delivery" data-off-text="Closed" class="switch-me btn-toggle btn-sm btn-outlet @if($outlet->is_delivery=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_delivery=="1") true @else false @endif" autocomplete="off">
  160. <div class="handle"></div>
  161. </button> {{__('label.accepting_delivery_orders')}}
  162. </div>
  163. <div class="col-md-4">
  164. <button type="button" data-type="pickup" data-on-text="Open" data-off-text="Closed" class="switch-me btn-toggle btn-sm btn-outlet @if($outlet->is_pickup=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_pickup=="1") true @else false @endif" autocomplete="off">
  165. <div class="handle"></div>
  166. </button> {{__('label.accepting_pickup_orders')}}
  167. </div>
  168. @if($business_type=="Restaurants")
  169. <div class="col-md-4">
  170. <button type="button" data-type="dine-in" data-on-text="Open" data-off-text="Closed" class="switch-me btn-toggle btn-sm btn-outlet @if($outlet->is_contactless_dining=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_contactless_dining=="1") true @else false @endif" autocomplete="off">
  171. <div class="handle"></div>
  172. </button>{{__('label.accepting_dine_in')}}
  173. </div>
  174. @endif
  175. </div>
  176. </div>
  177. @endforeach
  178. @endif
  179. </section>
  180. <!-- /.content -->
  181. </div>
  182. </div>
  183. <!-- /.content-wrapper -->
  184. @endsection
  185. @section('js')
  186. <script>
  187. $(function () {
  188. $("body").on("click",".switch-me",function () {
  189. var is_active = $(this).attr("aria-pressed");
  190. var id = $(this).data('id');
  191. var type = $(this).data('type');
  192. is_active = $.trim(is_active);
  193. var _this = $(this);
  194. var status = 0;
  195. if(is_active=="false"){
  196. status = 0;
  197. _this.parents('tr').addClass('inactive');
  198. }else{
  199. status = 1;
  200. _this.parents('tr').removeClass('inactive');
  201. }
  202. $.ajax({
  203. url:"{!! env('APP_URL') !!}outlet/feature/update/status",
  204. type:"POST",
  205. data:{
  206. id:id,
  207. status:status,
  208. type:type,
  209. "_token":'{!! csrf_token() !!}'
  210. },
  211. success:function () {
  212. if(is_active=="false"){
  213. $.toast({
  214. heading: 'Outlet '+type+' Status',
  215. text: 'Outlet '+type+' is deactive',
  216. position: 'top-right',
  217. loaderBg: '#ff6849',
  218. icon: 'error',
  219. hideAfter: 3000,
  220. stack: 1
  221. });
  222. }else{
  223. $.toast({
  224. heading: 'Outlet '+type+' Status',
  225. text: 'Outlet '+type+' is active.',
  226. position: 'top-right',
  227. loaderBg: '#ff6849',
  228. icon: 'success',
  229. hideAfter: 3000,
  230. stack: 1
  231. });
  232. }
  233. }
  234. });
  235. });
  236. })
  237. </script>
  238. @endsection