outlet-digital-menu.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. @extends('layouts.app')
  2. @section('content')
  3. <link href="{!! env('APP_ASSETS') !!}/vendor_components/dropzone/dropzone.css" rel="stylesheet"/>
  4. <link href="{!! env('APP_ASSETS') !!}/vendor_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet"/>
  5. <link href="{!! env('APP_ASSETS') !!}/css/jquery.timepicker.min.css" rel="stylesheet"/>
  6. <style>
  7. .vtabs .tabs-vertical {
  8. width: 229px;
  9. }
  10. .bootstrap-tagsinput {
  11. min-height: 60px; width: 100%;
  12. }
  13. h4{ margin-top: 40px}
  14. .bootstrap-timepicker-widget table td input{ width: 46px}
  15. .content{
  16. padding: 0;
  17. }
  18. .form-control, .form-select {
  19. height: 46px !important;
  20. border-color: #E4E6EB !important;
  21. border-radius: 7px !important;
  22. }
  23. .payout-details{
  24. background-color: #fff4de;
  25. border-radius: 3px;
  26. padding: 15px;
  27. }
  28. .theme-primary [type=checkbox].filled-in:checked.chk-col-primary + label:after {
  29. border: 2px solid #ffab00;
  30. background-color: #ffab00;
  31. }
  32. .theme-primary .btn-success:hover, .theme-primary .btn-success:active, .theme-primary .btn-success:focus, .theme-primary .btn-success.active {
  33. background-color:#017d53 !important;
  34. border-color:#017d53 !important;
  35. color: #ffffff !important;
  36. }
  37. #output canvas{
  38. width: 100%;
  39. }
  40. @media (min-width: 820px) and (max-width: 1023.99px){
  41. html[dir="rtl"] .content-wrapper {
  42. width: 100% !important;
  43. margin-right: 0px !important;
  44. padding-left: 20px;
  45. padding-right: 10px;
  46. margin-top: 78px !important;
  47. }
  48. html[dir="rtl"] .sidebar_div_main{
  49. padding-left: 0px;
  50. }
  51. }
  52. @media (device-width: 854px) and (device-height: 534px) {
  53. html[dir="rtl"] .content-wrapper{
  54. margin-right: 270px !important;
  55. width: calc(100% - 271px) !important;
  56. }
  57. }
  58. @media (device-width: 1024px) and (device-height: 768px) and (orientation: landscape) {
  59. html[dir="rtl"] .content-wrapper{
  60. margin-top: 0 !important;
  61. }
  62. .content-wrapper{
  63. width: 100% !important;
  64. }
  65. }
  66. </style>
  67. <!-- Content Wrapper. Contains page content -->
  68. <div class="content-wrapper">
  69. <div class="container-full">
  70. <!-- Content Header (Page header) -->
  71. <!-- Main content -->
  72. <section class="content">
  73. <div class="row">
  74. <div class="col-12 col-sm-4 sidebar_div_main" style="padding-right: 0;background-color: #F5F5F5">
  75. @include('outlets.outlet-sidebar')
  76. </div>
  77. @php
  78. $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  79. $lang = $resto->default_lang;
  80. app()->setLocale($lang);
  81. if(session('app_lang') !==null){
  82. $lang = session('app_lang');
  83. app()->setLocale($lang);
  84. }
  85. @endphp
  86. @php
  87. $restuarant1 = $resto;
  88. $resto_metas = \App\Helpers\CommonMethods::getRestoMetas($restuarant1);
  89. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  90. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
  91. $business_pwa = isset($resto_metas['USE_PWA_DMENU'])?$resto_metas['USE_PWA_DMENU']:"false";
  92. $url = (!empty($resto->domain_name)?$resto->domain_name:env('QRCODE_HOST'))."m/".$resto->resto_unique_name."?outlet=". \Illuminate\Support\Str::slug($outlet->name);
  93. if($business_pwa == "true")
  94. $url = "https://rjsdemo.taiftec.com/";
  95. @endphp
  96. <div class="col-12 col-sm-8 p-15">
  97. <div id="main" >
  98. <div class="row">
  99. <div class="col-sm-12 col-md-8">
  100. <div class="qr-card mt-4">
  101. <div class="card-header sm-justify-center">{{__('label.digital_menu_qr_code')}}</div>
  102. <div class="card-body sm-pt-0">
  103. <div id="output" class="qr-output"></div>
  104. <a style="width: 100%; margin: 10px 0" class="btn btn-primary download-image ">{{__('label.download')}}</a>
  105. <p>{{__('label.this_is_your_unique_qr_code_for_customers_to_see_the_menu_and_order_from_this_outlet_print_it_and_leave_it_on_the_tables_customers_just_need_to_scan_it_with_a_smartphone_to_place_their_order')}}</p>
  106. <!-- <input type="text" class="form-control" readonly name="" value="{!! env('QRCODE_HOST') !!}m/{!! $resto->resto_unique_name !!}">-->
  107. @if($resto->domain_name!="")
  108. <input type="text" class="form-control" readonly name="" value="{!! $resto->domain_name !!}m/{!! $resto->resto_unique_name !!}?outlet={!! \Illuminate\Support\Str::slug($outlet->name) !!}">
  109. @else
  110. <input type="text" class="form-control" readonly name="" value="{!! env('QRCODE_HOST') !!}m/{!! $resto->resto_unique_name !!}?outlet={!! \Illuminate\Support\Str::slug($outlet->name) !!}">
  111. @endif
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </section>
  121. <!-- /.content -->
  122. </div>
  123. <div id="download" style="display: none"></div>
  124. </div>
  125. <!-- /.content-wrapper -->
  126. @endsection
  127. @section('js')
  128. <script src="{!! env('APP_ASSETS') !!}js/jquery.timepicker.min.js"></script>
  129. <script src="{!! env('APP_ASSETS') !!}js/jquery.qrcode.min.js"></script>
  130. <script>
  131. $(function () {
  132. $('#output').qrcode({
  133. render: "canvas",
  134. text: "{!! $url !!}",
  135. width: 250,
  136. height: 250,
  137. background: "#ffffff",
  138. foreground: "#000000",
  139. /* src: "{!! isset(\Illuminate\Support\Facades\Auth::user()->restaurants) && isset(\Illuminate\Support\Facades\Auth::user()->restaurants->home_images) && !empty(\Illuminate\Support\Facades\Auth::user()->restaurants->home_images->file_name)?\Illuminate\Support\Facades\Auth::user()->restaurants->home_images->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  140. */ imgWidth: 50,
  141. imgHeight: 50
  142. });
  143. $('#download').qrcode({
  144. render: "canvas",
  145. text: "{!! $url !!}",
  146. width: 2000,
  147. height: 2000,
  148. background: "#ffffff",
  149. foreground: "#000000",
  150. /* src: "{!! isset(\Illuminate\Support\Facades\Auth::user()->restaurants) && isset(\Illuminate\Support\Facades\Auth::user()->restaurants->home_images) && !empty(\Illuminate\Support\Facades\Auth::user()->restaurants->home_images->file_name)?\Illuminate\Support\Facades\Auth::user()->restaurants->home_images->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  151. */ imgWidth: 500,
  152. imgHeight: 500
  153. });
  154. $(".download-image").click(function () {
  155. var canvas = $('#download canvas')[0];
  156. var _this = $(this);
  157. console.log(canvas.toDataURL());
  158. // Change here
  159. $.ajax({
  160. url: "{!! env('APP_URL') !!}download/qrcode",
  161. type: "POST",
  162. data: {
  163. resto:"digital-menu-{!! $resto->resto_unique_name !!}-outlet-{!! \Illuminate\Support\Str::slug($outlet->name) !!}",
  164. data: canvas.toDataURL(),
  165. '_token': "{!! csrf_token() !!}"
  166. },
  167. success: function (response) {
  168. console.log(response);
  169. var link = document.createElement('a');
  170. link.href = response;
  171. link.download = "digital-menu-{!! $resto->resto_unique_name !!}-qrcode.png";
  172. link.click();
  173. }
  174. });
  175. });
  176. $("body").on("click",".remove-hours",function () {
  177. var _id = $(this).data('id');
  178. var _this = $(this);
  179. $.ajax({
  180. url:"{!! env('APP_URL') !!}remove/hour",
  181. type:"POST",
  182. data:{
  183. id:_id,
  184. "_token":"{!! csrf_token() !!}"
  185. },
  186. success:function (response) {
  187. response = $.parseJSON(response);
  188. if(response.type=="success"){
  189. $.toast({
  190. heading: 'Hours',
  191. text: response.message,
  192. position: 'top-right',
  193. loaderBg: '#ff6849',
  194. icon: 'success',
  195. hideAfter: 3000,
  196. stack: 6
  197. });
  198. }else{
  199. $.toast({
  200. heading: 'Hours',
  201. text: response.message,
  202. position: 'top-right',
  203. loaderBg: '#ff6849',
  204. icon: 'danger',
  205. hideAfter: 3000,
  206. stack: 6
  207. });
  208. }
  209. }
  210. });
  211. _this.parents('.hour-section').remove();
  212. });
  213. $("body").on("click",".add-more-hours",function () {
  214. var _hour_section = $(this).parents(".hour-section");
  215. var day = $(this).data('day');
  216. var start_time='<div class="bootstrap-timepicker mt-1">\n' +
  217. ' <input type="text" name="start_time['+day+'][]" class="form-control timepicker time">\n' +
  218. ' </div>';
  219. var end_time='<div class="bootstrap-timepicker mt-1">\n' +
  220. ' <input type="text" name="end_time['+day+'][]" class="form-control timepicker time">\n' +
  221. ' </div><i class="fa fa-ban delete-hour"></i>';
  222. var input_start_time = _hour_section.find('.col-sm-3.time-show.start_time').append(start_time);
  223. var input_end_time = _hour_section.find('.col-sm-3.time-show.end_time').append(end_time);
  224. /* var hour_sections = _hour_section.find('.col-sm-2.time-show.hours-action').append('<div style="margin-top: 37px"><a href="#!" class="text-mute remove-hours" data-id="60" data-day="sunday"> <i class="fa fa-ban"></i> Remove hours</a></div>');
  225. */
  226. $(".timepicker").timepicker({ step:5});
  227. $('.timepicker').on('showTimepicker',function(){
  228. $("#li-11-59").remove();
  229. $("body").find(".ui-timepicker-list").append('<li id="li-11-59" class="ui-timepicker-pm" data-time="86340">11:59pm</li>');
  230. });
  231. });
  232. $("body").on("click",".update-hour-status",function () {
  233. var is_active = $(this).attr("aria-pressed");
  234. is_active = $.trim(is_active);
  235. if(is_active=="false"){
  236. // alert('off');
  237. $(this).parents('.hour-section').find('input[type=checkbox]').prop('checked',false);
  238. $(this).parents('.hour-section').find('.time-show').hide();
  239. }else{
  240. $(this).parents('.hour-section').find('input[type=checkbox]').prop('checked','checked');
  241. $(this).parents('.hour-section').find('.time-show').show();
  242. }
  243. })
  244. /*$("body").on("click",".action-on-off",function () {
  245. var unique_key =
  246. });*/
  247. $(".timepicker").timepicker({ step:5});
  248. $('.timepicker').on('showTimepicker',function(){
  249. $("#li-11-59").remove();
  250. $("body").find(".ui-timepicker-list").append('<li id="li-11-59" class="ui-timepicker-pm" data-time="86340">11:59pm</li>');
  251. });
  252. $("body").on("click",".switch",function () {
  253. var is_active = $(this).attr("aria-pressed");
  254. is_active = $.trim(is_active);
  255. if(is_active=="false"){
  256. $("#main").removeClass('active');
  257. }else{
  258. $("#main").addClass('active');
  259. }
  260. $.ajax({
  261. url:"{!! env('APP_URL') !!}update/outlet/feature/status",
  262. data:{
  263. outletId:"{!! $outlet->id !!}",
  264. feature:'is_contactless_dining',
  265. is_active:is_active,
  266. "_token":"{!! csrf_token() !!}"
  267. },
  268. type:"POST",
  269. success:function () {
  270. }
  271. });
  272. });
  273. $("body").on("click",".save-changes",function () {
  274. /*$.toast({
  275. heading: 'Welcome to my Riday Admin',
  276. text: 'Use the predefined ones, or specify a custom position object.',
  277. position: 'top-right',
  278. loaderBg: '#ff6849',
  279. icon: 'info',
  280. hideAfter: 3000,
  281. stack: 6
  282. });*/
  283. if($("#save-outlet").valid()){
  284. $("#save-outlet").ajaxForm(function (response) {
  285. response = $.parseJSON(response);
  286. if(response.type=="success"){
  287. $.toast({
  288. heading: '{{__("label.outlet_update")}}',
  289. text: response.message,
  290. position: 'top-right',
  291. loaderBg: '#ff6849',
  292. icon: 'success',
  293. hideAfter: 3000,
  294. stack: 1
  295. });
  296. setTimeout(function () {
  297. location.reload();
  298. },2000);
  299. }else{
  300. $.toast({
  301. heading: '{{__("label.outlet_update")}}',
  302. text: response.message,
  303. position: 'top-right',
  304. loaderBg: '#ff6849',
  305. icon: 'error',
  306. hideAfter: 3000,
  307. stack: 1
  308. });
  309. }
  310. }).submit();
  311. }
  312. });
  313. })
  314. </script>
  315. @endsection