Victoria Hall Booking for Events
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.

561 lines
16 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!doctype html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-public :: head}">
  4. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  5. <!-- Include jQuery (you can use any other AJAX library or plain JavaScript) -->
  6. <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
  7. <!-- Include your external JavaScript file -->
  8. <script th:src="@{/js/ajax.js}"></script>
  9. </head>
  10. <body>
  11. <!-- Page Container -->
  12. <div id="page-container"
  13. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  14. <!-- Side Overlay aside (right)-->
  15. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  16. <!-- END Side Overlay (right)-->
  17. <!-- Sidebar Nav-->
  18. <nav th:replace="~{fragments/nav-caretaker :: nav}"></nav>
  19. <!-- END Sidebar -->
  20. <!-- Header -->
  21. <header th:replace="~{fragments/header-caretaker :: header}"></header>
  22. <!-- END Header -->
  23. <!-- Main Container -->
  24. <main id="main-container">
  25. <!-- Page Content -->
  26. <div class="content">
  27. <div class="content content-full">
  28. <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
  29. <h3 th:text="'Welcome to ' + ${hallName}" class="flex-grow-1 fs-5 fw-semibold my-2 my-sm-3"></h3>
  30. </div>
  31. <div class="row items-push">
  32. <div class="col-sm-6 col-xl-4">
  33. <div class="block block-rounded text-center d-flex flex-column h-100 mb-0">
  34. <div class="block-content block-content-full flex-grow-1">
  35. <div class="item rounded-3 bg-body mx-auto my-3">
  36. <i class="fa fa-thumbs-up fa-lg text-primary"></i>
  37. </div>
  38. <div class="fs-2 fw-bold text-success" th:utext="${APPROVED}">30</div>
  39. <div class="text-muted mb-1 fs-5">Accept Count</div>
  40. </div>
  41. <!--<div class="block-content block-content-full block-content-sm bg-body-light fs-sm">
  42. <a class="fw-medium" href="/approval-history">
  43. <i class="fa fa-arrow-right ms-1 opacity-25"></i>
  44. </a>
  45. </div>-->
  46. </div>
  47. </div>
  48. <div class="col-sm-6 col-xl-4">
  49. <div class="block block-rounded text-center d-flex flex-column h-100 mb-0">
  50. <div class="block-content block-content-full flex-grow-1">
  51. <div class="item rounded-3 bg-body mx-auto my-3">
  52. <i class="fa fa-thumbs-down fa-lg text-primary"></i>
  53. </div>
  54. <div class="fs-2 fw-bold text-info" th:utext="${REJECTED}">50</div>
  55. <div class="text-muted mb-1 fs-5">Reject count</div>
  56. </div>
  57. <!--<div class="block-content block-content-full block-content-sm bg-body-light fs-sm">
  58. <a class="fw-medium" href="rejected-list">
  59. <i class="fa fa-arrow-right ms-1 opacity-25"></i>
  60. </a>
  61. </div>-->
  62. </div>
  63. </div>
  64. <div class="col-sm-6 col-xl-4">
  65. <div class="block block-rounded text-center d-flex flex-column h-100 mb-0">
  66. <div class="block-content block-content-full flex-grow-1">
  67. <div class="item rounded-3 bg-body mx-auto my-3">
  68. <i class="fas fa-sync fa-lg text-primary"></i>
  69. </div>
  70. <div class="fs-2 fw-bold text-success" th:utext="${COMPLETED}">20</div>
  71. <div class="text-muted mb-1 fs-5"> Completed Count</div>
  72. </div>
  73. <!--<div class="block-content block-content-full block-content-sm bg-body-light fs-sm">
  74. <a class="fw-medium" href="">
  75. <i class="fa fa-arrow-right ms-1 opacity-25"></i>
  76. </a>
  77. </div>-->
  78. </div>
  79. </div>
  80. </div>
  81. <div class="row items-push" style="margin-top: 20px;">
  82. <div class="col-md-6">
  83. <div class="card">
  84. <h3 class="card-title text-center" style="margin-top: 15px;">Monthly Data</h3>
  85. <div class="card-body p-md-3 p-lg-3 w-100" style="height: 350px;">
  86. <!-- Bars Chart Container -->
  87. <!-- Chart.js Chart is initialized in js/pages/be_pages_dashboard.min.js which was auto compiled from _js/pages/be_pages_dashboard.js -->
  88. <!-- For more info and examples you can check out http://www.chartjs.org/docs/ -->
  89. <canvas id="js-chartjs-analytics-bars"></canvas>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="col-md-6">
  94. <div class="card">
  95. <h3 class="card-title text-center" style="margin-top: 15px;">Total Counts</h3>
  96. <div class="card-body p-md-3 p-lg-3 w-100 d-flex justify-content-center align-items-center"
  97. style="height: 350px;">
  98. <!-- Bars Chart Container -->
  99. <!-- Chart.js Chart is initialized in js/pages/be_pages_dashboard.min.js which was auto compiled from _js/pages/be_pages_dashboard.js -->
  100. <!-- For more info and examples you can check out http://www.chartjs.org/docs/ -->
  101. <canvas id="myChart"></canvas>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- <div class="col-sm-6 col-xl-3">
  109. <div class="block block-rounded text-center d-flex flex-column h-100 mb-0">
  110. <div class="block-content block-content-full">
  111. <div class="item rounded-3 bg-body mx-auto my-3">
  112. <i class="fa fa-thumbs-down fa-lg text-primary"></i>
  113. </div>
  114. <div class="fs-2 fw-bold text-warning" th:utext="${totalNoFeedbacks}">000</div>
  115. <div class="text-muted mb-1 fs-5"></div>
  116. </div>
  117. <div class="block-content block-content-full block-content-sm bg-body-light fs-sm">
  118. <a class="fw-medium" href="/pending-complaint">
  119. <i class="fa fa-arrow-right ms-1 opacity-25"></i>
  120. </a>
  121. </div>
  122. </div>
  123. </div>-->
  124. <!-- END Page Content -->
  125. </main>
  126. <!-- END Main Container -->
  127. <!-- Footer -->
  128. <!-- END Footer -->
  129. </div>
  130. <!-- Scripts -->
  131. <div th:replace="~{fragments/resetpassword :: div}"></div>
  132. <script th:replace="~{fragments/script :: script}"></script>
  133. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  134. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  135. <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  136. <script type="text/javascript" th:inline="javascript">
  137. function addimg(x) {
  138. document.getElementById("myImg").src = "data:image/jpeg;base64," + x;
  139. }
  140. function accept() {
  141. let id = document.getElementById("uniqid").value;
  142. Swal.fire({
  143. title: 'Do you want to Accept this Pet ?',
  144. showDenyButton: true,
  145. showCancelButton: true,
  146. confirmButtonText: 'YES',
  147. denyButtonText: `NO`,
  148. }).then((result) => {
  149. /* Read more about isConfirmed, isDenied below */
  150. if (result.isConfirmed) {
  151. $.ajax({
  152. type: "GET",
  153. url: '/api/accept',
  154. data: {'id': id},
  155. success: function (bodyMessage) {
  156. if (bodyMessage == "success") {
  157. Swal.fire(
  158. 'Done',
  159. 'Successfully Accepted to the ID:' + id,
  160. 'success'
  161. ).then(() => {
  162. location.reload();
  163. });
  164. }
  165. }
  166. });
  167. } else if (result.isDenied) {
  168. Swal.fire('Changes are not saved', '', 'info')
  169. }
  170. })
  171. }
  172. function reject(list) {
  173. $('#rejectForm').modal({
  174. backdrop: 'static',
  175. keyboard: false
  176. });
  177. $('#rejectForm').modal('show');
  178. document.getElementById("uniqid").value = list.uniqueid;
  179. document.getElementById("petna").value = list.petname;
  180. document.getElementById("speci").value = list.species;
  181. document.getElementById("bre").value = list.breed;
  182. document.getElementById("gend").value = list.gender;
  183. document.getElementById("age").value = list.age;
  184. document.getElementById("arvd").value = list.arvdate;
  185. document.getElementById("dewormdate").value = list.dewormdate;
  186. document.getElementById("othervac").value = list.othervac;
  187. document.getElementById("previoslicenseNo").value = list.previoslicenseNo;
  188. document.getElementById("VeterinaryConsultant").value = list.veterinaryConsultant;
  189. document.getElementById("TNVCNo").value = list.tnvcno;
  190. document.getElementById("registerdate").value = list.registerdate;
  191. }
  192. function rejectsubmit() {
  193. var reason = $("#reason").val();
  194. var id = $("#uniqid").val();
  195. Swal.fire({
  196. title: 'Do you want to Reject this Pet ?',
  197. showDenyButton: true,
  198. showCancelButton: true,
  199. confirmButtonText: 'YES',
  200. denyButtonText: `NO`,
  201. }).then((result) => {
  202. /* Read more about isConfirmed, isDenied below */
  203. if (result.isConfirmed) {
  204. $.ajax({
  205. type: "GET",
  206. url: '/api/reject',
  207. data: {'id': id, 'reason': reason},
  208. success: function (bodyMessage) {
  209. if (bodyMessage == "success") {
  210. Swal.fire(
  211. 'Done',
  212. 'Successfully Rejected to the ID:' + id,
  213. 'success'
  214. ).then(() => {
  215. location.reload();
  216. });
  217. }
  218. }
  219. });
  220. } else if (result.isDenied) {
  221. Swal.fire('Changes are not saved', '', 'info')
  222. }
  223. })
  224. return false;
  225. }
  226. function viewOwner(mobilenum) {
  227. // let list;
  228. let own;
  229. $.ajax({
  230. type: "GET",
  231. url: '/api/getpetOwner',
  232. data: {
  233. 'mobilenum': mobilenum,
  234. },
  235. success: function (bodyMessage) {
  236. // this.list=bodyMessage;
  237. ownercall(bodyMessage);
  238. }
  239. });
  240. }
  241. function ownercall(list) {
  242. $('#ownerForm').modal({
  243. backdrop: 'static',
  244. keyboard: false
  245. });
  246. $('#ownerForm').modal('show');
  247. document.getElementById("title").value = list.title;
  248. document.getElementById("fname").value = list.fname;
  249. document.getElementById("doornumber").value = list.doornumber;
  250. document.getElementById("street").value = list.street;
  251. document.getElementById("area").value = list.area;
  252. document.getElementById("city").value = list.city;
  253. document.getElementById("pincode").value = list.pincode;
  254. document.getElementById("zone").value = list.zone;
  255. document.getElementById("ward").value = list.ward;
  256. document.getElementById("phone").value = list.phone;
  257. document.getElementById("email").value = list.email;
  258. document.getElementById("pancard").value = list.pancard;
  259. document.getElementById("aadhar").value = list.aadhar;
  260. document.getElementById("voterid").value = list.voterid;
  261. }
  262. // Function to call modal for New pet registration
  263. callAdd = function () {
  264. $('#addForm').modal({
  265. backdrop: 'static',
  266. keyboard: false
  267. })
  268. $('#addForm').modal('show');
  269. }
  270. $(document).ready(function () {
  271. var today = new Date();
  272. $('.datepicker').datepicker({
  273. dateFormat: 'yy/mm/dd',
  274. maxDate: '1'
  275. })
  276. $('.datepicker').keyup(function () {
  277. if (this.value.match(/[^0-9]/g)) {
  278. this.value = this.value.replace(/[^0-9^-]/g, '');
  279. }
  280. });
  281. });
  282. function getbydate() {
  283. var x = document.getElementById("fromdate").value;
  284. var y = document.getElementById("todate").value;
  285. $.ajax({
  286. type: "GET",
  287. url: '/api/getbydate',
  288. data: {
  289. 'fromdate': x,
  290. 'todate': y
  291. },
  292. success: function (x) {
  293. if (x == "ok") {
  294. location.reload();
  295. }
  296. }
  297. });
  298. }
  299. function resetDate() {
  300. $.ajax({
  301. type: "GET",
  302. url: '/api/resetdate',
  303. success: function (x) {
  304. if (x == "ok") {
  305. location.reload();
  306. }
  307. }
  308. });
  309. }
  310. class pageDashboard {
  311. /*
  312. * Init Charts
  313. *
  314. */
  315. static initChartsBars() {
  316. // Set Global Chart.js configuration
  317. Chart.defaults.color = '#818d96';
  318. Chart.defaults.scale.grid.color = 'transparent';
  319. Chart.defaults.scale.grid.zeroLineColor = 'transparent';
  320. Chart.defaults.scale.beginAtZero = true;
  321. Chart.defaults.elements.line.borderWidth = 1;
  322. Chart.defaults.plugins.legend.labels.boxWidth = 12;
  323. // Get Chart Containers
  324. let chartBarsCon = document.getElementById('js-chartjs-analytics-bars');
  325. // Set Chart and Chart Data variables
  326. let chartBars, chartLinesBarsData;
  327. const acceptedBookings = [];
  328. const rejectedBookings = [];
  329. const completedBookings = [];
  330. const labels = [];
  331. var mounthcount = [[${mounthcount}]];
  332. mounthcount.forEach(item => {
  333. labels.push(item.months);
  334. acceptedBookings.push(item.approved_count);
  335. rejectedBookings.push(item.rejected_count);
  336. completedBookings.push(item.completed_count);
  337. });
  338. // Bars Chart Data
  339. chartLinesBarsData = {
  340. //labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
  341. labels: labels,
  342. datasets: [
  343. {
  344. label: 'Accepted Booking',
  345. fill: true,
  346. backgroundColor: '#c7d7e6',
  347. borderColor: 'transparent',
  348. pointBackgroundColor: '#c7d7e6',
  349. pointBorderColor: '#fff',
  350. pointHoverBackgroundColor: '#fff',
  351. pointHoverBorderColor: '#c7d7e6',
  352. data: acceptedBookings
  353. },
  354. {
  355. label: 'Rejected Booking',
  356. fill: true,
  357. backgroundColor: '#c2d7ab',
  358. borderColor: 'transparent',
  359. pointBackgroundColor: '#c2d7ab',
  360. pointBorderColor: '#fff',
  361. pointHoverBackgroundColor: '#fff',
  362. pointHoverBorderColor: '#c2d7ab',
  363. data: rejectedBookings
  364. },
  365. {
  366. label: 'Completed',
  367. fill: true,
  368. backgroundColor: '#e9cb91',
  369. borderColor: 'transparent',
  370. pointBackgroundColor: '#e9cb91',
  371. pointBorderColor: '#fff',
  372. pointHoverBackgroundColor: '#fff',
  373. pointHoverBorderColor: '#e9cb91',
  374. data: completedBookings
  375. }
  376. ]
  377. };
  378. // Init Chart
  379. if (chartBarsCon !== null) {
  380. chartBars = new Chart(chartBarsCon, {
  381. type: 'bar',
  382. data: chartLinesBarsData,
  383. options: {
  384. responsive: true,
  385. maintainAspectRatio: false,
  386. plugins: {
  387. tooltip: {
  388. callbacks: {
  389. label: function (context) {
  390. return context.dataset.label + ': ' + context.parsed.y + '';
  391. }
  392. }
  393. }
  394. }
  395. }
  396. });
  397. }
  398. }
  399. /*
  400. * Init functionality
  401. *
  402. */
  403. static init() {
  404. this.initChartsBars();
  405. }
  406. }
  407. // Initialize when page loads
  408. Dashmix.onLoad(() => pageDashboard.init());
  409. $(function () {
  410. var start = moment().subtract(29, 'days');
  411. var end = moment();
  412. function cb(start, end) {
  413. $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  414. }
  415. $('#reportrange').daterangepicker({
  416. startDate: start,
  417. endDate: end,
  418. ranges: {
  419. 'Today': [moment(), moment()],
  420. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  421. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  422. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  423. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  424. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  425. }
  426. }, cb);
  427. cb(start, end);
  428. });
  429. //Chart Update data
  430. /* static updateChartLinesBarsData(newData) {
  431. // Update the chart data
  432. pageDashboard.chartLinesBarsData.datasets[0].data = newData.totalFeedbacks;
  433. pageDashboard.chartLinesBarsData.datasets[1].data = newData.positiveFeedbacks;
  434. pageDashboard.chartLinesBarsData.datasets[2].data = newData.negativeFeedbacks;
  435. // Update the chart
  436. if (pageDashboard.chartBars !== undefined) {
  437. pageDashboard.chartBars.data = pageDashboard.chartLinesBarsData;
  438. pageDashboard.chartBars.update();
  439. }
  440. };
  441. function getAndpushdata(){
  442. $.ajax({
  443. url: 'api/getchartfeedbackdata', // Replace with the URL to fetch the updated data
  444. method: 'GET', // Replace with the appropriate HTTP method
  445. dataType: 'json', // Replace with the data type you are expecting
  446. success: function (response) {
  447. // Assuming the response contains the updated chart data in the expected format
  448. pageDashboard.updateChartLinesBarsData(response);
  449. },
  450. error: function (xhr, status, error) {
  451. // Handle the error scenario
  452. console.error('Error:', error);
  453. }
  454. });
  455. }
  456. */
  457. var APPROVED = [[${APPROVED}]];
  458. var REJECTED = [[${REJECTED}]];
  459. var COMPLETED = [[${COMPLETED}]];
  460. var CANCELED = [[${CANCELED}]];
  461. var PAYMENT_FAILURE = [[${PAYMENT_FAILURE}]];
  462. var GCC_BLOCKED = [[${GCC_BLOCKED}]];
  463. var data = {
  464. labels: [' Approved', 'Rejected', 'Completed', 'CANCELED', 'PAYMENT FAILURE', 'GCC BLOCKED'],
  465. datasets: [{
  466. data: [APPROVED, REJECTED, COMPLETED, CANCELED, PAYMENT_FAILURE, GCC_BLOCKED], // Values for each segment
  467. backgroundColor: ['#c7d7e6', '#c2d7ab', '#e9cb91', '#DB403C', '#2878C5', '#A852B7'], // Colors for each segment
  468. }]
  469. };
  470. // Get the canvas element and create a pie chart
  471. var ctx = document.getElementById('myChart').getContext('2d');
  472. var myChart = new Chart(ctx, {
  473. type: 'doughnut',
  474. data: data,
  475. });
  476. </script>
  477. </body>
  478. </html>