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.

364 lines
16 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!doctype html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="fragments/head-public :: head"></head>
  4. <!-- Page JS Plugins CSS -->
  5. <link rel="stylesheet" href="assets/js/plugins/raty-js/jquery.raty.css">
  6. <body>
  7. <!-- Page Container -->
  8. <div id="page-container" class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  9. <header id="page-header">
  10. <!-- Header Content -->
  11. <div class="content-header p-0">
  12. <div class="row col-12 pt-1" style="margin:0px;">
  13. <div class="col-2 text-center">
  14. <img src="assets/media/images/tamilnadu-logo.png" style="padding-top:2px;" width="50px" alt="Tamilnadu Logo">
  15. </div>
  16. <div class="col-8 text-center">
  17. Government of Tamil Nadu<br>
  18. தமிழ்நாடு அரசு<br>
  19. பெருநகர சென்னை மாநகராட்சி
  20. </div>
  21. <div class="col-2 text-center">
  22. <img src='assets/media/images/logo-sm.png' width="55" alt="Logo Sm">
  23. </div>
  24. </div>
  25. </div>
  26. </header>
  27. <!-- Main Container -->
  28. <main id="main-container">
  29. <!-- Hero -->
  30. <div class="bg-image">
  31. <img src="/assets/media/images/chennai_bg.png" width="100%">
  32. </div>
  33. <!-- END Hero -->
  34. <!-- Page Content -->
  35. <div class="content">
  36. <div class="row">
  37. <div class="col-12">
  38. <!-- Content -->
  39. <div class="flex-grow-1 d-flex align-items-center p-5 bg-body-light" th:if="${assetId <= 0}">
  40. <div class="w-100">
  41. <p class="text-danger fs-4 fw-bold text-uppercase mb-2">
  42. 500 Error
  43. </p>
  44. <h1 class="fw-bold mb-2">
  45. Internal Server Error
  46. </h1>
  47. <p class="fs-4 fw-medium text-muted mb-5">
  48. We are sorry but there was an issue with our server and couldn’t fulfill your request.
  49. </p>
  50. </div>
  51. </div>
  52. <!-- END Content -->
  53. <form th:action="@{/gcc-complaint/save}" th:object="${saveFeedback}" id="saveFeedbackForm" method="post" onsubmit="return validate();" th:if="${assetId > 0}">
  54. <!-- Asset Details -->
  55. <div class="card alert-primary mb-3">
  56. <div class="card-header bg-secondary text-white">
  57. Gcc Asset Details
  58. </div>
  59. <div class="card-body">
  60. <div class="mb-0">
  61. <p class="card-title mb-0 text-center" th:text="${assetName}">Title</p>
  62. </div>
  63. <div class="mb-0">
  64. <p class="card-title mb-0 text-center" th:text="${assetAddress}">Address</p>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="card">
  69. <div class="card-header bg-primary text-white">
  70. Employee Details
  71. </div>
  72. <div class="card-body">
  73. <div class="mb-3">
  74. <label for="uname">Name (Optional):</label>
  75. <input type="text" class="form-control" name="uname" id="uname" placeholder="" required />
  76. <input type="hidden" class="form-control" name="assetId" id="assetId" th:value="${assetId}" required />
  77. </div>
  78. <div class="mb-3">
  79. <label for="mobile">Mobile No:</label>
  80. <input type="text" minlength="10" maxlength="10" pattern="\d*" class="form-control" name="mobile" id="mobile" placeholder="" required />
  81. </div>
  82. </div>
  83. </div>
  84. <div class="card">
  85. <div class="card-header bg-warning text-white">
  86. Complaint Form
  87. </div>
  88. <div class="card-body">
  89. <div class="table-responsive">
  90. <table class="table mb-0" style="padding:0px;">
  91. <tbody>
  92. <!-- Category Questions -->
  93. <tr style="border-bottom:0px;" th:each="questions, i : ${feedbackquestionlist}">
  94. <td style="vertical-align:top"><span class="nav-main-link-badge badge rounded-pill bg-primary" th:text="${i.count}">.)</span></td>
  95. <td>
  96. <p style="margin-bottom: 0.430rem;" th:text="${questions.engQuestion}"></p>
  97. <p th:text="${questions.tamilQuestion}"></p>
  98. <div class="col-md-9 px-5 py-1">
  99. <div class="form-check form-check-inline">
  100. <input class="form-check-input" type="radio" th:name="'cq_' + ${questions.cmqId}" th:id="'cq_' + ${questions.cmqId} + '_1'" value="yes" required>
  101. <label class="form-check-label" th:for="'cq_' + ${questions.cmqId} + '_1'">ஆம் / Yes</label>
  102. </div>
  103. <div class="form-check form-check-inline" >
  104. <input class="form-check-input" type="radio" th:name="'cq_' + ${questions.cmqId}" th:id="'cq_' + ${questions.cmqId} + '_2'" value="no" required>
  105. <label class="form-check-label" th:for="'cq_' + ${questions.cmqId} + '_2'">இல்லை / NO</label>
  106. </div>
  107. </div>
  108. </td>
  109. </tr>
  110. <!-- Parameter Questions -->
  111. <tr style="border-bottom:0px;" th:each="paramQuestions, j : ${assetparameterquestionlist}">
  112. <td style="vertical-align:top" th:text="${j.count + feedbackquestionlist.size}">.)</td>
  113. <td>
  114. <p style="margin-bottom: 0.430rem;" th:text="${paramQuestions.engQuestion}"></p>
  115. <p th:text="${paramQuestions.tamilQuestion}"></p>
  116. <div class="col-md-9 px-5 py-1">
  117. <div class="form-check form-check-inline">
  118. <input class="form-check-input" type="radio" th:name="'pq_' + ${paramQuestions.apqId}" th:id="'pq_' + ${paramQuestions.apqId} + '_1'" value="yes" required>
  119. <label class="form-check-label" th:for="'pq_' + ${paramQuestions.apqId} + '_1'">Yes</label>
  120. </div>
  121. <div class="form-check form-check-inline">
  122. <input class="form-check-input" type="radio" th:name="'pq_' + ${paramQuestions.apqId}" th:id="'pq_' + ${paramQuestions.apqId} + '_2'" value="no" required>
  123. <label class="form-check-label" th:for="'pq_' + ${paramQuestions.apqId} + '_2'">NO</label>
  124. </div>
  125. </div>
  126. </td>
  127. </tr>
  128. <!-- Asset Questions -->
  129. <tr style="border-bottom:0px;" th:each="assetQuestion, k : ${assetquestionlist}">
  130. <td style="vertical-align:top" th:text="${k.count + feedbackquestionlist.size + assetparameterquestionlist.size}">.)</td>
  131. <td>
  132. <p style="margin-bottom: 0.430rem;" th:text="${assetQuestion.engQuestion}"></p>
  133. <p th:text="${assetQuestion.tamilQuestion}"></p>
  134. <div class="col-md-9 px-5 py-1">
  135. <div class="form-check form-check-inline">
  136. <input class="form-check-input" type="radio" th:name="'aq_' + ${assetQuestion.aqId}" th:id="'aq_' + ${assetQuestion.aqId} + '_1'" value="yes" required>
  137. <label class="form-check-label" th:for="'aq_' + ${assetQuestion.aqId} + '_1'">ஆம் / Yes</label>
  138. </div>
  139. <div class="form-check form-check-inline">
  140. <input class="form-check-input" type="radio" th:name="'aq_' + ${assetQuestion.aqId}" th:id="'aq_' + ${assetQuestion.aqId} + '_2'" value="on" required>
  141. <label class="form-check-label" th:for="'aq_' + ${assetQuestion.aqId} + '_2'">இல்லை / NO</label>
  142. </div>
  143. </div>
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table><!--end /table-->
  148. </div>
  149. </div>
  150. </div>
  151. <div class="card">
  152. <div class="card-header bg-success text-white">
  153. Overall Satisfaction?
  154. </div>
  155. <div class="card-body text-center rating">
  156. <div class="js-rating" style="font-size:26px;"></div>
  157. </div><!---end card-body-->
  158. <div class="card-footer text-center">
  159. <button type="button" class="btn btn-de-secondary btn-sm" data-bs-dismiss="modal">Reset</button>
  160. <button type="submit" class="btn btn-primary btn-sm">Submit</button>
  161. </div><!--end modal-footer-->
  162. </div>
  163. </form>
  164. </div> <!-- end col -->
  165. </div> <!-- end row -->
  166. </div>
  167. <!-- END Page Content -->
  168. </main>
  169. <!-- END Main Container -->
  170. <!-- Footer -->
  171. <footer th:replace="fragments/footer :: footer"></footer>
  172. <!-- END Footer -->
  173. <!-- PopUp Modal Form -->
  174. <div class="modal fade" id="loginForm" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
  175. <div class="modal-dialog" role="document">
  176. <div class="modal-content">
  177. <form action="#" th:action="@{/updateParameterQuestion}" th:object="${parameterquestion}" method="post" onsubmit="return sendOTP();">
  178. <div class="block block-rounded block-themed block-transparent mb-0">
  179. <div class="block-header bg-primary-dark">
  180. <h3 class="block-title">OTP Login</h3>
  181. <div class="block-options">
  182. <button type="button" class="btn-block-option" data-bs-dismiss="modal" aria-label="Close">
  183. <i class="fa fa-fw fa-times"></i>
  184. </button>
  185. </div>
  186. </div>
  187. <div class="block-content">
  188. <div class="row">
  189. <div class="mb-3 text-center">
  190. <img src="assets/media/images/mobileotp.png" width="50%" alt="Mobileotp">
  191. </div>
  192. <div class="mb-3 text-center">
  193. <h4>OTP Verification</h4>
  194. <p class="text-mute">We will send you a one-time password to<br>this mobile number</p>
  195. </div>
  196. <div class="mb-3 text-center">
  197. <label for="mobile">Enter Mobile Number</label>
  198. <input type="text" minlength="10" maxlength="10" pattern="\d*" class="form-control text-center" name="mobileNo" id="mobileNo" placeholder="" required />
  199. </div>
  200. </div><!--end row-->
  201. </div><!--end modal-body-->
  202. </div>
  203. <div class="block-content block-content-full text-end bg-body">
  204. <button type="button" class="btn btn-de-secondary btn-sm" data-bs-dismiss="modal">Close</button>
  205. <button type="submit" class="btn btn-primary btn-sm">Get OTP</button>
  206. </div><!--end modal-footer-->
  207. </form>
  208. </div><!--end modal-content-->
  209. </div><!--end modal-dialog-->
  210. </div><!--end modal-->
  211. <!-- PopUp Modal OTP Form -->
  212. <div class="modal fade" id="otpForm" tabindex="-1" role="dialog" aria-labelledby="otpFormLabel" aria-hidden="true">
  213. <div class="modal-dialog" role="document">
  214. <div class="modal-content">
  215. <form action="#" th:action="@{/updateParameterQuestion}" th:object="${parameterquestion}" method="post" onsubmit="return verifyOtp();">
  216. <div class="block block-rounded block-themed block-transparent mb-0">
  217. <div class="block-header bg-primary-dark">
  218. <h3 class="block-title">OTP Login</h3>
  219. <div class="block-options">
  220. <button type="button" class="btn-block-option" data-bs-dismiss="modal" aria-label="Close">
  221. <i class="fa fa-fw fa-times"></i>
  222. </button>
  223. </div>
  224. </div>
  225. <div class="block-content">
  226. <div class="row">
  227. <div class="mb-3 text-center">
  228. <img src="assets/media/images/mobileotp.png" width="50%" alt="Mobileotp">
  229. </div>
  230. <div class="mb-1 text-center">
  231. <h4>OTP Verification</h4>
  232. <p class="text-mute">Enter the OTP sent to <b class="text-info" id="mobilenotxt"></b></p>
  233. </div>
  234. <div class="mb-3 text-center">
  235. <input type="text" minlength="5" maxlength="5" pattern="\d*" class="form-control text-center" name="otp" id="otp" placeholder="" required/>
  236. </div>
  237. <div class="mb-3 text-center">
  238. <p class="text-mute">Didn`t you receive the OTP? <a href="#" class="text-info" onclick="return validate();">Resend OTP</a></p>
  239. </div>
  240. </div><!--end row-->
  241. </div><!--end modal-body-->
  242. <div class="block-content block-content-full text-end bg-body">
  243. <button type="button" class="btn btn-de-secondary btn-sm" data-bs-dismiss="modal">Close</button>
  244. <button type="submit" class="btn btn-primary btn-sm">Verify OTP</button>
  245. </div><!--end modal-footer-->
  246. </div><!--end modal-content-->
  247. </form>
  248. </div><!--end modal-content-->
  249. </div><!--end modal-dialog-->
  250. </div><!--end modal-->
  251. </div>
  252. <!-- END Page Container -->
  253. <!-- Scripts -->
  254. <script th:replace="fragments/script :: script"></script>
  255. <!-- Page JS Plugins -->
  256. <script src="assets/js/plugins/raty-js/jquery.raty.js"></script>
  257. <!-- Page JS Code -->
  258. <script src="assets/js/pages/be_comp_rating.min.js"></script>
  259. <script>
  260. function callLogin(){
  261. $('#loginForm').modal({
  262. backdrop: 'static',
  263. keyboard: false
  264. })
  265. $('#otpForm').modal({
  266. backdrop: 'static',
  267. keyboard: false
  268. })
  269. $('#otpForm').modal('hide');
  270. $('#loginForm').modal('show');
  271. }
  272. function validate()
  273. {
  274. var mobile = $("#mobile").val();
  275. //alert(mobile);
  276. $("#mobileNo").val(mobile);
  277. callLogin();
  278. return false;
  279. }
  280. function sendOTP(){
  281. var mobileNo = $("#mobileNo").val();
  282. $("#mobile").val(mobileNo); // Set final mobile number after request otp
  283. $("#mobilenotxt").html(mobileNo);
  284. $('#loginForm').modal('hide');
  285. $.ajax({
  286. type: "GET",
  287. url: '/api/sendOTP',
  288. data: {'mobileNo':mobileNo},
  289. dataType: 'json',
  290. success: function(bodyMessage) {
  291. if(bodyMessage!="Error"){
  292. //alert("OTP Send Successfully!!!");
  293. $('#otpForm').modal('show');
  294. }else{
  295. alert("Error on Sending OTP!!!");
  296. }
  297. }
  298. });
  299. return false;
  300. }
  301. //Verify OTP
  302. function verifyOtp(){
  303. var otp = $("#otp").val();
  304. //alert(otp);
  305. //document.getElementById("saveFeedbackForm").submit();
  306. $.ajax({
  307. type: "GET",
  308. url: '/api/verifyOTP',
  309. data: {'otp':otp},
  310. dataType: 'text',
  311. success: function(bodyMessage) {
  312. if(bodyMessage.trim() == "Success"){
  313. //alert("OTP is Verified!!!");
  314. document.getElementById("saveFeedbackForm").submit();
  315. } else {
  316. alert("OTP is Incorrect!!!");
  317. // do something here
  318. }
  319. },
  320. error: function() {
  321. alert("Error");// Handle error here
  322. }
  323. });
  324. return false;
  325. }
  326. </script>
  327. </body>
  328. </html>