|
|
@ -220,16 +220,29 @@ td, th { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-md-3" id="deptDiv" style="display: none;"> |
|
|
|
|
|
|
|
|
<!-- <div class="col-md-3" id="deptDiv" style="display: none;"> |
|
|
<label for="departmentDropdown" class="form-label fw-bold">Department <span class="text-danger">*</span></label> |
|
|
<label for="departmentDropdown" class="form-label fw-bold">Department <span class="text-danger">*</span></label> |
|
|
<div class="form-control p-3 border rounded" style="height: 110px; overflow-y: auto; background-color: #f8f9fa;"> |
|
|
<div class="form-control p-3 border rounded" style="height: 110px; overflow-y: auto; background-color: #f8f9fa;"> |
|
|
<label class="d-block">Select Department |
|
|
|
|
|
</label> |
|
|
|
|
|
<hr> |
|
|
|
|
|
|
|
|
|
|
|
<div id="departmentCheckboxContainer"> |
|
|
<div id="departmentCheckboxContainer"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-md-3" id="deptDiv" style="display: none;"> |
|
|
|
|
|
<label for="departmentDropdown" class="form-label fw-bold">Department <span class="text-danger">*</span></label> |
|
|
|
|
|
<div class="dropdown"> |
|
|
|
|
|
<button class="btn btn-light border rounded w-100 text-start" type="button" id="departmentDropdownBtn" data-bs-toggle="dropdown" aria-expanded="false"> |
|
|
|
|
|
Select Department(s) |
|
|
|
|
|
</button> |
|
|
|
|
|
<ul class="dropdown-menu p-3" aria-labelledby="departmentDropdownBtn" style="max-height: 200px; overflow-y: auto; width: 100%;"> |
|
|
|
|
|
<div id="departmentCheckboxContainer"> |
|
|
|
|
|
<!-- Checkboxes will be loaded here --> |
|
|
|
|
|
</div> |
|
|
|
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Type of Category (Initially Hidden) --> |
|
|
<!-- Type of Category (Initially Hidden) --> |
|
|
@ -490,7 +503,7 @@ td, th { |
|
|
$(document).ready(function () { |
|
|
$(document).ready(function () { |
|
|
function loadFileCategories() { |
|
|
function loadFileCategories() { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "/getFileCategories", // Ensure this is the correct endpoint |
|
|
|
|
|
|
|
|
url: "/gcc/api/report/getFileCategories", // Ensure this is the correct endpoint |
|
|
type: "GET", |
|
|
type: "GET", |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
success: function (response) { |
|
|
success: function (response) { |
|
|
@ -535,9 +548,9 @@ td, th { |
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
$(document).ready(function () { |
|
|
|
|
|
|
|
|
function loadDepartments() { |
|
|
|
|
|
|
|
|
/* function loadDepartments() { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "/getdepartment", |
|
|
|
|
|
|
|
|
url: "/gcc/api/report/getdepartment", |
|
|
type: "GET", |
|
|
type: "GET", |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
success: function (response) { |
|
|
success: function (response) { |
|
|
@ -583,8 +596,64 @@ td, th { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function loadDepartments() { |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/gcc/api/report/getdepartment", |
|
|
|
|
|
type: "GET", |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
success: function (response) { |
|
|
|
|
|
console.log("Departments:", response); |
|
|
|
|
|
$("#departmentCheckboxContainer").empty(); // Clear previous checkboxes |
|
|
|
|
|
|
|
|
|
|
|
// Append "Select All" checkbox |
|
|
|
|
|
$("#departmentCheckboxContainer").append(` |
|
|
|
|
|
<li> |
|
|
|
|
|
<label class="dropdown-item"> |
|
|
|
|
|
<input type="checkbox" id="selectAllDept"> Select All |
|
|
|
|
|
</label> |
|
|
|
|
|
</li> |
|
|
|
|
|
`); |
|
|
|
|
|
|
|
|
|
|
|
// Append individual department checkboxes |
|
|
|
|
|
response.forEach(dept => { |
|
|
|
|
|
$("#departmentCheckboxContainer").append(` |
|
|
|
|
|
<li> |
|
|
|
|
|
<label class="dropdown-item"> |
|
|
|
|
|
<input type="checkbox" class="deptCheckbox" value="${dept.dept_id}"> ${dept.dept_name} |
|
|
|
|
|
</label> |
|
|
|
|
|
</li> |
|
|
|
|
|
`); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// "Select All" logic |
|
|
|
|
|
$("#selectAllDept").change(function () { |
|
|
|
|
|
$(".deptCheckbox").prop("checked", this.checked); // Check/uncheck all |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// If any individual checkbox is unchecked, uncheck "Select All" |
|
|
|
|
|
$(document).on("change", ".deptCheckbox", function () { |
|
|
|
|
|
if ($(".deptCheckbox:checked").length === $(".deptCheckbox").length) { |
|
|
|
|
|
$("#selectAllDept").prop("checked", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
$("#selectAllDept").prop("checked", false); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
error: function (xhr) { |
|
|
|
|
|
console.error("AJAX Error:", xhr.status, xhr.responseText); |
|
|
|
|
|
Swal.fire({ |
|
|
|
|
|
icon: "error", |
|
|
|
|
|
title: "Error Fetching Data", |
|
|
|
|
|
text: "Failed to load departments. Please try again.", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loadDepartments(); |
|
|
loadDepartments(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -1506,13 +1575,13 @@ td, th { |
|
|
|
|
|
|
|
|
let url, data; |
|
|
let url, data; |
|
|
if (typeOfReport === "Detailed") { |
|
|
if (typeOfReport === "Detailed") { |
|
|
url = "/getReportDetailspension"; |
|
|
|
|
|
|
|
|
url = "/gcc/api/report/getReportDetailspension"; |
|
|
data = { startDate: startDate, endDate: endDate, deptIds: selectedDeptIds, fileCatId: typeOfCategory, fileStatus: statusArray }; |
|
|
data = { startDate: startDate, endDate: endDate, deptIds: selectedDeptIds, fileCatId: typeOfCategory, fileStatus: statusArray }; |
|
|
$("#audittable").hide(); |
|
|
$("#audittable").hide(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
url = "/getReportDatapension"; |
|
|
|
|
|
|
|
|
url = "/gcc/api/report/getReportDatapension"; |
|
|
data = { startDate: startDate, endDate: endDate, fileCategoryId: typeOfCategory1 }; |
|
|
data = { startDate: startDate, endDate: endDate, fileCategoryId: typeOfCategory1 }; |
|
|
$("#audittable").show(); |
|
|
$("#audittable").show(); |
|
|
$("#cpstable").hide(); |
|
|
$("#cpstable").hide(); |
|
|
|