Browse Source

implemented full homeless survey module

main
AJITHKUMAR12 4 months ago
parent
commit
596e9a9469
  1. 54
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java
  2. 22
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  3. 815
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java
  4. 168
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java
  5. 4103
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java
  6. 5
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html
  7. 5
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html
  8. 5
      gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html
  9. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html
  10. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html
  11. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html
  12. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html
  13. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html
  14. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html
  15. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html
  16. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html
  17. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html
  18. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html
  19. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html
  20. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html
  21. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html
  22. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html
  23. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html
  24. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html
  25. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html
  26. 2085
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html
  27. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html
  28. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html
  29. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html
  30. 1007
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html
  31. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html
  32. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html
  33. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html
  34. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html
  35. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html
  36. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html
  37. 1257
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html
  38. 1012
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html
  39. 576
      gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html

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

@ -91,7 +91,18 @@ public class ChildrenSurveyService {
csr.survey_id,
MAX(CASE WHEN cqm.field_name = 'q6' THEN csr.answer END) AS child_name,
MAX(CASE WHEN cqm.field_name = 'q7' THEN gm.english_name END) AS gender,
MAX(
CASE
WHEN cqm.field_name = 'q7'
THEN CASE
WHEN csr.others_answer IS NOT NULL
AND TRIM(csr.others_answer) <> ''
THEN csr.others_answer
ELSE gm.english_name
END
END
) AS gender,
MAX(CASE WHEN cqm.field_name = 'q10' THEN csr.answer END) AS age,
MAX(CASE WHEN cqm.field_name = 'q24' THEN csr.answer END) AS mobile_number,
MAX(CASE WHEN cqm.field_name = 'q1' THEN lm.english_name END) AS area,
@ -118,6 +129,7 @@ public class ChildrenSurveyService {
""");
List<Object> params = new ArrayList<>();
// MAX(CASE WHEN cqm.field_name = 'q7' THEN gm.english_name END) AS gender,
// 🔍 NAME
if (name != null && !name.isEmpty()) {
@ -241,12 +253,16 @@ public class ChildrenSurveyService {
String rawAnswer = row.get("answer") != null
? row.get("answer").toString()
: "";
String othersAnswer = row.get("others_answer") != null
? row.get("others_answer").toString().trim()
: "";
String finalAnswer = resolveAnswer(
qid,
questionType,
masterTable,
rawAnswer);
rawAnswer,
othersAnswer);
// PERSONAL INFORMATION
/*
@ -335,10 +351,16 @@ public class ChildrenSurveyService {
Integer qid,
String questionType,
String masterTable,
String rawAnswer) {
String rawAnswer,
String othersAnswer) {
try {
if (othersAnswer != null
&& !othersAnswer.trim().isEmpty()) {
return othersAnswer;
}
if (rawAnswer == null || rawAnswer.trim().isEmpty()) {
return "";
}
@ -983,11 +1005,20 @@ public class ChildrenSurveyService {
WHEN cqm.field_name = 'q6'
THEN csr.answer
END) AS child_name,
MAX(
CASE
WHEN cqm.field_name = 'q7'
THEN CASE
WHEN csr.others_answer IS NOT NULL
AND TRIM(csr.others_answer) <> ''
THEN csr.others_answer
ELSE gm.english_name
END
END
) AS gender,
MAX(CASE
WHEN cqm.field_name = 'q7'
THEN gm.english_name
END) AS gender,
MAX(CASE
WHEN cqm.field_name = 'q10'
@ -1058,6 +1089,12 @@ public class ChildrenSurveyService {
""";
return jdbcTemplate.queryForList(sql, loginId, locationId, surveyDate);
/*
* MAX(CASE
* WHEN cqm.field_name = 'q7'
* THEN gm.english_name
* END) AS gender,
*/
}
// dashboard
@ -3362,8 +3399,7 @@ public class ChildrenSurveyService {
GROUP BY pr.survey_id
ORDER BY pr.cdate desc
ORDER BY MAX(pr.cdate) DESC
""");
// ORDER BY pr.survey_id

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

@ -24,14 +24,14 @@ 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";
// AWS
// private static String host = "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306";
// private static String dbpassword = "gcc-facial-password";
private static String host = "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306";
private static String dbpassword = "gcc-facial-password";
////////////////////////////// (For GCC APP) ////////////////////////
@Configuration
@ -407,7 +407,7 @@ public class DataSourceConfig {
dataSource.setPassword(dbpassword);
return dataSource;
}
/////////////// Road War /////////////////////
@Bean(name = "mysqlRoadWarDataSource")
public DataSource mysqlRoadWarDataSource() {
@ -419,6 +419,18 @@ public class DataSourceConfig {
return dataSource;
}
// homeles
@Bean(name = "mysqlHomelessSurveyDataSource")
public DataSource mysqlHomelessSurveyDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://" + host + "/gcc_homeless_survey");
// dataSource.setUrl("jdbc:mysql://" + host + "/gcc_homeless_survey_live");
dataSource.setUsername("root");
dataSource.setPassword(dbpassword);
return dataSource;
}
////////////////////////////// ORACLE ////////////////////////
@Bean(name = "oracleDataSource")
public DataSource oracleDataSource() {

815
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java

@ -0,0 +1,815 @@
package in.gov.chennaicorporation.gccoffice.homelesssurvey.Controller;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.http.HttpHeaders;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
import in.gov.chennaicorporation.gccoffice.homelesssurvey.Service.HomelessSurveyService;
@RestController
@RequestMapping("/gcc/api/homeless-survey")
public class HomelessSurveyController {
@Autowired
private HomelessSurveyService service;
@GetMapping("/list")
public ResponseEntity<List<Map<String, Object>>> getHomelessSurveyList(
@RequestParam(required = false) String zone,
@RequestParam(required = false) String ward,
@RequestParam(required = false) String fromDate,
@RequestParam(required = false) String toDate) {
return ResponseEntity.ok(
service.getHomelessSurveyList(
zone,
ward,
fromDate,
toDate));
}
@GetMapping("/zones")
public ResponseEntity<List<Map<String, Object>>> getZones() {
return ResponseEntity.ok(
service.getZones());
}
@GetMapping("/wards")
public ResponseEntity<List<Map<String, Object>>> getWards(
@RequestParam String zoneId) {
return ResponseEntity.ok(
service.getWards(zoneId));
}
@GetMapping("/nonsurveyed/list")
@ResponseBody
public List<Map<String, Object>> getHomelessNonSurveyedList(
@RequestParam(required = false) String zone,
@RequestParam(required = false) String ward,
@RequestParam(required = false) String fromDate,
@RequestParam(required = false) String toDate) {
return service.getHomelessNonSurveyedList(
zone,
ward,
fromDate,
toDate);
}
@GetMapping("/details")
public ResponseEntity<List<Map<String, Object>>> getSurveyDetails(
@RequestParam String surveyId) {
return ResponseEntity.ok(
service.getHomelessSurveyDetails(surveyId));
}
@GetMapping("/document-count")
public ResponseEntity<Integer> getDocumentCount(
@RequestParam String surveyId) {
return ResponseEntity.ok(
service.getDocumentCount(surveyId));
}
@GetMapping("/documents")
public ResponseEntity<List<Map<String, Object>>> getDocuments(
@RequestParam String surveyId) {
System.out.println("surveyId");
System.out.println(surveyId);
return ResponseEntity.ok(
service.getSurveyDocuments(surveyId));
}
/*
* @GetMapping("/download")
* public ResponseEntity<Resource> downloadFile(
*
* @RequestParam String fileUrl) throws Exception {
*
* URL url = new URL(fileUrl);
*
* InputStream inputStream = url.openStream();
*
* byte[] bytes = inputStream.readAllBytes();
*
* ByteArrayResource resource = new ByteArrayResource(bytes);
*
* String fileName = fileUrl.substring(
* fileUrl.lastIndexOf("/") + 1);
*
* return ResponseEntity.ok()
* .header(
* HttpHeaders.CONTENT_DISPOSITION,
* "attachment; filename=\"" +
* fileName + "\"")
* .contentLength(bytes.length)
* .body(resource);
* }
*/
@GetMapping("/download-all-documents")
public ResponseEntity<byte[]> downloadAllDocuments(
@RequestParam String surveyId) throws Exception {
List<Map<String, Object>> documents = service.getSurveyDocuments(surveyId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zipOut = new ZipOutputStream(baos);
for (Map<String, Object> doc : documents) {
String fileUrl = String.valueOf(doc.get("file_url"));
String documentName = String.valueOf(doc.get("document_name"))
.replaceAll("\\s+", "_");
URL url = new URL(fileUrl);
InputStream is = url.openStream();
byte[] fileBytes = is.readAllBytes();
String extension = fileUrl.substring(fileUrl.lastIndexOf("."));
ZipEntry zipEntry = new ZipEntry(
documentName + "_" +
surveyId +
extension);
zipOut.putNextEntry(zipEntry);
zipOut.write(fileBytes);
zipOut.closeEntry();
is.close();
}
zipOut.close();
return ResponseEntity.ok()
.header(
"Content-Disposition",
"attachment; filename=\""
+ surveyId
+ "_Documents.zip\"")
.header(
"Content-Type",
"application/zip")
.body(baos.toByteArray());
}
/*
* @GetMapping("/download-document")
* public ResponseEntity<byte[]> downloadDocument(
*
* @RequestParam String fileUrl,
*
* @RequestParam String fileName) {
*
* try {
*
* URL url = new URL(fileUrl);
*
* InputStream is = url.openStream();
*
* byte[] fileBytes = is.readAllBytes();
*
* String extension = fileUrl.substring(
* fileUrl.lastIndexOf("."));
*
* return ResponseEntity.ok()
* .header(
* "Content-Disposition",
* "attachment; filename=\"" + fileName + extension + "\"")
* .header(
* "Content-Type",
* "application/octet-stream")
* .body(fileBytes);
*
* } catch (Exception e) {
*
* throw new RuntimeException(e);
* }
* }
*/
@GetMapping("/categories")
public ResponseEntity<List<Map<String, Object>>> getCategories() {
return ResponseEntity.ok(
service.getCategories());
}
@GetMapping("/getSurveyorsList")
@ResponseBody
public List<Map<String, Object>> getSurveyorsList(
@RequestParam(required = false) String zone,
@RequestParam(required = false) String ward,
@RequestParam(required = false) String fromDate,
@RequestParam(required = false) String toDate) {
return service.getSurveyorsList(
zone,
ward,
fromDate,
toDate);
}
@GetMapping("/surveyor-details")
public ResponseEntity<List<Map<String, Object>>> getSurveyorDetails(
@RequestParam String loginId,
@RequestParam String zone,
@RequestParam String ward,
@RequestParam String surveyDate) {
return ResponseEntity.ok(
service.getSurveyorWiseSurveyList(
loginId,
zone,
ward,
surveyDate));
}
@GetMapping("/gendermasterlist")
public List<Map<String, Object>> getGenderList() {
return service.getGenderList();
}
@PostMapping("/gendersave")
public String saveGender(
@RequestBody Map<String, Object> req) {
service.saveGender(req);
return "SUCCESS";
}
@PostMapping("/gender-status")
public String updateGenderStatus(
@RequestBody Map<String, Object> req) {
service.updateGenderStatus(req);
return "SUCCESS";
}
@GetMapping("/relationtypemasterlist")
public List<Map<String, Object>> getRelationTypeList() {
return service.getRelationTypeList();
}
@PostMapping("/relationtypesave")
public String saveRelationType(
@RequestBody Map<String, Object> req) {
service.saveRelationType(req);
return "SUCCESS";
}
@PostMapping("/relationtype-status")
public String updateRelationTypeStatus(
@RequestBody Map<String, Object> req) {
service.updateRelationTypeStatus(req);
return "SUCCESS";
}
@GetMapping("/currentlylivingmasterlist")
public List<Map<String, Object>> getCurrentlyLivingList() {
return service.getCurrentlyLivingList();
}
@PostMapping("/currentlylivingsave")
public String saveCurrentlyLiving(
@RequestBody Map<String, Object> req) {
service.saveCurrentlyLiving(req);
return "SUCCESS";
}
@PostMapping("/currentlyliving-status")
public String updateCurrentlyLivingStatus(
@RequestBody Map<String, Object> req) {
service.updateCurrentlyLivingStatus(req);
return "SUCCESS";
}
@GetMapping("/martialmasterlist")
public List<Map<String, Object>> getMartialList() {
return service.getMartialList();
}
@PostMapping("/martialsave")
public String saveMartial(
@RequestBody Map<String, Object> req) {
service.saveMartial(req);
return "SUCCESS";
}
@PostMapping("/martial-status")
public String updateMartialStatus(
@RequestBody Map<String, Object> req) {
service.updateMartialStatus(req);
return "SUCCESS";
}
@GetMapping("/disabilitytype")
public List<Map<String, Object>> getDisabilityTypeList() {
return service.getDisabilityTypeList();
}
@PostMapping("/disabilitytypesave")
public String saveDisabilityType(
@RequestBody Map<String, Object> req) {
service.saveDisabilityType(req);
return "SUCCESS";
}
@PostMapping("/disabilitytype-status")
public String updateDisabilityTypeStatus(
@RequestBody Map<String, Object> req) {
service.updateDisabilityTypeStatus(req);
return "SUCCESS";
}
@GetMapping("/disabiltycertificatelist")
public List<Map<String, Object>> getDisabilityCertificateMasterList() {
return service.getDisabilityCertificateMasterList();
}
@PostMapping("/disabiltycertificategersave")
public String saveDisabilityCertificateMaster(
@RequestBody Map<String, Object> req) {
service.saveDisabilityCertificateMaster(req);
return "SUCCESS";
}
@PostMapping("/disabiltycertificate-status")
public String updateDisabilityCertificateMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateDisabilityCertificateMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/healthconditionlist")
public List<Map<String, Object>> getHealthConditionList() {
return service.getHealthConditionList();
}
@PostMapping("/healthconditionsave")
public String saveHealthCondition(
@RequestBody Map<String, Object> req) {
service.saveHealthCondition(req);
return "SUCCESS";
}
@PostMapping("/healthcondition-status")
public String updateHealthConditionStatus(
@RequestBody Map<String, Object> req) {
service.updateHealthConditionStatus(req);
return "SUCCESS";
}
@GetMapping("/educationmasterlist")
public List<Map<String, Object>> getEducationMasterList() {
return service.getEducationMasterList();
}
@PostMapping("/educationsave")
public String saveEducationMaster(
@RequestBody Map<String, Object> req) {
service.saveEducationMaster(req);
return "SUCCESS";
}
@PostMapping("/education-status")
public String updateEducationMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateEducationMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/discontinuedlist")
public List<Map<String, Object>> getDiscontinuedList() {
return service.getDiscontinuedList();
}
@PostMapping("/discontinuedsave")
public String saveDiscontinuedMaster(
@RequestBody Map<String, Object> req) {
service.saveDiscontinuedMaster(req);
return "SUCCESS";
}
@PostMapping("/discontinued-status")
public String updateDiscontinuedMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateDiscontinuedMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/employmenttypelist")
public List<Map<String, Object>> getEmploymentTypeList() {
return service.getEmploymentTypeList();
}
@PostMapping("/employmenttypesave")
public String saveEmploymentType(
@RequestBody Map<String, Object> req) {
service.saveEmploymentType(req);
return "SUCCESS";
}
@PostMapping("/employmenttype-status")
public String updateEmploymentTypeStatus(
@RequestBody Map<String, Object> req) {
service.updateEmploymentTypeStatus(req);
return "SUCCESS";
}
@GetMapping("/occupationlist")
public List<Map<String, Object>> getOccupationList() {
return service.getOccupationList();
}
@PostMapping("/occupationsave")
public String saveOccupation(
@RequestBody Map<String, Object> req) {
service.saveOccupation(req);
return "SUCCESS";
}
@PostMapping("/occupation-status")
public String updateOccupationStatus(
@RequestBody Map<String, Object> req) {
service.updateOccupationStatus(req);
return "SUCCESS";
}
@GetMapping("/notemployedlist")
public List<Map<String, Object>> getNotEmployedList() {
return service.getNotEmployedList();
}
@PostMapping("/notemployedsave")
public String saveNotEmployed(
@RequestBody Map<String, Object> req) {
service.saveNotEmployed(req);
return "SUCCESS";
}
@PostMapping("/notemployed-status")
public String updateNotEmployedStatus(
@RequestBody Map<String, Object> req) {
service.updateNotEmployedStatus(req);
return "SUCCESS";
}
@GetMapping("/homelessreasonmasterlist")
public List<Map<String, Object>> getReasonHomelessList() {
return service.getReasonHomelessList();
}
@PostMapping("/homelessreasonmasterlist")
public String saveReasonHomeless(
@RequestBody Map<String, Object> req) {
service.saveHomelessReason(req);
return "SUCCESS";
}
@PostMapping("/homelessreasonmaster-status")
public String updateHomelessReasonStatus(
@RequestBody Map<String, Object> req) {
service.updateHomelessReasonStatus(req);
return "SUCCESS";
}
@GetMapping("/sleepingspacemasterlist")
public List<Map<String, Object>> getSleepingSpaceList() {
return service.getSleepingSpaceList();
}
@PostMapping("/sleepingspacesave")
public String saveSleepingSpace(
@RequestBody Map<String, Object> req) {
service.saveSleepingSpace(req);
return "SUCCESS";
}
@PostMapping("/sleepingspace-status")
public String updateSleepingSpaceStatus(
@RequestBody Map<String, Object> req) {
service.updateSleepingSpaceStatus(req);
return "SUCCESS";
}
@GetMapping("/movingreasonmasterlist")
public List<Map<String, Object>> getMovingReasonList() {
return service.getMovingReasonList();
}
@PostMapping("/movingreasonmasterdatasave")
public String saveMovingReason(
@RequestBody Map<String, Object> req) {
service.saveMovingReason(req);
return "SUCCESS";
}
@PostMapping("/movingreasonmasterdata-status")
public String updateMovingReasonStatus(
@RequestBody Map<String, Object> req) {
service.updateMovingReasonStatus(req);
return "SUCCESS";
}
@GetMapping("/comeoutsheltermasterlist")
public List<Map<String, Object>> getComeOutShelterList() {
return service.getComeOutShelterList();
}
@PostMapping("/comeoutsheltersave")
public String saveComeOutShelter(
@RequestBody Map<String, Object> req) {
service.saveComeOutShelter(req);
return "SUCCESS";
}
@PostMapping("/comeoutshelter-status")
public String updateComeOutShelterStatus(
@RequestBody Map<String, Object> req) {
service.updateComeOutShelterStatus(req);
return "SUCCESS";
}
@GetMapping("/gccsheltermasterlist")
public List<Map<String, Object>> getGCCShelterMasterList() {
return service.getGCCShelterMasterList();
}
@PostMapping("/gccsheltermasterdatasave")
public String saveGCCShelterMaster(
@RequestBody Map<String, Object> req) {
service.saveGCCShelterMaster(req);
return "SUCCESS";
}
@PostMapping("/gccsheltermasterdata-status")
public String updateGCCShelterMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateGCCShelterMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/birthcertificatmasterlist")
public List<Map<String, Object>> getBirthCertificateNoReasonMasterList() {
return service.getBirthCertificateNoReasonMasterList();
}
@PostMapping("/birthcertificatmasterdatasave")
public String saveBirthCertificateNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveBirthCertificateNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/birthcertificatmasterdata-status")
public String updateBirthCertificateNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateBirthCertificateNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/communitymasterlist")
public List<Map<String, Object>> getCommunityMasterList() {
return service.getCommunityMasterList();
}
@PostMapping("/communitycertmasterdatasave")
public String saveCommunityMaster(
@RequestBody Map<String, Object> req) {
service.saveCommunityMaster(req);
return "SUCCESS";
}
@PostMapping("/communitycertmasterdata-status")
public String updateCommunityMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateCommunityMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/voteridmasterlist")
public List<Map<String, Object>> getVoterIdMasterList() {
return service.getVoterIdMasterList();
}
@PostMapping("/voteridmastersave")
public String saveVoterIdMaster(
@RequestBody Map<String, Object> req) {
service.saveVoterIdMaster(req);
return "SUCCESS";
}
@PostMapping("/voteridmaster-status")
public String updateVoterIdMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateVoterIdMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/aadharnoreasonlst")
public List<Map<String, Object>> getAadharCertificateNoReasonMasterList() {
return service.getAadharCertificateNoReasonMasterList();
}
@PostMapping("/aadharnoreasonsave")
public String saveAadharCertificateNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveAadharCertificateNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/aadharnoreason-status")
public String updateAadharCertificateNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateAadharCertificateNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/smartcardnoreasonmasterlist")
public List<Map<String, Object>> getSmartCardNoReasonMasterList() {
return service.getSmartCardNoReasonMasterList();
}
@PostMapping("/smartcardnoreasonsave")
public String saveSmartCardNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveSmartCardNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/smartcardnoreasonstatus")
public String updateSmartCardNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateSmartCardNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/driverlicensemasterlist")
public List<Map<String, Object>> getDriverLicenseNoReasonMasterList() {
return service.getDriverLicenseNoReasonMasterList();
}
@PostMapping("/driverlicensesave")
public String saveDriverLicenseNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveDriverLicenseNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/driverlicense-status")
public String updateDriverLicenseNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateDriverLicenseNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/cminsurancemasterlist")
public List<Map<String, Object>> getCmInsuranceNoReasonMasterList() {
return service.getCmInsuranceNoReasonMasterList();
}
@PostMapping("/cminsurancesave")
public String saveCmInsuranceNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveCmInsuranceNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/cminsurance-status")
public String updateCmInsuranceNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateCmInsuranceNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/bankpassbookreasonmasterlist")
public List<Map<String, Object>> getBankPassbookNoReasonMasterList() {
return service.getBankPassbookNoReasonMasterList();
}
@PostMapping("/bankpassbookreasonmaster-save")
public String saveBankPassbookNoReasonMaster(
@RequestBody Map<String, Object> req) {
service.saveBankPassbookNoReasonMaster(req);
return "SUCCESS";
}
@PostMapping("/bankpassbookreasonmasterstatus")
public String updateBankPassbookNoReasonMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateBankPassbookNoReasonMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/religionmasterlist")
public List<Map<String, Object>> getReligionMasterList() {
return service.getReligionMasterList();
}
@PostMapping("/religionmasterdatasave")
public String saveReligionMaster(
@RequestBody Map<String, Object> req) {
service.saveReligionMaster(req);
return "SUCCESS";
}
@PostMapping("/religionmasterdata-status")
public String updateReligionMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateReligionMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/castemasterlist")
public List<Map<String, Object>> getCasteMasterList() {
return service.getCasteMasterList();
}
@PostMapping("/castemasterdatasave")
public String saveCasteMaster(
@RequestBody Map<String, Object> req) {
service.saveCasteMaster(req);
return "SUCCESS";
}
@PostMapping("/castemasterdata-status")
public String updateCasteMasterStatus(
@RequestBody Map<String, Object> req) {
service.updateCasteMasterStatus(req);
return "SUCCESS";
}
@GetMapping("/dashboard")
public ResponseEntity<Map<String, Object>> getDashboard() {
return ResponseEntity.ok(
service.getDashboard());
}
@GetMapping("/zone-wise")
public ResponseEntity<List<Map<String, Object>>> getZoneWiseCount() {
return ResponseEntity.ok(
service.getZoneWiseCount());
}
@GetMapping("/ward-wise")
public ResponseEntity<List<Map<String, Object>>> getWardWiseCount(
@RequestParam String zone) {
return ResponseEntity.ok(
service.getWardWiseCount(zone));
}
}

168
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java

@ -0,0 +1,168 @@
package in.gov.chennaicorporation.gccoffice.homelesssurvey.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller("HomelessSurveyController")
@RequestMapping("/gcc/homelesssurvey")
public class MainController {
@GetMapping("/homelesslist/surveyedlist")
public String surveyedlist() {
return "modules/homelesssurvey/homelesslist";
}
@GetMapping("/homelesslist/nonsurveyedlist")
public String nonsurveyedlist() {
return "modules/homelesssurvey/nonsurveyedhomelist";
}
@GetMapping("/surveylist")
public String surveylist() {
return "modules/homelesssurvey/surveyorlist";
}
@GetMapping("/surveyorsreports")
public String surveyorsreports() {
return "modules/homelesssurvey/surveyorsreports";
}
@GetMapping("/homelesslist/gender")
public String gender() {
return "modules/homelesssurvey/gendermaster";
}
@GetMapping("/homelesslist/relationtype")
public String relationtype() {
return "modules/homelesssurvey/relationtype";
}
@GetMapping("/homelesslist/currentlyliving")
public String currentlyliving() {
return "modules/homelesssurvey/currentlyliving";
}
@GetMapping("/homelesslist/martial")
public String martialstatus() {
return "modules/homelesssurvey/martial";
}
@GetMapping("/homelesslist/disabilitytype")
public String disabilitytype() {
return "modules/homelesssurvey/disability";
}
@GetMapping("/homelesslist/diable")
public String disabiltycertificate() {
return "modules/homelesssurvey/disabiltycertificate";
}
@GetMapping("/homelesslist/healthcondition")
public String healthcondition() {
return "modules/homelesssurvey/healthcondition";
}
@GetMapping("/homelesslist/education")
public String education() {
return "modules/homelesssurvey/education";
}
@GetMapping("/homelesslist/discontinued")
public String discontinued() {
return "modules/homelesssurvey/discontinued";
}
@GetMapping("/homelesslist/employment")
public String employmenttype() {
return "modules/homelesssurvey/employmenttype";
}
@GetMapping("/homelesslist/occupation")
public String occupation() {
return "modules/homelesssurvey/occupation";
}
@GetMapping("/homelesslist/notemployed")
public String notemployed() {
return "modules/homelesssurvey/notemployed";
}
@GetMapping("/homelesslist/homeless")
public String homelessreason() {
return "modules/homelesssurvey/homelessreason";
}
@GetMapping("/homelesslist/sleepingspace")
public String sleepingspace() {
return "modules/homelesssurvey/sleepingspace";
}
@GetMapping("/homelesslist/moving")
public String movingreason() {
return "modules/homelesssurvey/movingreason";
}
@GetMapping("/homelesslist/comeoutshelter")
public String comeoutshelter() {
return "modules/homelesssurvey/comeoutshelter";
}
@GetMapping("/homelesslist/gccshelter")
public String gccshelter() {
return "modules/homelesssurvey/gccshelter";
}
@GetMapping("/homelesslist/birthcertificate")
public String birthcertficatenoreason() {
return "modules/homelesssurvey/birthcertficatenoreason";
}
@GetMapping("/homelesslist/communitycertificate")
public String communitycertificate() {
return "modules/homelesssurvey/communitynoreason";
}
@GetMapping("/homelesslist/votercertificate")
public String voterid() {
return "modules/homelesssurvey/voterid";
}
@GetMapping("/homelesslist/aadharcertificate")
public String aadhar() {
return "modules/homelesssurvey/aadhar";
}
@GetMapping("/homelesslist/smartcertificate")
public String smartcard() {
return "modules/homelesssurvey/smart";
}
@GetMapping("/homelesslist/drivercertificate")
public String driverlicense() {
return "modules/homelesssurvey/driver";
}
@GetMapping("/homelesslist/cmrcertificate")
public String cminsurance() {
return "modules/homelesssurvey/cminsurance";
}
@GetMapping("/homelesslist/bankpassbook")
public String bankpassbook() {
return "modules/homelesssurvey/bankpassbook";
}
@GetMapping("/homelesslist/religion")
public String religion() {
return "modules/homelesssurvey/religion";
}
@GetMapping("/homelesslist/caste")
public String caste() {
return "modules/homelesssurvey/caste";
}
}

4103
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java
File diff suppressed because it is too large
View File

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

@ -1058,7 +1058,10 @@
tbody += `
<tr>
<td>${formatDate(row.survey_date)}</td>
<!--td>${formatDate(row.survey_date)}</td-->
<td data-order="${row.survey_date}">
${formatDate(row.survey_date)}
</td>
<td>${row.survey_id || ''}</td>
<td>${row.child_name || ''}</td>

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

@ -827,7 +827,10 @@
tbody += `
<tr>
<td>${formatDate(row.survey_date)}</td>
<!--td>${formatDate(row.survey_date)}</td-->
<td data-order="${row.survey_date}">
${formatDate(row.survey_date)}
</td>
<td>${row.survey_id || ''}</td>

5
gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html

@ -792,7 +792,10 @@
// <td>${item.survey_date || ''}</td>
rows += `
<tr>
<td>${formatDate(item.survey_date)}</td>
<!--<td>${formatDate(item.survey_date)}</td>-->
<td data-order="${item.survey_date}">
${formatDate(item.survey_date)}
</td>
<td>${item.user_name || ''}</td>
<td>${item.mobile_no || ''}</td>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Aadhar No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Aadhar No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Aadhar No Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Aadhar No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Aadhar No Reason </label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Aadhar No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/aadharnoreasonlst",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Aadhar No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/aadharnoreasonsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/aadharnoreason-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Bank Passbook No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Bank Passbook No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Bank Passbook No Reason Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Bank Passbook No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Bank Passbook No Reason Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Bank Passbook No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/bankpassbookreasonmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Bank Passbook No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/bankpassbookreasonmaster-save",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/bankpassbookreasonmasterstatus",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Birth Certificate no Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Birth Certificate Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Birth Certificate no Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Birth Certificate no Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Birth Certificate no Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Birth Certificate no Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/birthcertificatmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Birth Certificate no Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/birthcertificatmasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/birthcertificatmasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Caste Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Caste
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Caste Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Caste</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Caste Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Caste");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/castemasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Caste");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/castemasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/castemasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">CM Insurance No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add CM Insurance No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>CM Insurance No Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add CM Insurance No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>CM Insurance No Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add CM Insurance No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/cminsurancemasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit CM Insurance No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/cminsurancesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/cminsurance-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Coming Out of Shelter Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Coming Out of Shelter
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Coming Out of Shelter</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Coming Out of Shelter</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Coming Out of Shelter Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Coming Out of Shelter");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/comeoutsheltermasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Coming Out of Shelter");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/comeoutsheltersave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/comeoutshelter-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Community No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Community No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Community No Reason Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Community No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Community No Reason Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Community No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/communitymasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Community No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/communitycertmasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/communitycertmasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Currently Living Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Currently Living
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Currently Living Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Currently Living</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Currently Living Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Currently Living");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/currentlylivingmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Currently Living");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/currentlylivingsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/currentlyliving-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Disablity Type Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Disablity Type
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Disablity Type</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Disablity Type</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Disablity Type</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Disablity Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/disabilitytype",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Disablity Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/disabilitytypesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/disabilitytype-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Disabilty Certificate Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Disability Certificate Master
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Disabilty Certificate Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Disability Certificate</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Disabilty Certificate Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add disabilty certificate");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/disabiltycertificatelist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit disabilty certificate");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/disabiltycertificategersave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/disabiltycertificate-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Discontinued Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Discontinued Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Discontinued Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Discontinued Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Discontinued Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Discontinued Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/discontinuedlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Discontinued Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/discontinuedsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/discontinued-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Driver License No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Driver License No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Driver License No Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Driver License No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Driver License No Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Driver License No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/driverlicensemasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Driver License No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/driverlicensesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/driverlicense-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Education Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Education
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Education Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Education</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Education Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Education");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/educationmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Education");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/educationsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/education-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Employment Type Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Employment Type
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Employment Type</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Employment Type</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Employment Type</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Employment Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/employmenttypelist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Employment Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/employmenttypesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/employmenttype-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">GCCShelter Not Stayed Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add GCCshelter Not Stayed
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>GCCShelter Not Stayed Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add GCCShelter Not Stayed</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>GCCshelter Not Stayed Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add GCCshelter Not Stayed");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/gccsheltermasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit GCCShelter Not Stayed");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/gccsheltermasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/gccsheltermasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Gender Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Gender
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Gender Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Gender</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Gender Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Gender");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/gendermasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Gender");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/gendersave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/gender-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Health Condition Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Health Condition
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Health Condition Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Health Condition</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Health Condition Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Health Condition");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/healthconditionlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Health Condition");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/healthconditionsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/healthcondition-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

2085
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html
File diff suppressed because it is too large
View File

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Homeless Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Homeless Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Homeless Reason Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Homeless Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Homeless Reason Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Homeless Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/homelessreasonmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Homeless Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/homelessreasonmasterlist",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/homelessreasonmaster-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Martial Status Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Martial Status
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Martial Status Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Martial Status</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Martial Status Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Martial Status");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/martialmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Martial Status");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/martialsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/martial-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Moving Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Moving Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Moving Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Moving Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Moving Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Moving Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/movingreasonmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Moving Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/movingreasonmasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/movingreasonmasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

1007
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html
File diff suppressed because it is too large
View File

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Not Employed Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Not Employed Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Not Employed Reason Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Not Employed Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Not Employed Reason Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Not Employed Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/notemployedlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Not Employed Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/notemployedsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/notemployed-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Occupation Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Occupation
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Occupation Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Occupation</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Occupation Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Occupation");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/occupationlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Occupation");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/occupationsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/occupation-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Relation Type Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Relation Type
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Relation Type Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Relation Type</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Relation Type Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Relation Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/relationtypemasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Relation Type");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/relationtypesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/relationtype-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Religion Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Religion
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Religion Name</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Religion</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Religion Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Religion");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/religionmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Religion");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/religionmasterdatasave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/religionmasterdata-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Sleeping Space Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Sleeping Space
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Sleeping Space</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Sleeping Space</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Sleeping Space</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Sleeping Space");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/sleepingspacemasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Sleeping Space");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/sleepingspacesave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/sleepingspace-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">Smart Card No Reason Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add Smart Card No Reason
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>Smart Card No Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add Smart Card No Reason</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Smart Card No Reason</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add Smart Card No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/smartcardnoreasonmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit Smart Card No Reason");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/smartcardnoreasonsave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/smartcardnoreasonstatus",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>

1257
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html
File diff suppressed because it is too large
View File

1012
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html
File diff suppressed because it is too large
View File

576
gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html

@ -0,0 +1,576 @@
<!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">
<div class="col-lg-6">
<div class="page-header-title d-flex align-items-center">
<i class="ik ik-book bg-blue me-2"></i>
<h5 class="mb-0">VoterId Master</h5>
</div>
</div>
<div class="col-lg-6 text-end">
<button class="btn btn-primary" onclick="openAddModal()">
<i class="fa fa-plus"></i> Add VoterId Reason Master
</button>
</div>
</div>
</div>
<hr>
<div class="card-block">
<table id="educationTable" class="table table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th>Slno</th>
<th>VoterId No Reason</th>
<th>Status</th>
<th>Delete</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal fade" id="educationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Add VoterId Reason Master</h5>
<button type="button" class="close" data-bs-dismiss="modal">
&times;
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>VoterId Reason Name</label>
<input type="text" id="educationName" class="form-control">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="saveEducation()">
Save
</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--<hr>-->
<!-- Filters Section -->
</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 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
});
});*/
$(document).ready(function () {
loadEducationTable();
});
function openAddModal() {
editId = 0;
$("#educationName").val('');
$(".modal-title").text("Add VoterId Reason Master");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
/*function openAddModal() {
$("#educationName").val('');
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}*/
function loadEducationTable() {
$.ajax({
url: "/gcc/api/homeless-survey/voteridmasterlist",
type: "GET",
success: function (data) {
let tbody = "";
data.forEach(function (row, index) {
let statusBadge = `<span class="badge">Active</span>`;
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 += `
<tr>
<td>${index + 1}</td>
<td>${row.english_name}</td>
<td>${statusBadge}</td>
<td>${actionButton}</td>
<td>
<button class="btn btn-primary btn-sm"
onclick="editEducation(${row.id},'${row.english_name}')">
Edit
</button>
</td>
</tr>
`;
});
if ($.fn.DataTable.isDataTable('#educationTable')) {
$('#educationTable')
.DataTable()
.clear()
.destroy();
}
$("#educationTable tbody").html(tbody);
$('#educationTable').DataTable({
responsive: true
});
}
});
}
//update logic
let editId = 0;
function editEducation(id, name) {
editId = id;
$("#educationName").val(name);
$(".modal-title").text("Edit VoterId Reason Master");
let modal = new bootstrap.Modal(
document.getElementById('educationModal')
);
modal.show();
}
function saveEducation() {
$.ajax({
url: "/gcc/api/homeless-survey/voteridmastersave",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: editId,
english_name: $("#educationName").val()
}),
success: function () {
editId = 0;
Swal.fire({
icon: 'success',
title: 'Saved Successfully'
});
bootstrap.Modal.getInstance(
document.getElementById('educationModal')
).hide();
loadEducationTable();
}
});
}
function toggleStatus(id, status) {
$.ajax({
url: "/gcc/api/homeless-survey/voteridmaster-status",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
id: id,
status: status
}),
success: function () {
Swal.fire({
icon: 'success',
title: 'Status Updated'
});
loadEducationTable();
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save