orders.blade.php_29april 81 KB

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