This portal only for GCC Officers. Based on there roles and Group ID they can view there module`s Like PGR, QR Public Asset Feedback, Makkalai Thedi Mayor,etc...
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.

874 lines
39 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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="node_modules/jquery.datetimepicker/jquery.datetimepicker.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">Create Request</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="request-form" id="request-form" onsubmit="return saveRequest();">
  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" autocomplete="off" 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" autocomplete="off" required>
  60. <div class="input-group-append">
  61. <button class="btn btn-primary" type="button" id="ptaxsearchbtn" autocomplete="off" 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" autocomplete="off" 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="availabilitydate">Availability Date & Time</label>
  76. <input type="text" class="form-control" name="availabilitydate" id="availabilitydate" placeholder="Year/Month/date Hours:Minutes" autocomplete="off" required>
  77. </div>
  78. </div>
  79. <div class="col-md-6">
  80. <div class="form-group">
  81. <label for="usertype">User Type</label>
  82. <select class="form-control" name="usertype" id="usertype" required>
  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-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>
  92. <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</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. <table id="requestDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
  111. <thead class="thead-dark">
  112. <tr role="row">
  113. <th class="text-center no-sort" width="1%">S.No</th>
  114. <th class="text-center" width="20%">Name</th>
  115. <th class="text-center" width="20%">Property tax number</th>
  116. <th class="text-center" width="20%">Mobile Number</th>
  117. <th class="text-center" width="20%">Availability Date</th>
  118. <th class="text-center" width="20%">User Type</th>
  119. <th class="text-center" width="20%">Status</th>
  120. <th class="text-center no-sort" style="width:50px;">Action</th>
  121. </tr>
  122. </theadclass="thead-dark">
  123. <tbody>
  124. <tr th:each="taxCollectionRequestList, i : ${taxCollectionRequestEntities}" class="taxCollectionRequestList text-capitalize">
  125. <td th:text="${i.count}">0</td>
  126. <td th:text="${taxCollectionRequestList.name}"></td>
  127. <td th:text="${taxCollectionRequestList.ptax}"></td>
  128. <td th:text="${taxCollectionRequestList.mobile}"></td>
  129. <td th:text="${taxCollectionRequestList.availabilitydate}"></td>
  130. <td th:text="${taxCollectionRequestList.usertype}"></td>
  131. <td>
  132. <a th:href="@{#}" th:text="${taxCollectionRequestList.status}" th:classappend="${taxCollectionRequestList.status == 'open'} ? 'badge badge-success mb-1' : 'badge badge-secondary mb-1'" th:onclick="return callStatusUpdate([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="Update Current Status" data-original-title="Update Current Status"></a>
  133. </td>
  134. <td class="text-center">
  135. <a th:href="@{#}" th:onclick="return callView([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="View Request Details" data-original-title="View Request Details"><i class="ik ik-eye f-16 text-blue"></i></a>&nbsp;&nbsp;
  136. </td>
  137. </tr>
  138. </tbody>
  139. <tfoot class="thead-dark">
  140. <tr>
  141. <th class="text-center">S.No</th>
  142. <th class="text-center">Name</th>
  143. <th class="text-center">Property tax number</th>
  144. <th class="text-center">Mobile Number</th>
  145. <th class="text-center">Availability Date</th>
  146. <th class="text-center">User Type</th>
  147. <th class="text-center">Status</th>
  148. <th class="text-center">Action</th>
  149. </tr>
  150. </tfoot>
  151. </table>
  152. </div>
  153. </div>
  154. </div>
  155. <img src="/images/userimg/my.jpeg">
  156. </div>
  157. </div>
  158. </div>
  159. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  160. </div>
  161. </div>
  162. <div class="modal fade" id="taxCollectionRequestView" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true">
  163. <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
  164. <div class="modal-content">
  165. <div class="modal-header">
  166. <h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Details</h5>
  167. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  168. </div>
  169. <div class="modal-body">
  170. <div class="row">
  171. <div class="col-xl-6 col-md-6" id="requestDetails">
  172. </div>
  173. <div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="pTaxdetails">
  174. &nbsp;
  175. </div>
  176. </div>
  177. </div>
  178. <div class="modal-footer">
  179. <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="modal fade" id="taxCollectionRequestUpdate" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true">
  185. <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
  186. <div class="modal-content">
  187. <div class="modal-header">
  188. <h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Status Update Form</h5>
  189. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  190. </div>
  191. <div class="modal-body">
  192. <div class="row">
  193. <div class="col-xl-6 col-md-6" id="requestDetailsUpdate">
  194. </div>
  195. <div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="statusUpdateForm">
  196. &nbsp;
  197. </div>
  198. <div class="card table-card mb-0">
  199. <h5 class="text-warning pl-10 text-center">Status History</h5>
  200. <div class="card-block pb-0">
  201. <div class="table-responsive">
  202. <table class="table table-hover mb-0">
  203. <thead>
  204. <tr>
  205. <th>Company</th>
  206. <th>Start Date</th>
  207. <th>End Date</th>
  208. <th>Status</th>
  209. </tr>
  210. </thead>
  211. <tbody>
  212. <tr>
  213. <td>Apple Company</td>
  214. <td>23/05/2017</td>
  215. <td>04/08/2018</td>
  216. <td><label class="badge badge-success">Paid</label></td>
  217. </tr>
  218. </tbody>
  219. </table>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="modal-footer">
  226. <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  232. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  233. <script src="node_modules/jquery.mask/1.14.16/jquery.mask.min.js"></script>
  234. <script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
  235. <script src="node_modules/amcharts3/amcharts/serial.js"></script>
  236. <script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
  237. <script src="node_modules/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
  238. <script th:inline="javascript">
  239. var loginUserID = /*[[${LoginUserId}]]*/'';
  240. $(document).ready(function() {
  241. // Input masking for the desired format
  242. $('#ptax').mask('00-000-00000-000');
  243. $('#mobileno').mask('0000000000');
  244. // For datetime picker
  245. jQuery('#availabilitydate').datetimepicker({
  246. minTime:'10:00',
  247. maxTime:'18:01',
  248. minDate: 0, // Today
  249. //minDate:'-1970/01/2',
  250. //maxDate:'+1970/01/2',
  251. //timepicker:false, // Disable time picker
  252. mask:false,
  253. disabledWeekDays:[0], //[0,1,2,3,4,5,6] -> 0-Sunday .... 6-saturday
  254. disabledDates:['2023/08/31','2023/08/11','2023/08/12'], // Disable date on holidays
  255. /*
  256. // Disable all weekends
  257. onGenerate:function( ct ){
  258. jQuery(this).find('.xdsoft_date.xdsoft_weekend')
  259. .addClass('xdsoft_disabled');
  260. }
  261. */
  262. });
  263. });
  264. function displayPtaxInfo(ptax){
  265. var inputElement = $('#ptax');
  266. inputElement.removeClass('is-invalid');
  267. // Disable the button to prevent multiple clicks
  268. $("#ptaxsearchbtn").prop("disabled", true);
  269. // Show the loading icon on the button
  270. $("#ptaxsearchbtn").html('<i class="fas fa-spinner fa-spin"></i>');
  271. var ptax = inputElement.val();
  272. var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000';
  273. // Check if the tax value is not null and follows the format
  274. if (ptax !== null && formatRegex.test(ptax)) {
  275. console.log('ptax value is valid:', ptax);
  276. // Check if the tax value has the correct length as per the format (15 characters)
  277. if (ptax.length === 16) {
  278. console.log('ptax value length is correct.');
  279. getPtaxInfo(ptax);
  280. } else {
  281. console.log('ptax value length is incorrect.');
  282. inputElement.addClass('is-invalid');
  283. $("#ptaxsearchbtn").prop("disabled", false);
  284. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  285. }
  286. } else {
  287. console.log('ptax value is not valid or null.');
  288. inputElement.addClass('is-invalid'); //Error
  289. $("#ptaxsearchbtn").prop("disabled", false);
  290. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  291. }
  292. }
  293. function getPtaxInfo(ptax){
  294. call_loading('ptaxPersonalInfo','start');
  295. //var ptax = '04-042-03251-000';
  296. var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
  297. $.ajax({
  298. url: apiUrl,
  299. type: 'GET',
  300. dataType: 'json',
  301. success: function(jsonResponse) {
  302. // Handle the API response data here
  303. console.log('Data from API:', jsonResponse);
  304. // Parse the JSON response into a JavaScript object
  305. var data = jsonResponse;
  306. if(data.ResultStatus=="False")
  307. {
  308. $("#ptaxPersonalInfo").html("<center>"+nodata(data.Message)+"</center>");
  309. $("#ptaxsearchbtn").prop("disabled", false);
  310. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  311. }
  312. else{
  313. // Access the values
  314. var owner = data.PROPTAX[0].Owner;
  315. var address = data.PROPTAX[0].Address;
  316. //var famCardNo = data.PROPTAX[0].Fam_Card_No;
  317. var mobNo = data.PROPTAX[0].Mob_No;
  318. var email = data.PROPTAX[0].Email_ID;
  319. // HTML content
  320. var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
  321. ' <tbody>' +
  322. ' <tr>' +
  323. ' <td>Property tax number</td>' +
  324. ' <td class="font-medium">'+ptax+'</td>' +
  325. ' </tr>' +
  326. ' <tr>' +
  327. ' <td>Owner Name</td>' +
  328. ' <td class="font-medium">'+owner+'</td>' +
  329. ' </tr>' +
  330. ' <tr>' +
  331. ' <td>Address</td>' +
  332. ' <td class="font-medium">'+address+'</td>' +
  333. ' </tr>' +
  334. ' <tr>' +
  335. ' <td>Mobile No</td>' +
  336. ' <td class="font-medium">'+mobNo+'</td>' +
  337. ' </tr>' +
  338. ' </tbody>' +
  339. '</table>';
  340. $("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml);
  341. // Enable the button
  342. $("#ptaxsearchbtn").prop("disabled", false);
  343. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  344. }
  345. },
  346. error: function(xhr, status, error) {
  347. // Handle errors here
  348. console.error('Error fetching data:', status, error);
  349. // Enable the button
  350. $("#ptaxsearchbtn").prop("disabled", false);
  351. $("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
  352. }
  353. });
  354. }
  355. function saveRequest(){
  356. // Disable the button to prevent multiple clicks
  357. $("#requestSubmitBtn").prop("disabled", true);
  358. // Show the loading icon on the button
  359. $("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Validating your request, please wait...');
  360. var name = $('#name').val();
  361. var inputElement = $('#ptax');
  362. var ptax = inputElement.val();
  363. var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000';
  364. inputElement.removeClass('is-invalid');
  365. var inputElementMobileNo = $('#mobileno');
  366. var mobileNo = inputElementMobileNo.val();
  367. var mobileFormatRegex = /^\d{10}$/; //'0000000000';
  368. inputElementMobileNo.removeClass('is-invalid');
  369. var inputElementUsertype = $('#usertype');
  370. var usertype = inputElementUsertype.val();
  371. //inputElementUsertype.removeClass('is-invalid');
  372. var inputElementAvailabilityDate = $('#availabilitydate');
  373. var availabilitydate = inputElementAvailabilityDate.val();
  374. var selectedDateTime = new Date(availabilitydate);
  375. var currentDateTime = new Date();
  376. if (selectedDateTime < currentDateTime) {
  377. alert('Selected date and time must be greater than or equal to the current date and time.');
  378. inputElementAvailabilityDate.addClass('is-invalid');
  379. $("#requestSubmitBtn").prop("disabled", false);
  380. $("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
  381. return false; // Prevent form submission
  382. }
  383. var formData = new FormData();
  384. // Check if the tax value is not null and follows the format
  385. if (ptax !== null && formatRegex.test(ptax) && ptax.length == 16) {
  386. // Mobile number Check
  387. if (mobileNo !== null && mobileFormatRegex.test(mobileNo) && mobileNo.length == 10) {
  388. $("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Submitting your request, please wait...');
  389. formData.append('name',name);
  390. formData.append('ptax', ptax );
  391. formData.append('mobile', mobileNo );
  392. formData.append('usertype', usertype );
  393. formData.append('availabilitydate', availabilitydate);
  394. formData.append('created_by', loginUserID);
  395. submitSaveRequest(formData);
  396. $("#requestSubmitBtn").html('Your request has been successfully submitted!');
  397. } else {
  398. inputElementMobileNo.addClass('is-invalid');
  399. $("#requestSubmitBtn").prop("disabled", false);
  400. $("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
  401. }
  402. } else {
  403. console.log('ptax value is not valid or null.');
  404. inputElement.addClass('is-invalid'); //Error
  405. $("#requestSubmitBtn").prop("disabled", false);
  406. $("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
  407. }
  408. return false;
  409. }
  410. function submitSaveRequest(formData){
  411. $.ajax({
  412. type: "POST",
  413. url: '/gcc/api/taxcollection/saveTaxCollectionRequest',
  414. data: formData,
  415. contentType: false,
  416. processData: false,
  417. }).done(function(response) {
  418. Swal.fire(
  419. 'Complaint Status Update!',
  420. 'Complaint closed Successfully!',
  421. 'success'
  422. ).then(() => {
  423. location.reload();
  424. });
  425. }).fail(function(jqXHR, textStatus, errorThrown) {
  426. $("#requestSubmitBtn").prop("disabled", false);
  427. // Log the error and any relevant information
  428. console.error("Error sending request: " + textStatus + " " + errorThrown);
  429. });
  430. }
  431. </script>
  432. <script>
  433. $(document).ready(function() {
  434. // DataTables buttons configuration
  435. var buttons = [
  436. {
  437. extend: 'pageLength',
  438. className: 'btn btn-warning'
  439. },
  440. {
  441. title: 'Data export',
  442. extend: 'copyHtml5',
  443. text: 'Copy',
  444. className: 'btn btn-secondary',
  445. id: 'copyBtn'
  446. },
  447. {
  448. extend: 'excelHtml5',
  449. text: 'Excel',
  450. className: 'btn btn-secondary',
  451. id: 'excelBtn'
  452. },
  453. {
  454. extend: 'csvHtml5',
  455. text: 'CSV',
  456. className: 'btn btn-secondary',
  457. id: 'csvBtn'
  458. },
  459. {
  460. extend: 'pdfHtml5',
  461. text: 'PDF',
  462. className: 'btn btn-secondary',
  463. id: 'pdfBtn'
  464. },
  465. ];
  466. $('#requestDatatable').DataTable( {
  467. dom: 'Bftip',
  468. columnDefs: [
  469. { targets: 'no-sort', orderable: false }
  470. ],
  471. lengthMenu: [
  472. [ 50, 100, 200, 500, -1 ],
  473. [ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
  474. ],
  475. scrollY: '50vh',
  476. fixedColumns: {
  477. left: 1,
  478. right: 1
  479. },
  480. buttons: [buttons],
  481. fixedHeader: true,
  482. autoWidth: true,
  483. responsive: true,
  484. searching: false,
  485. select: false,
  486. processing: false,
  487. } );
  488. } );
  489. function callView(request_id){
  490. $('#taxCollectionRequestView').modal({
  491. backdrop: 'static',
  492. keyboard: false
  493. })
  494. $('#taxCollectionRequestView').modal('show');
  495. call_loading('requestDetails','start');
  496. getTaxCollectionRequestDetails(request_id);
  497. call_loading('pTaxdetails','start');
  498. return false;
  499. }
  500. function getTaxCollectionRequestDetails(request_id){
  501. var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
  502. $.ajax({
  503. url: apiUrl,
  504. type: 'GET',
  505. dataType: 'json',
  506. success: function(jsonResponse) {
  507. // Handle the API response data here
  508. console.log('Data from API:', jsonResponse);
  509. // Parse the JSON response into a JavaScript object
  510. var data = jsonResponse;
  511. // Access the values
  512. var request_id = data.request_id;
  513. var requestNo = data.requestNo;
  514. var name = data.name;
  515. var mobile = data.mobile;
  516. var ptax = data.ptax;
  517. var usertype = data.usertype;
  518. var availabilitydate = data.availabilitydate;
  519. var status = data.status;
  520. var cdate = data.cDate;
  521. // HTML content
  522. var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
  523. ' <tbody>' +
  524. ' <tr>' +
  525. ' <td>Name</td>' +
  526. ' <td class="font-medium">'+name+'</td>' +
  527. ' </tr>' +
  528. ' <tr>' +
  529. ' <td>Property tax number</td>' +
  530. ' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' +
  531. ' </tr>' +
  532. ' <tr>' +
  533. ' <td>Mobile Number</td>' +
  534. ' <td class="font-medium">'+mobile+'</td>' +
  535. ' </tr>' +
  536. ' <tr>' +
  537. ' <td>Availability Date & Time</td>' +
  538. ' <td class="font-medium">'+availabilitydate+'</td>' +
  539. ' </tr>' +
  540. ' <tr>' +
  541. ' <td>User Type</td>' +
  542. ' <td class="font-medium">'+usertype+'</td>' +
  543. ' </tr>' +
  544. ' <tr>' +
  545. ' <td>Current Status</td>' +
  546. ' <td class="font-medium">'+status+'</td>' +
  547. ' </tr>' +
  548. ' <tr>' +
  549. ' <td>Request Created On</td>' +
  550. ' <td class="font-medium">'+cdate+'</td>' +
  551. ' </tr>' +
  552. ' </tbody>' +
  553. '</table>';
  554. $("#requestDetails").html(ptaxPersonalinfoHtml);
  555. getpTaxDetails(ptax);
  556. },
  557. error: function(xhr, status, error) {
  558. // Handle errors here
  559. console.error('Error fetching collection reqtest data:', status, error);
  560. }
  561. });
  562. }
  563. function getpTaxDetails(ptax){
  564. var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
  565. $.ajax({
  566. url: apiUrl,
  567. type: 'GET',
  568. dataType: 'json',
  569. success: function(jsonResponse) {
  570. // Handle the API response data here
  571. console.log('Data from API:', jsonResponse);
  572. // Parse the JSON response into a JavaScript object
  573. var data = jsonResponse;
  574. if (data.ResultStatus === "True") {
  575. // Access the values
  576. var owner = data.PROPTAX[0].Owner;
  577. var address = data.PROPTAX[0].Address;
  578. var mobNo = data.PROPTAX[0].Mob_No;
  579. var email = data.PROPTAX[0].Email_ID;
  580. // HTML content
  581. var ptaxPersonalinfoHtml = '<table class="table table-borderless">' +
  582. ' <tbody>' +
  583. ' <tr>' +
  584. ' <td>Property tax number</td>' +
  585. ' <td class="font-medium">'+ptax+'</td>' +
  586. ' </tr>' +
  587. ' <tr>' +
  588. ' <td>Owner Name</td>' +
  589. ' <td class="font-medium">'+owner+'</td>' +
  590. ' </tr>' +
  591. ' <tr>' +
  592. ' <td>Address</td>' +
  593. ' <td class="font-medium">'+address+'</td>' +
  594. ' </tr>' +
  595. ' <tr>' +
  596. ' <td>Mobile No</td>' +
  597. ' <td class="font-medium">'+mobNo+'</td>' +
  598. ' </tr>' +
  599. ' </tbody>' +
  600. '</table>';
  601. $("#pTaxdetails").html(ptaxPersonalinfoHtml);
  602. // if Ptax data fetched then load valid message
  603. var validPtax = ptax+'&nbsp;<font class="custom-tooltip-success"><a href="#" class="text-success" onclick="return false;" data-container=".custom-tooltip-success" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify success" data-original-title="Property tax number cross-verify success"><i class="ik ik-check-circle"></i></font>';
  604. $("#pTaxVerification").html(validPtax);
  605. }
  606. else {
  607. // No data found
  608. console.log("Message: " + data.Message);
  609. var inValidPtax = ptax+'&nbsp;<font class="custom-tooltip-warning"><a href="#" class="text-warning" onclick="return false;" data-container=".custom-tooltip-warning" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify failed" data-original-title="Property tax number cross-verify failed"><i class="ik ik-alert-triangle"></i></font>';
  610. $("#pTaxVerification").html(inValidPtax);
  611. $("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
  612. }
  613. // Enable tooltip for model page
  614. $('[data-toggle="tooltip"]').tooltip();
  615. },
  616. error: function(xhr, status, error) {
  617. // Handle errors here
  618. console.error('Error fetching pTax data:', status, error);
  619. }
  620. });
  621. }
  622. function callStatusUpdate(request_id){
  623. $('#taxCollectionRequestUpdate').modal({
  624. backdrop: 'static',
  625. keyboard: false
  626. })
  627. $('#taxCollectionRequestUpdate').modal('show');
  628. call_loading('requestDetailsUpdate','start');
  629. getTaxCollectionRequestUpdate(request_id);
  630. call_loading('statusUpdateForm','start');
  631. return false;
  632. }
  633. function getTaxCollectionRequestUpdate(request_id){
  634. var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
  635. $.ajax({
  636. url: apiUrl,
  637. type: 'GET',
  638. dataType: 'json',
  639. success: function(jsonResponse) {
  640. // Handle the API response data here
  641. console.log('Data from API:', jsonResponse);
  642. // Parse the JSON response into a JavaScript object
  643. var data = jsonResponse;
  644. // Access the values
  645. var request_id = data.request_id;
  646. var requestNo = data.requestNo;
  647. var name = data.name;
  648. var mobile = data.mobile;
  649. var ptax = data.ptax;
  650. var usertype = data.usertype;
  651. var availabilitydate = data.availabilitydate;
  652. var status = data.status;
  653. var cdate = data.cDate;
  654. // HTML content
  655. var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
  656. ' <tbody>' +
  657. ' <tr>' +
  658. ' <td>Name</td>' +
  659. ' <td class="font-medium">'+name+'</td>' +
  660. ' </tr>' +
  661. ' <tr>' +
  662. ' <td>Property tax number</td>' +
  663. ' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' +
  664. ' </tr>' +
  665. ' <tr>' +
  666. ' <td>Mobile Number</td>' +
  667. ' <td class="font-medium">'+mobile+'</td>' +
  668. ' </tr>' +
  669. ' <tr>' +
  670. ' <td>Availability Date & Time</td>' +
  671. ' <td class="font-medium">'+availabilitydate+'</td>' +
  672. ' </tr>' +
  673. ' <tr>' +
  674. ' <td>User Type</td>' +
  675. ' <td class="font-medium">'+usertype+'</td>' +
  676. ' </tr>' +
  677. ' <tr>' +
  678. ' <td>Current Status</td>' +
  679. ' <td class="font-medium">'+status+'</td>' +
  680. ' </tr>' +
  681. ' <tr>' +
  682. ' <td>Request Created On</td>' +
  683. ' <td class="font-medium">'+cdate+'</td>' +
  684. ' </tr>' +
  685. ' </tbody>' +
  686. '</table>';
  687. $("#requestDetailsUpdate").html(ptaxPersonalinfoHtml);
  688. showStatusUpdateForm(request_id, status);
  689. },
  690. error: function(xhr, status, error) {
  691. // Handle errors here
  692. console.error('Error fetching collection reqtest data:', status, error);
  693. }
  694. });
  695. }
  696. function showStatusUpdateForm(request_id, status){
  697. var selectInput = `<select class="form-control" name="requestStatus" id="requestStatus" required>
  698. <option value="open">Open</option>
  699. <option value="close">Close</option>
  700. </select>`;
  701. var textareaInput=`<textarea class="form-control" name="statusComments" id="statusComments" rows="4"></textarea>`;
  702. var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' +
  703. '<div class="card table-card mb-0"><div class="card-header" style="background-color: #ffe1003b !important;"><h3>Update Form</h3></div>' +
  704. '<div class="card-block p-0">' +
  705. '<table class="table table-borderless">' +
  706. ' <tbody>' +
  707. ' <tr>' +
  708. ' <td width="30%">Current Status</td>' +
  709. ' <td class="font-medium">'+selectInput+'</td>' +
  710. ' </tr>' +
  711. ' <tr>' +
  712. ' <td colspan="2">Status Comments' + textareaInput+'</td>' +
  713. ' </tr>' +
  714. ' </tbody>' +
  715. '</table>' +
  716. '</div><div class="card-footer text-center">' +
  717. ' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+
  718. ' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+
  719. '</div></div></form>';
  720. $("#statusUpdateForm").html(ptaxPersonalinfoHtml);
  721. var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
  722. $.ajax({
  723. url: apiUrl,
  724. type: 'GET',
  725. dataType: 'json',
  726. success: function(jsonResponse) {
  727. // Handle the API response data here
  728. console.log('Data from API:', jsonResponse);
  729. // Parse the JSON response into a JavaScript object
  730. var data = jsonResponse;
  731. if (data.ResultStatus === "True") {
  732. // Access the values
  733. var owner = data.PROPTAX[0].Owner;
  734. var address = data.PROPTAX[0].Address;
  735. var mobNo = data.PROPTAX[0].Mob_No;
  736. var email = data.PROPTAX[0].Email_ID;
  737. // HTML content
  738. var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' +
  739. '<div class="card table-card"><div class="card-header"><h3>Update Form</h3></div>' +
  740. '<div class="card-block">' +
  741. '<table class="table table-borderless">' +
  742. ' <tbody>' +
  743. ' <tr>' +
  744. ' <td>Current Status</td>' +
  745. ' <td class="font-medium">'+ptax+'</td>' +
  746. ' </tr>' +
  747. ' <tr>' +
  748. ' <td>Status Comments</td>' +
  749. ' <td class="font-medium">'+owner+'</td>' +
  750. ' </tr>' +
  751. ' <tr>' +
  752. ' <td>Address</td>' +
  753. ' <td class="font-medium">'+
  754. ' </td>' +
  755. ' </tr>' +
  756. ' </tbody>' +
  757. '</table>' +
  758. '</div><div class="card-footer text-center">' +
  759. ' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+
  760. ' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+
  761. '</div></div></form>';
  762. $("#statusUpdateForm").html(ptaxPersonalinfoHtml);
  763. }
  764. else {
  765. // No data found
  766. console.log("Status history: " + data.Message);
  767. //$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
  768. }
  769. // Enable tooltip for model page
  770. $('[data-toggle="tooltip"]').tooltip();
  771. },
  772. error: function(xhr, status, error) {
  773. // Handle errors here
  774. console.error('Error fetching Status history:', status, error);
  775. }
  776. });
  777. }
  778. function saveStatus(){
  779. return false;
  780. }
  781. </script>
  782. </body>
  783. </html>