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.

788 lines
29 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" href="node_modules/amcharts3/amcharts/plugins/export/export.css" type="text/css" media="all" />
  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 mb-2">
  21. <div class="row align-items-end">
  22. <div class="col-lg-8">
  23. <div class="page-header-title">
  24. <i class="ik ik-bar-chart-2 bg-blue"></i>
  25. <div class="d-inline">
  26. <h5>PGR</h5>
  27. <span>Public Grievance Redressal Reports</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 active" aria-current="page">Dashboard</li>
  38. </ol>
  39. </nav>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- <h4 class="h4 text-right text-mute" style="font-size: 12px;">Auot refresh in <font id="refresh-countdown">00</font> seconds</h4> -->
  44. <div class="row">
  45. <div class="col-md-12">
  46. <div class="card sale-card">
  47. <div class="card-header">
  48. <i class="fas fa-chart-pie pr-2"></i><h3>OverAll Complaint Age Analysis</h3>
  49. <div class="card-header-right">
  50. <i id="update_pie_loading"></i>
  51. </div>
  52. </div>
  53. <div class="card-block text-center" id="">
  54. <h3 id="pie_card" style="font-size:12px"></h3>
  55. <div id="pie_content_html">
  56. <h6>OverAll Pending</h6>
  57. <h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3>
  58. <h6>OverAll Reopen</h6>
  59. <h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="col-md-12">
  65. <div class="card sale-card">
  66. <div class="card-header">
  67. <i class="fas fa-chart-bar pr-2"></i><h3>Complaint`s Type Wise Pending Count`s</h3>
  68. </div>
  69. <div class="card-block">
  70. <div id="deal-analytic-chart" class="chart-shadow" style="height:300px"></div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  78. </div>
  79. </div>
  80. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  81. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  82. <script th:replace="~{fragments/modules/pgr/script :: script}"></script>
  83. <script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
  84. <script src="node_modules/amcharts3/amcharts/serial.js"></script>
  85. <script src="node_modules/amcharts3/amcharts/plugins/export/export.min.js"></script>
  86. <script src="node_modules/amcharts3/amcharts/pie.js"></script>
  87. <script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
  88. <!-- <script src="node_modules/fullcalendar/dist/fullcalendar.min.js"></script>-->
  89. <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  90. <script>
  91. var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
  92. const loading = $("#pie_card");
  93. var pie_data = "";
  94. var departmentlist = "";
  95. function callPieFilter(){
  96. var filter = $("#search_id").val();
  97. pass_pie_data(filter);
  98. pass_bar_data(filter);
  99. }
  100. function callReSetPieFilter(){
  101. var filter = 0;
  102. $("#search_id").val(filter);
  103. pass_pie_data(filter);
  104. pass_bar_data(filter);
  105. }
  106. function get_department_data(){
  107. get_department_list().then(function(departments) {
  108. // Handle the department list
  109. //console.log('Department list:', departmentlist);
  110. departmentlist = departments;
  111. fetchPie_Data(0); // Dropdown fileter value
  112. fetchData_Bar(0); // Dropdown fileter value
  113. }).catch(function(error) {
  114. // Handle errors
  115. console.error('Error fetching department list:', error.message);
  116. //alert('Failed to fetch department list. Please try again later.');
  117. Swal.fire({
  118. title: 'Failed to fetch data from ERP. Please try again later.',
  119. customClass: {
  120. title: 'swal-title-custom' // Add a custom class for the title
  121. },
  122. //text: "Error",
  123. icon: 'error',
  124. showCancelButton: false,
  125. confirmButtonColor: '#3085d6',
  126. cancelButtonColor: '#d33',
  127. confirmButtonText: 'Ok',
  128. }).then(function(result) {
  129. if (result.isConfirmed) {
  130. // Handle after confirmed button (Ok) click
  131. }
  132. });
  133. });
  134. }
  135. function fetchPie_Data(deptid){
  136. var pie_option = "";
  137. for (var i = 0; i < departmentlist.length; i++) {
  138. pie_option +='<option value="'+departmentlist[i]["ID_DEPT"]+'">'+departmentlist[i]["DEPT_NAME"]+'</option>';
  139. }
  140. call_loading('update_pie_loading','start');
  141. var apiUrl = '/gcc/api/pgr/getPendingComplaintCount';
  142. $.ajax({
  143. url: apiUrl,
  144. type: 'GET',
  145. dataType: 'json',
  146. success: function(jsonResponse) {
  147. // Handle the API response data here
  148. console.log('Data from API:', jsonResponse);
  149. pie_data = jsonResponse;
  150. $("#pie_content_html").html('' +
  151. '<div class="row">' +
  152. '<div class="col-12 mb-2">' +
  153. '<div class="input-group mb-0">' +
  154. '<span class="input-group-prepend">' +
  155. '<button type="button" class="btn btn-success" onclick="callReSetPieFilter(0);" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Reset" title="Reset">' +
  156. '<i class="ik ik-refresh-ccw"></i>' +
  157. '</button>' +
  158. '</span>' +
  159. '<select class="form-control" id="search_id" name="search_id">' +
  160. '<option value="0">All Departments</option>' +
  161. '' + pie_option +
  162. '</select>' +
  163. '<span class="input-group-append">' +
  164. '<button type="button" class="btn btn-success" onclick="callPieFilter();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="Search">' +
  165. '<i class="ik ik-search me-1"></i> Search' +
  166. '</button>' +
  167. '</span>' +
  168. '</div>' +
  169. '</div>' +
  170. '</div>' +
  171. '<h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3>' +
  172. '<h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3>'
  173. );
  174. pass_pie_data(0);
  175. },
  176. error: function(xhr, status, error) {
  177. // Handle errors here
  178. console.error('Error fetching data:', status, error);
  179. }
  180. });
  181. }
  182. /*
  183. let refreshInterval;
  184. let remainingTime = 60; // Initial countdown time in seconds
  185. function updateCountdown() {
  186. let remainingTimetxt = remainingTime;
  187. if(remainingTime<10){
  188. remainingTimetxt = "0"+remainingTime;
  189. }
  190. document.getElementById("refresh-countdown").textContent = remainingTimetxt;
  191. remainingTime--;
  192. if (remainingTime < 0) {
  193. clearInterval(refreshInterval);
  194. remainingTime = 60;
  195. fetchDashboardSummary_Pie();
  196. refreshInterval = setInterval(updateCountdown, 1000);
  197. }
  198. }
  199. */
  200. </script>
  201. <script>
  202. function pass_pie_data(filter){
  203. jsonResponse = pie_data;
  204. // Initialize variables to store sums
  205. var pending_title = "OverAll Pending Without Reopen";
  206. var pending_reoprn_title = "OverAll Reopen Pending";
  207. var DAYS_90_PEN = 0;
  208. var DAYS_90_REOPEN = 0;
  209. var DAYS_61_90_PEN = 0;
  210. var DAYS_61_90_REOPEN = 0;
  211. var DAYS_31_60_PEN = 0;
  212. var DAYS_31_60_REOPEN = 0;
  213. var DAYS_16_30_PEN = 0;
  214. var DAYS_16_30_REOPEN = 0;
  215. var DAYS_0_15_PEN = 0;
  216. var DAYS_0_15_REOPEN = 0;
  217. var filterSearch = [];
  218. // Loop through the jsonResponse array
  219. for (var i = 0; i < jsonResponse.length; i++) {
  220. // Accumulate values for each data
  221. if(filter>0){
  222. /*
  223. if(filter==48){ // Regional Office North (48)
  224. //Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36
  225. filterSearch = [32, 33, 34, 35, 36];
  226. }
  227. else if(filter==50){ //Regional Office Central (50)
  228. //Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41
  229. filterSearch = [37, 38, 39, 40, 41];
  230. }
  231. else if(filter==49){ //Regional Office South (49)
  232. //Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46
  233. filterSearch = [42, 43, 44, 45, 46];
  234. }
  235. else{
  236. filterSearch =[filter];
  237. }
  238. console.log(filterSearch);
  239. */
  240. //if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone
  241. if(jsonResponse[i]["DEPTID"]==filter){
  242. //alert(filter);
  243. pending_title = "OverAll Pending Witout Reopen of "+jsonResponse[i]["DEPT_NAME"];
  244. pending_reoprn_title = "OverAll Reopen Pending of "+jsonResponse[i]["DEPT_NAME"];
  245. DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"];
  246. DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"];
  247. DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"];
  248. DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"];
  249. DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"];
  250. DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"];
  251. DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"];
  252. DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"];
  253. DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"];
  254. DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"];
  255. }
  256. }
  257. else{
  258. // All data
  259. DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"];
  260. DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"];
  261. DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"];
  262. DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"];
  263. DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"];
  264. DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"];
  265. DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"];
  266. DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"];
  267. DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"];
  268. DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"];
  269. }
  270. }
  271. var pieData = [
  272. { "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_PEN },
  273. { "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_PEN },
  274. { "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_PEN },
  275. { "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_PEN },
  276. { "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_PEN }
  277. ];
  278. var pieData_reoprn = [
  279. { "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_REOPEN },
  280. { "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_REOPEN },
  281. { "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_REOPEN },
  282. { "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_REOPEN },
  283. { "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_REOPEN }
  284. ];
  285. call_pending_pie(pieData,pending_title);
  286. call_pending_reopen_pie(pieData_reoprn,pending_reoprn_title);
  287. loading.html("");
  288. $("#update_pie_loading").html("");
  289. }
  290. function call_pending_pie(pieData,title){
  291. var chart = AmCharts.makeChart("pie_pending", {
  292. "type": "pie",
  293. "theme": "light",
  294. "dataProvider": pieData,
  295. "valueField": "value",
  296. "titleField": "title",
  297. "colorField": "color",
  298. "alpha": 0.8,
  299. "outlineAlpha": 0.5,
  300. //"depth3D": 25,
  301. "balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>",
  302. "angle": 45,
  303. "export": {
  304. "enabled": true,
  305. "fileName": title
  306. },
  307. "legend": {
  308. "position": "right"
  309. },
  310. "titles": [{
  311. "text": title,
  312. "size": 15,
  313. "marginBottom": 20
  314. }]
  315. });
  316. }
  317. function call_pending_reopen_pie(pieData,title){
  318. var chart = AmCharts.makeChart("pie_reopen_pending", {
  319. "type": "pie",
  320. "theme": "light",
  321. "dataProvider": pieData,
  322. "valueField": "value",
  323. "titleField": "title",
  324. "colorField": "color",
  325. "alpha": 0.8,
  326. "outlineAlpha": 0.5,
  327. //"depth3D": 25,
  328. "balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>",
  329. "angle": 45,
  330. "export": {
  331. "enabled": true,
  332. "fileName": title
  333. },
  334. "legend": {
  335. "position": "right"
  336. },
  337. "titles": [{
  338. "text": title,
  339. "size": 15,
  340. "marginBottom": 20
  341. }]
  342. });
  343. }
  344. </script>
  345. <script>
  346. var bar_data_1 = "";
  347. var bar_data_2 = "";
  348. var chart = "";
  349. var pending_title = "OverAll Pending By Complaint`s Type";
  350. var pending_reopen_title = "OverAll Reopen By Complaint`s Type";
  351. function fetchData_Bar(deptid){
  352. call_loading('update_bar_loading','start');
  353. var apiUrl = '/gcc/api/pgr/getZoneWisePendingComplaintCount';
  354. $.ajax({
  355. url: apiUrl,
  356. type: 'GET',
  357. dataType: 'json',
  358. success: function(jsonResponse) {
  359. // Handle the API response data here
  360. console.log('Data from API:', jsonResponse);
  361. bar_data_1 = jsonResponse;
  362. fetch2Data_Bar(0);
  363. //loading.html("");
  364. //$("#update_pie_loading").html("");
  365. },
  366. error: function(xhr, status, error) {
  367. // Handle errors here
  368. console.error('Error fetching data:', status, error);
  369. }
  370. });
  371. }
  372. function fetch2Data_Bar(deptid){
  373. var apiUrl = '/gcc/api/pgr/getZoneWiseReopenComplaintCount';
  374. $.ajax({
  375. url: apiUrl,
  376. type: 'GET',
  377. dataType: 'json',
  378. success: function(jsonResponse) {
  379. // Handle the API response data here
  380. console.log('Data from API:', jsonResponse);
  381. bar_data_2 = jsonResponse;
  382. pass_bar_data(0);
  383. //loading.html("");
  384. //$("#update_pie_loading").html("");
  385. },
  386. error: function(xhr, status, error) {
  387. // Handle errors here
  388. console.error('Error fetching data:', status, error);
  389. }
  390. });
  391. }
  392. function pass_bar_data(filter){
  393. jsonResponse = bar_data_1;
  394. jsonResponse2 = bar_data_2;
  395. // Initialize variables to store sums
  396. var NONBURSTLT = 0;
  397. var REOFGAR = 0;
  398. var ROAD = 0;
  399. var MOSQUITE = 0;
  400. var WATER = 0;
  401. var REOFDEB = 0;
  402. var TREE = 0;
  403. var DOGS = 0;
  404. var ENCMTN = 0;
  405. var POT = 0;
  406. var PTAX = 0;
  407. var OTHERS = 0;
  408. var NONBURSTLT_REOPEN = 0;
  409. var REOFGAR_REOPEN = 0;
  410. var ROAD_REOPEN = 0;
  411. var MOSQUITE_REOPEN = 0;
  412. var WATER_REOPEN = 0;
  413. var REOFDEB_REOPEN = 0;
  414. var TREE_REOPEN = 0;
  415. var DOGS_REOPEN = 0;
  416. var ENCMTN_REOPEN = 0;
  417. var POT_REOPEN = 0;
  418. var PTAX_REOPEN = 0;
  419. var OTHERS_REOPEN = 0;
  420. var filterSearch = [];
  421. // Loop through the jsonResponse array
  422. for (var i = 0; i < jsonResponse.length; i++) {
  423. // Accumulate values for each data
  424. if(filter>0){
  425. if(filter==48){ // Regional Office North (48)
  426. //Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36
  427. filterSearch = [32, 33, 34, 35, 36];
  428. }
  429. else if(filter==50){ //Regional Office Central (50)
  430. //Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41
  431. filterSearch = [37, 38, 39, 40, 41];
  432. }
  433. else if(filter==49){ //Regional Office South (49)
  434. //Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46
  435. filterSearch = [42, 43, 44, 45, 46];
  436. }
  437. else{
  438. filterSearch =[filter];
  439. }
  440. if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone
  441. pending_title = "OverAll Pending of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type";
  442. pending_reopen_title = "OverAll Reopen of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type";
  443. NONBURSTLT += jsonResponse[i]["NONBURSTLT"];
  444. REOFGAR += jsonResponse[i]["REOFGAR"];
  445. ROAD += jsonResponse[i]["ROAD"];
  446. MOSQUITE += jsonResponse[i]["MOSQUITE"];
  447. WATER += jsonResponse[i]["WATER"];
  448. REOFDEB += jsonResponse[i]["REOFDEB"];
  449. TREE += jsonResponse[i]["TREE"];
  450. DOGS += jsonResponse[i]["DOGS"];
  451. ENCMTN += jsonResponse[i]["ENCMTN"];
  452. POT += jsonResponse[i]["POT"];
  453. PTAX += jsonResponse[i]["PTAX"];
  454. OTHERS += jsonResponse[i]["OTHERS"];
  455. }
  456. }
  457. else{
  458. // All data
  459. NONBURSTLT += jsonResponse[i]["NONBURSTLT"];
  460. REOFGAR += jsonResponse[i]["REOFGAR"];
  461. ROAD += jsonResponse[i]["ROAD"];
  462. MOSQUITE += jsonResponse[i]["MOSQUITE"];
  463. WATER += jsonResponse[i]["WATER"];
  464. REOFDEB += jsonResponse[i]["REOFDEB"];
  465. TREE += jsonResponse[i]["TREE"];
  466. DOGS += jsonResponse[i]["DOGS"];
  467. ENCMTN += jsonResponse[i]["ENCMTN"];
  468. POT += jsonResponse[i]["POT"];
  469. PTAX += jsonResponse[i]["PTAX"];
  470. OTHERS += jsonResponse[i]["OTHERS"];
  471. }
  472. }
  473. // Loop through the jsonResponse array
  474. for (var i = 0; i < jsonResponse2.length; i++) {
  475. // Accumulate values for each data
  476. if(filter>0){
  477. if(jsonResponse2[i]["DEPTID"]==filter){ // Only Seleted Departments or Zone
  478. pending_title = "OverAll Pending of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type";
  479. pending_reoprn_title = "OverAll Reopen of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type";
  480. NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"];
  481. REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"];
  482. ROAD_REOPEN += jsonResponse2[i]["ROAD"];
  483. MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"];
  484. WATER_REOPEN += jsonResponse2[i]["WATER"];
  485. REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"];
  486. TREE_REOPEN += jsonResponse2[i]["TREE"];
  487. DOGS_REOPEN += jsonResponse2[i]["DOGS"];
  488. ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"];
  489. POT_REOPEN += jsonResponse2[i]["POT"];
  490. PTAX_REOPEN += jsonResponse2[i]["PTAX"];
  491. OTHERS_REOPEN += jsonResponse2[i]["OTHERS"];
  492. }
  493. }
  494. else{
  495. // All data
  496. NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"];
  497. REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"];
  498. ROAD_REOPEN += jsonResponse2[i]["ROAD"];
  499. MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"];
  500. WATER_REOPEN += jsonResponse2[i]["WATER"];
  501. REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"];
  502. TREE_REOPEN += jsonResponse2[i]["TREE"];
  503. DOGS_REOPEN += jsonResponse2[i]["DOGS"];
  504. ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"];
  505. POT_REOPEN += jsonResponse2[i]["POT"];
  506. PTAX_REOPEN += jsonResponse2[i]["PTAX"];
  507. OTHERS_REOPEN += jsonResponse2[i]["OTHERS"];
  508. }
  509. }
  510. var barData = [
  511. {
  512. "issueCategory": "Street Light<br>not burning",
  513. "AllPendingwithReopen": NONBURSTLT,
  514. "onlyReopen": NONBURSTLT_REOPEN
  515. },
  516. {
  517. "issueCategory": "Removal of<br>Garbage",
  518. "AllPendingwithReopen": REOFGAR,
  519. "onlyReopen": REOFGAR_REOPEN
  520. },
  521. {
  522. "issueCategory": "Road<br>Damaged",
  523. "AllPendingwithReopen": ROAD,
  524. "onlyReopen": ROAD_REOPEN
  525. },
  526. {
  527. "issueCategory": "Mosquito<br>Nuisance",
  528. "AllPendingwithReopen": MOSQUITE,
  529. "onlyReopen": MOSQUITE_REOPEN
  530. },
  531. {
  532. "issueCategory": "Water<br>Stagnation",
  533. "AllPendingwithReopen": WATER,
  534. "onlyReopen": WATER_REOPEN
  535. },
  536. {
  537. "issueCategory": "Removal of<br>Debries",
  538. "AllPendingwithReopen": REOFDEB,
  539. "onlyReopen": REOFDEB_REOPEN
  540. },
  541. {
  542. "issueCategory": "Tree<br>Fallen",
  543. "AllPendingwithReopen": TREE,
  544. "onlyReopen": TREE_REOPEN
  545. },
  546. {
  547. "issueCategory": "Dog<br>Menace",
  548. "AllPendingwithReopen": DOGS,
  549. "onlyReopen": DOGS_REOPEN
  550. },
  551. {
  552. "issueCategory": "Encroachment",
  553. "AllPendingwithReopen": ENCMTN,
  554. "onlyReopen": ENCMTN_REOPEN
  555. },
  556. {
  557. "issueCategory": "Potshole",
  558. "AllPendingwithReopen": POT,
  559. "onlyReopen": POT_REOPEN
  560. },
  561. {
  562. "issueCategory": "Property Tax",
  563. "AllPendingwithReopen": PTAX,
  564. "onlyReopen": PTAX_REOPEN
  565. },
  566. {
  567. "issueCategory": "Others",
  568. "AllPendingwithReopen": OTHERS,
  569. "onlyReopen": OTHERS_REOPEN
  570. },
  571. ];
  572. call_zonewise_pending_bar(barData);
  573. }
  574. function call_zonewise_pending_bar(chartData){
  575. /*
  576. var chartData = [];
  577. var currentDate = new Date();
  578. var currentMonth = currentDate.getMonth() + 1;
  579. var currentYear = currentDate.getFullYear();
  580. var daysInMonth = new Date(currentYear, currentMonth, 0).getDate();
  581. // Generate random data for each date in the current month
  582. for (var i = 1; i <= daysInMonth; i++) {
  583. var randomValue1 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want
  584. var randomValue2 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want
  585. var issueCategory = currentYear + '-' + (currentMonth < 10 ? '0' : '') + currentMonth + '-' + (i < 10 ? '0' : '') + i;
  586. var dataPoint = {
  587. "issueCategory": issueCategory,
  588. "AllPendingwithReopen": randomValue1,
  589. "onlyReopen": randomValue2
  590. };
  591. chartData.push(dataPoint);
  592. }
  593. */
  594. // deal-analytic-chart
  595. chart = AmCharts.makeChart("deal-analytic-chart", {
  596. "type": "serial",
  597. "theme": "light",
  598. //"dataDateFormat": "YYYY-MM-DD",
  599. //"precision": 2,
  600. "valueAxes": [{
  601. "id": "v1",
  602. "position": "left",
  603. "autoGridCount": false,
  604. "labelFunction": function(value) {
  605. return "$" + Math.round(value) + "M";
  606. }
  607. }, {
  608. "id": "v2",
  609. "gridAlpha": 0,
  610. "autoGridCount": false
  611. }],
  612. "graphs": [{
  613. "id": "g1",
  614. "valueAxis": "v2",
  615. /*"bullet": "round",
  616. "bulletBorderAlpha": 1,
  617. "bulletColor": "#FFFFFF",
  618. "bulletSize": 8,
  619. "hideBulletsCount": 50,
  620. "lineThickness": 3,
  621. "lineColor": "#2ed8b6",*/
  622. "lineColor": "#2ed8b6",
  623. "fillColors": "#2ed8b6",
  624. "type": "column",
  625. "fillAlphas": 0.3,
  626. "columnWidth": 0.5,
  627. "title": pending_title,
  628. "useLineColorForBulletBorder": true,
  629. "valueField": "AllPendingwithReopen",
  630. "balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>"
  631. }, {
  632. "id": "g2",
  633. "valueAxis": "v2",
  634. //"bullet": "round",
  635. //"bulletBorderAlpha": 1,
  636. //"bulletColor": "#FFFFFF",
  637. //"bulletSize": 8,
  638. //"hideBulletsCount": 50,
  639. //"lineThickness": 3,
  640. //"lineColor": "#e95753",
  641. "lineColor": "#F22613",
  642. "fillColors": "#F22613",
  643. "type": "column",
  644. "fillAlphas": 0.3,
  645. "columnWidth": 0.5,
  646. "title": pending_reopen_title,
  647. "useLineColorForBulletBorder": true,
  648. "valueField": "onlyReopen",
  649. "balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>"
  650. }],
  651. "chartCursor": {
  652. "pan": true,
  653. "valueLineEnabled": true,
  654. "valueLineBalloonEnabled": true,
  655. "cursorAlpha": 0,
  656. "valueLineAlpha": 0.2
  657. },
  658. "categoryField": "issueCategory",
  659. "categoryAxis": {
  660. //"parseDates": true,
  661. "dashLength": 1,
  662. "minorGridEnabled": true
  663. },
  664. "legend": {
  665. "useGraphSettings": true,
  666. "position": "top"
  667. },
  668. "balloon": {
  669. "borderThickness": 1,
  670. "shadowAlpha": 0
  671. },
  672. "export": {
  673. "enabled": true,
  674. "fileName": "Complaint`s Type Wise Pending Count`s"
  675. },
  676. "dataProvider": chartData,
  677. });
  678. }
  679. </script>
  680. <script>
  681. $(document).ready(function() {
  682. //loading.html(searchinfo("<b>Please wait as I'm trying to fetch the data. It will take less than 30 seconds.</b>"));
  683. loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
  684. call_loading('deal-analytic-chart','start');
  685. $("#pie_content_html").html("");
  686. // Initial fetch and countdown start
  687. get_department_data(); // Dropdown fileter value
  688. //refreshInterval = setInterval(updateCountdown, 1000);
  689. });
  690. </script>
  691. </body>
  692. </html>