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.

121 lines
4.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <meta name="viewport" content="initial-scale=1">
  8. <title>Welcome to Greater Chennai Corporation</title>
  9. <link rel="stylesheet" href="styles.css" />
  10. <style>
  11. body {
  12. background-image: url("bg.jpg");
  13. height: 500px;
  14. background-position: center;
  15. background-repeat: no-repeat;
  16. background-size: cover;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <form action="data.jsp" class="form" method="post">
  22. <h2 class="heading">Property Tax Appointment Report</h2>
  23. <center>
  24. <div class="inputcontainer">
  25. <label class="label" for="zone"> Zone </label> &nbsp;
  26. <select class="blockinput" name="zone" id="zone">
  27. <option value="0">Select Zone</option>
  28. <option value="01">01</option>
  29. <option value="02">02</option>
  30. <option value="03">03</option>
  31. <option value="04">04</option>
  32. <option value="05">05</option>
  33. <option value="06">06</option>
  34. <option value="07">07</option>
  35. <option value="08">08</option>
  36. <option value="09">09</option>
  37. <option value="10">10</option>
  38. <option value="11">11</option>
  39. <option value="12">12</option>
  40. <option value="13">13</option>
  41. <option value="14">14</option>
  42. <option value="15">15</option>
  43. </select> &nbsp;
  44. &nbsp; &nbsp; &nbsp;
  45. <button type="button" class="button" id="button" onclick="getAppointmentsByZone()">Search</button>
  46. </div>
  47. </center>
  48. <div class="container12" style="margin-bottom: 0px;">
  49. <div class="propertyid">DIVISION</div>
  50. <div class="name">COMPLETED</div>
  51. <div class="address">PENDING</div>
  52. </div>
  53. <span id="data"></span>
  54. </form>
  55. <script
  56. src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  57. <script>
  58. function getAppointmentsByZone(){
  59. $('#data').html('');
  60. $('#button').text('Searching');
  61. $('#button').attr('disabled', true);
  62. $.post('getAbstractReport.jsp',{
  63. 'zone': $('#zone').val()
  64. },function(response){
  65. if(response[0].error == "1"){
  66. $('#data').html('<center>NO APPOINTMENTS FOUND</center>');
  67. }
  68. $('#button').text('Search');
  69. $('#button').attr('disabled', false);
  70. var data = [];
  71. $(response).each(function(){
  72. console.log(this);
  73. if(typeof this.app_property_id == 'undefined') return;
  74. var property_id = (this.app_property_id).split("-");
  75. var key = property_id[0]+'-'+property_id[1];
  76. //console.log('key: '+key);
  77. //console.log(data);
  78. if(typeof data[key] == 'undefined'){
  79. //console.log('key1: ' + key);
  80. data[key] = [];
  81. data[key]['count'] = 1;
  82. if(this.pending == 'Y'){
  83. data[key]['pending'] = 1;
  84. data[key]['completed'] = 0;
  85. } else{
  86. data[key]['completed'] = 1;
  87. data[key]['pending'] = 0;
  88. }
  89. $('#data').append(`<center><div class="container12" style="margin-top: 0px;margin-bottom: 0px;">
  90. <div class="request" style="background-color:#fff">`+property_id[1]+`</div>
  91. <div class="division" style="background-color:#fff" id="`+key+`_completed">`+data[key]['completed']+`</div>
  92. <div class="division" style="background-color:#fff" id="`+key+`_pending">`+data[key]['pending']+`</div>
  93. </div></center>`);
  94. }else{
  95. data[key]['count']++;
  96. //console.log('key: ' + key);
  97. if(this.pending == 'Y'){
  98. data[key]['pending']++;
  99. $('#'+key+'_pending').html(data[key]['pending']);
  100. } else {
  101. data[key]['completed']++;
  102. $('#'+key+'_completed').text(data[key]['completed']);
  103. }
  104. }
  105. if(this.count > 0){
  106. $('#data').append(`<center><div class="container11" style="margin-top: 0px;margin-bottom: 0px;">
  107. <div class="division" style="background-color:#fff">`+this.division+`</div>
  108. <div class="request" style="background-color:#fff">`+this.count+`</div>
  109. </div></center>`);
  110. }
  111. });
  112. });
  113. }
  114. </script>
  115.  
  116. </body>
  117. </html>