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.

404 lines
15 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3. <html xmlns:th="http://www.thymeleaf.org">
  4. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  5. <style>
  6. body {
  7. background-color: #f8f9fa;
  8. /* font-family: Arial, sans-serif;*/
  9. }
  10. .header {
  11. font-size: 22px;
  12. font-weight: bold;
  13. margin-bottom: 20px;
  14. }
  15. .table {
  16. border: 1px solid #dee2e6;
  17. }
  18. .table th,
  19. .table td {
  20. border: 1px solid #dee2e6;
  21. padding: 10px;
  22. }
  23. .section-title {
  24. font-size: 18px;
  25. font-weight: bold;
  26. margin-top: 20px;
  27. border-bottom: 2px solid #007bff;
  28. padding-bottom: 5px;
  29. }
  30. .form-group {
  31. margin-top: 15px;
  32. }
  33. .radio-group {
  34. display: flex;
  35. gap: 20px;
  36. margin-top: 10px;
  37. }
  38. </style>
  39. <body>
  40. <div class="wrapper">
  41. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  42. <div class="page-wrap">
  43. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  44. <div class="main-content">
  45. <div class="container">
  46. <div class="header">School Module - Master Details - {Id 3232193827918}</div>
  47. <hr style="border: 1px solid #ccc; margin-top: 10px; margin-bottom: 20px;">
  48. <!-- Card 1: School Information -->
  49. <div class="col-md-12">
  50. <div class="card">
  51. <div class="card-header" style=" background-color: #404E67;
  52. color: white;">School Information</div>
  53. <table class="table">
  54. <tr>
  55. <th>School Name:</th>
  56. <td>CPS KOLATHUR II</td>
  57. <th>UDISE Code:</th>
  58. <td>33020401404</td>
  59. </tr>
  60. <tr>
  61. <th>Category:</th>
  62. <td>Primary School</td>
  63. <th>Medium:</th>
  64. <td>Tamil, English</td>
  65. </tr>
  66. <tr>
  67. <th>School Type:</th>
  68. <td>Government</td>
  69. <th>Zone:</th>
  70. <td>Zone 11</td>
  71. </tr>
  72. <tr>
  73. <th>Ward:</th>
  74. <td>Ward 122</td>
  75. <th>Address:</th>
  76. <td>1a, school road, Venkat Nagar, Kolathur, Chennai.</td>
  77. </tr>
  78. </table>
  79. </div>
  80. </div>
  81. <div class="col-md-12">
  82. <div class="d-flex justify-content-between align-items-center">
  83. <h4>Room Wise Asset Mapping - Furniture Assets</h4>
  84. <button type="button" class="btn btn-primary"
  85. style="background-color: #0D587B; border: none; border-radius: 6px; padding: 6px 16px;"
  86. data-bs-toggle="modal" data-bs-target="#assetModal">
  87. + Add Assets
  88. </button>
  89. </div>
  90. <hr style="border: 1px solid #ccc; margin-top: 10px; margin-bottom: 20px;">
  91. </div>
  92. <div class="row mt-4">
  93. <div class="col-md-12">
  94. <div class="card">
  95. <div class="card-block">
  96. <h5 style="font-weight:bold;">List of Electrical Assets</h5>
  97. <h5 style="font-weight:bold;">
  98. <span th:text="${deptId}" id="deptId" style="display:none"></span>
  99. </h5>
  100. <span th:text="${userId}" id="userId" style="display:none"></span>
  101. <div id="completedCPSTable">
  102. <table id="CompletedCPSDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" style="width:100%">
  103. <thead class="thead-dark">
  104. <tr>
  105. <th style="width: 5%;">S.NO</th>
  106. <th style="width: 10%;">ASSET CODE</th>
  107. <th style="width: 15%;">NAME</th>
  108. <th style="width: 10%;">SOURCE</th>
  109. <th style="width: 15%;">SERIAL NUMBER</th>
  110. <th style="width: 15%;">RECEIVED DATE</th>
  111. <th style="width: 10%;">RECEIVED BY</th>
  112. <th style="width: 10%;">VENDOR DETAILS</th>
  113. <th style="width: 10%;">INVOICE NUMBER</th>
  114. <th style="width: 10%;">LOCATION</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <tr>
  119. <td>1</td>
  120. <td>TH40V40I</td>
  121. <td>CAMERA</td>
  122. <td>GCC</td>
  123. <td>22023293837281</td>
  124. <td>JUN 23, 2025 12:40 PM</td>
  125. <td>RECEIVED BY</td>
  126. <td>N/A</td>
  127. <td>2345676543ER</td>
  128. <td>CHENNAI</td>
  129. </tr>
  130. <tr>
  131. <td>2</td>
  132. <td>TH40V40I</td>
  133. <td>CAMERA</td>
  134. <td>GCC</td>
  135. <td>22023293837281</td>
  136. <td>JUN 23, 2025 12:40 PM</td>
  137. <td>RECEIVED BY</td>
  138. <td>N/A</td>
  139. <td>2345676543ER</td>
  140. <td>CHENNAI</td>
  141. </tr>
  142. <tr>
  143. <td>3</td>
  144. <td>TH40V40I</td>
  145. <td>CAMERA</td>
  146. <td>GCC</td>
  147. <td>22023293837281</td>
  148. <td>JUN 23, 2025 12:40 PM</td>
  149. <td>RECEIVED BY</td>
  150. <td>N/A</td>
  151. <td>2345676543ER</td>
  152. <td>CHENNAI</td>
  153. </tr>
  154. </tbody>
  155. </table>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <!-- Card 2: Other Details -->
  162. </div>
  163. </div>
  164. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  165. </div>
  166. </div>
  167. <!-- Modal -->
  168. <div class="modal fade" id="assetModal" tabindex="-1" role="dialog" aria-labelledby="assetModalLabel" aria-hidden="true">
  169. <div class="modal-dialog modal-lg" role="document">
  170. <div class="modal-content">
  171. <div class="modal-header">
  172. <h5 class="modal-title">Room Wise Asset Mapping - Electrical Assets</h5>
  173. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  174. <span aria-hidden="true">&times;</span>
  175. </button>
  176. </div>
  177. <div class="modal-body">
  178. <div class="row">
  179. <!-- Building Dropdown -->
  180. <div class="col-md-6">
  181. <div class="form-group">
  182. <label for="buildingDropdown">Select Building *</label>
  183. <select id="buildingDropdown" class="form-control">
  184. <option value="">-- Select Building --</option>
  185. <option value="building1">Building 1</option>
  186. <option value="building2">Building 2</option>
  187. </select>
  188. </div>
  189. </div>
  190. <!-- Floor Dropdown -->
  191. <div class="col-md-6">
  192. <div class="form-group">
  193. <label for="floorDropdown">Select Floor *</label>
  194. <select id="floorDropdown" class="form-control">
  195. <option value="">-- Select Floor --</option>
  196. <option value="floor1">1st Floor</option>
  197. <option value="floor2">2nd Floor</option>
  198. </select>
  199. </div>
  200. </div>
  201. <!-- Room Type Dropdown -->
  202. <div class="col-md-6">
  203. <div class="form-group">
  204. <label for="roomTypeDropdown">Select Room Type *</label>
  205. <select id="roomTypeDropdown" class="form-control">
  206. <option value="">-- Select Room Type --</option>
  207. <option value="classroom">Classroom</option>
  208. <option value="conference">Conference Room</option>
  209. </select>
  210. </div>
  211. </div>
  212. <!-- Room Dropdown -->
  213. <div class="col-md-6">
  214. <div class="form-group">
  215. <label for="roomDropdown">Select Room *</label>
  216. <select id="roomDropdown" class="form-control">
  217. <option value="">-- Select Room --</option>
  218. <option value="room1">Number 1</option>
  219. <option value="room2">Number 2</option>
  220. </select>
  221. </div>
  222. </div>
  223. <!-- Assets Dropdown -->
  224. <div class="col-md-12">
  225. <div class="form-group">
  226. <label for="assetDropdown">Select Assets *</label>
  227. <div class="form-control" id="assetDropdown">
  228. <div class="form-check">
  229. <input type="checkbox" class="asset-checkbox" value="fan"> Fan
  230. </div>
  231. <div class="form-check">
  232. <input type="checkbox" class="asset-checkbox" value="Smart TV"> Lights
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <!-- Dynamic Asset Selection Section -->
  238. <div class="col-md-12" id="assetContainer"></div>
  239. </div>
  240. <div class="modal-footer">
  241. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  242. <button type="button" class="btn btn-primary">Save</button>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  249. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  250. </body>
  251. <script>
  252. $(document).ready(function() {
  253. $('#CompletedCPSDatatable').DataTable({
  254. scrollX: true, // Enables horizontal scrolling
  255. autoWidth: false, // Ensures manual column widths are respected
  256. responsive: true, // Ensures better mobile view
  257. dom: 'Bftip',
  258. lengthMenu: [
  259. [10, 50, 100, 200, -1],
  260. ['10 rows', '50 rows', '100 rows', 'Show all']
  261. ],
  262. buttons: [
  263. { extend: 'pageLength', className: 'btn btn-warning' },
  264. { extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  265. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  266. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  267. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  268. ],
  269. fixedHeader: true,
  270. searching: true,
  271. select: false,
  272. processing: false
  273. });
  274. });
  275. document.getElementById('buildingDropdown').addEventListener('change', function () {
  276. const floorDropdown = document.getElementById('floorDropdown').parentElement;
  277. const roomTypeDropdown = document.getElementById('roomTypeDropdown').parentElement;
  278. const roomDropdown = document.getElementById('roomDropdown').parentElement;
  279. const assetDropdown = document.getElementById('assetDropdown').parentElement;
  280. if (this.value) {
  281. floorDropdown.style.display = 'block';
  282. roomTypeDropdown.style.display = 'block';
  283. roomDropdown.style.display = 'block';
  284. } else {
  285. floorDropdown.style.display = 'none';
  286. roomTypeDropdown.style.display = 'none';
  287. roomDropdown.style.display = 'none';
  288. assetDropdown.style.display = 'none';
  289. }
  290. document.getElementById('floorDropdown').value = "";
  291. document.getElementById('roomTypeDropdown').value = "";
  292. document.getElementById('roomDropdown').value = "";
  293. });
  294. // Show assets only when all dropdowns are selected
  295. function checkAllSelections() {
  296. const building = document.getElementById('buildingDropdown').value;
  297. const floor = document.getElementById('floorDropdown').value;
  298. const roomType = document.getElementById('roomTypeDropdown').value;
  299. const room = document.getElementById('roomDropdown').value;
  300. const assetDropdown = document.getElementById('assetDropdown').parentElement;
  301. if (building && floor && roomType && room) {
  302. assetDropdown.style.display = 'block';
  303. } else {
  304. assetDropdown.style.display = 'none';
  305. document.getElementById('assetContainer').innerHTML = ''; // Clear asset selection
  306. }
  307. }
  308. document.getElementById('floorDropdown').addEventListener('change', checkAllSelections);
  309. document.getElementById('roomTypeDropdown').addEventListener('change', checkAllSelections);
  310. document.getElementById('roomDropdown').addEventListener('change', checkAllSelections);
  311. // Initially hide all dependent dropdowns and asset section
  312. window.addEventListener('DOMContentLoaded', function () {
  313. document.getElementById('floorDropdown').parentElement.style.display = 'none';
  314. document.getElementById('roomTypeDropdown').parentElement.style.display = 'none';
  315. document.getElementById('roomDropdown').parentElement.style.display = 'none';
  316. document.getElementById('assetDropdown').parentElement.style.display = 'none';
  317. });
  318. // Dynamic Asset Mapping with Quantity Input
  319. document.querySelectorAll('.asset-checkbox').forEach(checkbox => {
  320. checkbox.addEventListener('change', function () {
  321. const assetContainer = document.getElementById('assetContainer');
  322. const assetValue = this.value;
  323. if (this.checked) {
  324. const assetDiv = document.createElement('div');
  325. assetDiv.classList.add('asset-item');
  326. assetDiv.id = `asset-${assetValue}`;
  327. assetDiv.innerHTML = `
  328. <div class="row">
  329. <div class="col-md-6">
  330. <div class="form-group mt-2">
  331. <label>${assetValue} Quantity *</label>
  332. <input type="number" class="form-control" placeholder="Enter Quantity" required>
  333. </div>
  334. </div>
  335. </div>
  336. `;
  337. assetContainer.appendChild(assetDiv);
  338. } else {
  339. const existingDiv = document.getElementById(`asset-${assetValue}`);
  340. if (existingDiv) {
  341. assetContainer.removeChild(existingDiv);
  342. }
  343. }
  344. });
  345. });
  346. </script>
  347. </html>