orders.blade.php_without_discount05-05 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702
  1. @extends('layouts.app')
  2. @section('page-title')| Live Orders @endsection
  3. @section('css')
  4. <link href="{!! env('APP_ASSETS') !!}css/liveorder.css?v={!! time() !!}" rel="stylesheet" type="text/css">
  5. @endsection
  6. @section('content')
  7. <style>
  8. .arrow-arabic svg{
  9. -webkit-transform:rotate(180deg);
  10. -moz-transform: rotate(180deg);
  11. -ms-transform: rotate(180deg);
  12. -o-transform: rotate(180deg);
  13. transform: rotate(180deg);
  14. }
  15. body {
  16. background-color: #FFF;
  17. }
  18. #print-recipt{
  19. display: none; }
  20. .mlist_li.selected{
  21. color: #000;
  22. background-color: #f1f1f1;
  23. }
  24. #show-recipes .box-header{
  25. padding: 15px 1.5rem 5px;
  26. }
  27. @-webkit-keyframes special {
  28. from { background-color: rgba(255, 121, 77, 0.27); }
  29. to { background-color: inherit; }
  30. }
  31. @-moz-keyframes special {
  32. from { background-color: rgba(255, 121, 77, 0.27);; }
  33. to { background-color: inherit; }
  34. }
  35. @-o-keyframes special {
  36. from { background-color: rgba(255, 121, 77, 0.27);; }
  37. to { background-color: inherit; }
  38. }
  39. @keyframes special {
  40. from { background-color: rgba(255, 121, 77, 0.27);; }
  41. to { background-color: inherit; }
  42. }
  43. .special {
  44. -webkit-animation: special 1s infinite; /* Safari 4+ */
  45. -moz-animation: special 1s infinite; /* Fx 5+ */
  46. -o-animation: special 1s infinite; /* Opera 12+ */
  47. animation: special 1s infinite; /* IE 10+ */
  48. }
  49. .mlist_li.selected .media, .mlist_li.selected .box{
  50. /*background-color: transparent !important;*/
  51. }
  52. .mlist_li.selected p{
  53. color:#000 !important;
  54. }
  55. .labelcenter { width: auto}
  56. .gap-items p.status{ font-size: 12px}
  57. .gap-items p.min{
  58. line-height: 13px;
  59. padding-top: 11px;
  60. font-size: 11px;
  61. }
  62. .bg-danger p.min, .bg-danger .gap-items p.status{
  63. display: none;}
  64. .bg-danger .circle-div{ height: 10px; width: 10px; background: #fff !important; margin-right: 15px;}
  65. .mlist_li.selected .media-list-hover > .media:not(.media-list-header):not(.media-list-footer):hover,.mlist_li.selected .media-list-hover .media-list-body > .media:hover{
  66. background-color: transparent !important;
  67. }
  68. .mlist_li.selected .media-list{
  69. color: #000;
  70. background-color: #f1f1f1 !important;
  71. }
  72. .sidebar-mini.sidebar-collapse .content-wrapper {
  73. width: calc(100% - 60px) !important;
  74. margin-left: 60px !important;
  75. }
  76. .no-order-found{
  77. background-color: #000;
  78. background-image: url({!! env('APP_ASSETS') !!}images/no-order.png);
  79. background-repeat: no-repeat;
  80. background-position: center;
  81. ;
  82. }
  83. .actions{
  84. position:absolute; top: 20px; right: 10px;
  85. }
  86. .actions li{ margin:0 !important; padding:0}
  87. @media screen and (min-device-width: 1200px) and (max-device-width: 1600px) and (-webkit-min-device-pixel-ratio: 1){
  88. body {
  89. padding: 0px !important;
  90. }
  91. }
  92. @media (max-width:767px){
  93. .actions {
  94. position: absolute;
  95. top: 20px;
  96. right: 15px;
  97. }
  98. .calc_div{
  99. padding: 14px;
  100. }
  101. .mlist_li.selected p {
  102. color: #fff!important;
  103. }
  104. .mlist_li.selected .media-list {
  105. color: #fff;
  106. background-color: transparent!important;
  107. }
  108. body.fixed {
  109. overflow-y:hidden;
  110. }
  111. .for-mobile{
  112. /* max-height: 330px; */
  113. max-height: 60vh;
  114. overflow: auto;
  115. }
  116. #show-recipes .box-header {
  117. padding:0rem 18px 0 12px !important;
  118. }
  119. .right-panel-footer p{margin-bottom: 5px !important;
  120. padding: 0 !important;}
  121. .button-bottom-div{margin-top: 0px !important;}
  122. }
  123. .box-header p {
  124. margin-bottom: 0;
  125. }
  126. .box-header {
  127. padding: 1.5rem 0.5rem;
  128. }
  129. @media (max-width:767px){
  130. .box-header {
  131. padding: 0.5rem 14px;
  132. }
  133. }
  134. @media (max-width: 1024px){
  135. .navbar-custom-menu .navbar-nav > li:last-child > a {
  136. line-height: 25px;
  137. margin-left: 30px !important;
  138. }
  139. }
  140. @media (min-width: 768px) and (max-width: 1024px) {
  141. body{
  142. overflow-x:hidden !important;
  143. overflow-y:hidden !important;
  144. }
  145. }
  146. </style>
  147. @php
  148. $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  149. $lang = $resto->default_lang;
  150. app()->setLocale($lang);
  151. if(session('app_lang') !==null){
  152. $lang = session('app_lang');
  153. app()->setLocale($lang);
  154. }
  155. $restuarant1 = $resto;
  156. $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null;
  157. //dump($resto_meta);
  158. $resto_metas = [];
  159. $billing = [];
  160. if(isset($resto_meta)){
  161. foreach($resto_meta as $meta){
  162. if($meta->outlet_id!=""){
  163. continue;
  164. }
  165. $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
  166. // dump($meta->resto_meta_defs);
  167. if($index_name=="BILLING_GATEWAY"){
  168. // dump($meta->resto_meta_defs->meta_def_name);
  169. // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
  170. $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
  171. }
  172. $resto_metas[$index_name] = $meta->meta_val;
  173. }
  174. }
  175. $resto_metas['BILLING_GATEWAY'] = $billing;
  176. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  177. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
  178. $is_allow_print_preview = isset($resto_metas['PRINT_PREVIEW_ON_ACCEPT_ORDER'])?$resto_metas['PRINT_PREVIEW_ON_ACCEPT_ORDER']:"Disabled";
  179. @endphp
  180. <!-- Content Wrapper. Contains page content -->
  181. <div class="content-wrapper">
  182. <div id="countdown"></div>
  183. <div class="container-full">
  184. <section class="content p-0">
  185. <div class="row">
  186. <div class="col-sm-12">
  187. <nav class="navbar navbar-static-top ">
  188. <!-- Sidebar toggle button-->
  189. <div class="row">
  190. <div class="col-md-12 tab-bar-section">
  191. <div class="app">
  192. <ul class="hs full nav nav-tabs" role="tablist">
  193. <li class="item nav-item d-flex align-items-start">
  194. <div class="gap-items-4 d-flex justify-content-end">
  195. <a class="nav-link p-0 active" data-bs-toggle="tab" href="#all-orders" data-status="all" role="tab">{{__('label.all')}}
  196. <span class="labelcenter label-default all">0</span></a>
  197. </div>
  198. </li>
  199. <li class="item nav-item d-flex align-items-start ">
  200. <div class="gap-items-4 d-flex justify-content-end">
  201. <a class="nav-link p-0" data-bs-toggle="tab" href="#new-orders" data-status="new" role="tab">{{__('label.new')}}
  202. <span class="labelcenter label-default new">0</span></a>
  203. </div>
  204. </li>
  205. <li class="item nav-item d-flex align-items-start">
  206. <div class="gap-items-4 d-flex justify-content-end">
  207. <a class="nav-link p-0" data-bs-toggle="tab" href="#in-kitchen" data-status="kitchen" role="tab">{{__('label.in_preparation')}}
  208. <span class="labelcenter label-default kitchen">0</span></a>
  209. </div>
  210. </li>
  211. <li class="item nav-item d-flex align-items-start">
  212. <div class="gap-items-4 d-flex justify-content-end">
  213. <a class="nav-link p-0" data-bs-toggle="tab" href="#in-route" data-status="route" role="tab" >{{__('label.in_routeready')}}
  214. <span class="labelcenter label-default route">0</span></a>
  215. </div>
  216. </li>
  217. </ul>
  218. </div>
  219. </div>
  220. </div>
  221. <!-- <div class="app-menu"></div> -->
  222. <a href="#" class="d-inline-block btn right-bar-btn waves-effect waves-circle btn btn-circle btn-danger btn-sm right-close-btn">
  223. <i class="mdi mdi-close"></i>
  224. </a>
  225. </nav>
  226. </div>
  227. </div>
  228. <div class="row">
  229. <div class="col-sm-12 col-md-4 order-sections-list" style="background-color: #f1f1f1">
  230. <div class="row p-10">
  231. <div class="col-md-12 mt-5">
  232. <div class="search-bx mx-5">
  233. <form>
  234. <div class="input-group search-div">
  235. <input type="search" class="form-control" style="background-color: transparent" placeholder="{{__('label.search_by_order_id')}}" aria-label="Search" aria-describedby="button-addon2">
  236. <div class="input-group-append">
  237. <button class="btn btn-sarch" type="submit" id="button-addon3"><i class="ti-search"></i></button>
  238. </div>
  239. </div>
  240. </form>
  241. </div>
  242. </div>
  243. </div>
  244. <div class="row mt-5 list_row">
  245. <div class=" col-md-12 p-0">
  246. <div class="tab-content">
  247. <div class="tab-pane fade in active all-orders" id="all-orders" role="tabpanel" style="max-height: 82vh; min-height: 82vh; overflow: auto;">
  248. <div class="p-0">
  249. <ul class="list-group list-ul list-unstyled orders-list" id="orders-list">
  250. {{--<li class="mlist_li p-5 mb-5 pl-15">
  251. <div class="d-grid gap-2 d-flex justify-content-center">
  252. <button class="btn btn-md btn-primary ref-btn">Refresh</button>
  253. </div>
  254. </li>--}}
  255. </ul>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="col-sm-12 col-md-6 box-shadowed">
  263. <div class="no-order" style="padding-top: 50%; height: 90vh ;">
  264. <h3 class="text-center text-light">{{__('label.no_order_selected')}}</h3>
  265. </div>
  266. <div class="order-section" style="display: none; height: 90vh ; overflow-x: auto">
  267. <div class="row back-to-orders d-md-none d-lg-none">
  268. <div class="col-sm-12 text-center @if($lang=='ar') arrow-arabic @endif">
  269. @if($lang=="en")
  270. <svg style=" filter: drop-shadow(1px 0px 0px black);" xmlns="http://www.w3.org/2000/svg" width="13.917" height="9.785" viewBox="0 0 13.917 9.785">
  271. <path id="Shape_878" data-name="Shape 878" d="M301.31,1645.861h-7.36v2.854l-6.557-4.9,6.548-4.889v2.853h7.369Zm-8.177,1.227v-2.051h7.354v-2.443h-7.364v-2.036l-4.368,3.261Z" transform="translate(-287.393 -1638.93)"/>
  272. </svg>
  273. {{__('label.live_orders')}}
  274. @else
  275. <svg style=" filter: drop-shadow(1px 0px 0px black);" xmlns="http://www.w3.org/2000/svg" width="13.917" height="9.785" viewBox="0 0 13.917 9.785">
  276. <path id="Shape_878" data-name="Shape 878" d="M301.31,1645.861h-7.36v2.854l-6.557-4.9,6.548-4.889v2.853h7.369Zm-8.177,1.227v-2.051h7.354v-2.443h-7.364v-2.036l-4.368,3.261Z" transform="translate(-287.393 -1638.93)"/>
  277. </svg> {{__('label.live_orders')}}
  278. @endif
  279. </div>
  280. </div>
  281. <div class="row">
  282. <div class="col-sm-12">
  283. <div class="boxs">
  284. <div class="box-header with-border">
  285. <div class="d-flex justify-content-between align-items-center">
  286. <p class="fw-bold" rel="order_ref"></p>
  287. <p rel="order_placed"></p>
  288. <span class="inkitchen-btn badge badge-warning " id="toggle"></span>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <div class="row">
  294. <div class="col-sm-12 mt-1 text-end">
  295. <a href="#!" class="print">{{__('label.print')}}</a>
  296. </div>
  297. </div>
  298. <div class="for-mobile">
  299. <div class="row right-panel-box">
  300. <div class="col-6">
  301. <div class="boxs">
  302. <div class="box-body">
  303. <div class="d-flex align-items-start">
  304. <div>
  305. <p class="text-fade mb-0">{{__('label.brand')}}</p>
  306. <p rel="brand_name"></p>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. <div class="col-6">
  313. <div class="boxs">
  314. <div class="box-body">
  315. <div class="d-flex align-items-start">
  316. <div>
  317. <p class="text-fade mb-0">{{__('label.outlets')}}</p>
  318. <p rel="outlet_name"></p>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <div class="row right-panel-box">
  326. <div class="col-6">
  327. <div class="boxs">
  328. <div class="box-body">
  329. <div class="d-flex align-items-start">
  330. <div>
  331. <p class="text-fade mb-0">{{__('label.order_type')}}</p>
  332. <p>
  333. <i class="icon-Dinner"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span></i>
  334. <span rel="order_type"></span>
  335. </p>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <div class="col-6 for-delivery">
  342. <div class="boxs">
  343. <div class="box-body">
  344. <div class="d-flex align-items-start">
  345. <div class="">
  346. <p class="text-fade mb-0">{{__('label.delivery_at')}}</p>
  347. <p rel="delivery_at"></p>
  348. </div>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. <div class="col-6 for-pickup" style="display:none">
  354. <div class="boxs">
  355. <div class="box-body">
  356. <div class="d-flex align-items-start">
  357. <div class="">
  358. <p class="text-fade mb-0">{{__('label.pickup_at')}}</p>
  359. <p rel="delivery_at"></p>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. <div class="row right-panel-box">
  367. <div class="col-6">
  368. <div class="boxs">
  369. <div class="box-body">
  370. <div class="d-flex align-items-start">
  371. <div class="">
  372. <p class="text-fade mb-0">{{__('label.customers')}}</p>
  373. <p rel="customer"> <br>
  374. <i class="mdi mdi-crown org-color"></i>
  375. <small class="org-color">Ordered 5 times </small>
  376. </p>
  377. </div>
  378. </div>
  379. </div>
  380. </div>
  381. </div>
  382. <div class="col-6">
  383. <div class="boxs">
  384. <div class="box-body">
  385. <div class="d-flex align-items-start">
  386. <div class="">
  387. <p class="text-fade mb-0">{{__('label.phone_number')}}</p>
  388. <p rel="phone"></p>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <div class="row right-panel-box">
  396. <div class="col-6">
  397. <div class="boxs">
  398. <div class="box-body">
  399. <div class="d-flex align-items-start">
  400. <div class="">
  401. <p class="text-fade mb-0">{{__('label.payment_mode')}}</p>
  402. <p rel="payment"></p>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. <div class="col-6">
  409. <div class="boxs">
  410. <div class="box-body">
  411. <div class="d-flex align-items-start">
  412. <div class="">
  413. <p class="text-fade mb-0">{{__('label.channel')}}</p>
  414. <p rel="channel"></p>
  415. </div>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. <div class="row right-panel-box">
  422. <!--<div class="col-md-6" id="address">
  423. <div class="boxs">
  424. <div class="box-body">
  425. <div class="d-flex align-items-start">
  426. <div class="">
  427. <p class="text-fade mb-0">Address</p>
  428. <p rel="address"></p>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>-->
  434. <div class="col-6" id="table" style="display:none">
  435. <div class="boxs">
  436. <div class="box-body">
  437. <div class="d-flex align-items-start">
  438. <div class="">
  439. <p class="text-fade mb-0">{{__('label.table')}}</p>
  440. <p rel="for_table"></p>
  441. </div>
  442. </div>
  443. </div>
  444. </div>
  445. </div>
  446. <div class="col-6 for-delivery">
  447. <div class="boxs">
  448. <div class="box-body">
  449. <div class="d-flex align-items-start">
  450. <div class="">
  451. <p class="text-fade mb-0">
  452. {{__('label.order_notes')}}</p>
  453. <p rel="delivery_notes">
  454. </p>
  455. <p rel="order_instructions">
  456. </p>
  457. </div>
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. </div>
  463. <div class="row right-panel-box">
  464. <div class="col-md-12">
  465. <div class="boxs" style="position: relative">
  466. <div class="box-body address_action_div">
  467. <div class="d-flex align-items-start">
  468. <div class="">
  469. <p class="text-fade mb-0">{{__('label.address')}}</p>
  470. <p rel="address" style="max-width: 80%"></p>
  471. </div>
  472. </div>
  473. </div>
  474. <div class="actions">
  475. <ul class="list-inline">
  476. <li class="list-inline-item"><a href="#!" class="address-actions" data-action="copy-clipboard"><svg data-v-10e82b3e="" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="" style="color: var(--color-midnight); width: 20px; height: 20px;"><path fill-rule="evenodd" d="M16 5.5H6a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h10a.5.5 0 00.5-.5V6a.5.5 0 00-.5-.5zM6 4a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2H6z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M1.25 4A2.75 2.75 0 014 1.25h6a.75.75 0 010 1.5H4c-.69 0-1.25.56-1.25 1.25v6a.75.75 0 01-1.5 0V4z" clip-rule="evenodd"></path></svg></a></li>
  477. <li class="list-inline-item"><a href="#!" class="address-actions" data-action="google-map"><svg data-v-2740a47f="" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="" style="width: 20px; height: 20px;"><path d="M16.45 7.7c0 3.152-2.19 4.965-3.831 6.72-.983 1.051-1.769 4.48-1.769 4.48s-.784-3.426-1.764-4.475C7.443 12.671 5.25 10.855 5.25 7.7a5.6 5.6 0 1111.2 0v0z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.61 7.7a2.24 2.24 0 104.48 0 2.24 2.24 0 00-4.48 0z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></a></li>
  478. <li class="list-inline-item">
  479. <a href="#!" class="address-actions" data-action="whatsapp">
  480. <svg data-v-2740a47f="" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="" style="width: 20px; height: 20px;"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.071 4.013a9.192 9.192 0 016.502-2.663 9.192 9.192 0 019.207 9.143v.01A9.222 9.222 0 015.803 18.33l-2.92.925a.75.75 0 01-.937-.954l.932-2.763a9.027 9.027 0 01-1.528-5.042v-.003a9.192 9.192 0 012.721-6.48zM10.572 2.1l-.002.75a7.692 7.692 0 00-7.72 7.65 7.527 7.527 0 001.464 4.473.75.75 0 01.107.685l-.58 1.72 1.84-.583a.75.75 0 01.638.088 7.722 7.722 0 0011.96-6.387 7.692 7.692 0 00-7.705-7.646l-.002-.75zM8.548 5.878c.223.115.47.313.606.628.055.126.132.314.212.51l.177.43c.07.167.134.316.186.428.026.056.045.096.058.12v.002a1.149 1.149 0 01.058 1.17 1.27 1.27 0 01-.282.38 5.126 5.126 0 01-.07.063l-.048.045a6.172 6.172 0 002.386 2.02c.085-.116.18-.253.252-.367.156-.246.41-.47.777-.513.277-.032.52.062.614.098l.009.004c.2.076 1.063.497 1.425.673l.136.066c.019.009.04.02.064.03.077.037.173.082.246.123.085.047.297.166.434.4.04.068.067.14.083.213a1.81 1.81 0 01-.216 1.572c-.796 1.379-2.173 1.81-3.55 1.667-1.356-.14-2.785-.827-3.962-1.76-1.178-.934-2.19-2.183-2.63-3.538-.452-1.393-.293-2.904.899-4.163.401-.436 1-.53 1.429-.496.233.018.482.078.707.195zm5.91 7.139l-.066-.031-.175-.085a155.61 155.61 0 00-1.056-.508 6 6 0 01-.39.508c-.133.15-.35.327-.67.366a1.22 1.22 0 01-.686-.133 7.672 7.672 0 01-3.436-2.979l-.01-.016a1.033 1.033 0 01-.085-.922c.086-.216.248-.379.276-.408a8.417 8.417 0 01.24-.234 15.217 15.217 0 01-.242-.552l-.19-.463a46.22 46.22 0 00-.15-.365.524.524 0 00-.313.012c-.76.8-.875 1.717-.565 2.672.323.995 1.113 2.016 2.135 2.826 1.021.81 2.188 1.34 3.184 1.443.963.1 1.683-.193 2.108-.943a.728.728 0 01.038-.061.312.312 0 00.052-.127zM7.515 7.194l-.002.003.002-.003zm.346.018H7.86h.002zm4.226 4.58zm-2.29-3.779z" fill="currentColor"></path></svg>
  481. </a>
  482. </li>
  483. </ul>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. @if( $business_type=="Florist")
  489. <div class="row right-panel-box" >
  490. <div class="col-6">
  491. <div class="boxs">
  492. <div class="box-body">
  493. <div class="d-flex align-items-start">
  494. <div class="">
  495. <p class="text-fade mb-0">{{__('label.receiver_name')}}</p>
  496. <p rel="recipient_name"></p>
  497. </div>
  498. </div>
  499. </div>
  500. </div>
  501. </div>
  502. <div class="col-6">
  503. <div class="boxs">
  504. <div class="box-body">
  505. <div class="d-flex align-items-start">
  506. <div class="">
  507. <p class="text-fade mb-0">{{__('label.receiver_phone')}}</p>
  508. <p rel="recipient_phone"></p>
  509. </div>
  510. </div>
  511. </div>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="row right-panel-box" >
  516. <div class="col-md-12">
  517. <div class="boxs">
  518. <div class="box-body">
  519. <div class="d-flex align-items-start">
  520. <div class="">
  521. <p class="text-fade mb-0">{{__('label.greeting_message')}}</p>
  522. <p rel="greeting_message"></p>
  523. </div>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. @endif
  530. <div class="col-12" id="show-recipes"></div>
  531. <div class="col-12 calc_div">
  532. <div class="box-header border-0 p-15 mt-0 pb-0">
  533. <div class="d-flex justify-content-between align-items-center m-0">
  534. <p>{{__('label.sub_total')}}:</p>
  535. <p class="sub_total"></p>
  536. </div>
  537. <div class="d-flex justify-content-between align-items-center m-0">
  538. <p>{{__('label.delivery_fee')}}:</p>
  539. <p class="delivery_fee"></p>
  540. </div>
  541. <div class="d-flex justify-content-between align-items-center m-0">
  542. <p class="">{{__('label.total')}}:</p>
  543. <p class="total_txt"></p>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. </div>
  549. <div class="row mt-0 right-panel-footer footer_btn_div">
  550. <div class="col-12 mt-5 button-bottom-div">
  551. <div class="m-0 text-center">
  552. <button type="button" class="waves-effect waves-light btn btn-outline btn-danger mb-0 btn-w80 rounded-0 rclose-btn reject change-status-reject" data-status="Rejected" style="display: none">{{__('label.reject')}}</button>
  553. <button type="button" class="waves-effect waves-light btn btn-outline btn-dark mb-0 btn-w50 rounded-0 rclose-btn accept change-status-reject" data-status="Close" style="display: none">{{__('label.close')}}</button>
  554. <button type="button" class="waves-effect waves-light btn btn-outline btn-danger mb-0 btn-w50 rounded-0 accept change-status-reject" data-status="Rejected" style="display: none">{{__('label.cancel')}}</button>
  555. <button type="button" class="waves-effect waves-light btn btn-default btn-w80 rounded-0 ready-collect change-status " data-status="">{{__('label.accept')}}</button>
  556. </div>
  557. </div>
  558. </div>
  559. </div>
  560. </div>
  561. </div>
  562. </section>
  563. <!-- /.content -->
  564. </div>
  565. </div>
  566. <!-- /.content-wrapper -->
  567. <div class="modal center-modal fade" id="accept-modal" tabindex="-1">
  568. <div class="modal-dialog">
  569. <div class="modal-content">
  570. <div class="modal-body">
  571. <h4>{{__('label.order_settings')}}</h4>
  572. <p>{{__('label.set_time_preparing_orders')}}</p>
  573. <div class="row">
  574. <div class="col-sm-6">
  575. <div class="form-group">
  576. <label>{{__('label.preparation_minutes')}}</label>
  577. <input type="text" name="preparation_time" class="form-control" value="15" />
  578. </div>
  579. </div>
  580. <div class="col-sm-6">
  581. <div class="form-group">
  582. <label>{{__('label.preparation_delivery_minutes')}}</label>
  583. <input type="text" name="preperation_delivery" class="form-control" value="40" />
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. <div class="modal-footer modal-footer-uniform">
  589. <button type="button" class="btn btn-danger" data-bs-dismiss="modal">{{__('label.close')}}</button>
  590. <button type="button" class="btn btn-primary float-end accept-order">{{__('label.accept')}}</button>
  591. </div>
  592. </div>
  593. </div>
  594. </div>
  595. <div id="print-recipt"> </div>
  596. @endsection
  597. @section('js')
  598. <script src="{!! env('APP_ASSETS') !!}js/jquery.jscroll.min.js"></script>
  599. <script src="{!! env('APP_ASSETS') !!}js/jquery.countdown360.min.js"></script>
  600. <script src="{!! env('APP_ASSETS') !!}vendor_components/sweetalert/sweetalert.min.js"></script>
  601. <script>
  602. var resto_id = 0;
  603. var status = "all";
  604. var counter = 0;
  605. var order_id = null;
  606. var order_object = null;
  607. $(function () {
  608. $("body").on("click",".back-to-orders",function () {
  609. $(".order-section").hide();
  610. });
  611. $("body").on("click",".address-actions",function(){
  612. var _actions = $(this).data("action");
  613. if(_actions=="google-map"){
  614. var map = "https://maps.google.com/?q="+order_object.geo_location;
  615. window.open(map,"_blank");
  616. return false;
  617. }
  618. if(_actions=="whatsapp"){
  619. var template = order_text_template(order_object,"whatsapp");
  620. //console.log(encodeURIComponent(template));
  621. window.open("https://api.whatsapp.com/send?text="+(template),"_blank");
  622. }
  623. if(_actions=="copy-clipboard"){
  624. var template = order_text_template(order_object,"copy-clipboard");
  625. //console.log(encodeURIComponent(template));
  626. navigator.clipboard.writeText(template);
  627. }
  628. });
  629. $("body").on("click",".print",function () {
  630. $.ajax({
  631. url:"{!! env('APP_URL') !!}order/print/"+order_id,
  632. success:function (response) {
  633. $('#print-recipt').html(response);
  634. $('#print-recipt').printThis();
  635. }
  636. });
  637. });
  638. $.ajax({
  639. url: "{!! env('APP_URL') !!}order/counts",
  640. success: function (response) {
  641. // response = $.parseJSON(response);
  642. var total_accepted = 0;
  643. var total = 0;
  644. $.each(response,function (i,v) {
  645. if(v.status=="Send_to_Kitchen" || v.status=="Accepted"){
  646. total_accepted+=parseInt(v.status_count);
  647. total+=parseInt(v.status_count);
  648. $(".labelcenter.kitchen").text(total_accepted);
  649. }
  650. if(v.status=="On_Road"){
  651. $(".labelcenter.route").text(v.status_count);
  652. total+=parseInt(v.status_count);
  653. }
  654. if(v.status=="Placed"){
  655. $(".labelcenter.new").text(v.status_count);
  656. total+=parseInt(v.status_count);
  657. if(parseInt(v.status_count) > 0){
  658. $("#order-counter").html(v.status_count);
  659. $("#order-counter").show();
  660. }
  661. }
  662. });
  663. $(".labelcenter.all").text(total);
  664. }
  665. });
  666. $("#all-orders").removeClass('no-order-found');
  667. $.ajax({
  668. url:"{!! env('APP_URL') !!}liveorders/"+status,
  669. success:function (response) {
  670. // response = $.parseJSON(response);
  671. if(response){
  672. if(response.type=="success"){
  673. $.each(response.orders,function (i,v) {
  674. var str='<li class="mlist_li" rel="detail" data-order-id="'+v.id+'">\n' +
  675. ' <div class="box '+v.box_bg+' rounded-0">\n' +
  676. ' <div class="media-list media-list-divided media-list-hover">\n' +
  677. ' <div class="media align-items-center">\n' +
  678. ' <div class="media-body">\n' +
  679. ' <p>#'+v.order_ref+'</p>\n' +
  680. ' <p> '+(v.campaign_type!=""?v.campaign_type:"Direct")+', '+v.created_at+'</p>\n' +
  681. ' </div>\n' +
  682. ' <div class="media-right gap-items">\n' +
  683. ' <div class="user-social-acount text-center">\n' +
  684. ' <p class="m-0 status">'+v.status+'</p>\n' +
  685. ' <div class="d-flex align-items-center float-end">\n' +
  686. ' <div class="circle-div '+v.bg+' text-center" data-min="'+v.remaining_min+'" data-color="'+v.bg_color+'">\n' +
  687. ' <p class="mb-5 min">'+v.remaining_min+'<br />\n'+
  688. ' Min</p>\n'+
  689. ' </div>\n' +
  690. ' </div>\n' +
  691. ' </div>\n' +
  692. ' </div>\n' +
  693. ' </div>\n' +
  694. ' </div>\n' +
  695. ' </div>\n' +
  696. '</li>';
  697. counter = counter+1;
  698. $("#orders-list").append(str);
  699. });
  700. $("span."+status).html(counter);
  701. }else{
  702. $("#all-orders").addClass('no-order-found');
  703. }
  704. }
  705. }
  706. });
  707. $("body").on("click",".nav-link",function () {
  708. $("#orders-list").html('');
  709. $(".no-order").show();
  710. $(".order-section").hide();
  711. status = $(this).data('status');
  712. $("#all-orders").removeClass('no-order-found');
  713. var counter = 0;
  714. $.ajax({
  715. url:"{!! env('APP_URL') !!}liveorders/"+status,
  716. success:function (response) {
  717. // response = $.parseJSON(response);
  718. if(response){
  719. if(response.type=="success"){
  720. $.each(response.orders,function (i,v) {
  721. var str='<li class="mlist_li" rel="detail" data-order-id="'+v.id+'">\n' +
  722. ' <div class="box '+v.box_bg+' rounded-0">\n' +
  723. ' <div class="media-list media-list-divided media-list-hover">\n' +
  724. ' <div class="media align-items-center">\n' +
  725. ' <div class="media-body">\n' +
  726. ' <p>#'+v.order_ref+'</p>\n' +
  727. ' <p> '+(v.campaign_type!=""?v.campaign_type:"Direct")+', '+v.created_at+'</p>\n' +
  728. ' </div>\n' +
  729. ' <div class="media-right gap-items">\n' +
  730. ' <div class="user-social-acount text-center">\n' +
  731. ' <p class="m-0 status">'+v.status+'</p>\n' +
  732. ' <div class="circle-div '+v.bg+' text-center" data-min="'+v.remaining_min+'" data-color="'+v.bg_color+'">\n' +
  733. ' <p class="mb-5 min">'+v.remaining_min+'<br />\n'+
  734. ' Min</p>\n'+
  735. ' </div>\n' +
  736. ' </div>\n' +
  737. ' </div>\n' +
  738. ' </div>\n' +
  739. ' </div>\n' +
  740. ' </div>\n' +
  741. '</li>';
  742. $("#orders-list").append(str);
  743. counter = counter+1;
  744. });
  745. }else{
  746. $("#all-orders").addClass('no-order-found');
  747. }
  748. //$("span."+status).html(counter);
  749. }
  750. }
  751. });
  752. });
  753. var _already_clicked = false;
  754. $("body").on("click","li[rel=detail]",function () {
  755. if(!_already_clicked){
  756. _already_clicked = true;
  757. var id = $(this).data("order-id");
  758. order_id = id;
  759. $(".mlist_li.selected").removeClass('selected');
  760. $("#show-recipes").html('');
  761. $(this).addClass('selected');
  762. $.ajax({
  763. url:"{!! env('APP_URL') !!}get/order/detail/"+id,
  764. success:function (response) {
  765. _already_clicked = false;
  766. response = $.parseJSON(response);
  767. order_object = response;
  768. var price = 0;
  769. var delivery_fee = 0;
  770. $(".change-status").attr('data-id',id);
  771. $(".change-status-reject").attr('data-id',id);
  772. var o_t = response.order_type.toLowerCase();
  773. $(".for-delivery").hide();
  774. $(".for-pickup").hide();
  775. $(".for-"+o_t).show();
  776. $.each(response,function (i,v) {
  777. $("p[rel="+i+"]").text(v);
  778. $("span[rel="+i+"]").text(v);
  779. if(i=="delivery_fee"){
  780. delivery_fee = v;
  781. $(".delivery_fee").html("{{ $currency }} "+v);
  782. }
  783. if(i=="geo_location"){
  784. $("p[rel=google-map-link]").html('<a target="_blank" href="https://maps.google.com/?q='+v+'">Share</a>');
  785. //$("p[rel=google-map-link]").html('<a target="_blank" href="https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=900x500&markers=color:yellow|label:D|'+v+'&key=AIzaSyBFh6fzq8G7dgWLfz8kccvTlmPCSI_uWXQ">Share</a>');
  786. }
  787. if(i=="order_type"){
  788. if(v=="Dine in"){
  789. $("#address").hide();
  790. $("#table").show();
  791. $("#google-map-link").hide();
  792. }else{
  793. $("#address").show();
  794. $("#table").hide();
  795. if(v=="Delivery")
  796. $("#google-map-link").show();
  797. else
  798. $("#google-map-link").hide();
  799. }
  800. }
  801. if(i=="status"){
  802. $(".inkitchen-btn").html(v);
  803. $(".inkitchen-btn").addClass();
  804. if(v=="New"){
  805. $(".reject").show();
  806. $(".accept").hide();
  807. }else{
  808. $(".accept").show();
  809. $(".reject").hide();
  810. }
  811. }
  812. if(i=="bg"){
  813. $(".inkitchen-btn").removeClass('org-bg');
  814. $(".inkitchen-btn").removeClass('bg-danger');
  815. $(".inkitchen-btn").removeClass('green-bg');
  816. $(".inkitchen-btn").addClass(v);
  817. }
  818. if(i=="next_action"){
  819. if(v=="Accepted")
  820. $(".change-status").html("{{__('label.accept')}}");
  821. else
  822. $(".change-status").html(v);
  823. }
  824. if(i=="next_status"){
  825. $(".change-status").attr('data-status',v);
  826. }
  827. if(i=="recipes"){
  828. var recipes = v;
  829. if(recipes){
  830. /*$.each(recipes,function(m,n){
  831. console.log(n);
  832. $("#show-recipes").append(show_recipe(n));
  833. price+=parseFloat(n.total_price);
  834. console.log("price: "+price);
  835. @if($business_type!="ClothsStore")
  836. if(n.extra_options){
  837. $.each(n.extra_options,function(c,d){
  838. price+=(parseInt(n.quantity) * parseFloat(d.price));
  839. });
  840. }
  841. @endif
  842. });*/
  843. $.each(recipes,function(m,n){
  844. console.log(n);
  845. $("#show-recipes").append(show_recipe(n));
  846. var discount_amount = n.discount_amount!=""?parseFloat(n.discount_amount):0;
  847. var discount_type = n.discount_type!=""?n.discount_type:"";
  848. if(discount_amount > 0 && discount_type!=""){
  849. if(discount_type=="%"){
  850. var d_price = parseFloat(n.total_price) - (parseFloat(n.total_price) * (discount_amount/100));
  851. console.log(d_price);
  852. price+=d_price;
  853. }else{
  854. var d_price = parseFloat(n.total_price) - discount_amount/100;
  855. price+=d_price;
  856. }
  857. }else{
  858. price+=parseFloat(n.total_price);
  859. }
  860. console.log("price: "+price);
  861. @if($business_type!="ClothsStore")
  862. if(n.extra_options){
  863. $.each(n.extra_options,function(c,d){
  864. if(d.price && d.price!=""){
  865. if(discount_amount > 0 && discount_type!=""){
  866. if(discount_type=="%"){
  867. var d_price = parseFloat(d.price) - (parseFloat(d.price) * (discount_amount/100));
  868. console.log(d_price);
  869. price+=d_price;
  870. }else{
  871. var d_price = parseFloat(d.price) - discount_amount/100;
  872. price+=d_price;
  873. }
  874. }else{
  875. price+=(parseInt(n.quantity) * parseFloat(d.price));
  876. }
  877. }
  878. });
  879. }
  880. @endif
  881. });
  882. $(".sub_total").html('{{ $currency }} '+price?price:0);
  883. }
  884. }
  885. $(".total_txt").html("{{ $currency }} "+((price?price:0)+delivery_fee));
  886. });
  887. }
  888. });
  889. $(".no-order").hide();
  890. $(".order-section").show();
  891. }
  892. });
  893. $('ul.pagination').hide();
  894. $('#all-orders').jscroll({
  895. autoTrigger: true,
  896. loadingHtml: '<img class="text-center" src="{!! env('APP_ASSETS') !!}images/preloaders/preloader.svg" alt="Loading..." />',
  897. padding: 0,
  898. nextSelector: '.pagination li.active + li a',
  899. contentSelector: 'div.mlist_li',
  900. callback: function() {
  901. $('ul.pagination').remove();
  902. }
  903. });
  904. $("body").on("click",".nav-link",function () {
  905. $(".nav-link").removeClass('active')
  906. $(this).addClass('active')
  907. });
  908. $("body").on("click",".order-row",function () {
  909. var id = $(this).data('id');
  910. window.location = "{!! env('APP_URL') !!}order/show/"+id;
  911. });
  912. $("body").on("click",".accept-order",function () {
  913. var _this = $(this);
  914. var preparation_time = $("input[name=preparation_time]").val();
  915. var preperation_delivery = $("input[name=preperation_delivery]").val();
  916. if(preperation_delivery==""){
  917. $("input[name=preperation_delivery]").focus();
  918. return false;
  919. }
  920. if(preparation_time==""){
  921. $("input[name=preparation_time]").focus();
  922. return false;
  923. }
  924. _this.attr('disabled','disabled');
  925. _this.html(progress_img);
  926. _this.removeClass('btn-primary');
  927. _this.addClass('btn-muted');
  928. $.ajax({
  929. url:"{!! env('APP_URL') !!}update/order/status",
  930. type:"POST",
  931. data:{
  932. id:order_id,
  933. status:"Accepted",
  934. preparation_time:preparation_time,
  935. preperation_delivery:preperation_delivery,
  936. "_token":"{!! csrf_token() !!}"
  937. },
  938. success:function () {
  939. // alert();
  940. $(".mlist_li.selected").remove();
  941. if(status=="all"){
  942. $("#orders-list").html('');
  943. _this.removeAttr('disabled');
  944. _this.html('Accept Order');
  945. _this.removeClass('btn-muted');
  946. _this.addClass('btn-primary');
  947. /*$.ajax({
  948. url:"{!! env('APP_URL') !!}liveorders/"+status,
  949. success:function (response) {
  950. //response = $.parseJSON(response);
  951. if(response){
  952. $.each(response.orders,function (i,v) {
  953. var str='<li class="mlist_li" rel="detail" data-order-id="'+v.id+'">\n' +
  954. ' <div class="box '+v.box_bg+' rounded-0">\n' +
  955. ' <div class="media-list media-list-divided media-list-hover">\n' +
  956. ' <div class="media align-items-center">\n' +
  957. ' <div class="media-body">\n' +
  958. ' <p>#'+v.order_ref+'</p>\n' +
  959. ' <p> '+(v.campaign_type!=""?v.campaign_type:"Direct")+', '+v.created_at+'</p>\n' +
  960. ' </div>\n' +
  961. ' <div class="media-right gap-items">\n' +
  962. ' <div class="user-social-acount text-center">\n' +
  963. ' <p class="m-0 status">'+v.status+'</p>\n' +
  964. ' <div class="d-flex align-items-center float-end">\n' +
  965. ' <div class="circle-div '+v.bg+' text-center" data-min="'+v.remaining_min+'" data-color="'+v.bg_color+'">\n' +
  966. ' <p class="mb-5 min">'+v.remaining_min+'<br />\n'+
  967. ' Min</p>\n'+
  968. ' </div>\n' +
  969. ' </div>\n' +
  970. ' </div>\n' +
  971. ' </div>\n' +
  972. ' </div>\n' +
  973. ' </div>\n' +
  974. ' </div>\n' +
  975. '</li>';
  976. counter = counter+1;
  977. $("#orders-list").append(str);
  978. });
  979. $("span."+status).html(counter);
  980. }
  981. }
  982. });*/
  983. }
  984. $(".no-order").show();
  985. $(".order-section").hide();
  986. /*$.ajax({
  987. url: "{!! env('APP_URL') !!}order/counts",
  988. success: function (response) {
  989. // response = $.parseJSON(response);
  990. var total_accepted = 0;
  991. var total = 0;
  992. $.each(response,function (i,v) {
  993. if(v.status=="Send_to_Kitchen" || v.status=="Accepted"){
  994. total_accepted+=parseInt(v.status_count);
  995. total+=parseInt(v.status_count);
  996. $(".labelcenter.kitchen").text(total_accepted);
  997. }
  998. if(v.status=="On_Road"){
  999. $(".labelcenter.route").text(v.status_count);
  1000. total+=parseInt(v.status_count);
  1001. }
  1002. if(v.status=="Placed"){
  1003. $(".labelcenter.new").html(v.status_count);
  1004. total+=parseInt(v.status_count);
  1005. if(parseInt(v.status_count) > 0){
  1006. $("#order-counter").html(v.status_count);
  1007. $("#order-counter").show();
  1008. }else{
  1009. audio.pause();
  1010. $("#order-counter").html(0);
  1011. $("#order-counter").hide();
  1012. }
  1013. }
  1014. });
  1015. $(".labelcenter.all").text(total);
  1016. }
  1017. });*/
  1018. // swal("Accepted!", "Order is Accepted.", "success");
  1019. $("#accept-modal").modal('hide');
  1020. @if($is_allow_print_preview=="Enabled")
  1021. $(".print").trigger('click');
  1022. @endif
  1023. }
  1024. });
  1025. });
  1026. $("body").on("click",'.change-status,.change-status-reject',function (e) {
  1027. // alert();
  1028. var s = $(".nav-link.active").data('status');
  1029. var status = $(this).attr('data-status');
  1030. // alert(status); return;
  1031. if(status=="Rejected"){
  1032. swal({
  1033. title: "Are you sure?",
  1034. text: "You will not be able to recover this order!",
  1035. type: "warning",
  1036. showCancelButton: true,
  1037. confirmButtonColor: "#DD6B55",
  1038. confirmButtonText: "Yes, Reject it!",
  1039. closeOnConfirm: false
  1040. }, function(e){
  1041. if(e){
  1042. //.after('disable-this');
  1043. $(".sa-button-container .confirm").attr('disabled','disabled');
  1044. //$(".sa-button-container .confirm").html(progress_img);
  1045. $(".sa-button-container .confirm").removeClass('btn-primary');
  1046. $(".sa-button-container .confirm").addClass('btn-muted');
  1047. $.ajax({
  1048. url:"{!! env('APP_URL') !!}update/order/status",
  1049. type:"POST",
  1050. data:{
  1051. id:order_id,
  1052. status:status,
  1053. "_token":"{!! csrf_token() !!}"
  1054. },
  1055. success:function () {
  1056. //alert();
  1057. $(".sa-button-container .confirm").removeAttr('disabled');
  1058. //$(".sa-button-container .confirm").html(progress_img);
  1059. $(".sa-button-container .confirm").addClass('btn-primary');
  1060. $(".sa-button-container .confirm").removeClass('btn-muted');
  1061. swal.close()
  1062. $(".mlist_li.selected").remove();
  1063. $(".no-order").show();
  1064. $(".order-section").hide();
  1065. $.ajax({
  1066. url: "{!! env('APP_URL') !!}order/counts",
  1067. success: function (response) {
  1068. // response = $.parseJSON(response);
  1069. var total_accepted = 0;
  1070. var total = 0;
  1071. $.each(response,function (i,v) {
  1072. if(v.status=="Send_to_Kitchen" || v.status=="Accepted"){
  1073. total_accepted+=parseInt(v.status_count);
  1074. total+=parseInt(v.status_count);
  1075. $(".labelcenter.kitchen").text(total_accepted);
  1076. }
  1077. if(v.status=="On_Road"){
  1078. $(".labelcenter.route").text(v.status_count);
  1079. total+=parseInt(v.status_count);
  1080. }
  1081. if(v.status=="Placed"){
  1082. $(".labelcenter.new").html(v.status_count);
  1083. total+=parseInt(v.status_count);
  1084. if(parseInt(v.status_count) > 0){
  1085. $("#order-counter").html(v.status_count);
  1086. $("#order-counter").show();
  1087. }else{
  1088. audio.pause();
  1089. $("#order-counter").html(0);
  1090. $("#order-counter").hide();
  1091. }
  1092. }
  1093. });
  1094. $(".labelcenter.all").text(total);
  1095. }
  1096. });
  1097. // swal("Rejected!", "Order is rejected.", "success");
  1098. }
  1099. });
  1100. }
  1101. /*$.ajax({
  1102. url:"{!! env('APP_URL') !!}update/order/status",
  1103. type:"POST",
  1104. data:{
  1105. id:order_id,
  1106. status:status,
  1107. "_token":"{!! csrf_token() !!}"
  1108. },
  1109. success:function () {
  1110. //alert();
  1111. $(".mlist_li.selected").remove();
  1112. $(".no-order").show();
  1113. $(".order-section").hide();
  1114. $.ajax({
  1115. url: "{!! env('APP_URL') !!}order/counts",
  1116. success: function (response) {
  1117. // response = $.parseJSON(response);
  1118. var total_accepted = 0;
  1119. var total = 0;
  1120. $.each(response,function (i,v) {
  1121. if(v.status=="Send_to_Kitchen" || v.status=="Accepted"){
  1122. total_accepted+=parseInt(v.status_count);
  1123. total+=parseInt(v.status_count);
  1124. $(".labelcenter.kitchen").text(total_accepted);
  1125. }
  1126. if(v.status=="On_Road"){
  1127. $(".labelcenter.route").text(v.status_count);
  1128. total+=parseInt(v.status_count);
  1129. }
  1130. if(v.status=="Placed"){
  1131. $(".labelcenter.new").html(v.status_count);
  1132. total+=parseInt(v.status_count);
  1133. if(parseInt(v.status_count) > 0){
  1134. $("#order-counter").html(v.status_count);
  1135. $("#order-counter").show();
  1136. }else{
  1137. audio.pause();
  1138. $("#order-counter").html(0);
  1139. $("#order-counter").hide();
  1140. }
  1141. }
  1142. });
  1143. $(".labelcenter.all").text(total);
  1144. }
  1145. });
  1146. // swal("Rejected!", "Order is rejected.", "success");
  1147. }
  1148. });*/
  1149. });
  1150. return false;
  1151. }
  1152. if(status=="Accepted"){
  1153. $("#accept-modal").modal('show');
  1154. return false;
  1155. }
  1156. // alert(order_id);
  1157. $.ajax({
  1158. url:"{!! env('APP_URL') !!}update/order/status",
  1159. type:"POST",
  1160. data:{
  1161. id:order_id,
  1162. status:status,
  1163. "_token":"{!! csrf_token() !!}"
  1164. },
  1165. success:function () {
  1166. $(".mlist_li.selected").remove();
  1167. if(s=="all"){
  1168. $("#orders-list").html('');
  1169. /* $.ajax({
  1170. url:"{!! env('APP_URL') !!}liveorders/all",
  1171. success:function (response) {
  1172. // response = $.parseJSON(response);
  1173. if(response){
  1174. $.each(response.orders,function (i,v) {
  1175. var str='<li class="mlist_li" rel="detail" data-order-id="'+v.id+'">\n' +
  1176. ' <div class="box '+v.box_bg+' rounded-0">\n' +
  1177. ' <div class="media-list media-list-divided media-list-hover">\n' +
  1178. ' <div class="media align-items-center">\n' +
  1179. ' <div class="media-body">\n' +
  1180. ' <p>#'+v.order_ref+'</p>\n' +
  1181. ' <p> '+(v.campaign_type!=""?v.campaign_type:"Direct")+', '+v.created_at+'</p>\n' +
  1182. ' </div>\n' +
  1183. ' <div class="media-right gap-items">\n' +
  1184. ' <div class="user-social-acount text-center">\n' +
  1185. ' <p class="m-0 status">'+v.status+'</p>\n' +
  1186. ' <div class="d-flex align-items-center float-end">\n' +
  1187. ' <div class="circle-div '+v.bg+' text-center" data-min="'+v.remaining_min+'" data-color="'+v.bg_color+'">\n' +
  1188. ' <p class="mb-5 min">'+v.remaining_min+'<br />\n'+
  1189. ' Min</p>\n'+
  1190. ' </div>\n' +
  1191. ' </div>\n' +
  1192. ' </div>\n' +
  1193. ' </div>\n' +
  1194. ' </div>\n' +
  1195. ' </div>\n' +
  1196. ' </div>\n' +
  1197. '</li>';
  1198. counter = counter+1;
  1199. $("#orders-list").append(str);
  1200. });
  1201. $("span."+status).html(counter);
  1202. }
  1203. }
  1204. });*/
  1205. }
  1206. $(".no-order").show();
  1207. $(".order-section").hide();
  1208. /*$.ajax({
  1209. url: "{!! env('APP_URL') !!}order/counts",
  1210. success: function (response) {
  1211. // response = $.parseJSON(response);
  1212. var total_accepted = 0;
  1213. var total = 0;
  1214. $.each(response,function (i,v) {
  1215. if(v.status=="Send_to_Kitchen" || v.status=="Accepted"){
  1216. total_accepted+=parseInt(v.status_count);
  1217. total+=parseInt(v.status_count);
  1218. $(".labelcenter.kitchen").text(total_accepted);
  1219. }
  1220. if(v.status=="On_Road"){
  1221. $(".labelcenter.route").text(v.status_count);
  1222. total+=parseInt(v.status_count);
  1223. }
  1224. if(v.status=="Placed"){
  1225. $(".labelcenter.new").text(v.status_count);
  1226. total+=parseInt(v.status_count);
  1227. }
  1228. });
  1229. $(".labelcenter.all").text(total);
  1230. }
  1231. });*/
  1232. }
  1233. });
  1234. e.preventDefault();
  1235. e.stopPropagation();
  1236. });
  1237. $('.table').DataTable({
  1238. "order": [[ 0, "desc" ]],
  1239. 'paging' : true,
  1240. 'lengthChange': true,
  1241. 'searching' : true,
  1242. 'ordering' : true,
  1243. 'info' : true,
  1244. 'autoWidth' : true,
  1245. /*"processing": true,
  1246. "serverSide": true,
  1247. "ajax": "{!! env('APP_URL') !!}get/ajax/orders",
  1248. "order": [[ 0, "desc", ]],*/
  1249. "lengthMenu": [ 50, 100, 150 ]
  1250. });
  1251. var min_minus = 1;
  1252. setInterval(function(){
  1253. $(".circle-div").each(function (i,v) {
  1254. var min = parseInt($(this).data('min'));
  1255. min = 1;
  1256. if((min)>0){
  1257. var new_time = (min-min_minus);
  1258. // alert(new_time);
  1259. if(new_time >= 0){
  1260. $(this).attr('data-min',new_time);
  1261. $(this).find('p.min').html(new_time+"<br />Min");
  1262. }
  1263. }
  1264. });
  1265. min_minus++;
  1266. },60000);
  1267. })
  1268. /*function show_recipe(recipe){
  1269. console.log(recipe);
  1270. var str='<div class="box-header border-1 ">\n' +
  1271. ' <div class="ml-5">\n' +
  1272. ' <div class="d-flex justify-content-between align-items-center">\n' +
  1273. ' <p>'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
  1274. if(recipe.total_price > 0)
  1275. str+= ' <p>{{ $currency }} '+recipe.total_price+'</p>\n';
  1276. if(recipe.extra_options){
  1277. str+='<dl>';
  1278. if(recipe.extra_options){
  1279. $.each(recipe.extra_options,function(c,d){
  1280. str+="<dt>"+d.name+" : {{ $currency }} "+d.price;
  1281. if(d.sub_items){
  1282. //str+="<ul>";
  1283. $.each(d.sub_items,function(m,n){
  1284. console.log("Sub Items");
  1285. str+="<dd>"+n.name+"</dd>";
  1286. });
  1287. //str+="</dt>";
  1288. }
  1289. str+="</li>"
  1290. });
  1291. }
  1292. str+='<dl>';
  1293. }
  1294. str+=
  1295. ' </div>\n' +
  1296. ' </div>\n' +
  1297. ' </div>';
  1298. return str;
  1299. }*/
  1300. /* function show_recipe(recipe){
  1301. console.log(recipe);
  1302. var str='<div class="box-header border-1 ">\n' +
  1303. ' <div class="ml-5">\n' +
  1304. ' <div class="d-flex justify-content-between align-items-center">\n' +
  1305. ' <p><img src="'+recipe.recipe_image+'" style="border-radius:10px" height="24px" width="24px" />'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
  1306. if(recipe.total_price > 0)
  1307. str+= ' <p>{{ $currency }} '+recipe.total_price+'</p>\n';
  1308. if(recipe.extra_options){
  1309. str+='<dl>';
  1310. if(recipe.extra_options){
  1311. console.log(recipe.extra_options);
  1312. $.each(recipe.extra_options,function(c,d){
  1313. @if($business_type=="ClothsStore")
  1314. if(c=="color")
  1315. str+='<div style="width: 20px; height: 20px; background-color: '+d+'; border-radius: 20px; float:left"></div>';
  1316. if(c=="size")
  1317. str+='<div style="float:right;font-size: 14px;margin-left: 8px;font-weight: 700;"> '+d+'</div>';
  1318. @else
  1319. str+="<dt>"+d.name+" : {{ $currency }} "+d.price;
  1320. if(d.sub_items){
  1321. //str+="<ul>";
  1322. $.each(d.sub_items,function(m,n){
  1323. console.log("Sub Items");
  1324. str+="<dd>"+n.name+"</dd>";
  1325. });
  1326. //str+="</dt>";
  1327. }
  1328. str+="</li>"
  1329. @endif
  1330. });
  1331. }
  1332. str+='<dl>';
  1333. }
  1334. str+=
  1335. ' </div>\n' +
  1336. ' </div>\n' +
  1337. ' </div>';
  1338. return str;
  1339. }*/
  1340. function show_recipe(recipe){
  1341. var discount_amount = parseFloat(recipe.discount_amount);
  1342. var str='<div class="box-header border-1 ">\n' +
  1343. ' <div class="ml-5">\n' +
  1344. ' <div class="d-flex justify-content-between align-items-center">\n' +
  1345. ' <p><img src="'+recipe.recipe_image+'" style="border-radius:10px" height="40px" width="40px" />'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
  1346. if(recipe.total_price > 0){
  1347. var price = parseFloat(recipe.total_price);
  1348. if(discount_amount > 0){
  1349. if(recipe.discount_type=="%"){
  1350. price = price - (price * (discount_amount/100));
  1351. price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+recipe.total_price+"</del></span>";
  1352. }
  1353. }
  1354. str+= ' <p>{{ $currency }} '+price+'</p>\n';
  1355. }
  1356. if(recipe.extra_options){
  1357. str+='<dl>';
  1358. if(recipe.extra_options){
  1359. console.log(recipe.extra_options);
  1360. $.each(recipe.extra_options,function(c,d){
  1361. @if($business_type=="ClothsStore")
  1362. if(c=="color")
  1363. str+='<div style="width: 20px; height: 20px; background-color: '+d+'; border-radius: 20px; float:left"></div>';
  1364. if(c=="size")
  1365. str+='<div style="float:right;font-size: 14px;margin-left: 8px;font-weight: 700;"> '+d+'</div>';
  1366. @else
  1367. if(d.price && d.price!=""){
  1368. var price = parseFloat(d.price);
  1369. if(discount_amount > 0){
  1370. if(recipe.discount_type=="%"){
  1371. price = price - (price * (discount_amount/100));
  1372. price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+d.price+"</del></span>";
  1373. }
  1374. }
  1375. str+="<dt>"+d.name+" : {{ $currency }} "+price;
  1376. if(d.sub_items){
  1377. //str+="<ul>";
  1378. $.each(d.sub_items,function(m,n){
  1379. console.log("Sub Items");
  1380. str+="<dd>"+n.name+"</dd>";
  1381. });
  1382. //str+="</dt>";
  1383. }
  1384. str+="</li>"
  1385. }
  1386. @endif
  1387. });
  1388. }
  1389. str+='<dl>';
  1390. }
  1391. str+=
  1392. ' </div>\n' +
  1393. ' </div>\n' +
  1394. ' </div>';
  1395. return str;
  1396. }
  1397. function order_text_template(object,action){
  1398. console.log(object);
  1399. var sep = "%0A";
  1400. if(action=="copy-clipboard")
  1401. sep = "\n";
  1402. var map = "https://maps.google.com/?q="+object.geo_location;
  1403. var str = "I would like to share an order with you:"+sep+sep;
  1404. str += "*OrderID:* "+object.order_ref+' '+sep;
  1405. str += " *Business:* "+object.brand_name+' '+sep;
  1406. str += " *Outlet:* "+object.outlet_name+' '+sep;
  1407. str += " *Customer Name:* "+object.customer+' '+sep;
  1408. str += " *Customer Phone No:* "+object.phone+' '+sep;
  1409. str += " *Payment Method:* "+object.payment+' '+sep;
  1410. str += " *Delivery Date:* "+object.delivery_at+' '+sep;
  1411. str += " *Delivery Address:* "+object.address+' '+sep;
  1412. if(action=="copy-clipboard")
  1413. str += ' *Map:* '+(map)+' '+sep;
  1414. else
  1415. str += ' *Map:* '+encodeURIComponent(map)+' '+sep;
  1416. str += ' *Sub Total:* '+object.total_price+' {!! $currency !!} '+sep;
  1417. str += ' *Delivery Fee:* '+object.delivery_fee+' {!! $currency !!} '+sep;
  1418. str += ' *Total:* '+(parseFloat(object.total_price) + parseFloat(object.delivery_fee))+' {!! $currency !!} '+sep;
  1419. return str;
  1420. }
  1421. </script>
  1422. @endsection