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.

300 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">Circular & Minutes</li>
  37. <li class="breadcrumb-item active" aria-current="page">Circular 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%">Category</th>
  55. <th class="text-center" width="10%">Type</th>
  56. <th class="text-center" width="10%">Department</th>
  57. <th class="text-center" width="10%">Date</th>
  58. <th class="text-center" width="40%">Subject</th>
  59. <th class="text-center no-sort no-exportable no-print" width="5%"><i class="ik ik-more-horizontal"></i></th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. </tbody>
  64. <!--
  65. <tfoot class="thead-dark">
  66. <tr>
  67. <th class="text-center no-sort">S.No</th>
  68. <th class="text-center">Category</th>
  69. <th class="text-center">Type</th>
  70. <th class="text-center">Department</th>
  71. <th class="text-center">Date</th>
  72. <th class="text-center">Subject</th>
  73. <th class="text-center no-sort no-exportable no-print"><i class="ik ik-more-horizontal"></i></th>
  74. </tr>
  75. </tfoot>
  76. -->
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  86. </div>
  87. </div>
  88. <div th:replace="~{fragments/modules/circular/modal-box :: div}"></div>
  89. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  90. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  91. <script th:replace="~{fragments/modules/circular/script :: script}"></script>
  92. <script th:inline="javascript">
  93. var createdBy = /*[[${LoginUserId}]]*/'';
  94. var uploadDirectory = /*[[${uploadDirectory}]]*/'';
  95. var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
  96. // Loading Div id
  97. const loading = $("#tableLoading");
  98. // DataTables buttons configuration
  99. var buttons = [
  100. {
  101. extend: 'pageLength',
  102. className: 'btn btn-warning'
  103. },
  104. {
  105. title: 'Data export',
  106. extend: 'copyHtml5',
  107. text: 'Copy',
  108. className: 'btn btn-secondary',
  109. id: 'copyBtn'
  110. },
  111. {
  112. extend: 'excelHtml5',
  113. text: 'Excel',
  114. className: 'btn btn-secondary',
  115. id: 'excelBtn',
  116. title: 'Circular List'
  117. },
  118. {
  119. extend: 'csvHtml5',
  120. text: 'CSV',
  121. className: 'btn btn-secondary',
  122. id: 'csvBtn',
  123. title: 'Circular List'
  124. },
  125. {
  126. extend: 'pdfHtml5',
  127. text: 'PDF',
  128. className: 'btn btn-secondary',
  129. id: 'pdfBtn',
  130. title: 'Circular List'
  131. },
  132. {
  133. extend: 'print',
  134. text: 'Print',
  135. className: 'btn btn-secondary',
  136. id: 'printBtn',
  137. title: 'Circular List',
  138. exportOptions: {
  139. columns: ':visible:not(.no-print)' // Exclude columns with class 'no-print' from print view
  140. }
  141. },
  142. {
  143. extend: 'colvis',
  144. className: 'btn btn-warning'
  145. },
  146. ];
  147. function call_loading(){
  148. loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
  149. }
  150. function remove_loading(){
  151. loading.html("");
  152. }
  153. /* Get Complaints Data */
  154. function get_circular_data(){
  155. var apiUrl = '/gcc/api/circular/getCircularList';
  156. // Return a Promise
  157. return new Promise(function(resolve, reject) {
  158. $.ajax({
  159. url: apiUrl,
  160. type: 'GET',
  161. dataType: 'json',
  162. success: function(jsonResponse) {
  163. // Resolve the Promise with the department list
  164. resolve(jsonResponse);
  165. },
  166. error: function(xhr, status, error) {
  167. // Reject the Promise with the error message
  168. reject(error);
  169. }
  170. });
  171. });
  172. }
  173. /* Get Complaints List */
  174. function get_circular_list(){
  175. get_circular_data().then(function(circularList) {
  176. // Handle the complaint list
  177. generate_table(circularList);
  178. }).catch(function(error) {
  179. // Handle errors
  180. if (error && error.message) {
  181. console.error('Error fetching circular list:', error.message);
  182. } else {
  183. console.error('An error occurred while fetching circular list:', error);
  184. }
  185. });
  186. }
  187. /* Call DataTable function */
  188. function generate_table(data){
  189. var table = $('#circularDatatable').DataTable( {
  190. dom: 'Bftip',
  191. columnDefs: [
  192. { targets: 'no-sort', "orderable": false },
  193. { targets: 'no-exportable', "exportable": false },
  194. { targets: 5, orderSequence: ['desc'] }
  195. ],
  196. lengthMenu: [
  197. [ 50, 100, 200, 500, -1 ],
  198. [ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
  199. ],
  200. /*scrollY: '50vh',*/
  201. fixedColumns: {
  202. left: 0,
  203. right: 0
  204. },
  205. buttons: [buttons],
  206. responsive: true,
  207. searching: false,
  208. select: false,
  209. processing: false,
  210. } );
  211. // Clearn Table data
  212. table.clear().draw();
  213. // Add rows to DataTable
  214. //var rowNum = data.length;
  215. var rowNum = 1;
  216. $.each(data, function(index, row) {
  217. var circular_category=row["category"];
  218. circular_category=circular_category.charAt(0).toUpperCase() + circular_category.slice(1);
  219. var file_text = `No File`;
  220. var filetype = '';
  221. if(row['file_exits']=='true'){
  222. file_text = row['file_name'];
  223. filetype = row['file_type'];
  224. }
  225. var action =`<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>`;
  226. table.row.add([
  227. rowNum++,
  228. circular_category,
  229. row['circular_type_name'],
  230. row['department_name'],
  231. convertdate_2(row['date']),
  232. row['subject'],
  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_circular_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>