orders.blade.php_bkp 82 KB

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