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.

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