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.

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