show.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container-fluid">
  4. <h1 class="mt-4">Restaurants</h1>
  5. <ol class="breadcrumb mb-4">
  6. <li class="breadcrumb-item"><a href="{!! env('APP_URL') !!}dashboard">Dashboard</a></li>
  7. <li class="breadcrumb-item"><a href="{!! env('APP_URL') !!}restaurants">Restaurants</a></li>
  8. <li class="breadcrumb-item active">{!! $restaurant->name !!}'s Detail</li>
  9. </ol>
  10. <div class="row">
  11. <div class="col-xl-12">
  12. <div class="card mb-4">
  13. <div class="card-body">
  14. <div class="card mb-4 order-list">
  15. <div class="gold-members p-4">
  16. <div class="media">
  17. <a href="#">
  18. @if(isset($restaurant->photos))
  19. <img class="mr-4" src="{!! $restaurant->photos->file_name !!}" alt="{!! $restaurant->name !!}">
  20. @else
  21. <img class="mr-4" src="{!! env('APP_ASSETS') !!}img/3.jpg" alt="Generic placeholder image">
  22. @endif
  23. </a>
  24. <div class="media-body">
  25. <a href="#">
  26. <span class="float-right text-success">Created on {!! date('l, d M, Y', strtotime($restaurant->created_at)) !!} <i class="feather-check-circle text-success"></i></span>
  27. </a>
  28. <div class="row">
  29. <div class="col-md-6">
  30. <h6 class="mb-3"><a href="#">
  31. </a><a href="#!" class="text-dark">{!! $restaurant->name !!}
  32. </a>
  33. </h6>
  34. <p class="text-black-50 mb-1"><i class="feather-phone"></i> {!! $restaurant-> phone_number !!}</p>
  35. <p class="text-black-50 mb-1"><i class="feather-map-pin"></i> {!! $restaurant->address !!}
  36. </p>
  37. <p class="text-black-50 mb-3"> {!! $restaurant->short_description !!}
  38. </p>
  39. <p>
  40. <a href="{!! env('QRCODE_HOST') !!}?id={!! $restaurant->unique_shared_key !!}" target="_blank">{!! env('QRCODE_HOST') !!}?id={!! $restaurant->unique_shared_key !!}</a>
  41. </p>
  42. <p>
  43. <a href="{!! env('QRCODE_HOST_ORDER') !!}d/{!! $restaurant->resto_unique_name !!}" target="_blank">{!! env('QRCODE_HOST_ORDER') !!}delivery/{!! $restaurant->resto_unique_name !!}</a>
  44. </p>
  45. </div>
  46. <div class="col-md-2">
  47. <div class="text-center">
  48. <p>Resto QR Code</p>
  49. <div id="output"></div>
  50. <div id="download" style="display: none"></div>
  51. <a style="position: relative; top: 13px; font-size: 13px" href="#!" class="download-image mt-4"><i style="font-size: 20px" class="fa fa-download"></i> </a>
  52. </div>
  53. </div>
  54. <div class="col-md-2">
  55. <div class="text-center">
  56. <p>Order QR Code</p>
  57. <div id="output-order"></div>
  58. <div id="download-order" style="display: none"></div>
  59. <a style="position: relative; top: 13px; font-size: 13px" href="#!" class="download-image-order mt-4"><i style="font-size: 20px" class="fa fa-download"></i> </a>
  60. </div>
  61. </div>
  62. </div>
  63. <hr>
  64. <div class="float-right">{{--
  65. <a href="#!" class="btn btn-sm btn-warning"><i class="feather-message-circle"></i> Message</a>--}}
  66. <a href="{!! env('APP_URL') !!}restaurant/edit/{!! \App\Helpers\CommonMethods::encrypt($restaurant->id) !!}" class="btn btn-sm btn-info"><i class="feather-edit"></i></a>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <h5>{!! $restaurant->name !!}'s Recipe</h5>
  73. <div class="table-responsive">
  74. <div class="table-responsive">
  75. <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
  76. <thead>
  77. <tr class="text-uppercase">
  78. <th>#</th>
  79. <th>Name</th>
  80. <th>Price</th>{{--
  81. <th>Description</th>--}}
  82. <th>Orders</th>
  83. <th>Comments</th>
  84. <th>Customizable</th>
  85. <th>Action</th>
  86. </tr>
  87. </thead>
  88. <tbody>
  89. <!----><!---->
  90. @if(isset($restaurant->recipes) && $restaurant->recipes->count() > 0)
  91. @foreach($restaurant->recipes as $recipe)
  92. <tr>
  93. <td>
  94. @if(isset($recipe->main_images))
  95. <img class="img-profile rounded-circle" src="{!! $recipe->main_images->file_name !!}">
  96. @else
  97. <img class="img-profile rounded-circle" src="{!! env('APP_ASSETS') !!}img/user/1.png">
  98. @endif
  99. </td>
  100. <td> {!! $recipe->name !!} </td>
  101. <td>{!! number_format($recipe->price,2) !!}</td>
  102. {{-- <td>{!! substr($recipe->short_description,0,150) !!}</td>--}}
  103. <td>0</td>
  104. <td>{!! $recipe->comments !!}</td>
  105. <td>{!! $recipe->active?'<span class="badge badge-success">Yes</span>':'<span class="badge badge-danger">No</span>' !!}</td>
  106. <td>
  107. <a href="{!! env('APP_URL') !!}recipe/show/{!! $recipe->id !!}" class="btn btn-success btn-sm" data-toggle="tooltip" data-placement="top" title="View"><i class="feather-eye"></i> </a>
  108. <a href="{!! env('APP_URL') !!}recipe/edit/{!! $recipe->id !!}" class="btn btn-sm btn-primary" data-toggle="tooltip" data-placement="top" title="Edit"><i class="feather-edit"></i> </a>
  109. <a href="javascript:;" data-id="{!! $recipe->id !!}" class="btn btn-sm btn-danger delete-recipe" data-toggle="tooltip" data-placement="top" title="Delete"><i class="feather-trash"></i> </a>
  110. </td>
  111. </tr>
  112. @endforeach
  113. @endif
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. @endsection
  124. @section('js')
  125. <script>
  126. $(function () {
  127. @if( isset($restaurant))
  128. $('#output').qrcode({
  129. render: "canvas",
  130. text: "{!! env('QRCODE_HOST') !!}?id={!! $restaurant->unique_shared_key !!}",
  131. width: 100,
  132. height: 100,
  133. background: "#ffffff",
  134. foreground: "#000000",
  135. src: "{!! isset($restaurant) && isset($restaurant->photos)?$restaurant->photos->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  136. imgWidth: 20,
  137. imgHeight: 20
  138. });
  139. $('#download').qrcode({
  140. render: "canvas",
  141. text: "{!! env('QRCODE_HOST') !!}?id={!! $restaurant->unique_shared_key !!}",
  142. width: 2000,
  143. height: 2000,
  144. background: "#ffffff",
  145. foreground: "#000000",
  146. src: "{!! isset($restaurant) && isset($restaurant->photos)?$restaurant->photos->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  147. imgWidth: 500,
  148. imgHeight: 500
  149. });
  150. $(".download-image").click(function () {
  151. var canvas = $('#download canvas')[0];
  152. var _this = $(this);
  153. // Change here
  154. $.ajax({
  155. url:"{!! env('APP_URL') !!}download/qrcode",
  156. type:"POST",
  157. data:{
  158. data:canvas.toDataURL(),
  159. '_token':"{!! csrf_token() !!}"
  160. },
  161. success:function(response){
  162. console.log(response);
  163. var link = document.createElement('a');
  164. link.href = response;
  165. link.download = "qrcode.png";
  166. link.click();
  167. }
  168. });
  169. });
  170. $('#output-order').qrcode({
  171. render: "canvas",
  172. text: "{!! env('QRCODE_HOST_ORDER') !!}?id={!! $restaurant->unique_shared_key !!}",
  173. width: 100,
  174. height: 100,
  175. background: "#ffffff",
  176. foreground: "#000000",
  177. src: "{!! isset($restaurant) && isset($restaurant->photos)?$restaurant->photos->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  178. imgWidth: 20,
  179. imgHeight: 20
  180. });
  181. $('#download-order').qrcode({
  182. render: "canvas",
  183. text: "{!! env('QRCODE_HOST_ORDER') !!}?id={!! $restaurant->unique_shared_key !!}",
  184. width: 2000,
  185. height: 2000,
  186. background: "#ffffff",
  187. foreground: "#000000",
  188. src: "{!! isset($restaurant) && isset($restaurant->photos)?$restaurant->photos->file_name:env('APP_URL').'public/layout/img/favicon.png' !!}",
  189. imgWidth: 500,
  190. imgHeight: 500
  191. });
  192. $(".download-image-order").click(function () {
  193. var canvas = $('#download-order canvas')[0];
  194. var _this = $(this);
  195. // Change here
  196. $.ajax({
  197. url:"{!! env('APP_URL') !!}download/qrcode",
  198. type:"POST",
  199. data:{
  200. data:canvas.toDataURL(),
  201. '_token':"{!! csrf_token() !!}"
  202. },
  203. success:function(response){
  204. console.log(response);
  205. var link = document.createElement('a');
  206. link.href = response;
  207. link.download = "qrcode.png";
  208. link.click();
  209. }
  210. });
  211. });
  212. @endif
  213. })
  214. </script>
  215. @endsection