You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

385 lines
14 KiB

6 days ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/user-head :: head}">
  4. <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.2/html2pdf.bundle.min.js"></script>
  5. </head>
  6. <body>
  7. <style>
  8. /* Hide menu & footer when printing */
  9. @media print {
  10. .navbar, footer, .btn {
  11. display: none !important;
  12. }
  13. }
  14. /* Desktop width control */
  15. @media (min-width: 850px) {
  16. .qr-container {
  17. max-width: 900px;
  18. margin: 0 auto;
  19. }
  20. }
  21. /* ===== ALIGNMENT FIXES ===== */
  22. .qr-container .card {
  23. padding: 25px 30px !important;
  24. border-radius: 20px;
  25. }
  26. .qr-header {
  27. text-align: center;
  28. }
  29. .qr-header img {
  30. width: 45px;
  31. display: block;
  32. margin: 0 auto 8px auto;
  33. }
  34. .qr-header-title {
  35. font-size: 14px;
  36. font-weight: bold;
  37. text-align: center;
  38. }
  39. /* Header */
  40. /*.qr-header {
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. gap: 12px;
  45. margin-bottom: 15px;
  46. text-align: center;
  47. }*/
  48. .qr-header img {
  49. width: 45px;
  50. }
  51. .qr-header-title {
  52. font-size: 13px;
  53. font-weight: bold;
  54. }
  55. /* Title */
  56. .booking-title {
  57. text-align: center;
  58. font-weight: bold;
  59. color: #15455D;
  60. margin-bottom: 10px;
  61. }
  62. /* QR */
  63. .qr-image {
  64. display: flex;
  65. justify-content: center;
  66. margin: 15px 0 25px;
  67. }
  68. .qr-image img {
  69. border: 4px solid #15455D;
  70. width: 150px;
  71. height: 150px;
  72. border-radius: 10px;
  73. }
  74. /* Section title */
  75. .section-title {
  76. text-align: center;
  77. font-weight: bold;
  78. color: #15455D;
  79. margin-bottom: 15px;
  80. }
  81. /* Booking details */
  82. .booking-details p {
  83. font-size: 14px;
  84. margin-bottom: 8px;
  85. }
  86. .booking-details span {
  87. font-weight: 600;
  88. }
  89. /* Note */
  90. .note-box {
  91. margin-top: 15px;
  92. font-size: 13px;
  93. text-align: justify;
  94. }
  95. .note-box span {
  96. color: red;
  97. font-weight: bold;
  98. }
  99. /* ID Proof Rules */
  100. .id-proof-box {
  101. margin-top: 15px;
  102. padding: 12px 15px;
  103. border: 1px dashed #15455D;
  104. border-radius: 8px;
  105. background: #f8fbfd;
  106. font-size: 13px;
  107. }
  108. .id-proof-box h6 {
  109. font-weight: bold;
  110. color: #15455D;
  111. margin-bottom: 8px;
  112. text-align: center;
  113. }
  114. .id-proof-box ul {
  115. padding-left: 18px;
  116. margin: 0;
  117. }
  118. .id-proof-box li {
  119. margin-bottom: 6px;
  120. }
  121. </style>
  122. <!-- Pre-loader -->
  123. <div th:replace="~{fragments/preloader :: div}"></div>
  124. <div id="pcoded" class="pcoded">
  125. <div class="pcoded-container">
  126. <nav th:replace="~{fragments/user-nav :: nav}"></nav>
  127. <div class="pcoded-main-container">
  128. <div class="pcoded-wrapper">
  129. <div class="pcoded-content">
  130. <div class="pcoded-inner-content">
  131. <div class="main-body">
  132. <div class="page-wrapper">
  133. <div class="page-body" style="padding-top:5%;">
  134. <div id="printArea" class="qr-container">
  135. <div class="card shadow">
  136. <!-- HEADER -->
  137. <div class="qr-header">
  138. <img th:src="@{/victoriapublichall/images/VPH-logo_main-EN 1.png}" alt="VPH logo" class="logo">
  139. <div class="qr-header-title text-center">
  140. Victorial Hall Booking
  141. </div>
  142. </div>
  143. <!-- TITLE -->
  144. <h5 class="booking-title">Booking Completed</h5>
  145. <!-- QR -->
  146. <div class="qr-image">
  147. <img id="qrCodeImage" alt="QR Code">
  148. </div>
  149. <!-- DETAILS TITLE -->
  150. <h6 class="section-title mt-3">Booking Details</h6>
  151. <th:block th:with="isBulk=${bookingDetails[0]['bulkRefId'] != null}">
  152. <div class="row booking-details">
  153. <div class="col-6 col-lg-3">
  154. <p>Mobile No:
  155. <span th:text="${bookingDetails[0]['mob_no']}"></span>
  156. </p>
  157. </div>
  158. <div class="col-6 col-lg-3">
  159. <p>Email Id:
  160. <span th:text="${bookingDetails[0]['email']}"></span>
  161. </p>
  162. </div>
  163. <div class="col-6 col-lg-3">
  164. <p>Visit Date:
  165. <span th:text="${bookingDetails[0]['visit_date']}"></span>
  166. </p>
  167. </div>
  168. <!-- SINGLE BOOKING -->
  169. <th:block th:if="${!isBulk}">
  170. <div class="col-6 col-lg-3">
  171. <p>Time:
  172. <span th:text="${bookingDetails[0]['timing']}"></span>
  173. </p>
  174. </div>
  175. <div class="col-6 col-lg-3">
  176. <p>AV Slot:
  177. <span th:text="${bookingDetails[0]['avslottime']}"></span>
  178. </p>
  179. </div>
  180. </th:block>
  181. <!-- BULK BOOKING -->
  182. <th:block th:if="${isBulk}">
  183. <div class="col-12">
  184. <p>Time Slots:
  185. <span th:text="${bookingDetails[0]['timings']}"></span>
  186. </p>
  187. </div>
  188. <div class="col-12">
  189. <p>AV Slots:
  190. <span th:text="${bookingDetails[0]['available_slots']}"></span>
  191. </p>
  192. </div>
  193. </th:block>
  194. <div class="col-6 col-lg-3">
  195. <p>Total People:
  196. <span th:text="${bookingDetails[0]['no_of_people']}"></span>
  197. </p>
  198. </div>
  199. <div class="col-6 col-lg-3">
  200. <p>Adults:
  201. <span th:text="${bookingDetails[0]['adult_count']}"></span>
  202. </p>
  203. </div>
  204. <div class="col-6 col-lg-3">
  205. <p>Children:
  206. <span th:text="${bookingDetails[0]['child_count']}"></span>
  207. </p>
  208. </div>
  209. <div class="col-6 col-lg-3">
  210. <p>Foreigners:
  211. <span th:text="${bookingDetails[0]['foreigner_count']}"></span>
  212. </p>
  213. </div>
  214. <div class="col-6 col-lg-3">
  215. <p>Senior Citizen:
  216. <span th:text="${bookingDetails[0]['sc_count']}"></span>
  217. </p>
  218. </div>
  219. <div class="col-6 col-lg-3">
  220. <p>Students:
  221. <span th:text="${bookingDetails[0]['students_count']}"></span>
  222. </p>
  223. </div>
  224. <div class="col-6 col-lg-3">
  225. <p>Physically Challenged:
  226. <span th:text="${bookingDetails[0]['pc_count']}"></span>
  227. </p>
  228. </div>
  229. </div>
  230. </th:block>
  231. <!-- ID PROOF RULES -->
  232. <div class="id-proof-box">
  233. <h6>ID Proof Requirements</h6>
  234. <ul>
  235. <li><b>Adults / Senior Citizen / Children:</b> Aadhaar Card</li>
  236. <li><b>Students:</b> Student Identity Card</li>
  237. <li><b>Foreigners / NRI:</b> Passport</li>
  238. </ul>
  239. <div class="note-box">
  240. <span>Note:</span>
  241. All individuals visiting the hall must carry a valid ID proof for verification.
  242. Failure to produce the ID proof may result in cancellation of the booking.
  243. </div>
  244. </div>
  245. <!-- NOTE -->
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. <center class="">
  255. <button class="btn btn-primary" onclick="downloadPDF()">
  256. Download PDF
  257. </button>
  258. </center>
  259. <center class="mt-2">
  260. <button class="btn btn-success"
  261. onclick="window.location.href='/victoriapublichall/home'">
  262. Back to Home
  263. </button>
  264. </center>
  265. <footer th:replace="~{fragments/footer :: footer}"></footer>
  266. </div>
  267. </div>
  268. </div>
  269. <script th:replace="~{fragments/user-script :: script}"></script>
  270. <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.2/html2pdf.bundle.min.js"></script>
  271. <script th:inline="javascript">
  272. function downloadPDF() {
  273. const element = document.getElementById('printArea');
  274. const opt = {
  275. margin: 10,
  276. filename: 'VPH_Booking_Details.pdf',
  277. image: { type: 'jpeg', quality: 0.98 },
  278. html2canvas: { scale: 2, useCORS: true },
  279. jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
  280. };
  281. html2pdf().set(opt).from(element).save();
  282. }
  283. function fetchQRCode(orderid) {
  284. $.ajax({
  285. url: '/victoriapublichall/bookingapi/generateQR?orderid=' + encodeURIComponent(orderid),
  286. type: 'GET',
  287. success: function (data) {
  288. console.log("data......",data)
  289. $('#qrCodeImage').attr('src', 'data:image/png;base64,' + data);
  290. }
  291. });
  292. }
  293. $(document).ready(function () {
  294. const orderid = [[${bookingDetails[0]['order_id']}]];
  295. console.log("Order ID:", orderid);
  296. fetchQRCode(orderid);
  297. });
  298. </script>
  299. </body>
  300. </html>