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.

429 lines
15 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}">
  5. <style>
  6. label {
  7. font-weight: 700;
  8. color: #2d5263;
  9. }
  10. .checkbox-label {
  11. display: block;
  12. margin-bottom: 10px;
  13. font-size: 16px;
  14. }
  15. .custom-file-upload {
  16. position: relative;
  17. display: flex;
  18. align-items: center;
  19. border: 1px solid #d9dde4;
  20. border-radius: 5px;
  21. padding: 5px;
  22. background-color: #f9fafb;
  23. cursor: pointer;
  24. margin-top: 5px;
  25. }
  26. .custom-file-upload input[type="file"] {
  27. position: absolute;
  28. left: 0;
  29. top: 0;
  30. width: 100%;
  31. height: 100%;
  32. opacity: 0;
  33. cursor: pointer;
  34. }
  35. .custom-file-upload label {
  36. display: flex;
  37. justify-content: space-between;
  38. width: 100%;
  39. align-items: center;
  40. }
  41. .upload-icon i {
  42. color: #a6adb5;
  43. font-size: 18px;
  44. }
  45. .file-name {
  46. margin-left: 10px;
  47. color: #414f69;
  48. font-size: 14px;
  49. }
  50. #upload-text {
  51. color: #a7adb5;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <!--[if lt IE 8]>
  57. <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>
  58. <![endif]-->
  59. <div class="wrapper">
  60. <!-- header top menu Start -->
  61. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  62. <!-- header top menu end -->
  63. <div class="page-wrap">
  64. <!--=============== Left Menu side Start ================-->
  65. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  66. <!--=============== Left side End ================-->
  67. <div class="main-content">
  68. <div class="container-fluid">
  69. <div class="page-header">
  70. <div class="row align-items-end">
  71. <div class="col-lg-6">
  72. <div class="page-header-title">
  73. <i class="ik ik-thumbs-up bg-blue"></i>
  74. <div class="d-inline">
  75. <h5>NULM STAFF</h5>
  76. <span>Staff Enrollment</span>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="col-lg-6">
  81. <nav class="breadcrumb-container" aria-label="breadcrumb">
  82. <ol class="breadcrumb">
  83. <li class="breadcrumb-item">
  84. <a href="/index"><i class="ik ik-home"></i></a>
  85. </li>
  86. <li class="breadcrumb-item active" aria-current="page">Staff Enrollment</li>
  87. </ol>
  88. </nav>
  89. </div>
  90. </div>
  91. </div>
  92. <hr>
  93. <div class="row align-items-center justify-content-center"
  94. style="color: white;background-color:#414f69 ;padding: 10px;">
  95. <h3 class="title resizable-content">Staff Enrollment</h3>
  96. </div>
  97. <!-- Add the resizable-content class to the card sections -->
  98. <div class="card mb-3 mt-4 resizable-content">
  99. <!--<div class="card-header text-white" style="background-color: #414f69;">Personal Information's
  100. </div>-->
  101. <div class="card-body">
  102. <div class="row">
  103. <div class="col-md-12 d-flex justify-content-between align-items-center">
  104. <label style="font-size: large; font-weight: 700; color: #414f69;">Self Help Group:</label>
  105. <div class="col-md-6" style="margin-right: 32%;">
  106. <select id="selfHelpGroupDropdown" class="form-control" style="font-size: large; margin-bottom: 15px;">
  107. <option value="">Select Group</option>
  108. </select>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="row">
  113. <div class="col-md-12 d-flex justify-content-between align-items-center">
  114. <label style="font-size: large;font-weight: 700;color: #414f69;">Name:</label>
  115. <div class="col-md-6" style="margin-right: 32%;">
  116. <input type="text" id="staff-name-input" class="form-control" placeholder="Enter Name..." style="font-size: large;margin-bottom: 15px;">
  117. </div>
  118. </div>
  119. </div>
  120. <div class="row">
  121. <div class="col-md-12 d-flex justify-content-between align-items-center">
  122. <label style="font-size: large;font-weight: 700;color: #414f69;">Gender:</label>
  123. <div class="col-md-6" style="margin-right: 32%;">
  124. <select id="gender-select" class="form-control" style="font-size: large;margin-bottom: 15px;">
  125. <option value="">Select Gender</option>
  126. <option value="1">Male</option>
  127. <option value="2">Female</option>
  128. <option value="3">Transgender</option>
  129. </select>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="row">
  134. <div class="col-md-12 d-flex justify-content-between align-items-center">
  135. <label style="font-size: large;font-weight: 700;color: #414f69;">Date Of Birth:</label>
  136. <div class="col-md-6" style="margin-right: 32%;">
  137. <input type="date" id="dob-input" class="form-control" style="font-size: large;margin-bottom: 15px;">
  138. </div>
  139. </div>
  140. </div>
  141. <div class="row">
  142. <div class="col-md-12 d-flex justify-content-between align-items-center">
  143. <label style="font-size: large;font-weight: 700;color: #414f69;">Address:</label>
  144. <div class="col-md-6" style="margin-right: 32%;">
  145. <input type="text" id="address-input" class="form-control" placeholder="Enter Name..." style="font-size: large;margin-bottom: 15px;">
  146. </div>
  147. </div>
  148. </div>
  149. <div class="row">
  150. <div class="col-md-12 d-flex justify-content-between align-items-center">
  151. <label style="font-size: large;font-weight: 700;color: #414f69;">Phone number:</label>
  152. <div class="col-md-6" style="margin-right: 32%;">
  153. <input type="text" id="phone-number-input" class="form-control" placeholder="Enter the Phone Number..." style="font-size: large;margin-bottom: 15px;" pattern="\d{10}" maxlength="10" minlength="10">
  154. </div>
  155. </div>
  156. </div>
  157. <!-- Update other input fields similarly -->
  158. <div class="row">
  159. <div class="col-md-12 d-flex justify-content-between align-items-center">
  160. <label style="font-size: large; font-weight: 700; color: #414f69;">Education
  161. Qualification:</label>
  162. <div class="col-md-6" style="margin-right: 32%;">
  163. <select id="educationQualification" class="form-control" style="font-size: large;margin-bottom: 15px;">
  164. <option value="">Select Qualification</option>
  165. <option value="8th">8th</option>
  166. <option value="9th">9th</option>
  167. <option value="10th">10th</option>
  168. <option value="11th">11th</option>
  169. <option value="12th">12th</option>
  170. <option value="UG">UG</option>
  171. <option value="PG">PG</option>
  172. </select>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="row">
  177. <div class="col-md-12 d-flex justify-content-between align-items-center">
  178. <label style="font-size: large;font-weight: 700;color: #414f69;">Additional Skills:</label>
  179. <div class="col-md-6" style="margin-right: 32%;">
  180. <select id="skills-select" class="form-control" style="font-size: large;margin-bottom: 15px;">
  181. <option value="">Select Additional Skills</option>
  182. <option value="typing">Typing</option>
  183. <option value="shorthand">ShortHand</option>
  184. <option value="dataentry">DataEntry</option>
  185. <option value="others">Others</option>
  186. </select>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="col-md-12">
  192. <label style="font-size: large;font-weight: 700;color: #414f69;">Proof
  193. Documents:</label>
  194. <div class="row">
  195. <!-- First File Upload -->
  196. <div class="col-md-4">
  197. <div class="custom-file-upload">
  198. <input type="file" id="file-upload-1" class="form-control"
  199. onchange="displayFileName('file-upload-1', 'file-name-1')">
  200. <label for="file-upload-1" id="file-label-1">
  201. <span class="upload-text" id="upload-text">Upload Aadhar Card</span>
  202. <span class="upload-icon">
  203. <i class="fas fa-file-upload"></i>
  204. </span>
  205. </label>
  206. <span id="file-name-1" class="file-name"></span>
  207. </div>
  208. </div>
  209. <!-- Second File Upload -->
  210. <div class="col-md-4">
  211. <div class="custom-file-upload">
  212. <input type="file" id="file-upload-2" class="form-control"
  213. onchange="displayFileName('file-upload-2', 'file-name-2')">
  214. <label for="file-upload-2" id="file-label-2">
  215. <span class="upload-text" id="upload-text">Upload Bank
  216. Passbook</span>
  217. <span class="upload-icon">
  218. <i class="fas fa-file-upload"></i>
  219. </span>
  220. </label>
  221. <span id="file-name-2" class="file-name"></span>
  222. </div>
  223. </div>
  224. <!-- Third File Upload -->
  225. <div class="col-md-4">
  226. <div class="custom-file-upload">
  227. <input type="file" id="file-upload-3" class="form-control"
  228. onchange="displayFileName('file-upload-3', 'file-name-3')">
  229. <label for="file-upload-3" id="file-label-3">
  230. <span class="upload-text" id="upload-text">Upload Ration Card</span>
  231. <span class="upload-icon">
  232. <i class="fas fa-file-upload"></i>
  233. </span>
  234. </label>
  235. <span id="file-name-3" class="file-name"></span>
  236. </div>
  237. </div>
  238. <!-- Fourth File Upload -->
  239. <div class="col-md-4">
  240. <div class="custom-file-upload">
  241. <input type="file" id="file-upload-4" class="form-control"
  242. onchange="displayFileName('file-upload-4', 'file-name-4')">
  243. <label for="file-upload-4" id="file-label-4">
  244. <span class="upload-text" id="upload-text">Upload Staff Photo</span>
  245. <span class="upload-icon">
  246. <i class="fas fa-file-upload"></i>
  247. </span>
  248. </label>
  249. <span id="file-name-4" class="file-name"></span>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. <div class="d-flex justify-content-center">
  255. <button class="btn"
  256. style="background-color: #414f69; color: white; width: 200px;padding: 10px;margin-bottom: 10px;"
  257. id="staffenroll">
  258. Enroll Staff
  259. </button>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  265. </div>
  266. </div>
  267. <div th:replace="~{fragments/modules/pgr/modal-box :: div}"></div>
  268. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  269. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  270. <script th:replace="~{fragments/modules/pgr/script :: script}"></script>
  271. <script th:inline="javascript">
  272. function displayFileName(inputId, outputId) {
  273. const fileInput = document.getElementById(inputId);
  274. const fileNameSpan = document.getElementById(outputId);
  275. const fileName = fileInput.files[0]?.name || 'No file chosen';
  276. fileNameSpan.textContent = fileName;
  277. }
  278. function isValidAge(dob) {
  279. const today = new Date();
  280. const birthDate = new Date(dob);
  281. let age = today.getFullYear() - birthDate.getFullYear();
  282. const monthDifference = today.getMonth() - birthDate.getMonth();
  283. // Adjust age if the birth date hasn't occurred yet this year
  284. if (monthDifference < 0 || (monthDifference === 0 && today.getDate() < birthDate.getDate())) {
  285. age--;
  286. }
  287. // Age should be at least 18
  288. return age >= 18;
  289. }
  290. $(document).ready(function () {
  291. $('#staffenroll').click(function () {
  292. const dob = document.getElementById('dob-input').value;
  293. if (!isValidAge(dob)) {
  294. Swal.fire({
  295. title: 'Invalid Date of Birth',
  296. text: 'Age must be at least 18 years old.',
  297. icon: 'error',
  298. confirmButtonText: 'OK',
  299. background: '#f5f5f5',
  300. confirmButtonColor: '#414f69'
  301. });
  302. return false;
  303. }
  304. const staffData = {
  305. name: document.getElementById('staff-name-input').value,
  306. phoneNumber: document.getElementById('phone-number-input').value,
  307. gender: document.getElementById('gender-select').value,
  308. dateOfBirth: dob,
  309. educationQualification: document.getElementById('educationQualification').value,
  310. additionalSkills: document.getElementById('skills-select').value,
  311. aadharCardUrl: document.getElementById('file-name-1').textContent,
  312. rationCardUrl: document.getElementById('file-name-3').textContent,
  313. bankPassbookUrl: document.getElementById('file-name-2').textContent,
  314. staffPhotoUrl: document.getElementById('file-name-4').textContent,
  315. address: document.getElementById('address-input').value, // Ensure this is included
  316. groupId: document.getElementById('selfHelpGroupDropdown').value,
  317. };
  318. console.log(staffData); // Debug log
  319. $.ajax({
  320. url: '/gcc/api/nulm/saveStaff',
  321. method: 'POST',
  322. contentType: 'application/json',
  323. data: JSON.stringify(staffData),
  324. success: function (response) {
  325. Swal.fire({
  326. icon: 'success',
  327. title: 'Success',
  328. text: response,
  329. }).then(function () {
  330. location.reload();
  331. });
  332. },
  333. error: function (xhr, status, error) {
  334. Swal.fire({
  335. icon: 'error',
  336. title: 'Error',
  337. text: 'Error saving staff details: ' + xhr.responseText,
  338. });
  339. }
  340. });
  341. });
  342. document.getElementById('educationQualification').addEventListener('change', function () {
  343. var selectedValue = this.value;
  344. var courseNameField = document.getElementById('courseNameField');
  345. if (selectedValue === 'UG' || selectedValue === 'PG') {
  346. courseNameField.style.display = 'block';
  347. } else {
  348. courseNameField.style.display = 'none';
  349. }
  350. });
  351. function loadSchemeGroupNames() {
  352. $.ajax({
  353. url: '/gcc/api/nulm/getAllSchemeGroupNames',
  354. method: 'GET',
  355. dataType: 'json',
  356. success: function (data) {
  357. var $dropdown = $('#selfHelpGroupDropdown');
  358. $dropdown.empty();
  359. $dropdown.append('<option value="">Select Scheme Group</option>');
  360. $.each(data, function (index, group) {
  361. $dropdown.append('<option value="' + group.group_id + '">' + group.group_name + '</option>');
  362. });
  363. },
  364. error: function (xhr, status, error) {
  365. console.error('Error fetching scheme group names:', error);
  366. }
  367. });
  368. }
  369. loadSchemeGroupNames();
  370. });
  371. </script>
  372. </body>
  373. </html>