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.

298 lines
12 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. <!--[if lt IE 8]>
  7. <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>
  8. <![endif]-->
  9. <div class="wrapper">
  10. <!-- header top menu Start -->
  11. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  12. <!-- header top menu end -->
  13. <div class="page-wrap">
  14. <!--=============== Left Menu side Start ================-->
  15. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  16. <!--=============== Left side End ================-->
  17. <div class="main-content">
  18. <div class="container-fluid">
  19. <div class="page-header">
  20. <div class="row align-items-end">
  21. <div class="col-lg-6">
  22. <div class="page-header-title">
  23. <i class="far fa-list-alt bg-blue"></i>
  24. <div class="d-inline">
  25. <h5>Circular List</h5>
  26. <span>Circular / Minutes</span>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="col-lg-6">
  31. <nav class="breadcrumb-container" aria-label="breadcrumb">
  32. <ol class="breadcrumb">
  33. <li class="breadcrumb-item">
  34. <a href="/index"><i class="ik ik-home"></i></a>
  35. </li>
  36. <li class="breadcrumb-item" aria-current="page">SOS</li>
  37. <li class="breadcrumb-item active" aria-current="page">Request List</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-block">
  48. <div id="tableLoading"></div>
  49. <div>
  50. <table id="circularDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
  51. <thead class="thead-dark">
  52. <tr class="table-bordered">
  53. <th class="text-center no-sort" width="2%">S.No</th>
  54. <th class="text-center" width="10%">Type</th>
  55. <th class="text-center no-sort" width="2%">Mode</th>
  56. <th class="text-center" width="10%">Name</th>
  57. <th class="text-center" width="10%">Mobile</th>
  58. <th class="text-center" width="10%">Zone</th>
  59. <th class="text-center" width="10%">ward</th>
  60. <th class="text-center" width="10%">Street Name</th>
  61. <th class="text-center" width="10%">Comments</th>
  62. <th class="text-center" width="10%">Status</th>
  63. <th class="text-center no-sort no-exportable no-print" width="5%"><i class="ik ik-more-horizontal"></i></th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. </tbody>
  68. <!--
  69. <tfoot class="thead-dark">
  70. <tr>
  71. <th class="text-center no-sort">S.No</th>
  72. <th class="text-center">Category</th>
  73. <th class="text-center">Type</th>
  74. <th class="text-center">Department</th>
  75. <th class="text-center">Date</th>
  76. <th class="text-center">Subject</th>
  77. <th class="text-center no-sort no-exportable no-print"><i class="ik ik-more-horizontal"></i></th>
  78. </tr>
  79. </tfoot>
  80. -->
  81. </table>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  90. </div>
  91. </div>
  92. <div th:replace="~{fragments/modules/circular/modal-box :: div}"></div>
  93. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  94. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  95. <script th:replace="~{fragments/modules/circular/script :: script}"></script>
  96. <script th:inline="javascript">
  97. var createdBy = /*[[${LoginUserId}]]*/'';
  98. var uploadDirectory = /*[[${uploadDirectory}]]*/'';
  99. var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
  100. // Loading Div id
  101. const loading = $("#tableLoading");
  102. // DataTables buttons configuration
  103. var buttons = [
  104. {
  105. extend: 'pageLength',
  106. className: 'btn btn-warning'
  107. },
  108. {
  109. title: 'Data export',
  110. extend: 'copyHtml5',
  111. text: 'Copy',
  112. className: 'btn btn-secondary',
  113. id: 'copyBtn'
  114. },
  115. {
  116. extend: 'excelHtml5',
  117. text: 'Excel',
  118. className: 'btn btn-secondary',
  119. id: 'excelBtn',
  120. title: 'Circular List'
  121. },
  122. {
  123. extend: 'csvHtml5',
  124. text: 'CSV',
  125. className: 'btn btn-secondary',
  126. id: 'csvBtn',
  127. title: 'Circular List'
  128. },
  129. {
  130. extend: 'pdfHtml5',
  131. text: 'PDF',
  132. className: 'btn btn-secondary',
  133. id: 'pdfBtn',
  134. title: 'Circular List'
  135. },
  136. {
  137. extend: 'print',
  138. text: 'Print',
  139. className: 'btn btn-secondary',
  140. id: 'printBtn',
  141. title: 'Circular List',
  142. exportOptions: {
  143. columns: ':visible:not(.no-print)' // Exclude columns with class 'no-print' from print view
  144. }
  145. },
  146. {
  147. extend: 'colvis',
  148. className: 'btn btn-warning'
  149. },
  150. ];
  151. function call_loading(){
  152. loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
  153. }
  154. function remove_loading(){
  155. loading.html("");
  156. }
  157. /* Get Complaints Data */
  158. function get_rescue_data(){
  159. var apiUrl = '/gcc/api/sos/getRescueList';
  160. // Return a Promise
  161. return new Promise(function(resolve, reject) {
  162. $.ajax({
  163. url: apiUrl,
  164. type: 'GET',
  165. dataType: 'json',
  166. success: function(jsonResponse) {
  167. // Resolve the Promise with the department list
  168. resolve(jsonResponse);
  169. },
  170. error: function(xhr, status, error) {
  171. // Reject the Promise with the error message
  172. reject(error);
  173. }
  174. });
  175. });
  176. }
  177. /* Get Complaints List */
  178. function get_rescue_list(){
  179. get_rescue_data().then(function(rescueList) {
  180. // Handle the complaint list
  181. generate_table(rescueList);
  182. }).catch(function(error) {
  183. // Handle errors
  184. if (error && error.message) {
  185. console.error('Error fetching resuce list:', error.message);
  186. } else {
  187. console.error('An error occurred while fetching rescue list:', error);
  188. }
  189. });
  190. }
  191. /* Call DataTable function */
  192. function generate_table(data){
  193. var table = $('#circularDatatable').DataTable( {
  194. dom: 'Bftip',
  195. columnDefs: [
  196. { targets: 'no-sort', "orderable": false },
  197. { targets: 'no-exportable', "exportable": false },
  198. { targets: 5, orderSequence: ['desc'] }
  199. ],
  200. lengthMenu: [
  201. [ 50, 100, 200, 500, -1 ],
  202. [ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
  203. ],
  204. /*scrollY: '50vh',*/
  205. fixedColumns: {
  206. left: 0,
  207. right: 0
  208. },
  209. buttons: [buttons],
  210. responsive: true,
  211. searching: false,
  212. select: false,
  213. processing: false,
  214. } );
  215. // Clearn Table data
  216. table.clear().draw();
  217. // Add rows to DataTable
  218. //var rowNum = data.length;
  219. var rowNum = 1;
  220. $.each(data, function(index, row) {
  221. var action ="1";//`<center><a href="#" onclick="return viewFile('${file_text}','${filetype}');" class="text-blue" data-animation="true" data-toggle="tooltip" data-placement="top" title="View Circular Details" data-original-title="View Circular Details"><i class="ik ik-eye f-16 text-blue"></i></a></center>`;
  222. table.row.add([
  223. rowNum++,
  224. row['request_type'],
  225. row['modeofcomplient'],
  226. row['contact_name'],
  227. row['contact_number'],
  228. row['zone'],
  229. row['ward'],
  230. row['streetname'],
  231. row['remarks'],
  232. row['statusText'],
  233. action
  234. ]).draw(false);
  235. });
  236. // Enable tooltips for all elements with data-toggle="tooltip"
  237. $('[data-toggle="tooltip"]').tooltip();
  238. remove_loading(); // remove Loading
  239. }
  240. $(document).ready(function() {
  241. call_loading();
  242. get_rescue_list();
  243. });
  244. function viewFile(filename,filetype){
  245. $("#viewFileBox").modal({
  246. backdrop: 'static',
  247. keyboard: false
  248. }); // Show Modal Box
  249. var filepath= '/gcc/files/circular/'+filename;
  250. var fileHTML = '';
  251. if(filetype=='application/pdf'){
  252. fileHTML = `<iframe src="${filepath}" type="application/pdf" width="100%" height="600px"></iframe>`;
  253. }
  254. else{
  255. fileHTML =nodata;
  256. }
  257. console.error(fileHTML);
  258. $('#viewFileBoxBody').html(fileHTML); // Inject content into modal body
  259. return false;
  260. }
  261. </script>
  262. </body>
  263. </html>