outlets-pause-orders.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. @media(max-width:767px)
  90. {
  91. .order_status_div
  92. {
  93. text-align:left !important;
  94. margin-top:14px;
  95. }
  96. .sm-mt-0
  97. {
  98. margin-top: 0px !important;
  99. }
  100. button.switch-me
  101. {
  102. margin-left: 3px !important;
  103. }
  104. }
  105. </style>
  106. @php
  107. $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  108. $lang = $resto->default_lang;
  109. app()->setLocale($lang);
  110. if(session('app_lang') !==null){
  111. $lang = session('app_lang');
  112. app()->setLocale($lang);
  113. }
  114. @endphp
  115. @php
  116. //$resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  117. $restuarant1 = $resto;
  118. $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null;
  119. //dump($resto_meta);
  120. $resto_metas = [];
  121. $billing = [];
  122. if(isset($resto_meta)){
  123. foreach($resto_meta as $meta){
  124. if($meta->outlet_id!=""){
  125. continue;
  126. }
  127. $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
  128. // dump($meta->resto_meta_defs);
  129. if($index_name=="BILLING_GATEWAY"){
  130. // dump($meta->resto_meta_defs->meta_def_name);
  131. // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
  132. $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
  133. }
  134. $resto_metas[$index_name] = $meta->meta_val;
  135. }
  136. }
  137. $resto_metas['BILLING_GATEWAY'] = $billing;
  138. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  139. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?trim($resto_metas['BUSSINESS_TYPE']):"Restaurants";
  140. @endphp
  141. <!-- Content Wrapper. Contains page content -->
  142. <div class="content-wrapper">
  143. <div class="container-full">
  144. <!-- Main content -->
  145. <section class="content">
  146. <div class="row ">
  147. <div class="col-md-6">
  148. <div class="m-15">
  149. <h3 class="title">{{__('label.pause_orders')}}</h3>
  150. </div>
  151. </div>
  152. </div>
  153. @php
  154. $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  155. @endphp
  156. @if(isset($outlets) && $outlets->count() > 0)
  157. @foreach($outlets as $outlet)
  158. <div class="pause-order">
  159. <div class="row">
  160. <div class="col-md-6"><p class="fw-normal m-0">{!! $resto->name !!}</p>
  161. <h5 class="m-0 fw-bold">{!! $outlet->name !!}</h5>
  162. </div>
  163. <div class="col-md-6 text-end order_status_div">
  164. <ul class="list-inline">
  165. <li> @if($outlet->is_delivery=="1") <span class="gdot"></span>{{__('label.delivery')}} @else<span class="rdot"></span> {{__('label.delivery_pause')}} @endif</li>
  166. <li> @if($outlet->is_pickup=="1") <span class="gdot"></span> {{__('label.pickup')}} @else <span class="rdot"></span>{{__('label.pickup_pause')}} @endif</li>
  167. @if($business_type=="Restaurants")
  168. <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>
  169. @endif
  170. </ul>
  171. </div>
  172. </div>
  173. <div class="row mt-30 sm-mt-0">
  174. <div class="col-md-12 col-lg-4 mb-2">
  175. <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">
  176. <div class="handle"></div>
  177. </button> {{__('label.accepting_delivery_orders')}}
  178. </div>
  179. <div class="col-md-12 col-lg-4">
  180. <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">
  181. <div class="handle"></div>
  182. </button> {{__('label.accepting_pickup_orders')}}
  183. </div>
  184. @if($business_type=="Restaurants")
  185. <div class="col-md-12 col-lg-4">
  186. <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">
  187. <div class="handle"></div>
  188. </button>{{__('label.accepting_dine_in')}}
  189. </div>
  190. @endif
  191. </div>
  192. </div>
  193. @endforeach
  194. @endif
  195. </section>
  196. <!-- /.content -->
  197. </div>
  198. </div>
  199. <!-- /.content-wrapper -->
  200. @endsection
  201. @section('js')
  202. <script>
  203. $(function () {
  204. $("body").on("click",".switch-me",function () {
  205. var is_active = $(this).attr("aria-pressed");
  206. var id = $(this).data('id');
  207. var type = $(this).data('type');
  208. is_active = $.trim(is_active);
  209. var _this = $(this);
  210. var status = 0;
  211. if(is_active=="false"){
  212. status = 0;
  213. _this.parents('tr').addClass('inactive');
  214. }else{
  215. status = 1;
  216. _this.parents('tr').removeClass('inactive');
  217. }
  218. $.ajax({
  219. url:"{!! env('APP_URL') !!}outlet/feature/update/status",
  220. type:"POST",
  221. data:{
  222. id:id,
  223. status:status,
  224. type:type,
  225. "_token":'{!! csrf_token() !!}'
  226. },
  227. success:function () {
  228. if(is_active=="false"){
  229. $.toast({
  230. heading: 'Outlet '+type+' Status',
  231. text: 'Outlet '+type+' is deactive',
  232. position: 'top-right',
  233. loaderBg: '#ff6849',
  234. icon: 'error',
  235. hideAfter: 3000,
  236. stack: 1
  237. });
  238. }else{
  239. $.toast({
  240. heading: 'Outlet '+type+' Status',
  241. text: 'Outlet '+type+' is active.',
  242. position: 'top-right',
  243. loaderBg: '#ff6849',
  244. icon: 'success',
  245. hideAfter: 3000,
  246. stack: 1
  247. });
  248. }
  249. }
  250. });
  251. });
  252. })
  253. </script>
  254. @endsection