orders-history.blade.php 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. @extends('layouts.app')
  2. @section('page-title')| Order History @endsection
  3. @section('content')
  4. <link href="{!! env('APP_ASSETS') !!}css/order-history.css" rel="stylesheet" type="text/css">
  5. <style>
  6. @-webkit-keyframes special {
  7. from { background-color: rgba(255, 121, 77, 0.27); }
  8. to { background-color: inherit; }
  9. }
  10. @-moz-keyframes special {
  11. from { background-color: rgba(255, 121, 77, 0.27);; }
  12. to { background-color: inherit; }
  13. }
  14. @-o-keyframes special {
  15. from { background-color: rgba(255, 121, 77, 0.27);; }
  16. to { background-color: inherit; }
  17. }
  18. @keyframes special {
  19. from { background-color: rgba(255, 121, 77, 0.27);; }
  20. to { background-color: inherit; }
  21. }
  22. .special {
  23. -webkit-animation: special 1s infinite; /* Safari 4+ */
  24. -moz-animation: special 1s infinite; /* Fx 5+ */
  25. -o-animation: special 1s infinite; /* Opera 12+ */
  26. animation: special 1s infinite; /* IE 10+ */
  27. }
  28. .page-link{
  29. padding: .5em 1em !important;
  30. border-radius: 2px;
  31. border: 0;
  32. margin: 0;
  33. min-width: 50px !important;
  34. text-align: center;
  35. }
  36. .page-item.active .page-link{
  37. background-color: #4c95dd;
  38. }
  39. table.dataTable {
  40. clear: both;
  41. margin-top: 6px !important;
  42. margin-bottom: 6px !important;
  43. max-width: none !important;
  44. border-collapse: collapse !important;
  45. font-family: 'Open Sans';
  46. }
  47. /*table.dataTable td{
  48. border-width: 1px;
  49. }*/
  50. .theme-primary .pagination li a:hover {
  51. background-color: #000 !important;
  52. }
  53. .table > :not(:last-child) > :last-child > * {
  54. border-bottom-color: transparent;
  55. }
  56. table.dataTable th{font-weight: 700 !important;}
  57. .dataTables_paginate {
  58. width: 100%;
  59. text-align: center;
  60. }
  61. div.dataTables_wrapper div.dataTables_paginate ul.pagination{
  62. justify-content: center !important;
  63. }
  64. .right-panel-footer {
  65. background-color: #fff7e8;
  66. }
  67. .actions{
  68. position:absolute; top: 25px; right: 0
  69. }
  70. .actions li{ margin:0 !important; padding:0}
  71. @media(max-width:767px)
  72. {
  73. .sm-w-50{
  74. width:50%;
  75. }
  76. }
  77. </style>
  78. @php
  79. $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  80. $lang = $resto->default_lang;
  81. app()->setLocale($lang);
  82. if(session('app_lang') !==null){
  83. $lang = session('app_lang');
  84. app()->setLocale($lang);
  85. }
  86. $restuarant1 = $resto ;
  87. $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null;
  88. //dump($resto_meta);
  89. $resto_metas = [];
  90. $billing = [];
  91. if(isset($resto_meta)){
  92. foreach($resto_meta as $meta){
  93. if($meta->outlet_id!=""){
  94. continue;
  95. }
  96. $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
  97. // dump($meta->resto_meta_defs);
  98. if($index_name=="BILLING_GATEWAY"){
  99. // dump($meta->resto_meta_defs->meta_def_name);
  100. // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
  101. $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
  102. }
  103. $resto_metas[$index_name] = $meta->meta_val;
  104. }
  105. }
  106. $resto_metas['BILLING_GATEWAY'] = $billing;
  107. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  108. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
  109. $translations = \App\Models\Translations::whereIn('item_key',['delivery','delivered','rejected','cancelled','close'])->get();
  110. $tr_ar = [];
  111. $tr_en = [];
  112. foreach($translations as $tr){
  113. if($tr->lang_id=="en")
  114. $tr_en[ucwords($tr->item_key)]= $tr->item_val;
  115. else
  116. $tr_ar[ucwords($tr->item_key)]= $tr->item_val;
  117. }
  118. @endphp
  119. <div class="content-wrapper">
  120. <div class="container-full">
  121. <section class="content">
  122. <h3 style="margin-left: 10px">{{__('label.order_history')}}</h3>
  123. <div class="row p-15">
  124. <div class="card cust_card p-15 rounded-1">
  125. <form class="row g-3 ordhistory" action="#">
  126. <div class="col-md-4">
  127. <input type="text" class="form-control" placeholder="{{__('label.id')}}" id="inputEmail4">
  128. </div>
  129. <div class="col-md-8">
  130. <input type="text" class="form-control" placeholder="{{__('label.phone_number')}}" id="inputPassword4">
  131. </div>
  132. <div class="col-12">
  133. <select class="form-control form-select " title="{{__('label.outlets')}}" data-live-search="true">
  134. @php
  135. $outlets = \App\Models\Outlets::whereNull('deleted_at')->where('resto_id',\App\Helpers\CommonMethods::getRestuarantID())->where('active',1)->get();
  136. @endphp
  137. @if(isset($outlets))
  138. @foreach($outlets as $outlet)
  139. <option value="{!! $outlet->id !!}">{!! $outlet->name !!}</option>
  140. @endforeach
  141. @endif
  142. </select>
  143. </div>
  144. <div class="col-12">
  145. <input type="text" class="form-control" id="inputAddress2" placeholder="{{__('label.date_range')}}">
  146. </div>
  147. <div class="col-12">
  148. <select class="form-control form-select" data-live-search="true" title="{{__('label.order_status')}}">
  149. <option value="Placed">{{__('label.new')}}</option>
  150. <option value="Accepted">{{__('label.in_preparation')}}</option>
  151. <option value="On_Road">{{__('label.in_routeready')}}</option>
  152. <option value="Has_Delivered">{{__('label.delivered')}}</option>
  153. <option value="Cancelled">{{__('label.cancelled')}}</option>
  154. <option value="Rejected">{{__('label.rejected')}}</option>
  155. <option value="Reject_by_User">{{__('label.new')}}</option>
  156. <option value="Close">{{__('label.rejected_by_user')}}</option>
  157. </select>
  158. </div>
  159. <div class="col-12">
  160. <select class="form-control form-select selectpicker">
  161. <option>{{__('label.select_option')}}</option>
  162. </select>
  163. </div>
  164. <div class="col-12">
  165. <select class="form-control form-select selectpicker">
  166. <option>{{__('label.select_option')}}</option>
  167. </select>
  168. </div>
  169. <div class="col-6">
  170. <button type="submit" class="btn btn-outline-primary btn-md rounded-0 sm-w-50">{{__('label.search')}}</button>
  171. </div>
  172. </form>
  173. </div>
  174. <div class="card p-15 rounded-1">
  175. <div class="jumbotron p-0">
  176. <div class="row">
  177. <div class="col-md-12">
  178. <div class="table-responsive">
  179. <table id="example" class="table table-striped" >
  180. <thead>
  181. <tr>
  182. <th>{{__('label.id')}}</th>
  183. <th>{{__('label.status')}}</th>
  184. <th>{{__('label.customer')}}</th>
  185. <th>{{__('label.mobile_no')}}</th>
  186. <th>{{__('label.type')}}</th>
  187. <th>{{__('label.payment_mode')}}</th>
  188. <th>{{__('label.total')}}</th>
  189. <th>{{__('label.channel')}}</th>
  190. <th>{{__('label.order_at')}}</th>
  191. <th>{{__('label.rating')}}</th>
  192. </tr>
  193. </thead>
  194. <tbody>
  195. @if(isset($orders) && $orders->count() > 0)
  196. @php
  197. $custom_status['Placed'] = ['Accepted'=>'Accepted','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
  198. $custom_status['Send_to_Kitchen'] = ['On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
  199. $custom_status['On_Road'] = ['Has_Delivered'=>'Delivered','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
  200. $custom_statuses = ['Rejected_by_User'=>'Rejected by User','Accepted'=>'Accepted','Rejected'=>'Rejected','Placed'=>'Placed','Send_to_Kitchen'=>'Send to Kitchen','On_Road'=>'On the Way', 'Has_Delivered'=>'Delivered','Served'=>"Served","Cancelled_by_Customer"=>"Cancelled","Close"=>"Close"];
  201. $custom_status['Accepted'] = ['On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
  202. @endphp
  203. @foreach($orders as $order)
  204. <tr class="order-detail" data-id="{!! $order->id !!}">
  205. <td> {!! $order->order_ref !!}</td>
  206. @if(app()->getLocale()=="en")
  207. <td>{!! isset($custom_statuses[$order->status])?$custom_statuses[$order->status]:"" !!}</td>
  208. @else
  209. <td>{!! $tr_ar[isset($custom_statuses[$order->status])?$custom_statuses[$order->status]:""] !!}</td>
  210. @endif
  211. <td>{!! isset($order->customers)?$order->customers->name:$order->customer_name !!}</td>
  212. @php
  213. $new_phone = "";
  214. if(isset($order->customers)){
  215. $pos = strpos($order->customers->users->email, env('COUNTRY_CODE'));
  216. if ($pos !== false) {
  217. $new_phone = substr_replace($order->customers->users->email, '', $pos, strlen(env('COUNTRY_CODE')));
  218. }
  219. }
  220. @endphp
  221. <td>{!! $new_phone !!}</td>
  222. <td>{!! app()->getLocale()=="en"?$order->order_type:$tr_ar[ucwords($order->order_type)] !!}</td>
  223. <td>{!! $order->payment_mode=="COD"?__('label.cash'):__('label.card') !!} </td>
  224. <td>{!! $currency !!} {!! number_format($order->total_price+$order->delivery_fee) !!}</td>
  225. <td>{!! $order->campaign_type!!}</td>
  226. <td>{!! \App\Helpers\CommonMethods::formatDateTime($order->created_at) !!}</td>
  227. <td></td>
  228. </tr>
  229. @endforeach
  230. @endif
  231. </tbody>
  232. </table>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </section>
  240. <!-- /.content -->
  241. </div>
  242. </div>
  243. <!-- /.content-wrapper -->
  244. <div class="modal fade" id="show-order-detail" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
  245. <div class="modal-dialog modal-lg">
  246. <div class="modal-content">
  247. <div class="modal-header">
  248. <h5 class="modal-title" id="staticBackdropLabel">{{__('label.order_detail')}}</h5>
  249. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  250. </div>
  251. <div class="modal-body">
  252. <div class="order-section" style="max-height: 500px; overflow-x: auto;">
  253. <div class="row">
  254. <div class="col-sm-12">
  255. <div class="boxs">
  256. <div class="box-header with-border">
  257. <div class="d-flex justify-content-between align-items-center">
  258. <p class="fw-bold" rel="order_ref"></p>
  259. <p rel="order_placed"></p>
  260. <p class="p-2 inkitchen-btn" id="toggle"></p>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="row">
  266. <div class="col-sm-12 mt-1 text-end">
  267. <a href="#!">{{__('label.print')}}</a>
  268. </div>
  269. </div>
  270. <div class="row right-panel-box">
  271. <div class="col-md-6">
  272. <div class="boxs">
  273. <div class="box-body">
  274. <div class="d-flex align-items-start">
  275. <div>
  276. <p class="text-fade mb-0">{{__('label.brand')}}</p>
  277. <p rel="brand_name"></p>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. </div>
  283. <div class="col-md-6">
  284. <div class="boxs">
  285. <div class="box-body">
  286. <div class="d-flex align-items-start">
  287. <div>
  288. <p class="text-fade mb-0">{{__('label.outlets')}}</p>
  289. <p rel="outlet_name"></p>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <div class="row right-panel-box">
  297. <div class="col-md-6">
  298. <div class="boxs">
  299. <div class="box-body">
  300. <div class="d-flex align-items-start">
  301. <div>
  302. <p class="text-fade mb-0">{{__('label.order_type')}}</p>
  303. <p>
  304. <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>
  305. <span rel="order_type"></span>
  306. </p>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. <div class="col-md-6 for-delivery">
  313. <div class="boxs">
  314. <div class="box-body">
  315. <div class="d-flex align-items-start">
  316. <div class="">
  317. <p class="text-fade mb-0">{{__('label.delivery_at')}}</p>
  318. <p rel="delivery_at"></p>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="col-md-6 for-pickup" style="display:none">
  325. <div class="boxs">
  326. <div class="box-body">
  327. <div class="d-flex align-items-start">
  328. <div class="">
  329. <p class="text-fade mb-0">{{__('label.pickup_at')}}</p>
  330. <p rel="delivery_at"></p>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. <div class="row right-panel-box">
  338. <div class="col-md-6">
  339. <div class="boxs">
  340. <div class="box-body">
  341. <div class="d-flex align-items-start">
  342. <div class="">
  343. <p class="text-fade mb-0">{{__('label.customers')}}</p>
  344. <p rel="customer"> <br>
  345. <i class="mdi mdi-crown org-color"></i>
  346. <small class="org-color">Ordered 5 times </small>
  347. </p>
  348. </div>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. <div class="col-md-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.phone_number')}}</p>
  359. <p rel="phone"></p>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. <div class="row right-panel-box">
  367. <div class="col-md-6">
  368. <div class="boxs">
  369. <div class="box-body">
  370. <div class="d-flex align-items-start">
  371. <div class="">
  372. <p class="text-fade mb-0">{{__('label.payment_mode')}}</p>
  373. <p rel="payment"></p>
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. <div class="col-md-6">
  380. <div class="boxs">
  381. <div class="box-body">
  382. <div class="d-flex align-items-start">
  383. <div class="">
  384. <p class="text-fade mb-0">{{__('label.channel')}}</p>
  385. <p rel="channel"></p>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. <div class="row right-panel-box">
  393. <div class="col-md-6">
  394. <div class="boxs">
  395. <div class="box-body">
  396. <div class="d-flex align-items-start">
  397. <div class="">
  398. <p class="text-fade mb-0">{{__('label.address')}}</p>
  399. <p rel="address"></p>
  400. </div>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. <div class="col-md-6">
  406. <div class="boxs">
  407. <div class="box-body">
  408. <div class="d-flex align-items-start">
  409. <div class="">
  410. <p class="text-fade mb-0">{{__('label.delivery_notes')}}</p>
  411. <p rel="delivery_notes"></p>
  412. </div>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. <!--<div class="row right-panel-box for-delivery" id="google-map-link">
  419. <div class="col-md-6">
  420. <div class="boxs">
  421. <div class="box-body">
  422. <div class="d-flex align-items-start">
  423. <div class="">
  424. <p class="text-fade mb-0">Formatted Address</p>
  425. <p rel="formatted_address"></p>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. <div class="col-md-6">
  432. <div class="boxs">
  433. <div class="box-body">
  434. <div class="d-flex align-items-start">
  435. <div class="">
  436. <p class="text-fade mb-0">Share Google map link</p>
  437. <p rel="google-map-link"></p>
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. </div>-->
  444. <div class="row right-panel-box">
  445. <div class="col-md-12">
  446. <div class="boxs" style="position: relative">
  447. <div class="box-body">
  448. <div class="d-flex align-items-start">
  449. <div class="">
  450. <p class="text-fade mb-0">{{__('label.address')}}</p>
  451. <p rel="address"></p>
  452. </div>
  453. </div>
  454. </div>
  455. <div class="actions">
  456. <ul class="list-inline">
  457. <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>
  458. <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>
  459. <li class="list-inline-item">
  460. <a href="#!" class="address-actions" data-action="whatsapp">
  461. <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>
  462. </a>
  463. </li>
  464. </ul>
  465. </div>
  466. </div>
  467. </div>
  468. </div>
  469. @if( $business_type=="Florist")
  470. <div class="row right-panel-box" >
  471. <div class="col-md-6">
  472. <div class="boxs">
  473. <div class="box-body">
  474. <div class="d-flex align-items-start">
  475. <div class="">
  476. <p class="text-fade mb-0">{{__('label.receiver_name')}}</p>
  477. <p rel="recipient_name"></p>
  478. </div>
  479. </div>
  480. </div>
  481. </div>
  482. </div>
  483. <div class="col-md-6">
  484. <div class="boxs">
  485. <div class="box-body">
  486. <div class="d-flex align-items-start">
  487. <div class="">
  488. <p class="text-fade mb-0">{{__('label.receiver_phone')}}</p>
  489. <p rel="recipient_phone"></p>
  490. </div>
  491. </div>
  492. </div>
  493. </div>
  494. </div>
  495. </div>
  496. <div class="row right-panel-box" >
  497. <div class="col-md-12">
  498. <div class="boxs">
  499. <div class="box-body">
  500. <div class="d-flex align-items-start">
  501. <div class="">
  502. <p class="text-fade mb-0">{{__('label.greeting_message')}}</p>
  503. <p rel="greeting_message"></p>
  504. </div>
  505. </div>
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. @endif
  511. </div>
  512. <div class="row mt-0 right-panel-footer ">
  513. <div class="col-12" id="show-recipes">
  514. </div>
  515. <div class="col-12">
  516. <div class="box-header border-0 p-15 mt-0 pb-0">
  517. <div class="d-flex justify-content-between align-items-center m-0">
  518. <p>{{__('label.sub_total')}}:</p>
  519. <p class="sub_total"></p>
  520. </div>
  521. <div class="d-flex justify-content-between align-items-center m-0">
  522. <p>{{__('label.delivery_fee')}}:</p>
  523. <p class="delivery_fee"></p>
  524. </div>
  525. <div class="d-flex justify-content-between align-items-center m-0">
  526. <p class="p-15 m-5 ">{{__('label.total')}}:</p>
  527. <p class="total_txt"></p>
  528. </div>
  529. </div>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. <div class="modal-footer">
  535. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{__('label.close')}}</button>
  536. </div>
  537. </div>
  538. </div>
  539. </div>
  540. @endsection
  541. @section('js')
  542. {{-- <script src="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-select/dist/js/bootstrap-select.js"></script>--}}
  543. <script>
  544. var resto_id = 0;
  545. var order_object = null;
  546. $(function () {
  547. $("body").on("click",".address-actions",function(){
  548. var _actions = $(this).data("action");
  549. if(_actions=="google-map"){
  550. var map = "https://maps.google.com/?q="+order_object.geo_location;
  551. window.open(map,"_blank");
  552. return false;
  553. }
  554. if(_actions=="whatsapp"){
  555. var template = order_text_template(order_object,"whatsapp");
  556. //console.log(encodeURIComponent(template));
  557. window.open("https://api.whatsapp.com/send?text="+(template),"_blank");
  558. }
  559. if(_actions=="copy-clipboard"){
  560. var template = order_text_template(order_object,"copy-clipboard");
  561. //console.log(encodeURIComponent(template));
  562. navigator.clipboard.writeText(template);
  563. }
  564. });
  565. $("body").on("click",".order-detail",function(){
  566. $("#show-recipes").html('');
  567. var id = $(this).data('id');
  568. $.ajax({
  569. url:"{!! env('APP_URL') !!}get/order/detail/"+id,
  570. success:function (response) {
  571. response = $.parseJSON(response);
  572. order_object = response;
  573. $("#show-recipes").html('');
  574. $("#show-order-detail").modal('show');
  575. var price = 0;
  576. var delivery_fee = 0;
  577. $(".change-status").attr('data-id',id);
  578. $(".change-status-reject").attr('data-id',id);
  579. var o_t = response.order_type.toLowerCase();
  580. $(".for-delivery").hide();
  581. $(".for-pickup").hide();
  582. $(".for-"+o_t).show();
  583. $.each(response,function (i,v) {
  584. $("p[rel="+i+"]").text(v);
  585. $("span[rel="+i+"]").text(v);
  586. if(i=="delivery_fee"){
  587. delivery_fee = v;
  588. $(".delivery_fee").html("{{ $currency }} "+v);
  589. }
  590. if(i=="geo_location"){
  591. $("p[rel=google-map-link]").html('<a target="_blank" href="https://maps.google.com/?q='+v+'">Share</a>');
  592. //$("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>');
  593. }
  594. if(i=="order_type"){
  595. if(v=="Delivery")
  596. $("#google-map-link").show();
  597. else
  598. $("#google-map-link").hide();
  599. }
  600. if(i=="status"){
  601. $(".inkitchen-btn").html(v);
  602. $(".inkitchen-btn").addClass();
  603. if(v=="New"){
  604. $(".reject").show();
  605. $(".accept").hide();
  606. }else{
  607. $(".accept").show();
  608. $(".reject").hide();
  609. }
  610. }
  611. if(i=="bg"){
  612. $(".inkitchen-btn").removeClass('org-bg');
  613. $(".inkitchen-btn").removeClass('bg-danger');
  614. $(".inkitchen-btn").removeClass('green-bg');
  615. $(".inkitchen-btn").addClass(v);
  616. }
  617. if(i=="next_action"){
  618. if(v=="Accepted")
  619. $(".change-status").html('Accept');
  620. else
  621. $(".change-status").html(v);
  622. }
  623. if(i=="next_status"){
  624. $(".change-status").attr('data-status',v);
  625. }
  626. if(i=="recipes"){
  627. var recipes = v;
  628. /* if(recipes){
  629. $.each(recipes,function(m,n){
  630. console.log(n);
  631. $("#show-recipes").append(show_recipe(n));
  632. price+=parseFloat(n.total_price);
  633. if(n.extra_options){
  634. $.each(n.extra_options,function(c,d){
  635. price+=(parseInt(n.quantity) * parseFloat(d.price));
  636. });
  637. }
  638. });
  639. $(".sub_total").html('{{ $currency }} '+price);
  640. }*/
  641. if(recipes){
  642. /*$.each(recipes,function(m,n){
  643. console.log(n);
  644. $("#show-recipes").append(show_recipe(n));
  645. price+=parseFloat(n.total_price);
  646. console.log("price: "+price);
  647. @if($business_type!="ClothsStore")
  648. if(n.extra_options){
  649. $.each(n.extra_options,function(c,d){
  650. price+=(parseInt(n.quantity) * parseFloat(d.price));
  651. });
  652. }
  653. @endif
  654. });*/
  655. $.each(recipes,function(m,n){
  656. console.log(n);
  657. $("#show-recipes").append(show_recipe(n));
  658. var discount_amount = n.discount_amount!=""?parseFloat(n.discount_amount):0;
  659. var discount_type = n.discount_type!=""?n.discount_type:"";
  660. if(discount_amount > 0 && discount_type!=""){
  661. if(discount_type=="%"){
  662. var d_price = parseFloat(n.total_price) - (parseFloat(n.total_price) * (discount_amount/100));
  663. console.log(d_price);
  664. price+=d_price;
  665. }else{
  666. var d_price = parseFloat(n.total_price) - discount_amount/100;
  667. price+=d_price;
  668. }
  669. }else{
  670. price+=parseFloat(n.total_price);
  671. }
  672. @if($business_type!="ClothsStore")
  673. if(n.extra_options){
  674. $.each(n.extra_options,function(c,d){
  675. if(d.price && d.price!=""){
  676. if(discount_amount > 0 && discount_type!=""){
  677. if(discount_type=="%"){
  678. var d_price = parseFloat(d.price) - (parseFloat(d.price) * (discount_amount/100));
  679. console.log(d_price);
  680. price+=d_price;
  681. }else{
  682. var d_price = parseFloat(d.price) - discount_amount/100;
  683. price+=d_price;
  684. }
  685. }else{
  686. price+=(parseInt(n.quantity) * parseFloat(d.price));
  687. }
  688. }
  689. });
  690. }
  691. @endif
  692. });
  693. $(".sub_total").html('{{ $currency }} '+price?price:0);
  694. }
  695. }
  696. $(".total_txt").html("{{ $currency }} "+(price+delivery_fee));
  697. });
  698. }
  699. });
  700. });
  701. $("body").on("click",".order-row",function () {
  702. var id = $(this).data('id');
  703. window.location = "{!! env('APP_URL') !!}order/show/"+id;
  704. });
  705. $("body").on("click",'.order-status',function (e) {
  706. // alert();
  707. var status = $(this).data('status');
  708. var order_id = $(this).data('id');
  709. $.ajax({
  710. url:"{!! env('APP_URL') !!}update/order/status",
  711. type:"POST",
  712. data:{
  713. id:order_id,
  714. status:status,
  715. "_token":"{!! csrf_token() !!}"
  716. },
  717. success:function () {
  718. location.reload();
  719. }
  720. });
  721. e.preventDefault();
  722. e.stopPropagation();
  723. });
  724. $('#example').DataTable({
  725. "bSort": true,
  726. "searching": false,
  727. "paging": true,
  728. "info": false,
  729. "bLengthChange": false,
  730. "aaSorting": [[0,'desc']],
  731. language: {
  732. paginate: {
  733. next: '<img src="{!! env("APP_ASSETS") !!}images/icons/next.png">', // or '→'
  734. previous: '<img src="{!! env("APP_ASSETS") !!}images/icons/preivew.png">' // or '←'
  735. }
  736. },
  737. });
  738. $("td nav").addClass('d-flex justify-content-center');
  739. // $('#example_wrapper .row:last').find('.col-md-5').first().remove()
  740. })
  741. /*function show_recipe(recipe){
  742. console.log(recipe);
  743. var str='<div class="box-header border-1 ">\n' +
  744. ' <div class="ml-5">\n' +
  745. ' <div class="d-flex justify-content-between align-items-center">\n' +
  746. ' <p>'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
  747. if(recipe.total_price > 0)
  748. str+= ' <p>{{ $currency }} '+recipe.total_price+'</p>\n';
  749. if(recipe.extra_options){
  750. str+='<dl>';
  751. if(recipe.extra_options){
  752. $.each(recipe.extra_options,function(c,d){
  753. str+="<dt>"+d.name+" : {{ $currency }} "+d.price;
  754. if(d.sub_items){
  755. //str+="<ul>";
  756. $.each(d.sub_items,function(m,n){
  757. console.log("Sub Items");
  758. str+="<dd>"+n.name+"</dd>";
  759. });
  760. //str+="</dt>";
  761. }
  762. str+="</li>"
  763. });
  764. }
  765. str+='<dl>';
  766. }
  767. str+=
  768. ' </div>\n' +
  769. ' </div>\n' +
  770. ' </div>';
  771. return str;
  772. }*/
  773. function show_recipe(recipe){
  774. var discount_amount = parseFloat(recipe.discount_amount);
  775. var str='<div class="box-header border-1 ">\n' +
  776. ' <div class="ml-5">\n' +
  777. ' <div class="d-flex justify-content-between align-items-center">\n' +
  778. ' <p><img src="'+recipe.recipe_image+'" style="border-radius:10px" height="24px" width="24px" />'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
  779. if(recipe.total_price > 0){
  780. var price = parseFloat(recipe.total_price);
  781. if(discount_amount > 0){
  782. if(recipe.discount_type=="%"){
  783. price = price - (price * (discount_amount/100));
  784. price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+recipe.total_price+"</del></span>";
  785. }
  786. }
  787. str+= ' <p>{{ $currency }} '+price+'</p>\n';
  788. }
  789. if(recipe.extra_options){
  790. str+='<dl>';
  791. if(recipe.extra_options){
  792. console.log(recipe.extra_options);
  793. $.each(recipe.extra_options,function(c,d){
  794. @if($business_type=="ClothsStore")
  795. if(c=="color")
  796. str+='<div style="width: 20px; height: 20px; background-color: '+d+'; border-radius: 20px; float:left"></div>';
  797. if(c=="size")
  798. str+='<div style="float:right;font-size: 14px;margin-left: 8px;font-weight: 700;"> '+d+'</div>';
  799. @else
  800. if(d.price && d.price!=""){
  801. var price = parseFloat(d.price);
  802. if(discount_amount > 0){
  803. if(recipe.discount_type=="%"){
  804. price = price - (price * (discount_amount/100));
  805. price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+d.price+"</del></span>";
  806. }
  807. }
  808. str+="<dt>"+d.name+" : {{ $currency }} "+price;
  809. if(d.sub_items){
  810. //str+="<ul>";
  811. $.each(d.sub_items,function(m,n){
  812. console.log("Sub Items");
  813. str+="<dd>"+n.name+"</dd>";
  814. });
  815. //str+="</dt>";
  816. }
  817. str+="</li>";
  818. }
  819. @endif
  820. });
  821. }
  822. str+='<dl>';
  823. }
  824. str+=
  825. ' </div>\n' +
  826. ' </div>\n' +
  827. ' </div>';
  828. return str;
  829. }
  830. function order_text_template(object,action){
  831. console.log(object);
  832. var sep = "%0A";
  833. if(action=="copy-clipboard")
  834. sep = "\n";
  835. var map = "https://maps.google.com/?q="+object.geo_location;
  836. var str = "I would like to share an order with you:"+sep+sep;
  837. str += "*OrderID:* "+object.order_ref+' '+sep;
  838. str += " *Business:* "+object.brand_name+' '+sep;
  839. str += " *Outlet:* "+object.outlet_name+' '+sep;
  840. str += " *Customer Name:* "+object.customer+' '+sep;
  841. str += " *Customer Phone No:* "+object.phone+' '+sep;
  842. str += " *Payment Method:* "+object.order_type+' '+sep;
  843. str += " *Delivery Address:* "+object.address+' '+sep;
  844. if(action=="copy-clipboard")
  845. str += ' *Map:* '+(map)+' '+sep;
  846. else
  847. str += ' *Map:* '+encodeURIComponent(map)+' '+sep;
  848. str += ' *Sub Total:* '+object.total_price+' {!! $currency !!} '+sep;
  849. str += ' *Delivery Fee:* '+object.delivery_fee+' {!! $currency !!} '+sep;
  850. str += ' *Total:* '+(parseFloat(object.total_price) + parseFloat(object.delivery_fee))+' {!! $currency !!} '+sep;
  851. return str;
  852. }
  853. </script>
  854. @endsection