Browse Source

added non childrensurvey list and changed footer for all pages

main
AJITHKUMAR12 4 months ago
parent
commit
8284dcf0a5
  1. 15
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Controller/ChildrenSurveyController.java
  2. 9
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Controller/MainController.java
  3. 115
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java
  4. 4
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  5. 329
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/castemaster.html
  6. 100
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html
  7. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/documentcorrectionmaster.html
  8. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/documentreasonmaster.html
  9. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/dropoutreasonmaster.html
  10. 331
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/educationmaster.html
  11. 347
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/gendermaster.html
  12. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/incomemaster.html
  13. 358
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/interestfieldmaster.html
  14. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/livingmaster.html
  15. 345
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/locationmaster.html
  16. 955
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html
  17. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/ownermaster.html
  18. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/religionmaster.html
  19. 142
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveyorsreports.html
  20. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/vulnerabilitymaster.html
  21. 343
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/whereaboutmaster.html

15
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Controller/ChildrenSurveyController.java

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -410,4 +411,18 @@ public class ChildrenSurveyController {
return "SUCCESS";
}
@GetMapping("/nonsurveyed/list")
public ResponseEntity<List<Map<String, Object>>> getNonSurveyedChildList(
@RequestParam(required = false) String area,
@RequestParam(required = false) String fromDate,
@RequestParam(required = false) String toDate) {
return ResponseEntity.ok(
service.getNonSurveyedChildList(
area,
fromDate,
toDate));
}
}

9
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Controller/MainController.java

@ -13,11 +13,16 @@ public class MainController {
return "modules/childrensurvey/surveylist";
}
@GetMapping("/childlist")
public String childlist() {
@GetMapping("/childlist/surveyedlist")
public String surveyedlist() {
return "modules/childrensurvey/childlist";
}
@GetMapping("/childlist/nonsurveyedlist")
public String nonsurveyedlist() {
return "modules/childrensurvey/nonchildlist";
}
@GetMapping("/surveyorsreports")
public String surveyorsreports() {
return "modules/childrensurvey/surveyorsreports";

115
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java

@ -172,7 +172,8 @@ public class ChildrenSurveyService {
params.add(toDate);
}
sql.append(" GROUP BY csr.survey_id ORDER BY MAX(csr.cdate) DESC");
// sql.append(" GROUP BY csr.survey_id ORDER BY MAX(csr.cdate) DESC");
sql.append(" GROUP BY csr.survey_id ORDER BY csr.survey_id ");
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
}
@ -905,6 +906,8 @@ public class ChildrenSurveyService {
WHERE 1 = 1
""");
List<Object> params = new ArrayList<>();
@ -3258,4 +3261,114 @@ public class ChildrenSurveyService {
id);
}
// non surveyed child list
public List<Map<String, Object>> getNonSurveyedChildList(
String area,
String fromDate,
String toDate) {
StringBuilder sql = new StringBuilder("""
SELECT
pr.survey_id,
DATE(MAX(pr.cdate)) AS survey_date,
MAX(
CASE
WHEN pm.qid = 1
THEN psm.english_name
END
) AS reason,
MAX(
CASE
WHEN pm.qid = 2
THEN lm.english_name
END
) AS area,
MAX(
CASE
WHEN pm.qid = 3
THEN pr.answer
END
) AS house_no,
MAX(
CASE
WHEN pm.qid = 4
THEN pr.answer
END
) AS block_no
FROM child_survey_participate_response pr
INNER JOIN child_survey_participate_master pm
ON pm.qid = pr.qid
LEFT JOIN participate_survey_master psm
ON pm.qid = 1
AND psm.id = pr.answer
LEFT JOIN location_master lm
ON pm.qid = 2
AND lm.id = pr.answer
WHERE pr.isactive = 1
AND pr.isdelete = 0
""");
List<Object> params = new ArrayList<>();
// AREA FILTER
if (area != null && !area.isEmpty()) {
sql.append("""
AND (
pr.survey_id IN (
SELECT survey_id
FROM child_survey_participate_response
WHERE qid = 2
AND answer = ?
)
)
""");
params.add(area);
}
// DATE FILTER
if (fromDate != null
&& toDate != null
&& !fromDate.isEmpty()
&& !toDate.isEmpty()) {
sql.append("""
AND DATE(pr.cdate) BETWEEN ? AND ?
""");
params.add(fromDate);
params.add(toDate);
}
sql.append("""
GROUP BY pr.survey_id
ORDER BY pr.survey_id
""");
return jdbcTemplate.queryForList(
sql.toString(),
params.toArray());
}
}

4
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java

@ -24,8 +24,8 @@ import java.util.Properties;
@EnableTransactionManagement
public class DataSourceConfig {
// private static String host = "localhost:3306";
// private static String dbpassword = "root";
// private static String host = "localhost:3306";
// private static String dbpassword = "root";
// private static String dbpassword = "gccroot";

329
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/castemaster.html

@ -294,147 +294,150 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
let editId = 0;
});
let editId = 0;
function openAddModal() {
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Caste");
$(".modal-title").text("Add Caste");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function loadEducationTable() {
modal.show();
}
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/castemasterlist",
type: "GET",
url: "/gcc/api/children-survey/castemasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -458,103 +461,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Caste");
$(".modal-title").text("Edit Caste");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/savecaste",
url: "/gcc/api/children-survey/savecaste",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/caste-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/caste-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

100
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html

@ -240,7 +240,7 @@
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active">Child List</li>
<li class="breadcrumb-item active"> Survey Child List</li>
</ol>
</nav>
</div>
@ -391,37 +391,40 @@
</table>
</div>
</div>
</div>
<div class="modal fade" id="surveyModal" tabindex="-1">
<div class="modal-dialog modal-lg modal-dialog-scrollable" style="max-width:70%; width:70%;">
<div class="modal-content">
<div class="modal fade" id="surveyModal" tabindex="-1">
<div class="modal-dialog modal-lg modal-dialog-scrollable" style="max-width:70%; width:70%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Child Survey Details</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-header">
<h5 class="modal-title">Child Survey Details</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div id="surveyDetails"></div>
</div>
<div class="modal-body">
<div id="surveyDetails"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
@ -542,12 +545,12 @@
let slno = 1;
/*for (const rowNode of rows) {
// GET SURVEY ID FROM TABLE
let surveyId = $(rowNode[1]).text() || rowNode[1];
surveyId = surveyId.toString().trim();
// CALL DETAILS API
let surveyData = await $.ajax({
url: "/gcc/api/children-survey/details",
@ -556,10 +559,10 @@
surveyId: surveyId
}
});
// MERGE ALL SECTIONS
let allQuestions = {
...surveyData.personalInformation,
...surveyData.locationDetails,
...surveyData.educationDetails,
@ -567,22 +570,22 @@
...surveyData.documentDetails,
...surveyData.vulnerabilityDetails
};
// CREATE ROW OBJECT
let rowData = {
"S.No": slno,
"Survey ID": surveyId
};
// ADD ALL QUESTIONS AS COLUMNS
Object.keys(allQuestions).forEach(function (question) {
rowData[question] = allQuestions[question];
});
excelData.push(rowData);
slno++;
}*/
for (const rowNode of rows) {
@ -648,7 +651,7 @@
"House No",
// PERSONAL
"Name of the Child Name",
"Name of the Child",
"Gender",
"Do you know DOB?",
"Date of Birth",
@ -661,7 +664,8 @@
"Child Living With",
"Father Name",
"Mother Name",
"Where abouts",
"Where about of Father?",
"Where about of Mother?",
"Guardian Name",
"Relationship",
"Occupation",
@ -675,6 +679,7 @@
"School Location",
"Which standard they stopped",
"Which year did they stopped",
"Reason for Dropout",
"Is The Child Interested In Continuing Education?",
"What are you Interested In?",
@ -687,20 +692,23 @@
"Health Details",
// DOCUMENT
"Documents Available",
"Aadhar card",
"Aadhar No",
"Community Certificate",
"Birth Certificate",
"Any corrections to be made in the document?",
"If Not Why?",
"Any corrections to be made in Aadhar card document?",
"If Not Why Aadhar card?",
"Any corrections to be made in community certificate document?",
"If Not Why community certificate?",
"Any corrections to be made in birth certificate document?",
"If Not Why birth certificate?",
// VULNERABILITY
"Vulnerability Assessment",
"Any Other Support Needed?",
"Comments & Remarks",
"Where about of Father?",
"Where about of Mother?"
];
// CREATE NEW ORDERED DATA
@ -727,16 +735,18 @@
header: headers
}
);
// DYNAMIC HEADERS
// AUTO COLUMN WIDTH
//const columns = [];
/*Object.keys(excelData[0]).forEach(function () {
columns.push({ wch: 30 });
});
worksheet['!cols'] = columns;*/
const columns = [];
@ -948,11 +958,11 @@
}
/*success: function (data) {
let html = "";
Object.keys(data).forEach(function (key) {
html += `
<div class="row mb-2">
<div class="col-md-5">
@ -964,9 +974,9 @@
</div>
`;
});
$("#surveyDetails").html(html);
// Show modal
let modal = new bootstrap.Modal(document.getElementById('surveyModal'));
modal.show();

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/documentcorrectionmaster.html

@ -294,157 +294,160 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Document Correction");
$(".modal-title").text("Add Document Correction");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/documentcreationmasterlist",
type: "GET",
url: "/gcc/api/children-survey/documentcreationmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -469,103 +472,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Document Correction");
$(".modal-title").text("Edit Document Correction");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/documentcreationsave",
url: "/gcc/api/children-survey/documentcreationsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
id: editId,
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/documentcreationstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/documentcreationstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/documentreasonmaster.html

@ -294,159 +294,162 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Document Reason");
$(".modal-title").text("Add Document Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/documentreasonmasterlist",
type: "GET",
url: "/gcc/api/children-survey/documentreasonmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${row.id}</td>
@ -471,103 +474,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Document Reason");
$(".modal-title").text("Edit Document Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/documentreasonmaster",
url: "/gcc/api/children-survey/documentreasonmaster",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
id: editId,
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/documentreasonmasterstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/documentreasonmasterstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/dropoutreasonmaster.html

@ -294,158 +294,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Dropout Reason");
$(".modal-title").text("Add Dropout Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/dropoutreasonmasterlist",
type: "GET",
url: "/gcc/api/children-survey/dropoutreasonmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${row.id}</td>
@ -471,103 +474,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Dropout Reason");
$(".modal-title").text("Edit Dropout Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/dropoutreasonsave",
url: "/gcc/api/children-survey/dropoutreasonsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
id: editId,
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/dropoutreasonstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/dropoutreasonstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

331
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/educationmaster.html

@ -294,149 +294,152 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
function openAddModal() {
editId = 0;
function openAddModal() {
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Education");
$(".modal-title").text("Add Education");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/educationmasterlist",
type: "GET",
url: "/gcc/api/children-survey/educationmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Delete
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -456,106 +459,106 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
let editId = 0;
});
}
let editId = 0;
function editEducation(id, name) {
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Education");
$(".modal-title").text("Edit Education");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/save",
url: "/gcc/api/children-survey/save",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
editId = 0;
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

347
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/gendermaster.html

@ -295,157 +295,160 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
function openAddModal() {
});
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Gender");
$(".modal-title").text("Add Gender");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
modal.show();
}*/
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/gendermasterlist",
type: "GET",
url: "/gcc/api/children-survey/gendermasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Delete
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -465,109 +468,109 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
//update logic
let editId = 0;
function editEducation(id, name) {
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Gender");
$(".modal-title").text("Edit Gender");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/gendersave",
url: "/gcc/api/children-survey/gendersave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
editId = 0;
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/gender-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/gender-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/incomemaster.html

@ -294,158 +294,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
let editId = 0;
function openAddModal() {
});
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Income");
$(".modal-title").text("Add Income");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function openAddModal1() {
function openAddModal1() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/incomemasterlist",
type: "GET",
url: "/gcc/api/children-survey/incomemasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -470,103 +473,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Income");
$(".modal-title").text("Edit Income");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/incomesave",
url: "/gcc/api/children-survey/incomesave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/incomemasterstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/incomemasterstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

358
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/interestfieldmaster.html

@ -294,158 +294,160 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Interest Field");
$(".modal-title").text("Add Interest Field");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/interestfieldmasterlist",
type: "GET",
url: "/gcc/api/children-survey/interestfieldmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -470,101 +472,101 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Interest Field");
$(".modal-title").text("Edit Interest Field");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/interestfieldsave",
url: "/gcc/api/children-survey/interestfieldsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/interestfieldmaster-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/interestfieldmaster-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/livingmaster.html

@ -295,158 +295,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Living");
$(".modal-title").text("Add Living");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/livingmasterlist",
type: "GET",
url: "/gcc/api/children-survey/livingmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -471,103 +474,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Living");
$(".modal-title").text("Edit Living");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/livingsave",
url: "/gcc/api/children-survey/livingsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/living-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/living-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

345
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/locationmaster.html

@ -295,160 +295,163 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function openAddModal() {
modal.show();
}*/
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Location");
$(".modal-title").text("Add Location");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/locationmasterlist",
type: "GET",
url: "/gcc/api/children-survey/locationmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = row.isactive == 1
? `<span class="badge">Active</span>`
: `<span class="badge">Disabled</span>`;
let statusBadge = row.isactive == 1
? `<span class="badge">Active</span>`
: `<span class="badge">Disabled</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -472,103 +475,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Location");
$(".modal-title").text("Edit Location");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/locationsave",
url: "/gcc/api/children-survey/locationsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/location-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/location-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

955
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html

@ -0,0 +1,955 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}">
<style>
#surveyModal .modal-dialog {
max-width: 70%;
width: 70%;
}
#surveyModal .modal-content {
border-radius: 10px;
}
#surveyModal .modal-header {
background-color: #f8f9fa;
border-bottom: 2px solid #007bff;
}
#surveyModal .modal-title {
font-weight: 600;
color: #2c3e50;
}
#surveyModal .modal-body {
padding: 30px 40px;
}
#surveyDetails .row {
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #e9ecef;
}
#surveyDetails .col-md-5 {
font-weight: 600;
color: #34495e;
font-size: 14px;
}
#surveyDetails .col-md-7 {
font-weight: 500;
color: #555;
font-size: 14px;
}
/* Modal scrollbar styling */
#surveyModal .modal-body::-webkit-scrollbar {
width: 6px;
}
#surveyModal .modal-body::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
#surveyModal .modal-body::-webkit-scrollbar-thumb {
background: #007bff;
border-radius: 10px;
}
#surveyModal .modal-body::-webkit-scrollbar-thumb:hover {
background: #0056b3;
}
@media (max-width: 768px) {
#surveyModal .modal-dialog {
max-width: 96%;
width: 96%;
}
#surveyModal .modal-body {
padding: 20px;
}
}
#surveyModal .modal-dialog {
max-width: 75%;
}
#surveyModal .modal-content {
border-radius: 12px;
overflow: hidden;
}
#surveyModal .modal-header {
background: #44506A;
color: white;
border: none;
}
#surveyModal .modal-title {
font-size: 32px;
font-weight: 600;
}
#surveyModal .modal-body {
padding: 30px;
background: #f7f8fa;
}
.detail-card {
background: #fff;
border-radius: 12px;
padding: 14px 18px;
border: 1px solid #e9ecef;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
height: 100%;
}
.detail-label {
font-size: 13px;
font-weight: 700;
color: #7f8c8d;
text-transform: uppercase;
line-height: 1.5;
}
.detail-value {
font-size: 16px;
font-weight: 600;
color: #2c3e50;
line-height: 1.6;
word-break: break-word;
}
.section-heading {
font-size: 24px;
font-weight: 700;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #e5e7eb;
color: #2c3e50;
}
.section-heading {
font-size: 20px;
font-weight: 700;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #e74c3c;
color: #2c3e50;
}
.detail-card {
background: white;
border-radius: 10px;
padding: 15px 18px;
height: 100%;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
border: 1px solid #edf0f2;
}
@media(max-width:768px) {
#surveyModal .modal-dialog {
max-width: 95%;
}
.detail-card {
margin-bottom: 10px;
}
}
</style>
</head>
<body>
<div class="wrapper">
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<div class="page-wrap">
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<div class="main-content">
<div class="container-fluid">
<!--<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="ik ik-thumbs-up bg-blue"></i>
<div class="d-inline">
<h5>Children Survey Dashboard</h5>
</div>
<div class="col-lg-6 text-end">
<input type="date" id="fromDate" class="form-control d-inline-block"
style="width:150px;">
<span class="mx-1">to</span>
<input type="date" id="toDate" class="form-control d-inline-block"
style="width:150px;">
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page">Update Staff</li>
</ol>
</nav>
</div>
</div>
</div>-->
<div class="page-header">
<div class="row align-items-center">
<!-- LEFT SIDE -->
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-thumbs-up bg-blue me-2"></i>
<h5 class="mb-0">Children Survey Dashboard</h5>
</div>
</div>
<!-- RIGHT SIDE (DATE FILTER) -->
<!--<div class="col-lg-6 text-end">
<label class="form-label fw-semibold me-2">From Date:</label>
<input type="date" id="fromDate" class="form-control d-inline-block"
style="width:150px;">
<label class="form-label fw-semibold me-2">To Date:</label>
<input type="date" id="toDate" class="form-control d-inline-block" style="width:150px;">
</div>-->
</div>
<!-- BREADCRUMB (SEPARATE ROW) -->
<div class="row mt-2">
<div class="col-lg-12">
<nav class="breadcrumb-container">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active">Non Survey Child List</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<!-- Filters Section -->
<div class="row mb-3 align-items-end">
<div class="col-md-2">
<select id="area" class="form-control">
<option value="">Area Wise</option>
</select>
</div>
<div class="col-md-2">
<label class="fw-semibold">From Date</label>
<input type="date" id="fromDate" class="form-control">
</div>
<div class="col-md-2">
<label class="fw-semibold">To Date</label>
<input type="date" id="toDate" class="form-control">
</div>
<div class="col-md-2 text-center">
<button class="btn btn-primary w-100" onclick="fetchSurveyData()">
Search
</button>
</div>
<div class="col-md-2 text-center">
<button class="btn btn-secondary w-100" onclick="resetFilters()">
Reset
</button>
</div>
</div>
<!--<div class="row mb-3">
<div class="col-md-2">
<select id="gender" class="form-control">
<option value="">Gender</option>
</select>
</div>
<div class="col-md-2">
<select id="age" class="form-control">
<option value="">Age</option>
<option value="4-8">4-8</option>
<option value="9-13">9-13</option>
<option value="14-18">14-18</option>
</select>
</div>
<div class="col-md-2">
<select id="area" class="form-control">
<option value="">Area Wise</option>
</select>
</div>
<div class="col-md-2">
<select id="education" class="form-control">
<option value="">Education</option>
</select>
</div>
<div class="col-lg-6 text-end">
<label class="form-label fw-semibold me-2">From Date:</label>
<input type="date" id="fromDate" class="form-control d-inline-block" style="width:150px;">
<label class="form-label fw-semibold me-2">To Date:</label>
<input type="date" id="toDate" class="form-control d-inline-block" style="width:150px;">
</div>
</div>
<div class="row mb-3 justify-content-center">
<div class="col-md-2 text-center">
<button class="btn btn-primary w-100 " onclick="fetchSurveyData()">Search</button>
</div>
<div class="col-md-2 text-center">
<button class="btn btn-secondary w-100 " onclick="resetFilters()">Reset</button>
</div>
</div>-->
</div>
<!-- Salary Report Table -->
<div class="card-block mt-3">
<table id="surveyTable" class="table table-striped table-bordered">
<div class="mb-3">
<!--<button class="btn btn-success" onclick="downloadBulkSurveyExcel()">
<i class="fa fa-file-excel"></i>
Bulk Download Excel
</button>-->
</div>
<thead class="thead-dark">
<tr>
<th>Date</th>
<th>Survey ID</th>
<th>Reason</th>
<th>Area</th>
<th>House No</th>
<th>Block No</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
</tfoot>
</table>
</div>
</div>
<div class="modal fade" id="surveyModal" tabindex="-1">
<div class="modal-dialog modal-lg modal-dialog-scrollable" style="max-width:70%; width:70%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Child Survey Details</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div id="surveyDetails"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
async function downloadBulkSurveyExcel() {
let area = $("#area").val();
let fromDate = $("#fromDate").val();
let toDate = $("#toDate").val();
try {
let response = await $.ajax({
url: "/gcc/api/children-survey/nonsurveyed/list",
type: "GET",
data: {
area: area,
fromDate: fromDate,
toDate: toDate
}
});
let excelData = [];
response.forEach(function (row, index) {
excelData.push({
"S.No": index + 1,
"Date": row.survey_date || '',
"Survey ID": row.survey_id || '',
"Reason": row.reason || '',
"Area": row.area || '',
"House No": row.house_no || '',
"Block No": row.block_no || ''
});
});
if (excelData.length === 0) {
alert("No data found");
return;
}
let worksheet = XLSX.utils.json_to_sheet(excelData);
let workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(
workbook,
worksheet,
"Non Survey Child List"
);
XLSX.writeFile(
workbook,
"Non_Survey_Child_List.xlsx"
);
} catch (e) {
console.log(e);
alert("Error downloading excel");
}
}
$(document).ready(function () {
// 🔹 Load dropdowns when page loads
loadDropdowns();
fetchSurveyData(true);
// 🔹 (Optional) Load table initially
// fetchSurveyData();
// Restrict To Date based on From Date
$("#fromDate").on("change", function () {
let fromDate = $(this).val();
// Set minimum selectable date for To Date
$("#toDate").attr("min", fromDate);
// If current To Date is less than From Date, clear it
if ($("#toDate").val() < fromDate) {
$("#toDate").val('');
}
});
});
function resetFilters() {
$("#searchName").val('');
$("#gender").val('');
$("#age").val('');
$("#area").val('');
$("#education").val('');
$("#fromDate").val('');
$("#toDate").val('');
// Re-load table with all data
fetchSurveyData(true);
}
function viewSurvey(surveyId) {
$.ajax({
url: "/gcc/api/children-survey/details",
type: "GET",
data: { surveyId: surveyId },
success: function (data) {
let html = "";
function buildSection(title, sectionData) {
let sectionHtml = `
<div class="survey-section mb-5">
<h5 class="section-heading">
${title}
</h5>
<div class="row">
`;
let keys = Object.keys(sectionData);
keys.forEach(function (key) {
sectionHtml += `
<div class="col-md-6 mb-3">
<div class="detail-card">
<div class="detail-label">
${key}
</div>
<div class="detail-value">
${sectionData[key] || '-'}
</div>
</div>
</div>
`;
});
sectionHtml += `
</div>
</div>
`;
return sectionHtml;
}
/*function buildSection(title, sectionData) {
let sectionHtml = `
<div class="mb-4">
<h5 class="fw-bold border-bottom pb-2 mb-3">
${title}
</h5>
`;
Object.keys(sectionData).forEach(function (key) {
sectionHtml += `
<div class="row py-2 border-bottom">
<div class="col-md-5 fw-bold">
${key}
</div>
<div class="col-md-7">
: ${sectionData[key] || ''}
</div>
</div>
`;
});
sectionHtml += `</div>`;
return sectionHtml;
}*/
html += buildSection(
"Location Details",
data.locationDetails
);
html += buildSection(
"Personal Information",
data.personalInformation
);
html += buildSection(
"Education Details",
data.educationDetails
);
html += buildSection(
"Health Details",
data.healthDetails
);
html += buildSection(
"Document Details",
data.documentDetails
);
html += buildSection(
"Vulnerability Details",
data.vulnerabilityDetails
);
$("#surveyDetails").html(html);
let modal = new bootstrap.Modal(
document.getElementById('surveyModal')
);
modal.show();
}
/*success: function (data) {
let html = "";
Object.keys(data).forEach(function (key) {
html += `
<div class="row mb-2">
<div class="col-md-5">
<strong>${key}</strong>
</div>
<div class="col-md-7">
: ${data[key]}
</div>
</div>
`;
});
$("#surveyDetails").html(html);
// Show modal
let modal = new bootstrap.Modal(document.getElementById('surveyModal'));
modal.show();
}*/
});
}
function fetchSurveyData(isInitialLoad = false) {
var gender = $("#gender").val();
var age = $("#age").val();
var area = $("#area").val();
var education = $("#education").val();
var fromDate = $("#fromDate").val();
var toDate = $("#toDate").val();
// SHOW SWAL ONLY WHEN SEARCH BUTTON CLICKED
if (!isInitialLoad &&
gender == '' &&
age == '' &&
area == '' &&
education == '' &&
fromDate == '' &&
toDate == '') {
Swal.fire({
icon: 'warning',
title: 'Warning',
text: 'Please select at least one filter.',
confirmButtonColor: '#3085d6'
});
return;
}
if (fromDate != '') {
if (toDate == '') {
Swal.fire({
icon: 'warning',
title: 'Warning',
text: 'Please select both from date and to date.',
confirmButtonColor: '#3085d6'
});
return;
}
}
if (toDate != '') {
if (fromDate == '') {
Swal.fire({
icon: 'warning',
title: 'Warning',
text: 'Please select both from date and to date.',
confirmButtonColor: '#3085d6'
});
return;
}
}
$.ajax({
url: "/gcc/api/children-survey/nonsurveyed/list",
type: "GET",
data: {
area: $("#area").val(),
fromDate: $("#fromDate").val(),
toDate: $("#toDate").val()
},
success: function (data) {
let tbody = "";
data.forEach(function (row) {
//<td>${row.survey_date || ''}</td>
tbody += `
<tr>
<td>${formatDate(row.survey_date)}</td>
<td>${row.survey_id || ''}</td>
<td>${row.reason || ''}</td>
<td>${row.area || ''}</td>
<td>${row.house_no || ''}</td>
<td>${row.block_no || ''}</td>
</tr>
`;
});
// 🔥 Destroy old DataTable if exists
if ($.fn.DataTable.isDataTable('#surveyTable')) {
$('#surveyTable').DataTable().clear().destroy();
}
// Set new data
$("#surveyTable tbody").html(tbody);
// 🔥 Reinitialize DataTable WITH BUTTONS
$('#surveyTable').DataTable({
dom: 'Bfrtip',
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-success'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
orientation: 'landscape',
pageSize: 'A4'
}
],
responsive: true,
destroy: true
});
}
});
}
function formatDate(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${day}-${month}-${year}`;
}
function loadDropdowns() {
// Gender
$.ajax({
url: "/gcc/api/children-survey/gender",
type: "GET",
success: function (data) {
let options = '<option value="">Gender</option>';
data.forEach(function (g) {
options += `<option value="${g.id}">${g.english_name}</option>`;
});
$("#gender").html(options);
}
});
// Area
$.ajax({
url: "/gcc/api/children-survey/location",
type: "GET",
success: function (data) {
let options = '<option value="">Area</option>';
data.forEach(function (a) {
options += `<option value="${a.id}">${a.english_name}</option>`;
});
$("#area").html(options);
}
});
// Education
$.ajax({
url: "/gcc/api/children-survey/education",
type: "GET",
success: function (data) {
let options = '<option value="">Education</option>';
data.forEach(function (e) {
options += `<option value="${e.id}">${e.english_name}</option>`;
});
$("#education").html(options);
}
});
}
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/ownermaster.html

@ -294,158 +294,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Owner");
$(".modal-title").text("Add Owner");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/ownermasterlist",
type: "GET",
url: "/gcc/api/children-survey/ownermasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${row.id}</td>
@ -470,103 +473,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Owner");
$(".modal-title").text("Edit Owner");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/ownermastersave",
url: "/gcc/api/children-survey/ownermastersave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/ownermasterstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/ownermasterstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/religionmaster.html

@ -294,158 +294,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Religion");
$(".modal-title").text("Add Religion");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/religionmasterlist",
type: "GET",
url: "/gcc/api/children-survey/religionmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${index + 1}</td>
@ -470,103 +473,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Religion");
$(".modal-title").text("Edit Religion");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/religionsave",
url: "/gcc/api/children-survey/religionsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/religion-status",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/religion-status",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

142
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveyorsreports.html

@ -684,83 +684,85 @@
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
$(document).ready(function () {
<script th:inline="javascript">
$(document).ready(function () {
loadDashboard();
loadDashboard();
});
});
function loadDashboard() {
function loadDashboard() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/dashboard",
url: "/gcc/api/children-survey/dashboard",
type: "GET",
type: "GET",
success: function (data) {
success: function (data) {
$("#totalChildren").text(data.totalChildren);
$("#totalChildren").text(data.totalChildren);
$("#areasCovered").text(data.areasCovered);
$("#areasCovered").text(data.areasCovered);
$("#maleCount").text(data.maleCount);
$("#maleCount").text(data.maleCount);
$("#femaleCount").text(data.femaleCount);
$("#othersCount").text(data.othersCount);
$("#femaleCount").text(data.femaleCount);
$("#othersCount").text(data.othersCount);
//$("#currentlyStudying").text(data.currentlyStudying);
$("#currentlyStudying").text(
data.currentlyStudying + "%"
);
//$("#currentlyStudying").text(data.currentlyStudying);
$("#currentlyStudying").text(
data.currentlyStudying + "%"
);
$("#age4to8").text(data.age4to8);
$("#age4to8").text(data.age4to8);
$("#age9to13").text(data.age9to13);
$("#age9to13").text(data.age9to13);
$("#age14to18").text(data.age14to18);
$("#aadharYes").text(data.certificateDetails.aadhar_yes || 0);
$("#aadharNo").text(data.certificateDetails.aadhar_no || 0);
$("#age14to18").text(data.age14to18);
$("#aadharYes").text(data.certificateDetails.aadhar_yes || 0);
$("#aadharNo").text(data.certificateDetails.aadhar_no || 0);
$("#communityYes").text(data.certificateDetails.community_yes || 0);
$("#communityNo").text(data.certificateDetails.community_no || 0);
$("#communityYes").text(data.certificateDetails.community_yes || 0);
$("#communityNo").text(data.certificateDetails.community_no || 0);
$("#birthYes").text(data.certificateDetails.birth_yes || 0);
$("#birthNo").text(data.certificateDetails.birth_no || 0);
$("#birthYes").text(data.certificateDetails.birth_yes || 0);
$("#birthNo").text(data.certificateDetails.birth_no || 0);
// AREA WISE
// AREA WISE
let areaHtml = "";
let areaHtml = "";
$.each(data.areaWise, function (i, row) {
$.each(data.areaWise, function (i, row) {
areaHtml += `
areaHtml += `
<div class="report-row">
<div class="d-flex justify-content-between">
@ -782,17 +784,17 @@
</div>
`;
});
});
$("#areaWiseDiv").html(areaHtml);
$("#areaWiseDiv").html(areaHtml);
// VULNERABILITY
// VULNERABILITY
let vulnerabilityHtml = "";
let vulnerabilityHtml = "";
$.each(data.vulnerability, function (i, row) {
$.each(data.vulnerability, function (i, row) {
vulnerabilityHtml += `
vulnerabilityHtml += `
<div class="d-flex justify-content-between mb-2">
<span>${row.vulnerability}</span>
@ -801,15 +803,15 @@
</div>
`;
});
});
$("#vulnerabilityDiv").html(vulnerabilityHtml);
$("#vulnerabilityDiv").html(vulnerabilityHtml);
// EDUCATION
// EDUCATION
// EDUCATION STATUS
// EDUCATION STATUS
let educationHtml = `
let educationHtml = `
<div class="d-flex justify-content-between mb-2">
@ -837,15 +839,15 @@
`;
$("#educationDiv").html(educationHtml);
$("#educationDiv").html(educationHtml);
// HEALTH
// HEALTH
let healthHtml = "";
let healthHtml = "";
$.each(data.healthOverview, function (i, row) {
$.each(data.healthOverview, function (i, row) {
healthHtml += `
healthHtml += `
<div class="d-flex justify-content-between mb-2">
<span>${row.status}</span>
@ -854,18 +856,18 @@
</div>
`;
});
});
$("#healthDiv").html(healthHtml);
$("#healthDiv").html(healthHtml);
}
});
}
});
}
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/vulnerabilitymaster.html

@ -294,158 +294,161 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Vulnerability");
$(".modal-title").text("Add Vulnerability");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/vulnerabilitymasterlist",
type: "GET",
url: "/gcc/api/children-survey/vulnerabilitymasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${row.id}</td>
@ -470,103 +473,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Vulnerability");
$(".modal-title").text("Edit Vulnerability");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/vulnerabilitysave",
url: "/gcc/api/children-survey/vulnerabilitysave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/vulnerabilitymasterstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/vulnerabilitymasterstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>

343
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/whereaboutmaster.html

@ -294,157 +294,160 @@
<!-- Filters Section -->
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<div th:replace="~{fragments/modules/base/script :: script}"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap5.min.css">
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<!-- DataTable Buttons -->
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
<script th:inline="javascript">
//var createdBy = /*[[${LoginUserId}]]*/'';
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
/*$(document).ready(function () {
function clearUrlParams() {
const currentUrl = window.location.href;
const urlWithoutParams = currentUrl.split('?')[0]; // Remove the query parameters
window.history.replaceState({}, document.title, urlWithoutParams); // Replace the current URL without params
}
// Call this on page load to reset the URL
clearUrlParams();
// Initialize DataTable
var table = $('#salaryreporttable').DataTable({
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
orientation: 'landscape', // Change to landscape for more horizontal space
pageSize: 'A3', // You can change to A4 or A3 depending on your needs
customize: function (doc) {
// Custom column widths for better fit
//doc.content[1].table.widths = ['2%', '6%', '6%', '6%', '6%', '6%', '6%', '3%', '3%', '3%', '3%', '3%', '3%', '6%', '6%', '6%'];
// Optional: Adjust font size if needed
doc.styles.tableBodyEven.alignment = 'center';
doc.styles.tableBodyOdd.alignment = 'center';
}
}
],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: true,
select: false,
processing: false
});
});*/
$(document).ready(function () {
loadEducationTable();
loadEducationTable();
});
});
/*function openAddModal() {
/*function openAddModal() {
$("#educationName").val('');
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
let editId = 0;
function openAddModal() {
modal.show();
}*/
let editId = 0;
function openAddModal() {
editId = 0;
editId = 0;
$("#educationName").val('');
$("#educationName").val('');
$(".modal-title").text("Add Where About");
$(".modal-title").text("Add Where About");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function loadEducationTable() {
function loadEducationTable() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/whereaboutmasterlist",
type: "GET",
url: "/gcc/api/children-survey/whereaboutmasterlist",
type: "GET",
success: function (data) {
success: function (data) {
let tbody = "";
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
let actionButton = row.isactive == 1
? `
let actionButton = row.isactive == 1
? `
<button class="btn btn-danger btn-sm"
onclick="toggleStatus(${row.id},0)">
Disable
</button>
`
: `
: `
<button class="btn btn-success btn-sm"
onclick="toggleStatus(${row.id},1)">
Enable
</button>
`;
tbody += `
tbody += `
<tr>
<td>${row.id}</td>
@ -469,103 +472,103 @@
</tr>
`;
});
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
$('#educationTable').DataTable({
responsive: true
});
}
function editEducation(id, name) {
});
}
function editEducation(id, name) {
editId = id;
editId = id;
$("#educationName").val(name);
$("#educationName").val(name);
$(".modal-title").text("Edit Where About");
$(".modal-title").text("Edit Where About");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
modal.show();
}
function saveEducation() {
function saveEducation() {
$.ajax({
$.ajax({
url: "/gcc/api/children-survey/whereaboutsave",
url: "/gcc/api/children-survey/whereaboutsave",
type: "POST",
type: "POST",
contentType: "application/json",
contentType: "application/json",
data: JSON.stringify({
id: editId,
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
english_name: $("#educationName").val()
}),
}),
success: function () {
success: function () {
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
function toggleStatus(id, status) {
url: "/gcc/api/children-survey/whereaboutstatus",
$.ajax({
type: "POST",
url: "/gcc/api/children-survey/whereaboutstatus",
contentType: "application/json",
type: "POST",
data: JSON.stringify({
contentType: "application/json",
id: id,
status: status
data: JSON.stringify({
}),
id: id,
status: status
success: function () {
}),
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
success: function () {
loadEducationTable();
}
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</script>
</body>
</html>
Loading…
Cancel
Save