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.

686 lines
32 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" dir="">
  3. <html xmlns:th="http://www.thymeleaf.org">
  4. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  5. <body>
  6. <!--[if lt IE 8]>
  7. <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  8. <![endif]-->
  9. <div class="wrapper">
  10. <!-- header top menu Start -->
  11. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  12. <!-- header top menu end -->
  13. <div class="page-wrap">
  14. <!--=============== Left Menu side Start ================-->
  15. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  16. <!--=============== Left side End ================-->
  17. <div class="main-content">
  18. <div class="container-fluid">
  19. <div class="page-header">
  20. <div class="row align-items-end">
  21. <div class="col-lg-3">
  22. <div class="page-header-title">
  23. <i class='fa fa-envelope' style='font-size:24px; color: #1aafd4'></i>
  24. <div class="d-inline">
  25. <h5>Request Info</h5>
  26. <span>Pet Registration</span>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="col-lg-5">
  31. <div class="content">
  32. <div class="block block-rounded">
  33. <div class="block-header block-header-default" style="display: block;">
  34. <form class="row" action="javascript:getbydate()">
  35. <div class="row">
  36. <div class="col-4">
  37. <input type="date" th:value="${fromDate}" class="form-control"
  38. name="FromDate" id="fromdate"
  39. data-date-format="yyyy-mm-dd" />
  40. </div>
  41. <div class="col-4">
  42. <input type="date" th:value="${toDate}" class="form-control"
  43. name="ToDate" id="todate" data-date-format="yyyy-mm-dd" />
  44. </div>
  45. <div class="col-2 p-0 text-center">
  46. <button type="submit" class="btn btn-sm btn-primary"
  47. name="submit" id="submit"
  48. onclick="getbydate()">Submit</button>
  49. <br>
  50. </div>
  51. <div class="col-2 p-0 text-center">
  52. <button class="btn btn-danger" onclick="resetDate()"
  53. name="reset" type="reset">Reset</button>
  54. </div>
  55. </div>
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-lg-3">
  62. <nav class="breadcrumb-container" aria-label="breadcrumb">
  63. <ol class="breadcrumb">
  64. <li class="breadcrumb-item">
  65. <a href="/index"><i class="ik ik-home"></i></a>
  66. </li>
  67. <li class="breadcrumb-item">Pet Registration</li>
  68. <li class="breadcrumb-item">Request</li>
  69. </ol>
  70. </nav>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="row">
  75. <div class="col-md-12">
  76. <div class="card">
  77. <div class="card-block">
  78. <div>
  79. <table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
  80. <thead class="thead-dark">
  81. <tr role="row">
  82. <th>S.No</th>
  83. <th>Name</th>
  84. <th>Type</th>
  85. <th>Breed</th>
  86. <th>sex</th>
  87. <th>pet photo</th>
  88. <th>Rabies certi</th>
  89. <th>Application photo</th>
  90. <th>Address Proof</th>
  91. <th class="text-center">Status</th>
  92. <th class="text-center text-center no-sort">Action</th>
  93. </tr>
  94. </theadclass="thead-dark">
  95. <tbody>
  96. <tr th:each="list, i : ${petlist}">
  97. <td th:text="${i.count}">0</td>
  98. <td class="text-center" th:text="${list.petname}"></td>
  99. <td th:text="${list.species}"></td>
  100. <td th:text="${list.breed}"></td>
  101. <td th:text="${list.gender}"></td>
  102. <!-- <td th:text="${list.gender}"></td>-->
  103. <td class="text-center">
  104. <button type="button"
  105. th:onclick="petimg([[${list.mobilenum}]],[[${list.uniqueid}]])"
  106. class="btn btn-primary">
  107. view
  108. </button>
  109. </td>
  110. <td class="text-center">
  111. <button type="button"
  112. th:onclick="certificateimg([[${list.mobilenum}]],[[${list.uniqueid}]])"
  113. class="btn btn-primary">
  114. view
  115. </button>
  116. </td>
  117. <td class="text-center">
  118. <button type="button"
  119. th:onclick="applicantimg([[${list.mobilenum}]],[[${list.uniqueid}]])"
  120. class="btn btn-primary">
  121. view
  122. </button>
  123. </td>
  124. <td class="text-center">
  125. <button type="button"
  126. th:onclick="proofimg([[${list.mobilenum}]],[[${list.uniqueid}]])"
  127. class="btn btn-primary">
  128. view
  129. </button>
  130. </td>
  131. <!--<td th:if="${list.status}"><span class="badge bg-success">Active</span></td>
  132. <td th:unless="${list.status}"><span class="badge bg-warning">InActive</span></td>-->
  133. <td>
  134. <p>
  135. <!-- <span class="badge bg-success" th:onclick="accept([[${list.uniqueid}]])">Accept</span> -->
  136. <span class="badge bg-warning" style="cursor: pointer;"
  137. th:onclick="reject([[${list.uniqueid}]])">pending</span>
  138. </p>
  139. </td>
  140. <td class="text-center">
  141. <a th:onclick="viewOwner( [[${list.mobilenum}]] );"
  142. data-bs-toggle="tooltip" data-bs-animation="true"
  143. data-bs-placement="top" title="View PetOwner info"><i
  144. class="fa-regular fa-user"
  145. style="font-size: 18px;cursor: pointer;"></i></a>
  146. </td>
  147. </tr>
  148. </tbody>
  149. <tfoot class="thead-dark">
  150. <tr>
  151. <th>S.No</th>
  152. <th>Name</th>
  153. <th>Type</th>
  154. <th>Breed</th>
  155. <th>sex</th>
  156. <th>pet photo</th>
  157. <th>Rabies certi</th>
  158. <th>Application photo</th>
  159. <th>Address Proof</th>
  160. <th class="text-center">Status</th>
  161. <th class="text-center text-center no-sort">Action</th>
  162. </tr>
  163. </tfoot>
  164. </table>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  175. <!-- Modal image -->
  176. <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterLabel"
  177. aria-hidden="true">
  178. <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
  179. <div class="modal-content">
  180. <div class="modal-header">
  181. <h5 class="modal-title" id="exampleModalCenterLabel">Photo</h5>
  182. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  183. aria-hidden="true">&times;</span></button>
  184. </div>
  185. <div class="modal-body">
  186. <img alt="" id="myImg" src="" style="width:100%">
  187. </div>
  188. <div class="modal-footer">
  189. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- end of modal image -->
  195. <!-- Pet Info Form -->
  196. <div class="modal fade" id="rejectForm" tabindex="-1" role="dialog" aria-labelledby="rejectFormCenterLabel"
  197. aria-hidden="true">
  198. <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
  199. <div class="modal-content">
  200. <form id="petform" onsubmit="return rejectsubmit();">
  201. <div class="modal-header">
  202. <h5 class="modal-title" id="rejectFormCenterLabel">Pet Information</h5>
  203. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  204. aria-hidden="true">&times;</span></button>
  205. </div>
  206. <div class="modal-body">
  207. <div class="row">
  208. <input type="hidden" class="form-control text-center" name="uniqid" id="uniqid" disabled />
  209. <input type="hidden" class="form-control text-center" name="Mobii" id="Mobii" disabled />
  210. <div class="col-xl-6 col-md-12"> <strong>Pet Name</strong>
  211. <p class="text-muted form-control showInputValue" id="petna"></p>
  212. </div>
  213. <div class="col-xl-6 col-md-12"> <strong>Pet Type</strong>
  214. <p class="text-muted form-control showInputValue" id="speci"></p>
  215. </div>
  216. <div class="col-xl-6 col-md-12"> <strong>Breed</strong>
  217. <p class="text-muted form-control showInputValue" id="bre"></p>
  218. </div>
  219. <div class="col-xl-6 col-md-12"> <strong>Sex</strong>
  220. <p class="text-muted form-control showInputValue" id="gend"></p>
  221. </div>
  222. <div class="col-xl-6 col-md-12"> <strong>Age</strong>
  223. <p class="text-muted form-control showInputValue" id="age"></p>
  224. </div>
  225. <div class="col-xl-6 col-md-12"> <strong>ARV Date</strong>
  226. <p class="text-muted form-control showInputValue" id="arvd"></p>
  227. </div>
  228. <div class="col-xl-6 col-md-12"> <strong>Last Date Of De-Worming</strong>
  229. <p class="text-muted form-control showInputValue" id="dewormdate"></p>
  230. </div>
  231. <div class="col-xl-6 col-md-12"> <strong>Other Vaccination Given</strong>
  232. <p class="text-muted form-control showInputValue" id="othervac"></p>
  233. </div>
  234. <div class="col-xl-6 col-md-12"> <strong>Previous License No</strong>
  235. <p class="text-muted form-control showInputValue" id="previoslicenseNo"></p>
  236. </div>
  237. <div class="col-xl-6 col-md-12"> <strong>Name of Veterinary doctor</strong>
  238. <p class="text-muted form-control showInputValue" id="VeterinaryConsultant"></p>
  239. </div>
  240. <div class="col-xl-6 col-md-12"> <strong>Veterinary Council Number</strong>
  241. <p class="text-muted form-control showInputValue" id="TNVCNo"></p>
  242. </div>
  243. <div class="col-xl-6 col-md-12"> <strong>Register Date</strong>
  244. <p class="text-muted form-control showInputValue" id="registerdate"></p>
  245. </div>
  246. <div class="col-xl-6 col-md-12">
  247. <label class="form-label" for="reason">Reason:<span class="text-danger"></span></label>
  248. <textarea class="form-control " name="reason" id="reason" required></textarea>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="modal-footer">
  253. <button type="button" class="btn btn-success" onclick="accept()">Accept</button>
  254. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  255. <button type="submit" class="btn btn-primary">Reject</button>
  256. </div>
  257. </form>
  258. </div>
  259. </div>
  260. </div>
  261. <!-- owner Info -->
  262. <div class="modal fade" id="ownerForm" tabindex="-1" role="dialog" aria-labelledby="ownerFormCenterLabel"
  263. aria-hidden="true">
  264. <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
  265. <div class="modal-content">
  266. <div class="modal-header">
  267. <h5 class="modal-title" id="ownerFormCenterLabel">Pet Owner information</h5>
  268. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  269. <span aria-hidden="true">&times;</span>
  270. </button>
  271. </div>
  272. <div class="modal-body">
  273. <div class="row">
  274. <!-- <input type="hidden" class="form-control text-center" name="uniqid" id="uniqid" disabled /> -->
  275. <div class="col-xl-6 col-md-12"> <strong>Tittle</strong>
  276. <p class="text-muted form-control showInputValue" id="title"></p>
  277. </div>
  278. <div class="col-xl-6 col-md-12"> <strong>Pet Owner Name</strong>
  279. <p class="text-muted form-control showInputValue" id="fname"></p>
  280. </div>
  281. <div class="col-xl-6 col-md-12"> <strong>Door No</strong>
  282. <p class="text-muted form-control showInputValue" id="doornumber"></p>
  283. </div>
  284. <div class="col-xl-6 col-md-12"> <strong>Street</strong>
  285. <p class="text-muted form-control showInputValue" id="street"></p>
  286. </div>
  287. <div class="col-xl-6 col-md-12"> <strong>Area</strong>
  288. <p class="text-muted form-control showInputValue" id="area"></p>
  289. </div>
  290. <div class="col-xl-6 col-md-12"> <strong>City</strong>
  291. <p class="text-muted form-control showInputValue" id="city"></p>
  292. </div>
  293. <div class="col-xl-6 col-md-12"> <strong>Pincode</strong>
  294. <p class="text-muted form-control showInputValue" id="pincode"></p>
  295. </div>
  296. <div class="col-xl-6 col-md-12"> <strong>Zone</strong>
  297. <p class="text-muted form-control showInputValue" id="zone"></p>
  298. </div>
  299. <div class="col-xl-6 col-md-12"> <strong>Ward</strong>
  300. <p class="text-muted form-control showInputValue" id="ward"></p>
  301. </div>
  302. <div class="col-xl-6 col-md-12"> <strong>Contact No</strong>
  303. <p class="text-muted form-control showInputValue" id="phone"></p>
  304. </div>
  305. <div class="col-xl-6 col-md-12"> <strong>Email Id</strong>
  306. <p class="text-muted form-control showInputValue" id="email"></p>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  314. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  315. <script type="text/javascript">
  316. $(document).ready(function () {
  317. // DataTables buttons configuration
  318. var buttons = [
  319. {
  320. extend: 'pageLength',
  321. className: 'btn btn-warning'
  322. },
  323. {
  324. title: 'Data export',
  325. extend: 'copyHtml5',
  326. text: 'Copy',
  327. className: 'btn btn-secondary',
  328. id: 'copyBtn'
  329. },
  330. {
  331. extend: 'excelHtml5',
  332. text: 'Excel',
  333. className: 'btn btn-secondary',
  334. id: 'excelBtn'
  335. },
  336. {
  337. extend: 'csvHtml5',
  338. text: 'CSV',
  339. className: 'btn btn-secondary',
  340. id: 'csvBtn'
  341. },
  342. {
  343. extend: 'pdfHtml5',
  344. text: 'PDF',
  345. className: 'btn btn-secondary',
  346. id: 'pdfBtn'
  347. },
  348. ];
  349. $('#assetDatatable').DataTable({
  350. dom: 'Bftip',
  351. columnDefs: [
  352. { targets: 'no-sort', orderable: false }
  353. ],
  354. lengthMenu: [
  355. [50, 100, 200, 500, -1],
  356. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  357. ],
  358. scrollY: '50vh',
  359. fixedColumns: {
  360. left: 1,
  361. right: 1
  362. },
  363. buttons: [buttons],
  364. responsive: true,
  365. searching: true,
  366. select: false,
  367. processing: false,
  368. });
  369. $('#searchInput').on('keyup', function () {
  370. dataTable.search(this.value).draw();
  371. });
  372. });
  373. function petimg(mobno, uniqueid) {
  374. alert(mobno + " "+uniqueid);
  375. $.ajax({
  376. type: "GET",
  377. url: '/api/petregistration/getpetimg',
  378. data: {
  379. 'mobno': mobno,
  380. 'uniqueid': uniqueid
  381. },
  382. success: function (x) {
  383. document.getElementById("myImg").src = "data:image/jpeg;base64," + x;
  384. }
  385. });
  386. $('#exampleModal').modal({
  387. backdrop: 'static',
  388. keyboard: false
  389. });
  390. $('#exampleModal').modal('show');
  391. return false;
  392. }
  393. function applicantimg(mobno, uniqueid) {
  394. $.ajax({
  395. type: "GET",
  396. url: '/api/petregistration/getapplicantimg',
  397. data: {
  398. 'mobno': mobno,
  399. 'uniqueid': uniqueid
  400. },
  401. success: function (x) {
  402. document.getElementById("myImg").src = "data:image/jpeg;base64," + x;
  403. }
  404. });
  405. //document.getElementById("myImg").src ="data:image/jpeg;base64,"+x.applicantphoto;
  406. $('#exampleModal').modal({
  407. backdrop: 'static',
  408. keyboard: false
  409. });
  410. $('#exampleModal').modal('show');
  411. }
  412. function certificateimg(mobno, uniqueid) {
  413. $.ajax({
  414. type: "GET",
  415. url: '/api/petregistration/getvaccineimg',
  416. data: {
  417. 'mobno': mobno,
  418. 'uniqueid': uniqueid
  419. },
  420. success: function (x) {
  421. document.getElementById("myImg").src = "data:image/jpeg;base64," + x;
  422. }
  423. });
  424. //document.getElementById("myImg").src ="data:image/jpeg;base64,"+x.rabiesvacCerti;
  425. $('#exampleModal').modal({
  426. backdrop: 'static',
  427. keyboard: false
  428. });
  429. $('#exampleModal').modal('show');
  430. }
  431. function proofimg(mobno, uniqueid) {
  432. $.ajax({
  433. type: "GET",
  434. url: '/api/petregistration/getaddressproofimg',
  435. data: {
  436. 'mobno': mobno,
  437. 'uniqueid': uniqueid
  438. },
  439. success: function (x) {
  440. document.getElementById("myImg").src = "data:image/jpeg;base64," + x;
  441. }
  442. });
  443. //document.getElementById("myImg").src ="data:image/jpeg;base64,"+x.addressproof;
  444. $('#exampleModal').modal({
  445. backdrop: 'static',
  446. keyboard: false
  447. });
  448. $('#exampleModal').modal('show');
  449. }
  450. function accept() {
  451. let id = document.getElementById("uniqid").value;
  452. let mobileNo = document.getElementById("Mobii").value;
  453. Swal.fire({
  454. title: 'Do you want to Accept this Pet ?',
  455. showDenyButton: true,
  456. showCancelButton: true,
  457. confirmButtonText: 'YES',
  458. denyButtonText: `NO`,
  459. }).then((result) => {
  460. /* Read more about isConfirmed, isDenied below */
  461. if (result.isConfirmed) {
  462. $.ajax({
  463. type: "GET",
  464. url: '/api/pet/accept',
  465. data: { 'id': id, 'mobileNo': mobileNo },
  466. success: function (bodyMessage) {
  467. if (bodyMessage == "success") {
  468. Swal.fire(
  469. 'Done',
  470. 'Successfully Accepted to the ID:' + id,
  471. 'success'
  472. ).then(() => {
  473. location.reload();
  474. });
  475. }
  476. }
  477. });
  478. } else if (result.isDenied) {
  479. Swal.fire('Changes are not saved', '', 'info')
  480. }
  481. })
  482. }
  483. function reject(uniqueid) {
  484. $.ajax({
  485. type: "GET",
  486. url: '/api/pet/getpetInfo',
  487. data: {
  488. 'petid': uniqueid
  489. },
  490. success: function (x) {
  491. showPetInfo(x)
  492. }
  493. });
  494. }
  495. function showPetInfo(list) {
  496. $('#rejectForm').modal({
  497. backdrop: 'static',
  498. keyboard: false
  499. });
  500. $('#rejectForm').modal('show');
  501. console.log(list);
  502. document.getElementById("Mobii").value = list.mobilenum;
  503. document.getElementById("uniqid").value = list.uniqueid;
  504. document.getElementById("petna").innerHTML = list.petname;
  505. document.getElementById("speci").innerHTML = list.species;
  506. document.getElementById("bre").innerHTML = list.breed;
  507. document.getElementById("gend").innerHTML = list.gender;
  508. document.getElementById("age").innerHTML = list.age;
  509. document.getElementById("arvd").innerHTML = list.arvdate;
  510. document.getElementById("dewormdate").innerHTML = list.dewormdate;
  511. document.getElementById("othervac").innerHTML = list.othervac;
  512. document.getElementById("previoslicenseNo").innerHTML = list.previoslicenseNo;
  513. document.getElementById("VeterinaryConsultant").innerHTML = list.veterinaryConsultant;
  514. document.getElementById("TNVCNo").innerHTML = list.tnvcno;
  515. document.getElementById("registerdate").innerHTML = list.registerdate;
  516. }
  517. function rejectsubmit() {
  518. var reason = $("#reason").val();
  519. var id = $("#uniqid").val();
  520. var mobileNo = $("#Mobii").val();
  521. // alert(reason+" "+id+" "+mobileNo);
  522. Swal.fire({
  523. title: 'Do you want to Reject this Pet ?',
  524. showDenyButton: true,
  525. showCancelButton: true,
  526. confirmButtonText: 'YES',
  527. denyButtonText: `NO`,
  528. }).then((result) => {
  529. /* Read more about isConfirmed, isDenied below */
  530. if (result.isConfirmed) {
  531. $.ajax({
  532. type: "GET",
  533. url: '/api/pet/reject',
  534. data: { 'id': id, 'reason': reason, 'mobileNo': mobileNo },
  535. success: function (bodyMessage) {
  536. if (bodyMessage == "success") {
  537. console.log("done");
  538. Swal.fire(
  539. 'Done',
  540. 'Successfully Rejected to the ID:' + id,
  541. 'success'
  542. ).then(() => {
  543. location.reload();
  544. });
  545. }
  546. }
  547. });
  548. } else if (result.isDenied) {
  549. Swal.fire('Changes are not saved', '', 'info')
  550. }
  551. })
  552. return false;
  553. }
  554. function viewOwner(mobilenum) {
  555. let own;
  556. $.ajax({
  557. type: "GET",
  558. url: '/api/pet/getpetOwner',
  559. data: { 'mobilenum': mobilenum },
  560. success: function (bodyMessage) {
  561. ownercall(bodyMessage);
  562. }
  563. });
  564. }
  565. function ownercall(list) {
  566. $('#ownerForm').modal({
  567. backdrop: 'static',
  568. keyboard: false
  569. });
  570. $('#ownerForm').modal('show');
  571. document.getElementById("title").innerHTML = list.title;
  572. document.getElementById("fname").innerHTML = list.fname;
  573. document.getElementById("doornumber").innerHTML = list.doornumber;
  574. document.getElementById("street").innerHTML = list.street;
  575. document.getElementById("area").innerHTML = list.area;
  576. document.getElementById("city").innerHTML = list.city;
  577. document.getElementById("pincode").innerHTML = list.pincode;
  578. document.getElementById("zone").innerHTML = list.zone;
  579. document.getElementById("ward").innerHTML = list.ward;
  580. document.getElementById("phone").innerHTML = list.phone;
  581. document.getElementById("email").innerHTML = list.email;
  582. document.getElementById("pancard").innerHTML = list.pancard;
  583. document.getElementById("aadhar").innerHTML = list.aadhar;
  584. document.getElementById("voterid").innerHTML = list.voterid;
  585. }
  586. // Function to call modal for New pet registration
  587. callAdd = function () {
  588. $('#addForm').modal({
  589. backdrop: 'static',
  590. keyboard: false
  591. })
  592. $('#addForm').modal('show');
  593. }
  594. // $(document).ready(function () {
  595. // var today = new Date();
  596. // $('.datepicker').datepicker({
  597. // dateFormat: 'yy-mm-dd',
  598. // maxDate: '1'
  599. // })
  600. // $('.datepicker').keyup(function () {
  601. // if (this.value.match(/[^0-9]/g)) {
  602. // this.value = this.value.replace(/[^0-9^-]/g, '');
  603. // }
  604. // });
  605. // });
  606. function getbydate() {
  607. var x = document.getElementById("fromdate").value;
  608. var y = document.getElementById("todate").value;
  609. var url = '/petregistration/requestlist?fromDate=' + x + '&toDate=' + y;
  610. window.location.href = url;
  611. }
  612. function resetDate() {
  613. var url = '/petregistration/requestlist';
  614. window.location.href = url;
  615. }
  616. </script>
  617. </body>
  618. </html>