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.

458 lines
16 KiB

3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
3 years ago
​
3 years ago
3 years ago
3 years ago
​
3 years ago
3 years ago
​
3 years ago
​
3 years ago
​
​
3 years ago
3 years ago
​
3 years ago
​
3 years ago
3 years ago
3 years ago
3 years ago
​
3 years ago
​
​
3 years ago
3 years ago
​
​
​
3 years ago
3 years ago
3 years ago
​
3 years ago
​
​
3 years ago
​
​
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
​
3 years ago
​
​
​
3 years ago
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
3 years ago
3 years ago
3 years ago
​
​
​
​
3 years ago
3 years ago
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
3 years ago
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}">
  4. <script type="text/javascript"
  5. src="https://www.gstatic.com/charts/loader.js"></script>
  6. <script
  7. src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
  8. </head>
  9. <style>
  10. .chart-container {
  11. display: flex;
  12. justify-content: center;
  13. align-items: center;
  14. height: 100%;
  15. box-sizing: border-box;
  16. /* Optionally set the height to fill the container */
  17. }
  18. </style>
  19. <body>
  20. <link rel="stylesheet"
  21. href="/assets/node_modules/fullcalendar/dist/fullcalendar.min.css">
  22. <div class="wrapper">
  23. <!-- header top menu Start -->
  24. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  25. <!-- header top menu end -->
  26. <div class="page-wrap">
  27. <!--=============== Left Menu side Start ================-->
  28. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  29. <!--=============== Left side End ================-->
  30. <div class="main-content">
  31. <div class="container-fluid">
  32. <div class="page-header mb-2">
  33. <div class="row align-items-end">
  34. <div class="col-lg-8">
  35. <div class="page-header-title">
  36. <i class="ik ik-bar-chart-2 bg-blue"></i>
  37. <div class="d-inline">
  38. <h5>PGR Report</h5>
  39. <span>Public Grievance Redressal Complaint Report</span>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="col-lg-4">
  44. <nav class="breadcrumb-container" aria-label="breadcrumb">
  45. <ol class="breadcrumb">
  46. <li class="breadcrumb-item"><a href="index"><i
  47. class="ik ik-home"></i></a></li>
  48. <li class="breadcrumb-item active" aria-current="page">Dashboard</li>
  49. </ol>
  50. </nav>
  51. </div>
  52. </div>
  53. </div>
  54. <h4 class="h4 text-right text-mute" style="font-size: 12px;">
  55. Auto refresh in <font id="refresh-countdown">00</font> seconds
  56. </h4>
  57. <br>
  58. <!--............. This is form for select departments to show bar and pie chart ............ -->
  59. <form class="" action="" onsubmit="getByZone()">
  60. <div class="row">
  61. <div class="col-md-4">
  62. <label for="DepartmentDropdown">Select AgeAnalysis
  63. Department for PieChart:</label> <select class="form-control"
  64. name="DEPT_NAME" id="zone">
  65. <option value='0' th:selected="${DEPT_NAME == 0}">----
  66. All ----</option>
  67. <option th:each="complaintdepartment : ${complaintdept1}"
  68. th:value="${complaintdepartment.name}"
  69. th:text="${complaintdepartment.name}"
  70. th:selected="${DEPT_NAME == complaintdepartment.name}"></option>
  71. </select>
  72. </div>
  73. <div class="col-md-4">
  74. <label for="DepartmentDropdown">Select ZoneWise
  75. Department for BarChart:</label> <select class="form-control"
  76. name="DEPTID" id="zonewithreopenbar">
  77. <option value='0' th:selected="${DEPTID == 0}">----
  78. All ----</option>
  79. <option th:each="complaintdepartment : ${complaintdept}"
  80. th:value="${complaintdepartment.id}"
  81. th:text="${complaintdepartment.name}"
  82. th:selected="${DEPTID == complaintdepartment.id}"></option>
  83. </select>
  84. </div>
  85. <div class="col-md-4 "
  86. style="display: flex; justify-content: space-between; align-items: center; margin-top: 25px;">
  87. <button type="submit" style="width: 90%; height: auto;"
  88. class="btn btn-sm btn-primary">Submit</button>
  89. </div>
  90. </div>
  91. </form>
  92. <br>
  93. <!-- ..................Styles and design for bar and PieChart............. -->
  94. <div class="row"
  95. style="max-width: 100%; max-height: 100%; overflow: auto;">
  96. <div class="col-md-12">
  97. <div class="card sale-card"
  98. style="max-width: 150%; max-height: 150%; height: 100%; width: auto; overflow: auto;">
  99. <div class="card-block"
  100. style="max-width: 100%; max-height: 90%; height: 90%; width: auto; overflow: auto;">
  101. <svg id="chart-container" xmlns="http://www.w3.org/2000/svg"
  102. viewBox="0 0 1000 500" preserveAspectRatio="xMidYMid meet"
  103. style="max-width: 100%; max-height: 100%;">
  104. <foreignObject width="100%" height="100%">
  105. <div id="totalpiechart"
  106. style="width: 50%; height: auto; float: left;"></div>
  107. <div id="reopenpiechart"
  108. style="width: 50%; height: auto; float: left;"></div>
  109. </foreignObject>
  110. </svg>
  111. </div>
  112. <div class="card-block"
  113. style="max-width: 100%; max-height: 100%; height: 90%; width: auto; overflow: auto;">
  114. <svg id="chart-container" xmlns="http://www.w3.org/2000/svg"
  115. viewBox="0 0 1000 500" preserveAspectRatio="xMidYMid meet"
  116. style="max-width: 100%; max-height: 100%;">
  117. <foreignObject width="100%" height="100%">
  118. <div id="barchart"
  119. style="width: 50%; height: auto; float: left;"></div>
  120. </foreignObject>
  121. </svg>
  122. </div>
  123. <div class="card-block"
  124. style="max-width: 100%; max-height: 100%; height: 100%; width: auto; overflow: auto;">
  125. <svg id="chart-container" xmlns="http://www.w3.org/2000/svg"
  126. viewBox="0 0 1000 500" preserveAspectRatio="xMidYMid meet"
  127. style="max-width: 100%; max-height: 100%;">
  128. <foreignObject width="100%" height="100%">
  129. <div id="reopenbarchart"
  130. style="width: 50%; height: auto; float: left;"></div>
  131. </foreignObject>
  132. </svg>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <!--.................... end ............. -->
  138. <br>
  139. <!-- First Tile End -->
  140. </div>
  141. </div>
  142. </div>
  143. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  144. </div>
  145. <!-- Model Box -->
  146. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  147. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  148. <script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
  149. <script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
  150. <script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
  151. <script
  152. src="/assets/node_modules/fullcalendar/dist/fullcalendar.min.js"></script>
  153. <script
  154. src="/assets/node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  155. <script>
  156. //alert('Select departments to load data....');
  157. $(document).ready(function () {
  158. $.ajax({
  159. url: '/pgr/daskboard', // Change this URL to your endpoint
  160. type: 'GET',
  161. success: function (data) {
  162. var dropdown = $('#DepartmentDropdown');
  163. $.each(data, function (index, complaintdepartment) {
  164. dropdown.append($('<option></option>').attr('value', complaintdepartment.id).text(complaintdepartment.name));
  165. });
  166. },
  167. //error: function () {
  168. // alert('Select departments to load data....');
  169. // }
  170. });
  171. });
  172. function getByZone(){
  173. alert("Wait for response to load data...")
  174. let DEPT_NAME = document.getElementById("zone").value;
  175. let DEPTID = document.getElementById("zonewithreopenbar").value;
  176. window.location.href='/dashboard?zone='+DEPT_NAME +'&zonewithreopenbar='+DEPTID;
  177. }
  178. </script>
  179. <script type="text/javascript"
  180. src="https://www.gstatic.com/charts/loader.js"></script>
  181. <script type="text/javascript" th:inline="javascript">
  182. /*------------- Pie and bar chart-------------- */
  183. var daysDataTotal = [
  184. [(${ageanalysisdashboardList[0].DAYS_0_15_PEN})],
  185. [(${ageanalysisdashboardList[0].DAYS_16_30_PEN})],
  186. [(${ageanalysisdashboardList[0].DAYS_31_60_PEN})],
  187. [(${ageanalysisdashboardList[0].DAYS_61_90_PEN})],
  188. [(${ageanalysisdashboardList[0].DAYS_90_PEN})]
  189. ];
  190. var daysDataReopen = [
  191. [(${ageanalysisdashboardList[0].DAYS_0_15_REOPEN})],
  192. [(${ageanalysisdashboardList[0].DAYS_16_30_REOPEN})],
  193. [(${ageanalysisdashboardList[0].DAYS_31_60_REOPEN})],
  194. [(${ageanalysisdashboardList[0].DAYS_61_90_REOPEN})],
  195. [(${ageanalysisdashboardList[0].DAYS_90_REOPEN})]
  196. ];
  197. /* var daysDataTotal = [];
  198. var daysDataReopen = [];
  199. if (ageanalysisdashboardList.length > 0) {
  200. daysDataTotal = [
  201. [(${ageanalysisdashboardList[0].DAYS_0_15_PEN})],
  202. [(${ageanalysisdashboardList[0].DAYS_16_30_PEN})],
  203. [(${ageanalysisdashboardList[0].DAYS_31_60_PEN})],
  204. [(${ageanalysisdashboardList[0].DAYS_61_90_PEN})],
  205. [(${ageanalysisdashboardList[0].DAYS_90_PEN})]
  206. ];
  207. daysDataReopen = [
  208. [(${ageanalysisdashboardList[0].DAYS_0_15_REOPEN})],
  209. [(${ageanalysisdashboardList[0].DAYS_16_30_REOPEN})],
  210. [(${ageanalysisdashboardList[0].DAYS_31_60_REOPEN})],
  211. [(${ageanalysisdashboardList[0].DAYS_61_90_REOPEN})],
  212. [(${ageanalysisdashboardList[0].DAYS_90_REOPEN})]
  213. ];
  214. } else {
  215. alert("No data available in the ageanalysis department.");
  216. } */
  217. /* if (ageanalysisdashboardList.length === 0) {
  218. alert("No data available for this department. Please choose a different department.");
  219. } */
  220. google.charts.load('current', {'packages': ['corechart']});
  221. google.charts.setOnLoadCallback(drawPieCharts); // Use a new callback for pie charts
  222. google.charts.setOnLoadCallback(drawBarCharts); // Use a new callback for bar charts
  223. function drawPieCharts() {
  224. console.log("Pie charts");
  225. var dataTotal = google.visualization.arrayToDataTable([
  226. ['Category', 'Count'],
  227. ['0-15 Days Pending', daysDataTotal[0]],
  228. ['16-30 Days Pending', daysDataTotal[1]],
  229. ['31-60 Days Pending', daysDataTotal[2]],
  230. ['61-90 Days Pending', daysDataTotal[3]],
  231. ['Above 90 Days Pending', daysDataTotal[4]],
  232. ]);
  233. var dataReopen = google.visualization.arrayToDataTable([
  234. ['Category', 'Count'],
  235. ['0-15 Days Reopen', daysDataReopen[0]],
  236. ['16-30 Days Reopen', daysDataReopen[1]],
  237. ['31-60 Days Reopen', daysDataReopen[2]],
  238. ['61-90 Days Reopen', daysDataReopen[3]],
  239. ['Above 90 Days Reopen', daysDataReopen[4]],
  240. ]);
  241. var optionspiepen = {
  242. 'title': 'Overall Pending Complaint Info ',
  243. 'legend': 'bottom',
  244. 'height': '500',
  245. 'width': '500',
  246. 'colors': ['#f4ca47', '#0ebce0', '#aae00e', '#053a4c', '#0ee0ad']
  247. };
  248. var optionspiere = {
  249. 'title': 'Overall Reopen Complaint Info ',
  250. 'legend': 'bottom',
  251. 'height': '500',
  252. 'width': '500',
  253. 'colors': ['#f4ca47', '#0ebce0', '#aae00e', '#053a4c', '#0ee0ad']
  254. };
  255. var piechartTotal = new google.visualization.PieChart(document.getElementById('totalpiechart'));
  256. var piechartReopen = new google.visualization.PieChart(document.getElementById('reopenpiechart'));
  257. piechartTotal.draw(dataTotal, optionspiepen);
  258. piechartReopen.draw(dataReopen, optionspiere);
  259. }
  260. <!-- Bar chart -->
  261. var zoneDatawithReopen = [
  262. [(${zonewisedashboardList[0].NonBURSTLT})],
  263. [(${zonewisedashboardList[0].REOFGAR})],
  264. [(${zonewisedashboardList[0].ROAD})],
  265. [(${zonewisedashboardList[0].MOSQUITE})],
  266. [(${zonewisedashboardList[0].WATER})],
  267. [(${zonewisedashboardList[0].REOFDEB})],
  268. [(${zonewisedashboardList[0].TREE})],
  269. [(${zonewisedashboardList[0].DOGS})],
  270. [(${zonewisedashboardList[0].ENCMTN})],
  271. [(${zonewisedashboardList[0].POT})],
  272. [(${zonewisedashboardList[0].PTAX})],
  273. [(${zonewisedashboardList[0].OTHERS})],
  274. [(${zonewisedashboardList[0].TOTAL})]
  275. ];
  276. var zoneDatawithoutReopen = [
  277. [(${reopenzonewisedashboardList[0].NonBURSTLT})],
  278. [(${reopenzonewisedashboardList[0].REOFGAR})],
  279. [(${reopenzonewisedashboardList[0].ROAD})],
  280. [(${reopenzonewisedashboardList[0].MOSQUITE})],
  281. [(${reopenzonewisedashboardList[0].WATER})],
  282. [(${reopenzonewisedashboardList[0].REOFDEB})],
  283. [(${reopenzonewisedashboardList[0].TREE})],
  284. [(${reopenzonewisedashboardList[0].DOGS})],
  285. [(${reopenzonewisedashboardList[0].ENCMTN})],
  286. [(${reopenzonewisedashboardList[0].POT})],
  287. [(${reopenzonewisedashboardList[0].PTAX})],
  288. [(${reopenzonewisedashboardList[0].OTHERS})],
  289. [(${reopenzonewisedashboardList[0].TOTAL})]
  290. ];
  291. function drawBarCharts() {
  292. console.log("Bar charts");
  293. var zonewithReopen = google.visualization.arrayToDataTable([
  294. ['Category', 'Count'],
  295. ['Street Light not burning', zoneDatawithReopen[0]],
  296. ['Removal of Garbage', zoneDatawithReopen[1]],
  297. ['Road Damaged', zoneDatawithReopen[2]],
  298. ['Mosquito Nuisance', zoneDatawithReopen[3]],
  299. ['Water Stagnation', zoneDatawithReopen[4]],
  300. ['Removal of Debries', zoneDatawithReopen[5]],
  301. ['Tree Fallen', zoneDatawithReopen[6]],
  302. ['Dog Menace', zoneDatawithReopen[7]],
  303. ['Encroachment', zoneDatawithReopen[8]],
  304. ['Potshole', zoneDatawithReopen[9]],
  305. ['Property Tax', zoneDatawithReopen[10]],
  306. ['Others', zoneDatawithReopen[11]],
  307. ['Total', zoneDatawithReopen[12]],
  308. ]);
  309. var zonewithoutReopen = google.visualization.arrayToDataTable([
  310. ['Category', 'Count'],
  311. ['Street Light not burning', zoneDatawithoutReopen[0]],
  312. ['Removal of Garbage', zoneDatawithoutReopen[1]],
  313. ['Road Damaged', zoneDatawithoutReopen[2]],
  314. ['Mosquito Nuisance', zoneDatawithoutReopen[3]],
  315. ['Water Stagnation', zoneDatawithoutReopen[4]],
  316. ['Removal of Debries', zoneDatawithoutReopen[5]],
  317. ['Tree Fallen', zoneDatawithoutReopen[6]],
  318. ['Dog Menace', zoneDatawithoutReopen[7]],
  319. ['Encroachment', zoneDatawithoutReopen[8]],
  320. ['Potshole', zoneDatawithoutReopen[9]],
  321. ['Property Tax', zoneDatawithoutReopen[10]],
  322. ['Others', zoneDatawithoutReopen[11]],
  323. ['Total', zoneDatawithoutReopen[12]],
  324. ]);
  325. var optionszonewithreopencolumn = {
  326. 'title': 'Zonewise (With Reopen) Complaints ',
  327. 'legend': 'bottom',
  328. 'height': '500',
  329. 'width': '1100',
  330. "useLineColorForBulletBorder": true,
  331. 'colors': ['Green', 'Blue', 'Yellow', 'Brown', 'Pink', 'Orange', 'Purple', 'Grey', 'SkyBlue', 'LightGreen','Violet', 'Gold'],
  332. 'responsive':true
  333. };
  334. var optionszonewithoutreopencolumn = {
  335. 'title': 'Zonewise (Without Reopen) Complaints ',
  336. 'legend': 'bottom',
  337. 'height': '500',
  338. 'width': '1100',
  339. "useLineColorForBulletBorder": true,
  340. 'colors': ['Red', 'Blue', 'Yellow', 'Brown', 'Pink', 'Orange', 'Purple', 'Grey', 'SkyBlue', 'LightGreen','Violet', 'Gold'],
  341. 'responsive':true
  342. };
  343. var barchartReopen = new google.visualization.ColumnChart(document.getElementById('reopenbarchart'));
  344. var barchartwithReopen = new google.visualization.ColumnChart(document.getElementById('barchart'));
  345. barchartReopen.draw(zonewithoutReopen, optionszonewithoutreopencolumn);
  346. barchartwithReopen.draw(zonewithReopen, optionszonewithreopencolumn);
  347. }
  348. </script>
  349. </body>
  350. </html>