CM works overall dashboard integrate with gcc_office_portal
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.

433 lines
22 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  4. <style>
  5. .form-group {
  6. margin-bottom: 20px; /* Add space between form groups */
  7. }
  8. .form-select.custom-select {
  9. width: 100%; /* Ensure select elements take full width of their container */
  10. }
  11. </style>
  12. <body>
  13. <div class="wrapper">
  14. <!-- Header -->
  15. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  16. <div class="page-wrap">
  17. <!-- Left Menu -->
  18. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  19. <div class="main-content">
  20. <div class="container-fluid">
  21. <div class="page-header">
  22. <div class="row align-items-end">
  23. <div class="col-lg-8">
  24. <div class="page-header-title">
  25. <i class="fas fa-th-large bg-blue"></i>
  26. <div class="d-inline">
  27. <h5>CM Dashboard</h5>
  28. <span>All Details</span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="col-lg-4">
  33. <nav class="breadcrumb-container" aria-label="breadcrumb">
  34. <ol class="breadcrumb">
  35. <li class="breadcrumb-item"><a href="/index"><i class="ik ik-home"></i></a></li>
  36. <li class="breadcrumb-item">CM Dashboard</li>
  37. <li class="breadcrumb-item active" aria-current="page">All Details</li>
  38. </ol>
  39. </nav>
  40. </div>
  41. </div>
  42. </div>
  43. <hr>
  44. <div class="row">
  45. <div class="col-md-12">
  46. <div class="card">
  47. <div class="card-header">
  48. <div class="row">
  49. <div class="col-md-4">
  50. <div class="form-group">
  51. <label for="zone-select"><b>Zone Name:</b></label>
  52. <select id="zone-select" class="form-select custom-select">
  53. <option value="all">--All--</option>
  54. <option value="B-Buildings">B-Buildings</option>
  55. <option value="BR-Bus Route Roads">BR-Bus Route Roads</option>
  56. <option value="D-Storm Water Drains">D-Storm Water Drains</option>
  57. <option value="J-Bridges">J-Bridges</option>
  58. <option value="L-Electrical">L-Electrical</option>
  59. <option value="P-Parks and Playfields">P-Parks and Playfields</option>
  60. <option value="Q-Solid Waste Management">Q-Solid Waste Management</option>
  61. <option value="SP-SPECIAL PROJECTS">SP-SPECIAL PROJECTS</option>
  62. <option value="01 - NA-THIRUVOTTIYUR">01 - NA-THIRUVOTTIYUR</option>
  63. <option value="02 - NB-MANALI">02 - NB-MANALI</option>
  64. <option value="03 - NC-MADHAVARAM">03 - NC-MADHAVARAM</option>
  65. <option value="04 - ND-TONDIARPET">04 - ND-TONDIARPET</option>
  66. <option value="05 - NE-ROYAPURAM">05 - NE-ROYAPURAM</option>
  67. <option value="06 - NF-THIRU-VI-KA NAGAR">06 - NF-THIRU-VI-KA NAGAR</option>
  68. <option value="07 - NG-AMBATTUR">07 - NG-AMBATTUR</option>
  69. <option value="08 - NH-ANNA NAGAR">08 - NH-ANNA NAGAR</option>
  70. <option value="09 - NJ-TEYNAMPET">09 - NJ-TEYNAMPET</option>
  71. <option value="10 - NK-KODAMBAKKAM">10 - NK-KODAMBAKKAM</option>
  72. <option value="11 - NL-VALASARAVAKKAM">11 - NL-VALASARAVAKKAM</option>
  73. <option value="12 - NM-ALANDUR">12 - NM-ALANDUR</option>
  74. <option value="13 - NN-ADYAR">13 - NN-ADYAR</option>
  75. <option value="14 - NP-PERUNGUDI">14 - NP-PERUNGUDI</option>
  76. <option value="15 - NQ-SHOZHINGANALLUR">15 - NQ-SHOZHINGANALLUR</option>
  77. </select>
  78. </div>
  79. </div>
  80. <div class="col-md-4">
  81. <div class="form-group">
  82. <label for="scheme-select"><b>Scheme Name:</b></label>
  83. <select id="scheme-select" class="form-select custom-select">
  84. <option value="all">--All--</option>
  85. <option value="CAPITAL GRANT FUND">CAPITAL GRANT FUND</option>
  86. <option value="CHENNAI MEGA CITY DEVELOPMENT MISSION">CHENNAI MEGA CITY DEVELOPMENT MISSION</option>
  87. <option value="HEALTH BUILDINGS-NUHM">HEALTH BUILDINGS-NUHM</option>
  88. <option value="NULM - NIGHT SHELTER (SPL)">NULM - NIGHT SHELTER (SPL)</option>
  89. <option value="Own Source Fund">Own Source Fund</option>
  90. <option value="SMART CITY">SMART CITY</option>
  91. <option value="SMART CITY-SPECIAL PROJECT">SMART CITY-SPECIAL PROJECT</option>
  92. <option value="SWACHH BHARAT MISSION">SWACHH BHARAT MISSION</option>
  93. <option value="TURIF - 2020-2021">TURIF - 2020-2021</option>
  94. <option value="TURIF (2018-2019)">TURIF (2018-2019)</option>
  95. <option value="TURIF (2019-2020)">TURIF (2019-2020)</option>
  96. </select>
  97. </div>
  98. </div>
  99. <div class="col-md-4">
  100. <div class="form-group">
  101. <label for="work-select"><b>Type of Work Name:</b></label>
  102. <select id="work-select" class="form-select custom-select">
  103. <option value="all">--All--</option>
  104. <option value="Bridges">Bridges</option>
  105. <option value="Buildings">Buildings</option>
  106. <option value="Culvert">Culvert</option>
  107. <option value="Electrical">Electrical</option>
  108. <option value="Flyovers">Flyovers</option>
  109. <option value="Footpath">Footpath</option>
  110. <option value="Overbridges">Overbridges</option>
  111. <option value="Parks">Parks</option>
  112. <option value="Playfields">Playfields</option>
  113. <option value="Road Cut Restoration">Road Cut Restoration</option>
  114. <option value="Roads">Roads</option>
  115. <option value="Storm Water Drain">Storm Water Drain</option>
  116. <option value="Subway">Subway</option>
  117. </select>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="card-block">
  123. <div>
  124. <table id="worksDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="99.5%">
  125. <thead class="thead-dark">
  126. <tr role="row">
  127. <th>S.No</th>
  128. <th>EST ID</th>
  129. <th>Region Name</th>
  130. <th>Zone Name</th>
  131. <th>Scheme Name</th>
  132. <th>Category of Work</th>
  133. <th>Type of Work</th>
  134. </tr>
  135. </thead>
  136. <tbody>
  137. <tr th:each="cmlistinfo, i : ${cmlist}">
  138. <td th:text="${i.count}">0</td>
  139. <td>
  140. <a style="color: blue;" href="javascript:void(0)" th:onclick="'showModal(' + ${cmlistinfo.data_id} + ')'"
  141. th:text="${cmlistinfo.abs_est_number}"></a>
  142. </td>
  143. <td th:text="${cmlistinfo.regionname}"></td>
  144. <td th:text="${cmlistinfo.zonename}"></td>
  145. <td th:text="${cmlistinfo.schemename}"></td>
  146. <td th:text="${cmlistinfo.workcategory}"></td>
  147. <td th:text="${cmlistinfo.typeofwork}"></td>
  148. </tr>
  149. </tbody>
  150. <tfoot class="thead-dark">
  151. <tr>
  152. <th>S.No</th>
  153. <th>EST ID</th>
  154. <th>Region Name</th>
  155. <th>Zone Name</th>
  156. <th>Scheme Name</th>
  157. <th>Category of Work</th>
  158. <th>Type of Work</th>
  159. </tr>
  160. </tfoot>
  161. </table>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  170. </div>
  171. </div>
  172. <!-- Modal -->
  173. <div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  174. <div class="modal-dialog modal-lg" role="document">
  175. <div class="modal-content">
  176. <div class="modal-header">
  177. <h5 class="modal-title" id="detailModalLabel"><span id="modal_abs_est_number"></span></h5>
  178. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  179. <span aria-hidden="true">&times;</span>
  180. </button>
  181. </div>
  182. <div class="modal-body">
  183. <table class="table table-striped table-bordered">
  184. <tbody>
  185. <tr><th>Name of Work</th><td id="modal_nameofwork"></td></tr>
  186. <tr><th>Region Name</th><td id="modal_regionname"></td></tr>
  187. <tr><th>Zone Name</th><td id="modal_zonename"></td></tr>
  188. <tr><th>Ward Name</th><td id="modal_wardname"></td></tr>
  189. </tbody>
  190. </table>
  191. <table class="table table-striped table-bordered">
  192. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Agreement Details:</span></thead>
  193. <tbody>
  194. <tr><th>Administration Sanctioned</th><td id="modal_administrationsanctioned"></td></tr>
  195. <tr><th>Agreement Date</th><td id="modal_agreementdate"></td></tr>
  196. <tr><th>Agreement Period</th><td id="modal_agreementperiod"></td></tr>
  197. <tr><th>Council Resolution Date</th><td id="modal_councilresolutiondate"></td></tr>
  198. <tr><th>LOA Issued</th><td id="modal_loaissued"></td></tr>
  199. </tbody>
  200. </table>
  201. <table class="table table-striped table-bordered">
  202. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Scheme Details:</span></thead>
  203. <tbody>
  204. <tr><th>Scheme Name</th><td id="modal_schemename"></td></tr>
  205. <tr><th>Technical Sanction Date</th><td id="modal_technicalsanctiondate"></td></tr>
  206. <tr><th>Technical Bid Finalized</th><td id="modal_technicalbidfinalized"></td></tr>
  207. <tr><th>Tender Announced</th><td id="modal_tenderannounced"></td></tr>
  208. </tbody>
  209. </table>
  210. <table class="table table-striped table-bordered">
  211. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Work Category Details:</span></thead>
  212. <tbody>
  213. <tr><th>Work Category</th><td id="modal_workcategory"></td></tr>
  214. <tr><th>Work Commenced</th><td id="modal_workcommenced"></td></tr>
  215. <tr><th>Work Order Issued</th><td id="modal_workorderissued"></td></tr>
  216. </tbody>
  217. </table>
  218. <table class="table table-striped table-bordered">
  219. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Completed Date Wise Details:</span></thead>
  220. <tbody>
  221. <tr><th>Completed Date 25%</th><td id="modal_completeddate_25_percent"></td></tr>
  222. <tr><th>Completed Date 50%</th><td id="modal_completeddate_50_percent"></td></tr>
  223. <tr><th>Completed Date 75%</th><td id="modal_completeddate_75_percent"></td></tr>
  224. <tr><th>Completed Date 100%</th><td id="modal_completeddate_100_percent"></td></tr>
  225. <tr><th>Completion Report Date</th><td id="modal_completionreportdate"></td></tr>
  226. </tbody>
  227. </table>
  228. <table class="table table-striped table-bordered">
  229. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Payment Details:</span></thead>
  230. <tbody>
  231. <tr><th>Type of Work</th><td id="modal_typeofwork"></td></tr>
  232. <tr><th>Value of Work</th><td>Rs.<span id="modal_valueofwork"></span></td></tr>
  233. <tr><th>Price Bid Finalize Date</th><td id="modal_pricebidfinalized"></td></tr>
  234. <tr><th>Paymentfully Settled Date</th><td id="modal_paymentfullysettleddate"></td></tr>
  235. </tbody>
  236. </table>
  237. <table class="table table-striped table-bordered">
  238. <thead><span style="font-weight: bold;color: red; font-size: 20px;">Image:</span></thead>
  239. <tbody>
  240. <tr><td><img id="modal_workimage" src="" alt="Work Image" style="width:100%;"></td></tr>
  241. </tbody>
  242. </table>
  243. </div>
  244. <div class="modal-footer">
  245. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <!-- Include jQuery and Bootstrap JavaScript -->
  251. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  252. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  253. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  254. <script type="text/javascript">
  255. $(document).ready(function() {
  256. var table = $('#worksDatatable').DataTable({
  257. dom: 'Bftip',
  258. columnDefs: [
  259. { targets: 'no-sort', orderable: false }
  260. ],
  261. lengthMenu: [
  262. [50, 100, 200, 500, -1],
  263. ['50 rows', '100 rows', '200 rows', 'Show all']
  264. ],
  265. scrollY: '50vh',
  266. fixedColumns: {
  267. left: 1,
  268. right: 1
  269. },
  270. buttons: [
  271. {
  272. extend: 'pageLength',
  273. className: 'btn btn-warning'
  274. },
  275. {
  276. title: 'Data export',
  277. extend: 'copyHtml5',
  278. text: 'Copy',
  279. className: 'btn btn-secondary',
  280. id: 'copyBtn'
  281. },
  282. {
  283. extend: 'excelHtml5',
  284. text: 'Excel',
  285. className: 'btn btn-secondary',
  286. id: 'excelBtn'
  287. },
  288. {
  289. extend: 'csvHtml5',
  290. text: 'CSV',
  291. className: 'btn btn-secondary',
  292. id: 'csvBtn'
  293. },
  294. {
  295. extend: 'pdfHtml5',
  296. text: 'PDF',
  297. className: 'btn btn-secondary',
  298. id: 'pdfBtn'
  299. }
  300. ],
  301. fixedHeader: true,
  302. autoWidth: true,
  303. responsive: true,
  304. searching: false,
  305. select: false,
  306. processing: false
  307. });
  308. function getUrlParameter(name) {
  309. name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  310. var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
  311. var results = regex.exec(location.search);
  312. return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
  313. }
  314. // Get URL parameters
  315. let zoneParam = getUrlParameter('zonename');
  316. let schemeParam = getUrlParameter('schemename');
  317. let workParam = getUrlParameter('typeofwork');
  318. // Set the dropdown values if parameters exist
  319. if (zoneParam) {
  320. $('#zone-select').val(zoneParam);
  321. }
  322. if (schemeParam) {
  323. $('#scheme-select').val(schemeParam);
  324. }
  325. if (workParam) {
  326. $('#work-select').val(workParam);
  327. }
  328. // Trigger the DataTable filter
  329. $('#zone-select, #scheme-select, #work-select').trigger('change');
  330. // Custom filter function
  331. $.fn.dataTable.ext.search.push(
  332. function(settings, data, dataIndex) {
  333. let zoneValue = $('#zone-select').val();
  334. let schemeValue = $('#scheme-select').val();
  335. let workValue = $('#work-select').val();
  336. let zoneText = data[3]; // Index of zone column
  337. let schemeText = data[4]; // Index of scheme column
  338. let workText = data[6]; // Index of work column
  339. if (
  340. (zoneValue === "all" || zoneText.includes(zoneValue)) &&
  341. (schemeValue === "all" || schemeText.includes(schemeValue)) &&
  342. (workValue === "all" || workText.includes(workValue))
  343. ) {
  344. return true;
  345. }
  346. return false;
  347. }
  348. );
  349. // Event listener for filter dropdowns
  350. $('#zone-select, #scheme-select, #work-select').on('change', function() {
  351. table.draw();
  352. });
  353. });
  354. function showModal(dataId) {
  355. // Fetch the data based on dataId
  356. $.ajax({
  357. url: '/gcc/api/cmdashboard/all-list/' + dataId,
  358. method: 'GET',
  359. success: function(data) {
  360. // Update the modal content
  361. document.getElementById('modal_abs_est_number').innerText = data.abs_est_number;
  362. document.getElementById('modal_nameofwork').innerText = data.nameofwork;
  363. document.getElementById('modal_regionname').innerText = data.regionname;
  364. document.getElementById('modal_zonename').innerText = data.zonename;
  365. document.getElementById('modal_wardname').innerText = data.wardname;
  366. document.getElementById('modal_administrationsanctioned').innerText = data.administrationsanctioned;
  367. document.getElementById('modal_agreementdate').innerText = data.agreementdate;
  368. document.getElementById('modal_agreementperiod').innerText = data.agreementperiod;
  369. document.getElementById('modal_councilresolutiondate').innerText = data.councilresolutiondate;
  370. document.getElementById('modal_loaissued').innerText = data.loaissued;
  371. document.getElementById('modal_schemename').innerText = data.schemename;
  372. document.getElementById('modal_technicalsanctiondate').innerText = data.technicalsanctiondate;
  373. document.getElementById('modal_technicalbidfinalized').innerText = data.technicalbidfinalized;
  374. document.getElementById('modal_tenderannounced').innerText = data.tenderannounced;
  375. document.getElementById('modal_workcategory').innerText = data.workcategory;
  376. document.getElementById('modal_workcommenced').innerText = data.workcommenced;
  377. document.getElementById('modal_workorderissued').innerText = data.workorderissued;
  378. document.getElementById('modal_completeddate_25_percent').innerText = data.completeddate_25_percent;
  379. document.getElementById('modal_completeddate_50_percent').innerText = data.completeddate_50_percent;
  380. document.getElementById('modal_completeddate_75_percent').innerText = data.completeddate_75_percent;
  381. document.getElementById('modal_completeddate_100_percent').innerText = data.completeddate_100_percent;
  382. document.getElementById('modal_completionreportdate').innerText = data.completionreportdate;
  383. document.getElementById('modal_typeofwork').innerText = data.typeofwork;
  384. document.getElementById('modal_valueofwork').innerText = data.valueofwork;
  385. document.getElementById('modal_pricebidfinalized').innerText = data.pricebidfinalized;
  386. document.getElementById('modal_paymentfullysettleddate').innerText = data.paymentfullysettleddate;
  387. $('#modal_workimage').attr('src', data.imageurl);
  388. // Show the modal
  389. $('#detailModal').modal('show');
  390. },
  391. error: function(err) {
  392. console.error(err);
  393. alert('Failed to fetch data');
  394. }
  395. });
  396. }
  397. </script>
  398. </body>
  399. </html>