orders-history.blade.php_26aprl 50 KB

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