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.

354 lines
13 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
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  4. <body>
  5. <div class="wrapper">
  6. <!-- header top menu Start -->
  7. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  8. <!-- header top menu end -->
  9. <div class="page-wrap">
  10. <!--=============== Left Menu side Start ================-->
  11. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  12. <!--=============== Left side End ================-->
  13. <div class="main-content">
  14. <div class="container-fluid">
  15. <div class="page-header">
  16. <div class="row align-items-end">
  17. <div class="col-lg-8">
  18. <div class="page-header-title">
  19. <i class="ik ik-layers bg-blue"></i>
  20. <div class="d-inline">
  21. <h5>PGR List</h5>
  22. <span>PGR list module</span>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="col-lg-4">
  27. <nav class="breadcrumb-container" aria-label="breadcrumb">
  28. <ol class="breadcrumb">
  29. <li class="breadcrumb-item"><a href="/index"><i
  30. class="ik ik-home"></i></a></li>
  31. <li class="breadcrumb-item">PGR Complaints</li>
  32. <li class="breadcrumb-item">All Reports</li>
  33. <li class="breadcrumb-item active" aria-current="page">Complaints
  34. List</li>
  35. </ol>
  36. </nav>
  37. </div>
  38. </div>
  39. </div>
  40. <hr>
  41. <div class="row">
  42. <div class="col-md-12">
  43. <div class="card">
  44. <div class="card-block">
  45. <form class="" action="" onsubmit="getReport()">
  46. <div class="row">
  47. <div class="col-md-6">
  48. <label for="fromDate" class="">From Date</label> <input
  49. type="date" class="form-control" id="fromDate"
  50. name="sFrDate" th:value="${sFrDate}"
  51. data-date-format="dd/mm/yy" required>
  52. </div>
  53. <div class="col-md-6">
  54. <label for="toDate" class="">To Date</label> <input
  55. type="date" class="form-control" id="toDate" name="sToDate"
  56. th:value="${sToDate}" data-date-format="dd/mm/yy" required>
  57. </div>
  58. </div>
  59. <div class="row">
  60. <div class="col-md-6">
  61. <label for="complaintgroupDropdown">Group:</label> <select
  62. class="form-control" name="sRptGroup" id="group">
  63. <option value='0' th:selected="${sRptGroup == 0}">----
  64. All ----</option>
  65. <option th:each="complaintGroup : ${complaintGroups}"
  66. th:value="${complaintGroup.name}"
  67. th:text="${complaintGroup.name}"
  68. th:selected="${sRptGroup == complaintGroup.name}"></option>
  69. </select>
  70. </div>
  71. <div class="col-md-6">
  72. <label for="complainttypesDropdown">Complaint Type:</label>
  73. <select class="form-control" name="sRptType" id="type">
  74. <option value='0' th:selected="${sRptType == 0}">----
  75. All ----</option>
  76. <option th:each="complaintType : ${complaintTypes}"
  77. th:value="${complaintType.name}"
  78. th:text="${complaintType.name}"
  79. th:selected="${sRptType == complaintType.name}"></option>
  80. </select>
  81. </div>
  82. </div>
  83. <div class="row">
  84. <div class="col-md-6">
  85. <label for="complaintStatus">Status :</label> <select
  86. class="form-control" name="cbCompStatus" id="status"><option
  87. value='0'>---- All ----</option>
  88. <option value='Pending'
  89. th:selected="${cbCompStatus == 'Pending'}">Pending</option>
  90. <option value='Completed'
  91. th:selected="${cbCompStatus == 'Completed'}">Completed</option>
  92. <option value='Forwarded'
  93. th:selected="${cbCompStatus == 'Forwarded'}">Forwarded</option>
  94. <option value='Reopened'
  95. th:selected="${cbCompStatus == 'Reopened'}">Reopened</option>
  96. </select>
  97. </div>
  98. <div class="col-md-6">
  99. <label for="modes">Modes :</label> <select
  100. class="form-control" name="mode" id="mode">
  101. <option value='0'>---- All ----</option>
  102. <option value='2'>Phone</option>
  103. <option value='3'>Paper form</option>
  104. <option value='1'>Internet</option>
  105. <option value='4'>WHATSAPP</option>
  106. <option value='5'>FLOOD CONTROL</option>
  107. <option value='6'>MOBILE APPLICATION</option>
  108. <option value='7'>SOCIAL MEDIA</option>
  109. <option value='8'>NEWS PAPER</option>
  110. </select>
  111. </div>
  112. <div class="col-md-6"
  113. style="display: flex; justify-content: space-between; align-items: center; margin-top: 25px;">
  114. <button type="submit" style="width: 100%; height: auto;"
  115. class=" btn btn-sm btn-primary btn-l">search</button>
  116. </div>
  117. </div>
  118. </form>
  119. <br> <br>
  120. <div>
  121. <table id="assetDatatable"
  122. class="table table-striped table-bordered table-hover dataTable"
  123. role="grid" width="100%">
  124. <thead class="thead-dark">
  125. <tr role="row">
  126. <th class="text-center no-sort" width="1%">S.No</th>
  127. <th class="text-center" width="20%">Zone No</th>
  128. <th class="text-center" width="10%">Div No</th>
  129. <th class="text-center" width="10%">User Name</th>
  130. <th class="text-center" width="20%">Complaint No</th>
  131. <th class="text-center" width="10%">Complaint Type</th>
  132. <th class="text-center" width="10%">Mode</th>
  133. <th class="text-center" width="20%">Location</th>
  134. <th class="text-center" width="10%">Date</th>
  135. <th class="text-center" width="10%">Time</th>
  136. <th class="text-center" width="10%">Status</th>
  137. </tr>
  138. </theadclass="thead-dark">
  139. <tbody>
  140. <tr th:each="pgrreport, i : ${pgrreportlist}"
  141. class="pgrreportlist">
  142. <td th:text="${i.count}">0</td>
  143. <td class="text-center" th:text="${pgrreport.ZONE_NAME}"></td>
  144. <td class="text-center"
  145. th:text="${pgrreport.DIVISION_NAME}"></td>
  146. <td class="text-center" th:text="${pgrreport.USER_NAME}"></td>
  147. <td class="text-center"
  148. th:text="${pgrreport.COMPLAINTNUMBER}"></td>
  149. <td class="text-center"
  150. th:text="${pgrreport.COMPLAINTTYPENAME}"></td>
  151. <td class="text-center" th:text="${pgrreport.MODE}"></td>
  152. <td class="text-center" th:text="${pgrreport.LOCATION}"></td>
  153. <td class="text-center" th:text="${pgrreport.COMPDATE}"></td>
  154. <td class="text-center" th:text="${pgrreport.TIME}"></td>
  155. <td class="text-center" th:text="${pgrreport.STATUS}"></td>
  156. <!-- <td class="text-center" th:if="${asset.isActive}"><span class="badge bg-success">Active</span></td>
  157. <td class="text-center" th:unless="${asset.isActive}"><span class="badge bg-warning">InActive</span></td> -->
  158. <!-- <td class="text-center">
  159. <a th:href="@{#}" th:onclick="return callEdit()" data-animation="true" data-toggle="tooltip" data-placement="top" title="Edit" data-original-title="Edit"><i class="ik ik-edit f-16 text-green"></i></a>&nbsp;&nbsp;
  160. <a th:href="@{#}" th:onclick="return callDelete();" data-animation="true" data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete"><i class="ik ik-trash-2 f-16 text-red"></i></a>
  161. </td> -->
  162. </tr>
  163. </tbody>
  164. <tfoot class="thead-dark">
  165. <tr>
  166. <th class="text-center">S.No</th>
  167. <th class="text-center">Zone No</th>
  168. <th class="text-center">Div No</th>
  169. <th class="text-center">User Name</th>
  170. <th class="text-center">Complaint No</th>
  171. <th class="text-center">Complaint Type</th>
  172. <th class="text-center">Mode</th>
  173. <th class="text-center">Location</th>
  174. <th class="text-center">Date</th>
  175. <th class="text-center">Time</th>
  176. <th class="text-center">Status</th>
  177. </tr>
  178. </tfoot>
  179. </table>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  188. </div>
  189. </div>
  190. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  191. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  192. <script>
  193. let mod = [[${mode}]];
  194. function setDefaultValue(){
  195. document.getElementById("mode").value=mod;
  196. }
  197. setDefaultValue();
  198. $(document).ready(function() {
  199. // DataTables buttons configuration
  200. var buttons = [
  201. {
  202. extend: 'pageLength',
  203. className: 'btn btn-warning'
  204. },
  205. {
  206. title: 'Data export',
  207. extend: 'copyHtml5',
  208. text: 'Copy',
  209. className: 'btn btn-secondary',
  210. id: 'copyBtn'
  211. },
  212. {
  213. extend: 'excelHtml5',
  214. text: 'Excel',
  215. className: 'btn btn-secondary',
  216. id: 'excelBtn'
  217. },
  218. {
  219. extend: 'csvHtml5',
  220. text: 'CSV',
  221. className: 'btn btn-secondary',
  222. id: 'csvBtn'
  223. },
  224. {
  225. extend: 'pdfHtml5',
  226. text: 'PDF',
  227. className: 'btn btn-secondary',
  228. id: 'pdfBtn'
  229. },
  230. // Additional button
  231. /* {
  232. text: '<i class="far fa-plus-square"></i> Add New Asset',
  233. className: 'btn btn-warning',
  234. action: function () {
  235. callAdd();
  236. }
  237. } */
  238. ];
  239. $('#assetDatatable').DataTable( {
  240. dom: 'Bftip',
  241. columnDefs: [
  242. { targets: 'no-sort', orderable: false }
  243. ],
  244. lengthMenu: [
  245. [ 50, 100, 200, 500, -1 ],
  246. [ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
  247. ],
  248. scrollY: '50vh',
  249. fixedColumns: {
  250. left: 1,
  251. right: 1
  252. },
  253. buttons: [buttons],
  254. fixedHeader: true,
  255. autoWidth: true,
  256. responsive: true,
  257. searching: false,
  258. select: false,
  259. processing: false,
  260. } );
  261. } );
  262. function callAdd(){
  263. $('#addForm').modal({
  264. backdrop: 'static',
  265. keyboard: false
  266. })
  267. $('#addForm').modal('show');
  268. }
  269. function getReport(){
  270. alert("Wait for response..")
  271. let sFrDate = document.getElementById("fromdate").value;
  272. let sToDate = document.getElementById("todate").value;
  273. let sRptGroup = document.getElementById("group").value;
  274. let sRptType = document.getElementById("type").value;
  275. let cbCompStatus = document.getElementById("status").value;
  276. let mode = document.getElementById("mode").value;
  277. window.location.href='/allreportlist?sFrDate='+sFrDate+'&sToDate='+sToDate+'&sRptgroup='+sRptgroup+'&sRptType='+sRptType+'&cbCompStatus='+cbCompStatus+'&mode='+mode;
  278. }
  279. // Complainttypes dropdown
  280. $(document).ready(function () {
  281. $.ajax({
  282. url: '/pgr/allreportlist', // Change this URL to your endpoint
  283. type: 'GET',
  284. success: function (data) {
  285. var dropdown = $('#complainttypesDropdown')
  286. $.each(data, function (index, complaintType) {
  287. dropdown.append($('<option></option>').attr('value', complaintType.id).text(complaintType.name));
  288. });
  289. },
  290. error: function () {
  291. alert('Error loading complaint types.');
  292. }
  293. });
  294. });
  295. //ComplaintGroups dropdown
  296. $(document).ready(function () {
  297. $.ajax({
  298. url: '/pgr/allreportlist', // Change this URL to your endpoint
  299. type: 'GET',
  300. success: function (data) {
  301. var dropdown = $('#complaintgroupDropdown')
  302. $.each(data, function (index, complaintGroup) {
  303. dropdown.append($('<option></option>').attr('value', complaintGroup.id).text(complaintGroup.name));
  304. });
  305. },
  306. error: function () {
  307. alert('Error loading complaint group.');
  308. }
  309. });
  310. });
  311. </script>
  312. </body>
  313. </html>