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.

256 lines
12 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. <link rel="stylesheet" type="text/css" href="/assets/node_modules/jquery.datetimepicker/jquery.datetimepicker.min.css"/ >
  7. <!--[if lt IE 8]>
  8. <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>
  9. <![endif]-->
  10. <div class="wrapper">
  11. <!-- header top menu Start -->
  12. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  13. <!-- header top menu end -->
  14. <div class="page-wrap">
  15. <!--=============== Left Menu side Start ================-->
  16. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  17. <!--=============== Left side End ================-->
  18. <div class="main-content">
  19. <div class="container-fluid">
  20. <div class="page-header">
  21. <div class="row align-items-end">
  22. <div class="col-lg-8">
  23. <div class="page-header-title">
  24. <i class="far fa-calendar-plus bg-blue"></i>
  25. <div class="d-inline">
  26. <h5>Create Request</h5>
  27. <span>1913 Tax Collection Module</span>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="col-lg-4">
  32. <nav class="breadcrumb-container" aria-label="breadcrumb">
  33. <ol class="breadcrumb">
  34. <li class="breadcrumb-item">
  35. <a href="index"><i class="ik ik-home"></i></a>
  36. </li>
  37. <li class="breadcrumb-item" aria-current="page">1913 Tax Collection</li>
  38. <li class="breadcrumb-item active" aria-current="page">Dashboard</li>
  39. </ol>
  40. </nav>
  41. </div>
  42. </div>
  43. </div>
  44. <hr>
  45. <div class="row">
  46. <div class="col-md-6">
  47. <div class="card">
  48. <form class="forms-sample">
  49. <div class="card-header"><h3>Request Form</h3></div>
  50. <div class="card-body">
  51. <div class="form-group">
  52. <label for="exampleInputPassword1">Name</label>
  53. <input type="text" class="form-control" name="name" id="name" placeholder="Name" required>
  54. </div>
  55. <div class="row">
  56. <div class="col-md-6">
  57. <label for="exampleInputEmail1">Property tax number</label>
  58. <div class="form-group input-group input-group-button">
  59. <input type="text" class="form-control" id="ptax" placeholder="00-000-00000-000" required>
  60. <div class="input-group-append">
  61. <button class="btn btn-primary" type="button" id="ptaxsearchbtn" onclick="displayPtaxInfo();return false;"><i class="ik ik-search"></i></button>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="col-md-6">
  66. <div class="form-group">
  67. <label for="exampleInputUsername1">Mobile Number</label>
  68. <input type="text" class="form-control" id="mobileno" placeholder="Enter your 10-digit mobile number" required>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row">
  73. <div class="col-md-6">
  74. <div class="form-group">
  75. <label for="exampleInputEmail3">Availability Date & Time</label>
  76. <input type="text" class="form-control" id="datetimepicker">
  77. </div>
  78. </div>
  79. <div class="col-md-6">
  80. <div class="form-group">
  81. <label for="exampleSelectGender">User Type</label>
  82. <select class="form-control" id="exampleSelectGender">
  83. <option>Senior citizen</option>
  84. <option>Disability</option>
  85. </select>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="card-footer text-right">
  91. <button type="reset" class="btn btn-light mr-2">Cancel</button>
  92. <button type="submit" class="btn btn-primary">Submit</button>
  93. </div>
  94. </form>
  95. </div>
  96. </div>
  97. <div class="col-md-6">
  98. <div class="card">
  99. <div class="card-header"><h3>Property tax Information</h3></div>
  100. <div class="card-body" id="ptaxPersonalInfo">
  101. </div>
  102. </div>
  103. </div>
  104. <div class="card">
  105. <div class="card-block">
  106. <div class="d-flex">
  107. <h4 class="card-title">Today tax collection request list</h4>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  115. </div>
  116. </div>
  117. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  118. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  119. <script src="/assets/node_modules/jquery.mask/1.14.16/jquery.mask.min.js"></script>
  120. <script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
  121. <script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
  122. <script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
  123. <script src="/assets/node_modules/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
  124. <script>
  125. $(document).ready(function() {
  126. // Input masking for the desired format
  127. $('#ptax').mask('00-000-00000-000');
  128. $('#mobileno').mask('0000000000');
  129. // For datetime picker
  130. jQuery('#datetimepicker').datetimepicker({
  131. minTime:'10:00',
  132. maxTime:'18:01',
  133. minDate: 0, // Today
  134. //minDate:'-1970/01/2',
  135. //maxDate:'+1970/01/2',
  136. //timepicker:false, // Disable time picker
  137. mask:true,
  138. disabledWeekDays:[0], //[0,1,2,3,4,5,6] -> 0-Sunday .... 6-saturday
  139. weekends:['2023/08/10','2023/08/11','2023/08/12'], // Disable date on holidays
  140. // Disable all weekends
  141. onGenerate:function( ct ){
  142. jQuery(this).find('.xdsoft_date.xdsoft_weekend')
  143. .addClass('xdsoft_disabled');
  144. }
  145. });
  146. });
  147. function displayPtaxInfo(ptax){
  148. var inputElement = $('#ptax');
  149. inputElement.removeClass('is-invalid');
  150. // Disable the button to prevent multiple clicks
  151. $("#ptaxsearchbtn").prop("disabled", true);
  152. // Show the loading icon on the button
  153. $("#ptaxsearchbtn").html('<i class="fas fa-spinner fa-spin"></i>');
  154. var ptax = inputElement.val();
  155. var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000';
  156. // Check if the tax value is not null and follows the format
  157. if (ptax !== null && formatRegex.test(ptax)) {
  158. console.log('ptax value is valid:', ptax);
  159. // Check if the tax value has the correct length as per the format (15 characters)
  160. if (ptax.length === 16) {
  161. console.log('ptax value length is correct.');
  162. getPtaxInfo(ptax);
  163. } else {
  164. console.log('ptax value length is incorrect.');
  165. inputElement.addClass('is-invalid');
  166. $("#ptaxsearchbtn").prop("disabled", false);
  167. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  168. }
  169. } else {
  170. console.log('ptax value is not valid or null.');
  171. inputElement.addClass('is-invalid'); //Error
  172. $("#ptaxsearchbtn").prop("disabled", false);
  173. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  174. }
  175. }
  176. function getPtaxInfo(ptax){
  177. //var ptax = '04-042-03251-000';
  178. var apiUrl = '/taxcollection/api/getPropertTaxPersonalDetails?ptax='+ptax;
  179. $.ajax({
  180. url: apiUrl,
  181. type: 'GET',
  182. dataType: 'json',
  183. success: function(jsonResponse) {
  184. // Handle the API response data here
  185. console.log('Data from API:', jsonResponse);
  186. // Parse the JSON response into a JavaScript object
  187. var data = jsonResponse;
  188. // Access the values
  189. var owner = data.PROPTAX[0].Owner;
  190. var address = data.PROPTAX[0].Address;
  191. //var famCardNo = data.PROPTAX[0].Fam_Card_No;
  192. var mobNo = data.PROPTAX[0].Mob_No;
  193. var email = data.PROPTAX[0].Email_ID;
  194. // HTML content
  195. var ptaxPersonalinfoHtml = '<table class="table table-borderless">' +
  196. ' <tbody>' +
  197. ' <tr>' +
  198. ' <td>Property tax number</td>' +
  199. ' <td class="font-medium">'+ptax+'</td>' +
  200. ' </tr>' +
  201. ' <tr>' +
  202. ' <td>Owner Name</td>' +
  203. ' <td class="font-medium">'+owner+'</td>' +
  204. ' </tr>' +
  205. ' <tr>' +
  206. ' <td>Address</td>' +
  207. ' <td class="font-medium">'+address+'</td>' +
  208. ' </tr>' +
  209. ' <tr>' +
  210. ' <td>Mobile No</td>' +
  211. ' <td class="font-medium">'+mobNo+'</td>' +
  212. ' </tr>' +
  213. ' </tbody>' +
  214. '</table>';
  215. $("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml);
  216. // Enable the button
  217. $("#ptaxsearchbtn").prop("disabled", false);
  218. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  219. },
  220. error: function(xhr, status, error) {
  221. // Handle errors here
  222. console.error('Error fetching data:', status, error);
  223. // Enable the button
  224. $("#ptaxsearchbtn").prop("disabled", false);
  225. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  226. }
  227. });
  228. }
  229. </script>
  230. </body>
  231. </html>