orders.blade.php 78 KB

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