Browse Source

officer portal updated code

master
KaNi-04 3 months ago
parent
commit
19816ce627
  1. 2
      .gitignore
  2. 244
      src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/APIController.java
  3. 38
      src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/MainController.java
  4. 65
      src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkMasterService.java
  5. 456
      src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkWasteService.java
  6. 261
      src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/WhatsappController.java
  7. 65
      src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/WhatsappqaqcMsgService.java
  8. 54
      src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java
  9. 45
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  10. 11
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/Maincontroller.java
  11. 305
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/PendinglistApicontroller.java
  12. 60
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/ReportApicontroller.java
  13. 625
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
  14. 226
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/ReportService.java
  15. 815
      src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java
  16. 168
      src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java
  17. 4103
      src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java
  18. 57
      src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/Maincontroller.java
  19. 258
      src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/RegisterApiController.java
  20. 51
      src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/LoginMappingService.java
  21. 777
      src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/RegisterService.java
  22. 17
      src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/MainController.java
  23. 2
      src/main/resources/application.properties
  24. 3007
      src/main/resources/templates/modules/bulkwaste/requestdetails.html
  25. 17
      src/main/resources/templates/modules/callcenterqaqc/agentqaqccalls.html
  26. 5
      src/main/resources/templates/modules/childrensurvey/childlist.html
  27. 5
      src/main/resources/templates/modules/childrensurvey/nonchildlist.html
  28. 5
      src/main/resources/templates/modules/childrensurvey/surveylist.html
  29. 2
      src/main/resources/templates/modules/greencommittee/monitoring.html
  30. 797
      src/main/resources/templates/modules/greencommittee/pendinglist.html
  31. 403
      src/main/resources/templates/modules/greencommittee/reports.html
  32. 1136
      src/main/resources/templates/modules/greencommittee/treepruningreports.html
  33. 576
      src/main/resources/templates/modules/homelesssurvey/aadhar.html
  34. 576
      src/main/resources/templates/modules/homelesssurvey/bankpassbook.html
  35. 576
      src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html
  36. 576
      src/main/resources/templates/modules/homelesssurvey/caste.html
  37. 576
      src/main/resources/templates/modules/homelesssurvey/cminsurance.html
  38. 576
      src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html
  39. 576
      src/main/resources/templates/modules/homelesssurvey/communitynoreason.html
  40. 576
      src/main/resources/templates/modules/homelesssurvey/currentlyliving.html
  41. 576
      src/main/resources/templates/modules/homelesssurvey/disability.html
  42. 576
      src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html
  43. 576
      src/main/resources/templates/modules/homelesssurvey/discontinued.html
  44. 576
      src/main/resources/templates/modules/homelesssurvey/driver.html
  45. 576
      src/main/resources/templates/modules/homelesssurvey/education.html
  46. 576
      src/main/resources/templates/modules/homelesssurvey/employmenttype.html
  47. 576
      src/main/resources/templates/modules/homelesssurvey/gccshelter.html
  48. 576
      src/main/resources/templates/modules/homelesssurvey/gendermaster.html
  49. 576
      src/main/resources/templates/modules/homelesssurvey/healthcondition.html
  50. 2085
      src/main/resources/templates/modules/homelesssurvey/homelesslist.html
  51. 576
      src/main/resources/templates/modules/homelesssurvey/homelessreason.html
  52. 576
      src/main/resources/templates/modules/homelesssurvey/martial.html
  53. 576
      src/main/resources/templates/modules/homelesssurvey/movingreason.html
  54. 1007
      src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html
  55. 576
      src/main/resources/templates/modules/homelesssurvey/notemployed.html
  56. 576
      src/main/resources/templates/modules/homelesssurvey/occupation.html
  57. 576
      src/main/resources/templates/modules/homelesssurvey/relationtype.html
  58. 576
      src/main/resources/templates/modules/homelesssurvey/religion.html
  59. 576
      src/main/resources/templates/modules/homelesssurvey/sleepingspace.html
  60. 576
      src/main/resources/templates/modules/homelesssurvey/smart.html
  61. 1257
      src/main/resources/templates/modules/homelesssurvey/surveyorlist.html
  62. 1012
      src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html
  63. 576
      src/main/resources/templates/modules/homelesssurvey/voterid.html
  64. 2427
      src/main/resources/templates/modules/roadwar/regform.html
  65. 3543
      src/main/resources/templates/modules/roadwar/updateform.html
  66. 764
      src/main/resources/templates/modules/vendors/certificate.html

2
.gitignore

@ -0,0 +1,2 @@
/target
hs_err_pid38028.log

244
src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/APIController.java

@ -0,0 +1,244 @@
package in.gov.chennaicorporation.gccoffice.bulkwaste.Controller;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.http.MediaType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import in.gov.chennaicorporation.gccoffice.bulkwaste.Service.BulkWasteService;
import in.gov.chennaicorporation.gccoffice.bulkwaste.Service.BulkMasterService;
@RequestMapping("gcc/api/bulkwaste")
@RestController("BulkWasteAPIController")
public class APIController {
@Autowired
private BulkMasterService masterService;
private BulkWasteService bulkWasteService;
@Autowired
public APIController(BulkMasterService masterService,
BulkWasteService bulkWasteService) {
this.masterService = masterService;
this.bulkWasteService = bulkWasteService;
}
@GetMapping(value="/getCategoryTypes")
public List getCategoryTypes() {
return masterService.getCategoryTypes();
}
@GetMapping(value="/getZones")
public List getZones() {
return masterService.getZones();
}
@GetMapping("/getWards")
public List<Map<String, Object>> getWards(
@RequestParam String zoneName) {
return masterService.getWards(zoneName);
}
@GetMapping("/getBulkWasteRequestDetails")
public List<Map<String, Object>> getBulkWasteRequestDetails(
@RequestParam(value = "fromDate", required = false)
@DateTimeFormat(pattern = "yyyy-MM-dd") Date fromDate,
@RequestParam(value = "toDate", required = false)
@DateTimeFormat(pattern = "yyyy-MM-dd") Date toDate,
@RequestParam(value = "categoryType", required = false) String categoryType,
@RequestParam(value = "zoneType", required = false) String zoneType,
@RequestParam(value = "wardType", required = false) String wardType) {
return bulkWasteService.getBulkWasteRequestDetails(fromDate, toDate, categoryType, zoneType, wardType);
}
@GetMapping("/bulkWasteRequestView")
public Map<String, Object> bulkWasteRequestView(
@RequestParam Long requestId) {
return bulkWasteService.getBulkWasteRequestView(requestId);
}
@GetMapping("/getMinSurveyDate")
public String getMinSurveyDate() {
return bulkWasteService.getMinSurveyDate();
}
@PostMapping(value="/updateBulkWasteRequest",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Map<String, Object>> updateBulkWasteRequest(
@RequestParam Long requestId,
@RequestParam String name_of_establishment, @RequestParam Integer category_id,
@RequestParam Integer zone_id, @RequestParam Integer ward_id,
@RequestParam(required = false) String trade_license_No,
@RequestParam String person_name, @RequestParam String email_id,
@RequestParam String mobile_no, @RequestParam String address,
@RequestParam(required = false) String gst_No,
@RequestParam String total_builtup_area_sqmt, @RequestParam String establishment_type,
@RequestParam(required = false) Integer dwelling_units,
@RequestParam(required = false) Integer avg_daily_footfall,
@RequestParam String totalEmployees,
@RequestParam BigDecimal wet_waste, @RequestParam BigDecimal dry_waste,
@RequestParam BigDecimal domestic_hazardous_waste,
@RequestParam BigDecimal sanitary_waste,
@RequestParam(required = false) BigDecimal cd_waste,
@RequestParam(required = false) MultipartFile wasteAuditFile,
@RequestParam String wet_waste_processed,
@RequestParam(required = false) String technology_used,
@RequestParam(required = false) String other_technology,
@RequestParam(required = false) BigDecimal installed_capacity_kg,
@RequestParam(required = false) Integer installation_year,
@RequestParam(required = false) String vendor_name,
@RequestParam(required = false) String unit_functional_status,
@RequestParam(required = false) MultipartFile installedUnitPhoto,
@RequestParam(defaultValue = "false") boolean removeInstalledPhoto,
@RequestParam(required = false) String longitude,
@RequestParam(required = false) String latitude,
@RequestParam String dry_waste_recycler,
@RequestParam(required = false) String recycler_name,
@RequestParam(required = false) String recycler_authorization_no,
@RequestParam BigDecimal residual_waste_quantity,
@RequestParam String collection_frequency,
@RequestParam String vehicle_type,
@RequestParam Integer update_by
) {
try {
String result = bulkWasteService.updateBulkWasteRequest(
requestId,
name_of_establishment, category_id, zone_id, ward_id, trade_license_No,
person_name, email_id, mobile_no, gst_No, address,
total_builtup_area_sqmt, establishment_type,
dwelling_units, avg_daily_footfall, totalEmployees,
wet_waste, dry_waste, domestic_hazardous_waste, sanitary_waste, cd_waste,
wasteAuditFile,
wet_waste_processed, technology_used, other_technology,
installed_capacity_kg, installation_year,
vendor_name, unit_functional_status, installedUnitPhoto,
removeInstalledPhoto, // <-- ADD THIS
longitude, latitude,
dry_waste_recycler, recycler_name, recycler_authorization_no,
residual_waste_quantity, collection_frequency, vehicle_type,
update_by
);
if ("mobile_exists".equals(result)) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "duplicate",
"description", "This Mobile Number is already registered."
));
}
if ("success".equals(result)) {
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Bulk Waste Request Updated Successfully"
));
}
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Update Failed"
));
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.ok(Map.of(
"status", false,
"message", "error",
"description", "Something went wrong"
));
}
}
@PostMapping("/deactivatebulk")
public ResponseEntity<Map<String, Object>> DeactivateBulkRequest(@RequestParam int requestId,
//@RequestParam Integer userId,
@RequestParam("update_by") Integer updateBy) {
try {
String result = bulkWasteService.deactivatebulkrequest(requestId,updateBy);
if (result == null || result.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", " Failed to Deleted Bulk "
));
}
return ResponseEntity.ok(Map.of(
"status", true,
"title", "success",
"message", " Bulk Deleted successfully "
));
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.ok(Map.of(
"status", false,
"message", "error",
"description", " Something went wrong "
));
}
}
}

38
src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/MainController.java

@ -0,0 +1,38 @@
package in.gov.chennaicorporation.gccoffice.bulkwaste.Controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@Controller("BulkWasteController")
@RequestMapping("/gcc/bulkwaste")
public class MainController {
private final RestTemplate restTemplate;
private String BasePath = "modules/bulkwaste/";
@Autowired
public MainController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
@GetMapping("bulkwastelist")
public String ownerList(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
return BasePath+"requestdetails";
}
@GetMapping("surveyorsreports")
public String surveyorsreports(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
return BasePath+"surveyorsreports";
}
}

65
src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkMasterService.java

@ -0,0 +1,65 @@
package in.gov.chennaicorporation.gccoffice.bulkwaste.Service;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class BulkMasterService {
private JdbcTemplate jdbcTemplate;
@Autowired
public void setDataSource(@Qualifier("mysqlBulkWasteDataSource") DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> getCategoryTypes() {
String sqlQuery =
"SELECT * " +
"FROM category_master " +
"WHERE is_active = 1 " +
"AND is_delete = 0";
// getSpaceRearTypes
return jdbcTemplate.queryForList(sqlQuery);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> getZones() {
String sqlQuery =
"SELECT * FROM zones " +
"WHERE is_active = 1 AND is_delete = 0";
return jdbcTemplate.queryForList(sqlQuery);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> getWards(String zoneName) {
String sqlQuery =
"SELECT * " +
"FROM wards " +
"WHERE is_active = 1 " +
"AND is_delete = 0 " +
"AND zone_name = ?";
return jdbcTemplate.queryForList(sqlQuery, zoneName);
}
}

456
src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkWasteService.java

@ -0,0 +1,456 @@
package in.gov.chennaicorporation.gccoffice.bulkwaste.Service;
import java.util.Date;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.multipart.MultipartFile;
import in.gov.chennaicorporation.gccoffice.controller.DateTimeUtil;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class BulkWasteService {
private JdbcTemplate jdbcTemplate;
private final Environment environment;
private String fileBaseUrl;
public BulkWasteService(Environment environment) {
this.environment = environment;
this.fileBaseUrl = environment.getProperty("fileBaseUrl");
}
@Autowired
public void setDataSource(@Qualifier("mysqlBulkWasteDataSource") DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> getBulkWasteRequestDetails(Date fromDate, Date toDate,
String categoryType, String zoneType, String wardType) {
try {
StringBuilder sql = new StringBuilder(
"SELECT bwr.request_id, bwr.name_of_establishment, " +
"bwr.category_id, cm.category_name, " +
"bwr.zone_id, bwr.ward_id, " +
"bwr.person_name, bwr.mobile_no, bwr.cdate " +
"FROM bulk_waste_request bwr " +
"LEFT JOIN category_master cm ON cm.category_id = bwr.category_id "
);
List<Object> params = new ArrayList<>();
List<String> conditions = new ArrayList<>();
// Date Filter
if (fromDate != null && toDate != null) {
conditions.add("DATE(bwr.cdate) BETWEEN ? AND ?");
params.add(fromDate);
params.add(toDate);
}
// Category Filter
if (categoryType != null && !categoryType.trim().isEmpty()) {
conditions.add("bwr.category_id = ?");
params.add(Integer.parseInt(categoryType));
}
// Zone Filter
if (zoneType != null && !zoneType.trim().isEmpty()) {
conditions.add("bwr.zone_id = ?");
params.add(zoneType);
}
// Ward Filter
if (wardType != null && !wardType.trim().isEmpty()) {
conditions.add("bwr.ward_id = ?");
params.add(wardType);
}
// Show only active records (Optional)
conditions.add("bwr.is_delete = 0");
conditions.add("bwr.is_active = 1");
if (!conditions.isEmpty()) {
sql.append(" WHERE ").append(String.join(" AND ", conditions));
}
sql.append(" ORDER BY bwr.cdate DESC");
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
} catch (DataAccessException e) {
e.printStackTrace();
return Collections.emptyList();
}
}
@Transactional(readOnly = true)
public String getMinSurveyDate() {
String sql = "SELECT DATE(MIN(cdate)) FROM bulk_waste_request";
return jdbcTemplate.queryForObject(sql, String.class);
}
@Transactional(readOnly = true)
public Map<String, Object> getBulkWasteRequestView(Long requestId) {
String sql =
"SELECT bwr.request_id, " +
"bwr.name_of_establishment, bwr.person_name, " +
"bwr.category_id, cm.category_name, bwr.email_id, bwr.mobile_no, " +
"bwr.zone_id, bwr.ward_id, bwr.trade_license_No, bwr.gst_No, " +
"bwr.address, " +
"bwr.total_builtup_area_sqmt, bwr.establishment_type, " +
"bwr.dwelling_units, bwr.avg_daily_footfall, bwr.totalEmployees, " +
"bwr.wet_waste, bwr.dry_waste, bwr.domestic_hazardous_waste, " +
"bwr.sanitary_waste, bwr.cd_waste, " +
"CONCAT('" + fileBaseUrl + "/gccofficialapp/files', bwr.waste_audit_report_file) AS waste_audit_report_file, " +
"bwr.wet_waste_processed, bwr.technology_used, bwr.other_technology, " +
"bwr.installed_capacity_kg, bwr.installation_year, " +
"bwr.vendor_name, bwr.unit_functional_status, " +
"CONCAT('" + fileBaseUrl + "/gccofficialapp/files', bwr.installed_unit_photo_file) AS installed_unit_photo_file, " +
"bwr.longitude, bwr.latitude, " +
"bwr.dry_waste_recycler, bwr.recycler_name, bwr.recycler_authorization_no, " +
"bwr.residual_waste_quantity, bwr.collection_frequency, bwr.vehicle_type, " +
"bwr.is_active, bwr.is_delete, bwr.cdate " +
"FROM bulk_waste_request bwr " +
"LEFT JOIN category_master cm ON cm.category_id = bwr.category_id " +
"WHERE bwr.request_id = ?";
return jdbcTemplate.queryForMap(sql, requestId);
}
public String fileUpload(MultipartFile file, String name) {
// Set the file path where you want to save it
String uploadDirectory = environment.getProperty("file.upload.directory.mobile");
String serviceFolderName = environment.getProperty("bulk_waste_foldername");
var year = DateTimeUtil.getCurrentYear();
var month = DateTimeUtil.getCurrentMonth();
uploadDirectory = uploadDirectory + serviceFolderName + "/" + year + "/" + month;
try {
// Create directory if it doesn't exist
Path directoryPath = Paths.get(uploadDirectory);
if (!Files.exists(directoryPath)) {
Files.createDirectories(directoryPath);
}
// Datetime string
String datetimetxt = DateTimeUtil.getCurrentDateTime();
// File name
String fileName = name + "_" + datetimetxt + "_" + file.getOriginalFilename();
fileName = fileName.replaceAll("\\s+", ""); // Remove space on filename
String filePath = uploadDirectory + "/" + fileName;
String filepath_txt = "/" + serviceFolderName + "/" + year + "/" + month + "/" + fileName;
// Create a new Path object
Path path = Paths.get(filePath);
// Get the bytes of the file
byte[] bytes = file.getBytes();
Files.write(path, bytes);
// System.out.println(filePath);
return filepath_txt;
} catch (IOException e) {
e.printStackTrace();
return "Failed to save file " + file.getOriginalFilename();
}
}
@Transactional
public String updateBulkWasteRequest(
Long requestId,
String name_of_establishment,
Integer category_id, Integer zone_id, Integer ward_id,
String trade_license_No, String person_name, String email_id,
String mobile_no, String gst_No, String address,
String total_builtup_area_sqmt, String establishment_type,
Integer dwelling_units, Integer avg_daily_footfall, String totalEmployees,
BigDecimal wet_waste, BigDecimal dry_waste,
BigDecimal domestic_hazardous_waste, BigDecimal sanitary_waste, BigDecimal cd_waste,
MultipartFile wasteAuditFile,
String wet_waste_processed, String technology_used, String other_technology,
BigDecimal installed_capacity_kg, Integer installation_year, String vendor_name,
String unit_functional_status, MultipartFile installedUnitPhoto,
boolean removeInstalledPhoto,
String longitude, String latitude,
String dry_waste_recycler, String recycler_name, String recycler_authorization_no,
BigDecimal residual_waste_quantity, String collection_frequency, String vehicle_type,
Integer update_by
) {
try {
//=====================================================
// Store Existing Record into Log Table
//=====================================================
String logSql =
"INSERT INTO bulk_waste_request_log(" +
"request_id,name_of_establishment,category_id,zone_id,ward_id," +
"trade_license_No,person_name,email_id,mobile_no,gst_No,address," +
"total_builtup_area_sqmt,establishment_type,dwelling_units," +
"avg_daily_footfall,totalEmployees,wet_waste,dry_waste," +
"domestic_hazardous_waste,sanitary_waste,cd_waste," +
"waste_audit_report_file,wet_waste_processed,technology_used," +
"other_technology,installed_capacity_kg,installation_year," +
"vendor_name,unit_functional_status,installed_unit_photo_file," +
"longitude,latitude,dry_waste_recycler,recycler_name," +
"recycler_authorization_no,residual_waste_quantity," +
"collection_frequency,vehicle_type,is_active,is_delete," +
"cdate,update_date,update_by,log_cdate)" +
" SELECT " +
"request_id,name_of_establishment,category_id,zone_id,ward_id," +
"trade_license_No,person_name,email_id,mobile_no,gst_No,address," +
"total_builtup_area_sqmt,establishment_type,dwelling_units," +
"avg_daily_footfall,totalEmployees,wet_waste,dry_waste," +
"domestic_hazardous_waste,sanitary_waste,cd_waste," +
"waste_audit_report_file,wet_waste_processed,technology_used," +
"other_technology,installed_capacity_kg,installation_year," +
"vendor_name,unit_functional_status,installed_unit_photo_file," +
"longitude,latitude,dry_waste_recycler,recycler_name," +
"recycler_authorization_no,residual_waste_quantity," +
"collection_frequency,vehicle_type,is_active,is_delete," +
"cdate,update_date,update_by,NOW()" +
" FROM bulk_waste_request WHERE request_id=?";
jdbcTemplate.update(logSql, requestId);
//--------------------------------------------------
// Existing File Paths
//--------------------------------------------------
String wasteAuditPath = jdbcTemplate.queryForObject(
"SELECT waste_audit_report_file FROM bulk_waste_request WHERE request_id=?",
String.class,
requestId);
String installedPhotoPath = jdbcTemplate.queryForObject(
"SELECT installed_unit_photo_file FROM bulk_waste_request WHERE request_id=?",
String.class,
requestId);
// Remove old installed photo
if(removeInstalledPhoto){
installedPhotoPath = null;
}
//--------------------------------------------------
// Upload New Files
//--------------------------------------------------
if (wasteAuditFile != null && !wasteAuditFile.isEmpty()) {
wasteAuditPath = fileUpload(wasteAuditFile, "waste_audit");
}
if (installedUnitPhoto != null && !installedUnitPhoto.isEmpty()) {
installedPhotoPath = fileUpload(installedUnitPhoto, "installed_unit");
}
//----------------------------------------------------
// If Wet Waste = No
//----------------------------------------------------
if ("No".equalsIgnoreCase(wet_waste_processed)) {
technology_used = null;
other_technology = null;
installed_capacity_kg = null;
installation_year = null;
vendor_name = null;
unit_functional_status = null;
longitude = null;
latitude = null;
installedPhotoPath = null;
}
//----------------------------------------------------
// If Recycler = No
//----------------------------------------------------
if ("No".equalsIgnoreCase(dry_waste_recycler)) {
recycler_name = null;
recycler_authorization_no = null;
}
//--------------------------------------------------
// Check Duplicate Mobile Number
//--------------------------------------------------
Integer mobileCount = jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM bulk_waste_request " +
"WHERE mobile_no=? AND request_id<>? AND is_delete=0",
Integer.class,
mobile_no,
requestId
);
if (mobileCount != null && mobileCount > 0) {
return "mobile_exists";
}
//--------------------------------------------------
// Update
//--------------------------------------------------
String sql =
"UPDATE bulk_waste_request SET " +
"name_of_establishment=?,category_id=?,zone_id=?,ward_id=?,trade_license_No=?," +
"person_name=?,email_id=?,mobile_no=?,gst_No=?,address=?," +
"total_builtup_area_sqmt=?,establishment_type=?,dwelling_units=?," +
"avg_daily_footfall=?,totalEmployees=?," +
"wet_waste=?,dry_waste=?,domestic_hazardous_waste=?,sanitary_waste=?,cd_waste=?," +
"waste_audit_report_file=?," +
"wet_waste_processed=?,technology_used=?,other_technology=?," +
"installed_capacity_kg=?,installation_year=?,vendor_name=?," +
"unit_functional_status=?,installed_unit_photo_file=?," +
"longitude=?,latitude=?," +
"dry_waste_recycler=?,recycler_name=?,recycler_authorization_no=?," +
"residual_waste_quantity=?,collection_frequency=?,vehicle_type=?," +
"update_date=NOW()," +
"update_by=? " +
"WHERE request_id=?";
int count = jdbcTemplate.update(
sql,
name_of_establishment, category_id, zone_id, ward_id,
trade_license_No, person_name, email_id, mobile_no, gst_No, address,
total_builtup_area_sqmt, establishment_type, dwelling_units, avg_daily_footfall, totalEmployees,
wet_waste, dry_waste, domestic_hazardous_waste, sanitary_waste, cd_waste,
wasteAuditPath,
wet_waste_processed, technology_used, other_technology, installed_capacity_kg,
installation_year, vendor_name, unit_functional_status, installedPhotoPath,
longitude, latitude,
dry_waste_recycler, recycler_name, recycler_authorization_no,
residual_waste_quantity, collection_frequency, vehicle_type,
update_by,
requestId
);
return count > 0 ? "success" : "error";
} catch (Exception e) {
e.printStackTrace();
return "error";
}
}
// ==============================
// Delete Details
// ==============================
public String deactivatebulkrequest(int requestId,Integer updateBy) {
try {
String sql =
"UPDATE bulk_waste_request " +
"SET is_active = 0, is_delete = 1,update_by=?,update_date=NOW() " +
"WHERE request_id = ?";
int count = jdbcTemplate.update(sql, updateBy,requestId);
if (count > 0) {
return "success";
} else {
return "error";
}
} catch (Exception e) {
e.printStackTrace();
return "error";
}
}
}

261
src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/WhatsappController.java

@ -56,11 +56,11 @@ public class WhatsappController {
String result = sendWhatsappMsg(pname, complaintTypeName, mobnumber, complaintNumber,returnedAction);
if(result.equals("200")) {
System.out.println("Whatsapp Message Triggered for "+complaintNumber);
System.out.println(returnedAction+" Whatsapp Message Triggered for "+complaintNumber);
return true;
}
else {
System.out.println("Whatsapp Message Failed for "+complaintNumber);
System.out.println(returnedAction+ " Whatsapp Message Failed for "+complaintNumber);
return false;
}
}
@ -74,31 +74,35 @@ public class WhatsappController {
try {
if("COMPLETED".equalsIgnoreCase(returnedAction)) {
String placeholders =
URLEncoder.encode(
pname + "|~|" + cat + "|~|" + complaintNumber,
StandardCharsets.UTF_8.toString());
}
String buttonPlaceholder =
URLEncoder.encode(
complaintNumber+ "|~|" +complaintNumber,
StandardCharsets.UTF_8.toString());
if("UNATTENDED".equalsIgnoreCase(returnedAction)) {
String mobile =
URLEncoder.encode(
mob_no,
StandardCharsets.UTF_8.toString());
}
String placeholders =
URLEncoder.encode(
pname + "|~|" + cat + "|~|" + complaintNumber,
StandardCharsets.UTF_8.toString());
if("COMPLETED".equalsIgnoreCase(returnedAction)) {
String buttonPlaceholder =
URLEncoder.encode(
complaintNumber,
StandardCharsets.UTF_8.toString());
urlString="https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=5c995535-6244-11f0-98fc-02c8a5e042bd&from=919445061913&to="+mobile+"&templateid=3310383&type=template&placeholders="+placeholders;
String mobile =
URLEncoder.encode(
mob_no,
StandardCharsets.UTF_8.toString());
}
if("UNATTENDED".equalsIgnoreCase(returnedAction)) {
urlString="";
urlString="https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=5c995535-6244-11f0-98fc-02c8a5e042bd&from=919445061913&to="+mobile+"&templateid=3304038&type=template&placeholders="+placeholders+"&button_placeholder="+buttonPlaceholder;
}
String res = hitURL(urlString);
return res;
@ -120,7 +124,7 @@ public class WhatsappController {
int responseCode = connection.getResponseCode();
response = String.valueOf(responseCode);
//System.out.println("Response Code for URL: " + urlString + " is " + responseCode);
System.out.println("Response Code for Whatsapp msg URL: " + urlString + " is " + responseCode);
} catch (Exception e) {
e.printStackTrace();
@ -129,17 +133,224 @@ public class WhatsappController {
return response;
}
@GetMapping("/getclosefromuser")
public String getclosefromuser(@RequestParam String complaintNumber) {
// @GetMapping("/getclosefromuser")
// public String getclosefromuser(@RequestParam String complaintNumber) {
//
// return whatsappqaqcMsgService.getclosefromuser(complaintNumber);
//
// }
return whatsappqaqcMsgService.getclosefromuser(complaintNumber);
@GetMapping(value = "/getclosefromuser", produces = "text/html")
public String getclosefromuser(@RequestParam String complaintNumber) {
String result = whatsappqaqcMsgService.getclosefromuser(complaintNumber);
boolean success = result.contains("Successfully");
String color = success ? "#28a745" : "#dc3545";
String logoUrl = "https://gccservices.in/gcc/assets/images/logo.png";
//background: #f5f5f5;
return """
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GCC PGR Complaint Status</title>
<style>
body{
font-family: Arial, sans-serif;
background: #1d495a;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.card{
width: 600px;
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0,0,0,0.15);
overflow: hidden;
}
.card-header{
display: flex;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #ddd;
background: #f8f9fa;
}
.card-header img{
width: 60px;
height: 60px;
object-fit: contain;
}
.card-header h2{
flex: 1;
text-align: center;
margin: 0;
color: #003366;
}
.card-body{
padding: 30px;
text-align: center;
min-height: 120px;
display: flex;
align-items: center;
justify-content: center;
}
.card-body h3{
white-space: pre-line;
margin: 0;
color: %s;
line-height: 1.8;
}
.card-footer{
padding: 12px 20px;
border-top: 1px solid #ddd;
text-align: right;
font-weight: bold;
color: #666;
background: #f8f9fa;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header">
<img src="%s" alt="GCC Logo">
<h2>Thanks For Your Response !!!</h2>
</div>
<div class="card-body">
<h3>%s</h3>
</div>
<div class="card-footer">
- GCC
</div>
</div>
</body>
</html>
""".formatted(color, logoUrl, result);
}
@GetMapping("/getreopenfromuser")
@GetMapping(value="/getreopenfromuser", produces = "text/html")
public String getreopenfromuser(@RequestParam String complaintNumber) {
return whatsappqaqcMsgService.getreopenfromuser(complaintNumber);
String result= whatsappqaqcMsgService.getreopenfromuser(complaintNumber);
boolean success = result.contains("Successfully");
String color = success ? "#28a745" : "#dc3545";
String logoUrl = "https://gccservices.in/gcc/assets/images/logo.png";
//background: #f5f5f5;
return """
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GCC PGR Complaint Status</title>
<style>
body{
font-family: Arial, sans-serif;
background: #1d495a;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.card{
width: 600px;
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0,0,0,0.15);
overflow: hidden;
}
.card-header{
display: flex;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #ddd;
background: #f8f9fa;
}
.card-header img{
width: 60px;
height: 60px;
object-fit: contain;
}
.card-header h2{
flex: 1;
text-align: center;
margin: 0;
color: #003366;
}
.card-body{
padding: 30px;
text-align: center;
min-height: 120px;
display: flex;
align-items: center;
justify-content: center;
}
.card-body h3{
white-space: pre-line;
margin: 0;
color: %s;
line-height: 1.8;
}
.card-footer{
padding: 12px 20px;
border-top: 1px solid #ddd;
text-align: right;
font-weight: bold;
color: #666;
background: #f8f9fa;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header">
<img src="%s" alt="GCC Logo">
<h2>Thanks For Your Response !!!</h2>
</div>
<div class="card-body">
<h3>%s</h3>
</div>
<div class="card-footer">
- GCC
</div>
</div>
</body>
</html>
""".formatted(color, logoUrl, result);
}

65
src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/WhatsappqaqcMsgService.java

@ -88,7 +88,7 @@ public class WhatsappqaqcMsgService {
String sql =
"SELECT call_status " +
"FROM qaqc_upload_data_history " +
"WHERE complaint_number=? " +
"WHERE complaint_number=? AND call_category='CLOSED' " +
"ORDER BY id DESC " +
"LIMIT 20";
@ -121,7 +121,7 @@ public class WhatsappqaqcMsgService {
String sql =
"SELECT call_status " +
"FROM qaqc_upload_data_history " +
"WHERE complaint_number=? " +
"WHERE complaint_number=? AND call_category='CLOSED' " +
"ORDER BY id DESC " +
"LIMIT 5";
@ -151,6 +151,15 @@ public class WhatsappqaqcMsgService {
return response;
}
public String getErpusername() {
String query="SELECT erp_username FROM agents_list "
+ "where calling_type='WHATSAPP_MSG'";
return jdbcTemplate.queryForObject(query,String.class);
}
public String getclosefromuser(String complaintNumber) {
try {
@ -164,27 +173,42 @@ public class WhatsappqaqcMsgService {
)
);
String Erpname="QAops72";
String Erpname=getErpusername();
System.out.println("Erpname="+Erpname);
if ("Action Taken - Level 2".equalsIgnoreCase(currentStatus)) {
boolean statusUpdated=qaqcCallsService.ChangeStatusInErp(complaintNumber, "", "COMPLETED",Erpname);
boolean statusUpdated=qaqcCallsService.ChangeStatusInErp(complaintNumber, "COMPLAINT CLOSED BY WHATSAPP MESSAGE", "COMPLETED",Erpname);
if (statusUpdated)
{
return complaintNumber+ " PGR Complaint closed Successfully";
return "Your "+complaintNumber+ " PGR Complaint has been closed Successfully.\n If you need further assistance,\n Please contact GCC 1913 Helpline.";
}
else {
return "Unable to close "+complaintNumber+" PGR Complaint";
return "We are unable to process your request at the moment.\n Please try again later.";
}
}
else {
return "Unable to close PGR "+complaintNumber+" Complaint,Because the complaint status is "+currentStatus;
if("FINAL_CLOSURE".equalsIgnoreCase(currentStatus)){
return "Your " + complaintNumber + " complaint has already been closed.\n\n"
+ "If you need further assistance, please contact GCC 1913 Helpline.";
}
else if("REOPENED".equalsIgnoreCase(currentStatus)) {
return "Your "+complaintNumber+" complaint has already been reopened. Once it is resolved, we will reach you by GCC’s 1913 helpline. If you need further assistance, please contact GCC 1913 Helpline.";
}
else {
return "Your "+complaintNumber+" complaint is Under Progress.\n Once it is resolved, \n we will reach you by GCC’s 1913 helpline.";
}
}
} catch (Exception e) {
e.printStackTrace();
return "Error in closing PGR complaint from user "+complaintNumber;
return "We are unable to process your request at the moment.\n Please try again later.";
}
@ -204,27 +228,40 @@ public class WhatsappqaqcMsgService {
)
);
String Erpname="QAops72";
String Erpname=getErpusername();
System.out.println("Erpname="+Erpname);
if ("Action Taken - Level 2".equalsIgnoreCase(currentStatus)) {
boolean statusUpdated=qaqcCallsService.ChangeStatusInErp(complaintNumber, "", "REOPEN",Erpname);
boolean statusUpdated=qaqcCallsService.ChangeStatusInErp(complaintNumber, "COMPLAINT REOPENED BY WHATSAPP MESSAGE", "REOPEN",Erpname);
if (statusUpdated)
{
return complaintNumber+ " Complaint Reopened Successfully";
return "Your "+complaintNumber+ " PGR complaint has been reopened Successfully.\n Once it is resolved , we will reach you by GCC’s 1913 helpline.If you need further assistance , please contact GCC 1913 Helpline.";
}
else {
return "Unable to Reopen "+complaintNumber+" Complaint";
return "We are unable to process your request at the moment.\n Please try again later.";
}
}
else {
return "Unable to Reopen "+complaintNumber+" Complaint,Because the complaint status is "+currentStatus;
if("FINAL_CLOSURE".equalsIgnoreCase(currentStatus)){
return "Your " + complaintNumber + " complaint has already been closed.\n\n"
+ "If you need further assistance, please contact GCC 1913 Helpline.";
}
else if("REOPENED".equalsIgnoreCase(currentStatus)) {
return "Your "+complaintNumber+" complaint has already been reopened. Once it is resolved, we will reach you by GCC’s 1913 helpline. If you have any further assistance, please contact GCC 1913 Helpline.";
}
else {
return "Your "+complaintNumber+" complaint is Under Progress.\n Once it is resolved, \n we will reach you by GCC’s 1913 helpline.";
}
}
} catch (Exception e) {
e.printStackTrace();
return "Error in Reopen complaint from user "+complaintNumber;
return "We are unable to process your request at the moment.\n Please try again later.";
}

54
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

45
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java

@ -408,6 +408,51 @@ public class DataSourceConfig {
return dataSource;
}
/////////////// Road War /////////////////////
@Bean(name = "mysqlRoadWarDataSource")
public DataSource mysqlRoadWarDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://" + host + "/gcc_roadwar_web");
dataSource.setUsername("root");
dataSource.setPassword(dbpassword);
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;
}
/////////////// Bulk Waste Generator /////////////////////
@Bean(name = "mysqlBulkWasteDataSource")
public DataSource mysqlBulkWasteDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://" + host + "/bulk_waste");
dataSource.setUsername("root");
dataSource.setPassword(dbpassword);
return dataSource;
}
//////////////////////////////(For GCC USER) ////////////////////////
@Bean(name = "mysqlGCCUserDataSource")
public DataSource mysqlGCCUserDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://" + host + "/gcc_users");
dataSource.setUsername("root");
dataSource.setPassword(dbpassword);
return dataSource;
}
////////////////////////////// ORACLE ////////////////////////
@Bean(name = "oracleDataSource")
public DataSource oracleDataSource() {

11
src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/Maincontroller.java

@ -78,4 +78,15 @@ public class Maincontroller {
return "modules/greencommittee/reports";
}
@GetMapping("/treepruningreports")
public String viewtreepruningreports(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId", LoginUserId);
String UserRole = LoginUserInfo.getUserRole();
model.addAttribute("UserRole", UserRole);
return "modules/greencommittee/treepruningreports";
}
}

305
src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/PendinglistApicontroller.java

@ -25,159 +25,158 @@ public class PendinglistApicontroller {
@Autowired
private PendinglistService pendinglistService;
@GetMapping("/getzones")
public List<Map<String, Object>> ViewZoneDropdown() {
return pendinglistService.ViewZoneDropdown();
}
@GetMapping("/getwardbyzone")
public List<Map<String, Object>> ViewWardDropdown(@RequestParam String zone) {
return pendinglistService.ViewWardDropdown(zone);
}
@GetMapping("/dropdown-Event")
public ResponseEntity<List<Map<String, Object>>> ViewDropdownEvent() {
try {
List<Map<String, Object>> result = pendinglistService.ViewDropdownEvent();
return ResponseEntity.ok(result);
} catch (Exception e) {
Map<String, Object> error = new HashMap<>();
error.put("error", "Unable to fetch event list");
error.put("details", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Collections.singletonList(error));
}
}
// @GetMapping("/getgreencommitteelist")
// public List<Map<String, Object>> getgreencommitteelist(@RequestParam String date,
// @RequestParam String zones) {
//
// List<String> refnums = pendinglistService.getrefnums(date, zones);
// //System.out.println("refnums="+refnums);
// List<Map<String, Object>> savedids=pendinglistService.getvcsavedrefids();
// //System.err.println("savedids="+savedids);
// // Convert to List<String>
// List<String> savedRefIds = savedids.stream()
// .map(m -> m.get("ref_id").toString())
// .toList();
//
// //System.out.println("savedRefIds=" + savedRefIds);
//
// List<Map<String, Object>> finalList = new ArrayList<>();
//
// if (refnums.isEmpty()) {
// return Collections.emptyList();
// }
//
// // REMOVE already saved ref_ids
// List<String> filteredRefIds = refnums.stream()
// .filter(ref -> !savedRefIds.contains(ref))
// .toList();
//
// //System.out.println("filteredRefIds="+filteredRefIds);
//
// for (String ref : filteredRefIds) {
// Map<String, Object> data = pendinglistService.getlistdata(ref);
// if (data != null && !data.isEmpty()) {
// finalList.add(data);
// }
// }
//
// return finalList;
// }
@GetMapping("/getgreencommitteelist")
public List<Map<String, Object>> getgreencommitteelist(
@RequestParam String date, @RequestParam String zones) {
List<Map<String,Object>> refnums = pendinglistService.getrefnums(date, zones);
System.out.println("refnums="+refnums);
List<Map<String,Object>> savedIds = pendinglistService.getvcsavedrefids();
System.out.println("savedIds="+savedIds);
// Convert savedIds → List<String>
List<String> savedRefList = new ArrayList<>();
for (Map<String,Object> m : savedIds) {
savedRefList.add(m.get("ref_id").toString());
}
List<Map<String,Object>> finalList = new ArrayList<>();
for (Map<String,Object> row : refnums) {
String refId = row.get("ref_id").toString();
Integer inspReinsId = row.get("latest_reinspection_id") != null ?
Integer.parseInt(row.get("latest_reinspection_id").toString())
: null;
// Skip if already committee decided
if (savedRefList.contains(refId)) continue;
// Get reinspection latest id
Integer dbLatest = pendinglistService.getLatestReinspectionId(refId);
// Rule: if inspection reinspection ID is NULL but in DB exists → skip
if (inspReinsId == null && dbLatest != null) continue;
// Rule: if BOTH exist AND not equal → skip
if (inspReinsId != null && dbLatest != null && !inspReinsId.equals(dbLatest))
continue;
// 👍 Valid, add final data
Map<String,Object> data = pendinglistService.getlistdata(refId);
if (data != null && !data.isEmpty()) {
System.out.println("inside="+refId);
finalList.add(data);
}
}
return finalList;
}
@GetMapping("/getdetailsbyrefid")
public Map<String, Object> getdetailsbyrefid(@RequestParam String refid) {
return pendinglistService.getdetailsbyrefid(refid);
}
@GetMapping("/getCommitteeActions")
public List<Map<String, Object>> getCommitteeActions() {
return pendinglistService.getCommitteeActions();
}
@PostMapping("/savecommittee")
public Map<String, Object> saveCommittee(@RequestBody Map<String, Object> payload) {
String refId = (String) payload.get("ref_id");
String remarks = (String) payload.get("remarks");
int userId = Integer.parseInt(payload.get("userId").toString());
int meetingid = Integer.parseInt(payload.get("meetingid").toString());
List<Map<String, Object>> decisions = (List<Map<String, Object>>) payload.get("decisions");
return pendinglistService.saveCommittee(refId, remarks, meetingid, userId, decisions);
}
@PostMapping("/savereinspection")
public Map<String, Object> saveReInspection(@RequestBody Map<String, Object> payload) {
String refId = payload.get("ref_id").toString();
int committeeAction = Integer.parseInt(payload.get("committee_action").toString());
int meetingId = Integer.parseInt(payload.get("meeting_id").toString());
String remarks = payload.get("remarks") != null ? payload.get("remarks").toString() : null;
int userId = Integer.parseInt(payload.get("userId").toString());
return pendinglistService.saveReInspection(refId, committeeAction, meetingId, remarks, userId);
}
public List<Map<String, Object>> ViewZoneDropdown() {
return pendinglistService.ViewZoneDropdown();
}
@GetMapping("/getwardbyzone")
public List<Map<String, Object>> ViewWardDropdown(@RequestParam String zone) {
return pendinglistService.ViewWardDropdown(zone);
}
@GetMapping("/dropdown-Event")
public ResponseEntity<List<Map<String, Object>>> ViewDropdownEvent() {
try {
List<Map<String, Object>> result = pendinglistService.ViewDropdownEvent();
return ResponseEntity.ok(result);
} catch (Exception e) {
Map<String, Object> error = new HashMap<>();
error.put("error", "Unable to fetch event list");
error.put("details", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Collections.singletonList(error));
}
}
// @GetMapping("/getgreencommitteelist")
// public List<Map<String, Object>> getgreencommitteelist(@RequestParam String
// date,
// @RequestParam String zones) {
//
// List<String> refnums = pendinglistService.getrefnums(date, zones);
// //System.out.println("refnums="+refnums);
// List<Map<String, Object>> savedids=pendinglistService.getvcsavedrefids();
// //System.err.println("savedids="+savedids);
// // Convert to List<String>
// List<String> savedRefIds = savedids.stream()
// .map(m -> m.get("ref_id").toString())
// .toList();
//
// //System.out.println("savedRefIds=" + savedRefIds);
//
// List<Map<String, Object>> finalList = new ArrayList<>();
//
// if (refnums.isEmpty()) {
// return Collections.emptyList();
// }
//
// // REMOVE already saved ref_ids
// List<String> filteredRefIds = refnums.stream()
// .filter(ref -> !savedRefIds.contains(ref))
// .toList();
//
// //System.out.println("filteredRefIds="+filteredRefIds);
//
// for (String ref : filteredRefIds) {
// Map<String, Object> data = pendinglistService.getlistdata(ref);
// if (data != null && !data.isEmpty()) {
// finalList.add(data);
// }
// }
//
// return finalList;
// }
@GetMapping("/getgreencommitteelist")
public List<Map<String, Object>> getgreencommitteelist(
@RequestParam String date, @RequestParam String zones) {
List<Map<String, Object>> refnums = pendinglistService.getrefnums(date, zones);
System.out.println("refnums=" + refnums);
List<Map<String, Object>> savedIds = pendinglistService.getvcsavedrefids();
System.out.println("savedIds=" + savedIds);
// Convert savedIds → List<String>
List<String> savedRefList = new ArrayList<>();
for (Map<String, Object> m : savedIds) {
savedRefList.add(m.get("ref_id").toString());
}
List<Map<String, Object>> finalList = new ArrayList<>();
for (Map<String, Object> row : refnums) {
String refId = row.get("ref_id").toString();
Integer inspReinsId = row.get("latest_reinspection_id") != null
? Integer.parseInt(row.get("latest_reinspection_id").toString())
: null;
// Skip if already committee decided
if (savedRefList.contains(refId))
continue;
// Get reinspection latest id
Integer dbLatest = pendinglistService.getLatestReinspectionId(refId);
// Rule: if inspection reinspection ID is NULL but in DB exists → skip
if (inspReinsId == null && dbLatest != null)
continue;
// Rule: if BOTH exist AND not equal → skip
if (inspReinsId != null && dbLatest != null && !inspReinsId.equals(dbLatest))
continue;
// 👍 Valid, add final data
Map<String, Object> data = pendinglistService.getlistdata(refId);
if (data != null && !data.isEmpty()) {
System.out.println("inside=" + refId);
finalList.add(data);
}
}
return finalList;
}
@GetMapping("/getdetailsbyrefid")
public Map<String, Object> getdetailsbyrefid(@RequestParam String refid) {
return pendinglistService.getdetailsbyrefid(refid);
}
@GetMapping("/getCommitteeActions")
public List<Map<String, Object>> getCommitteeActions() {
return pendinglistService.getCommitteeActions();
}
@PostMapping("/savecommittee")
public Map<String, Object> saveCommittee(@RequestBody Map<String, Object> payload) {
String refId = (String) payload.get("ref_id");
String remarks = (String) payload.get("remarks");
int userId = Integer.parseInt(payload.get("userId").toString());
int meetingid = Integer.parseInt(payload.get("meetingid").toString());
List<Map<String, Object>> decisions = (List<Map<String, Object>>) payload.get("decisions");
return pendinglistService.saveCommittee(refId, remarks, meetingid, userId, decisions);
}
@PostMapping("/savereinspection")
public Map<String, Object> saveReInspection(@RequestBody Map<String, Object> payload) {
String refId = payload.get("ref_id").toString();
int committeeAction = Integer.parseInt(payload.get("committee_action").toString());
int meetingId = Integer.parseInt(payload.get("meeting_id").toString());
String remarks = payload.get("remarks") != null ? payload.get("remarks").toString() : null;
int userId = Integer.parseInt(payload.get("userId").toString());
return pendinglistService.saveReInspection(refId, committeeAction, meetingId, remarks, userId);
}
}

60
src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/ReportApicontroller.java

@ -7,9 +7,11 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
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 in.gov.chennaicorporation.gccoffice.greencommittee.service.ReportService;
@ -23,9 +25,9 @@ public class ReportApicontroller {
@GetMapping("/getgreencommitteelist")
public List<Map<String, Object>> getgreencommitteelist(@RequestParam String meetingid,
@RequestParam String zones) {
@RequestParam String zones, @RequestParam String deptid, @RequestParam String appType) {
List<String> refnums = reportService.getrefnums(meetingid, zones);
List<String> refnums = reportService.getrefnums(meetingid, zones, deptid, appType);
System.out.println("refnums=" + refnums);
List<Map<String, Object>> finalList = new ArrayList<>();
@ -130,4 +132,58 @@ public class ReportApicontroller {
return response;
}
@GetMapping("/getDepartments")
@ResponseBody
public List<Map<String, Object>> getDepartments() {
return reportService.getDepartments();
}
@GetMapping("/wards")
public List<Map<String, Object>> getWards(@RequestParam Integer zoneId) {
return reportService.getWards(zoneId);
}
@GetMapping("/zones")
public List<Map<String, Object>> getZones() {
return reportService.getZones();
}
@GetMapping("/details")
public ResponseEntity<?> getComplaintDetails(
@RequestParam String complaintId) {
return ResponseEntity.ok(
reportService.getComplaintDetailsreport(complaintId));
}
@GetMapping("/getreport")
public ResponseEntity<List<Map<String, Object>>> getTreePruningReport(
@RequestParam String fromDate,
@RequestParam String toDate,
@RequestParam(required = false) String zone,
@RequestParam(required = false) String ward,
@RequestParam(required = false) String status
) {
return ResponseEntity.ok(
reportService.getReport(
fromDate,
toDate,
zone,
ward,
status)
);
}
}

625
src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java

@ -4,10 +4,13 @@ import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.sql.DataSource;
@ -37,365 +40,385 @@ public class PendinglistService {
public List<Map<String, Object>> ViewWardDropdown(String zone) {
String sql = "SELECT ward_name "
+ "FROM ward_master "
+ "WHERE is_active=1 AND is_delete=0 AND zone_id=?";
try {
return jdbcTemplate.queryForList(sql,zone);
+ "FROM ward_master "
+ "WHERE is_active=1 AND is_delete=0 AND zone_id=?";
try {
return jdbcTemplate.queryForList(sql, zone);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return Collections.emptyList();
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> ViewZoneDropdown() {
String sql = "SELECT zone_name "
+ "FROM zone_master "
+ "WHERE is_active=1 AND is_delete=0";
try {
return jdbcTemplate.queryForList(sql);
+ "FROM zone_master "
+ "WHERE is_active=1 AND is_delete=0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return Collections.emptyList();
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> ViewDropdownEvent() {
String sql = "SELECT * FROM create_meeting WHERE isactive=1 AND isdelete=0";
return jdbcTemplate.queryForList(sql);
String sql = "SELECT * FROM create_meeting WHERE isactive=1 AND isdelete=0";
return jdbcTemplate.queryForList(sql);
}
// public List<String> getrefnums(String date, String zones) {
//
// try {
//
// StringBuilder sql = new StringBuilder(
// "SELECT t.ref_id " +
// "FROM ( " +
// " SELECT ref_id, inspection_by, MAX(cdate) AS latest_date " +
// " FROM inspection_data " +
// " WHERE DATE(cdate) <= STR_TO_DATE(?, '%d-%m-%Y') " +
// " AND isactive = 1 "
// );
//
// List<Object> params = new ArrayList<>();
// params.add(date);
//
// if (zones != null && !zones.isEmpty()) {
// sql.append(" AND zone = ? ");
// params.add(zones);
// }
//
// sql.append(
// " GROUP BY ref_id, inspection_by " +
// ") AS t " +
// "GROUP BY t.ref_id " +
// "HAVING COUNT(DISTINCT t.inspection_by) = 3 " +
// "ORDER BY MAX(t.latest_date) DESC"
// );
//
// return jdbcTemplate.queryForList(sql.toString(), params.toArray(), String.class);
//
// } catch (Exception e) {
//
// System.err.println("Error in getrefums(): " + e.getMessage());
// e.printStackTrace();
// return Collections.emptyList();
// }
// }
// public List<String> getrefnums(String date, String zones) {
//
// try {
//
// StringBuilder sql = new StringBuilder(
// "SELECT t.ref_id " +
// "FROM ( " +
// " SELECT ref_id, inspection_by, MAX(cdate) AS latest_date " +
// " FROM inspection_data " +
// " WHERE DATE(cdate) <= STR_TO_DATE(?, '%d-%m-%Y') " +
// " AND isactive = 1 "
// );
//
// List<Object> params = new ArrayList<>();
// params.add(date);
//
// if (zones != null && !zones.isEmpty()) {
// sql.append(" AND zone = ? ");
// params.add(zones);
// }
//
// sql.append(
// " GROUP BY ref_id, inspection_by " +
// ") AS t " +
// "GROUP BY t.ref_id " +
// "HAVING COUNT(DISTINCT t.inspection_by) = 3 " +
// "ORDER BY MAX(t.latest_date) DESC"
// );
//
// return jdbcTemplate.queryForList(sql.toString(), params.toArray(),
// String.class);
//
// } catch (Exception e) {
//
// System.err.println("Error in getrefums(): " + e.getMessage());
// e.printStackTrace();
// return Collections.emptyList();
// }
// }
public List<Map<String, Object>> getrefnums(String date, String zones) {
System.out.println(date + " " + zones);
try {
StringBuilder sql = new StringBuilder(
"SELECT ref_id, " +
" MAX(latest_reinspection_id) AS latest_reinspection_id " +
"FROM ( " +
" SELECT ref_id, inspection_by, " +
" MAX(cdate) AS latest_date, " +
" MAX(reinspection_id) AS latest_reinspection_id " +
" FROM inspection_data " +
" WHERE DATE(cdate) <= STR_TO_DATE(?, '%d-%m-%Y') " +
" AND isactive = 1 "
);
List<Object> params = new ArrayList<>();
params.add(date);
if (zones != null && !zones.isEmpty()) {
sql.append(" AND zone = ? ");
params.add(zones);
}
sql.append(
" GROUP BY ref_id, inspection_by " +
") AS x " +
"GROUP BY ref_id " +
"HAVING COUNT(DISTINCT inspection_by) = 3 " +
"ORDER BY MAX(latest_date) DESC"
);
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
try {
StringBuilder sql = new StringBuilder(
"SELECT ref_id, " +
" MAX(latest_reinspection_id) AS latest_reinspection_id " +
"FROM ( " +
" SELECT ref_id, inspection_by, " +
" MAX(cdate) AS latest_date, " +
" MAX(reinspection_id) AS latest_reinspection_id " +
" FROM inspection_data " +
" WHERE DATE(cdate) <= STR_TO_DATE(?, '%d-%m-%Y') " +
" AND isactive = 1 ");
List<Object> params = new ArrayList<>();
params.add(date);
if (zones != null && !zones.isEmpty()) {
sql.append(" AND zone = ? ");
params.add(zones);
}
sql.append(
" GROUP BY ref_id, inspection_by " +
") AS x " +
"GROUP BY ref_id " +
"HAVING COUNT(DISTINCT inspection_by) >= 2 " +
"ORDER BY MAX(latest_date) DESC");
public Integer getLatestReinspectionId(String refId) {
try {
String sql = "SELECT id FROM reinspection WHERE ref_id=? ORDER BY id DESC LIMIT 1";
return jdbcTemplate.queryForObject(sql, Integer.class, refId);
} catch (Exception e) {
return null;
}
}
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public Integer getLatestReinspectionId(String refId) {
try {
String sql = "SELECT id FROM reinspection WHERE ref_id=? ORDER BY id DESC LIMIT 1";
return jdbcTemplate.queryForObject(sql, Integer.class, refId);
} catch (Exception e) {
return null;
}
}
public Map<String, Object> getlistdata(String ref) {
Map<String, Object> regDetails = getRegDetails(ref);
Map<String, Object> regDetails = getRegDetails(ref);
List<Map<String, Object>> compDetails = getComplaintDetails(ref);
List<Map<String, Object>> compDetails = getComplaintDetails(ref);
regDetails.put("comp_details", compDetails);
regDetails.put("comp_details", compDetails);
return regDetails;
return regDetails;
}
public Map<String, Object> getRegDetails(String ref) {
String sql = "SELECT * FROM reg_details WHERE is_active = 1 AND ref_id = ?";
return jdbcTemplate.queryForMap(sql, ref);
String sql = "SELECT * FROM reg_details WHERE is_active = 1 AND ref_id = ?";
return jdbcTemplate.queryForMap(sql, ref);
}
public List<Map<String, Object>> getComplaintDetails(String ref) {
String sql = "SELECT cn.name AS nature, SUM(cd.no_of_trees) AS total_trees " +
"FROM complaint_details cd " +
"JOIN comp_nature cn ON cn.id = cd.comp_nature_id " +
"WHERE cd.is_active = 1 AND cd.ref_id = ? " +
"GROUP BY cn.name";
String sql = "SELECT cn.name AS nature, SUM(cd.no_of_trees) AS total_trees " +
"FROM complaint_details cd " +
"JOIN comp_nature cn ON cn.id = cd.comp_nature_id " +
"WHERE cd.is_active = 1 AND cd.ref_id = ? " +
"GROUP BY cn.name";
return jdbcTemplate.queryForList(sql, ref);
return jdbcTemplate.queryForList(sql, ref);
}
public Map<String, Object> getdetailsbyrefid(String refId) {
Map<String, Object> response = new HashMap<>();
// 1 — Application details
Map<String, Object> app = jdbcTemplate.queryForMap(
"SELECT *,DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') as r_Cdate FROM reg_details WHERE ref_id=? AND is_active=1",
refId
);
// 2 — Complaint details (grouped)
List<Map<String, Object>> complaints = jdbcTemplate.queryForList(
"SELECT cn.name AS nature, SUM(cd.no_of_trees) AS count " +
"FROM complaint_details cd JOIN comp_nature cn ON cn.id=cd.comp_nature_id " +
"WHERE cd.ref_id=? GROUP BY cn.name", refId
);
// 3 — Complaint images
List<String> compImages = jdbcTemplate.queryForList(
"SELECT img_path FROM img_uploads WHERE ref_id=? AND is_active=1",
new Object[]{refId}, String.class
).stream()
.map(path -> fileBaseUrl + "/gccofficialapp/files" + path)
.collect(Collectors.toList());
app.put("complaints", complaints);
app.put("images", compImages);
response.put("application", app);
// 4 — Inspection details
List<Map<String, Object>> inspectionList = new ArrayList<>();
String sql =
"SELECT id.*, um.name AS inspector_name, " +
" DATE_FORMAT(id.cdate, '%d-%m-%Y %l:%i %p') AS f_Cdate " +
"FROM inspection_data id " +
"LEFT JOIN user_maping um ON um.userid = id.cby " +
"INNER JOIN ( " +
" SELECT inspection_by, MAX(cdate) AS latest_date " +
" FROM inspection_data " +
" WHERE ref_id = ? AND isactive = 1 " +
" GROUP BY inspection_by " +
") latest ON id.inspection_by = latest.inspection_by " +
" AND id.cdate = latest.latest_date " +
"WHERE id.ref_id = ? AND id.isactive = 1 " +
"ORDER BY FIELD(id.inspection_by, 'GCC', 'NGO', 'TNFD')";
List<Map<String, Object>> rows = jdbcTemplate.queryForList(
sql, refId, refId
);
for (Map<String, Object> row : rows) {
Integer inspId = (Integer) row.get("inspection_data_id");
// 4a — Recommendation details
List<Map<String, Object>> recommend = jdbcTemplate.queryForList(
"SELECT rm.name, itd.nooftrees AS count " +
"FROM inspection_tree_data itd " +
"JOIN inspection_recommend_master rm ON rm.rid = itd.action " +
"WHERE itd.inspection_data_id=? AND itd.isactive=1",
inspId
);
row.put("recommendations", recommend);
// 4b — Images (thumbnail list)
List<String> imgs = new ArrayList<>();
if (row.get("file_1") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_1").toString());
}
if (row.get("file_2") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_2").toString());
}
if (row.get("file_3") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_3").toString());
}
row.put("images", imgs);
inspectionList.add(row);
}
response.put("inspections", inspectionList);
// 5 — Re-Inspection Details
String reSql =
"SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " +
" DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " +
" cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date " +
"FROM reinspection r " +
"LEFT JOIN create_meeting cm ON cm.id = r.meeting_id " +
"WHERE r.ref_id = ? AND r.isactive = 1 " +
"ORDER BY r.id DESC";
List<Map<String, Object>> reinspectionList = jdbcTemplate.queryForList(reSql, refId);
response.put("reinspections", reinspectionList);
return response;
Map<String, Object> response = new HashMap<>();
// 1 — Application details
Map<String, Object> app = jdbcTemplate.queryForMap(
"SELECT *,DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') as r_Cdate FROM reg_details WHERE ref_id=? AND is_active=1",
refId);
// 2 — Complaint details (grouped)
List<Map<String, Object>> complaints = jdbcTemplate.queryForList(
"SELECT cn.name AS nature, SUM(cd.no_of_trees) AS count " +
"FROM complaint_details cd JOIN comp_nature cn ON cn.id=cd.comp_nature_id " +
"WHERE cd.ref_id=? GROUP BY cn.name",
refId);
// 3 — Complaint images
List<String> compImages = jdbcTemplate.queryForList(
"SELECT img_path FROM img_uploads WHERE ref_id=? AND is_active=1",
new Object[] { refId }, String.class).stream()
.map(path -> fileBaseUrl + "/gccofficialapp/files" + path)
.collect(Collectors.toList());
app.put("complaints", complaints);
app.put("images", compImages);
response.put("application", app);
// 4 — Inspection details
List<Map<String, Object>> inspectionList = new ArrayList<>();
String sql = "SELECT id.*, um.name AS inspector_name, " +
" DATE_FORMAT(id.cdate, '%d-%m-%Y %l:%i %p') AS f_Cdate " +
"FROM inspection_data id " +
"LEFT JOIN user_maping um ON um.userid = id.cby " +
"INNER JOIN ( " +
" SELECT inspection_by, MAX(cdate) AS latest_date " +
" FROM inspection_data " +
" WHERE ref_id = ? AND isactive = 1 " +
" GROUP BY inspection_by " +
") latest ON id.inspection_by = latest.inspection_by " +
" AND id.cdate = latest.latest_date " +
"WHERE id.ref_id = ? AND id.isactive = 1 " +
"ORDER BY FIELD(id.inspection_by, 'GCC', 'NGO', 'TNFD')";
List<Map<String, Object>> rows = jdbcTemplate.queryForList(
sql, refId, refId);
for (Map<String, Object> row : rows) {
Integer inspId = (Integer) row.get("inspection_data_id");
// 4a — Recommendation details
List<Map<String, Object>> recommend = jdbcTemplate.queryForList(
"SELECT rm.name, itd.nooftrees AS count,itd.treename as treename " +
"FROM inspection_tree_data itd " +
"JOIN inspection_recommend_master rm ON rm.rid = itd.action " +
"WHERE itd.inspection_data_id=? AND itd.isactive=1",
inspId);
row.put("recommendations", recommend);
// 4b — Images (thumbnail list)
List<String> imgs = new ArrayList<>();
if (row.get("file_1") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_1").toString());
}
if (row.get("file_2") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_2").toString());
}
if (row.get("file_3") != null) {
imgs.add(fileBaseUrl + "/gccofficialapp/files" + row.get("file_3").toString());
}
row.put("images", imgs);
inspectionList.add(row);
}
// ak
// Expected inspection stages
List<String> expected = Arrays.asList("GCC", "NGO", "TNFD");
// Completed stages
Set<String> completed = inspectionList.stream()
.map(m -> String.valueOf(m.get("inspection_by")))
.collect(Collectors.toSet());
// Add pending cards
for (String type : expected) {
if (!completed.contains(type)) {
Map<String, Object> pending = new HashMap<>();
pending.put("inspection_by", type);
pending.put("status", "PENDING");
pending.put("inspector_name", "");
pending.put("f_Cdate", "");
pending.put("remarks", "");
pending.put("recommendations", new ArrayList<>());
pending.put("images", new ArrayList<>());
inspectionList.add(pending);
}
}
// Sort in order GCC -> NGO -> TNFD
Map<String, Integer> order = new HashMap<>();
order.put("GCC", 1);
order.put("NGO", 2);
order.put("TNFD", 3);
inspectionList.sort(
Comparator.comparingInt(
m -> order.getOrDefault(String.valueOf(m.get("inspection_by")), 99)));
response.put("inspections", inspectionList);
// 5 — Re-Inspection Details
String reSql = "SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " +
" DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " +
" cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date " +
"FROM reinspection r " +
"LEFT JOIN create_meeting cm ON cm.id = r.meeting_id " +
"WHERE r.ref_id = ? AND r.isactive = 1 " +
"ORDER BY r.id DESC";
List<Map<String, Object>> reinspectionList = jdbcTemplate.queryForList(reSql, refId);
response.put("reinspections", reinspectionList);
return response;
}
public List<Map<String, Object>> getCommitteeActions() {
String sql = "SELECT id,name "
+ "FROM committee_recommend_master "
+ "WHERE isactive=1 AND isdelete=0 "
+ "ORDER BY orderby";
try {
return jdbcTemplate.queryForList(sql);
+ "FROM committee_recommend_master "
+ "WHERE isactive=1 AND isdelete=0 "
+ "ORDER BY orderby";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return Collections.emptyList();
e.printStackTrace();
return Collections.emptyList();
}
}
public Map<String, Object> saveCommittee(
String refId,
String remarks,
int meetingid,
int userId,
List<Map<String, Object>> decisions
) {
String refId,
String remarks,
int meetingid,
int userId,
List<Map<String, Object>> decisions) {
Map<String, Object> response = new HashMap<>();
Map<String, Object> response = new HashMap<>();
try {
// 1️⃣ Save committee_data and get generated ID
int committeeDataId = saveCommitteeData(refId, remarks, meetingid, userId);
try {
// 1️⃣ Save committee_data and get generated ID
int committeeDataId = saveCommitteeData(refId, remarks, meetingid, userId);
List<Integer> insertedTreeIds = saveCommitteeTreeData(decisions, committeeDataId, refId, userId);
List<Integer> insertedTreeIds = saveCommitteeTreeData(decisions, committeeDataId, refId, userId);
response.put("committee_data_id", committeeDataId);
response.put("tree_ids", insertedTreeIds);
response.put("status", "success");
response.put("message", "Committee decision saved!");
response.put("committee_data_id", committeeDataId);
response.put("tree_ids", insertedTreeIds);
response.put("status", "success");
response.put("message", "Committee decision saved!");
} catch (Exception e) {
response.put("status", "error");
response.put("message", e.getMessage());
}
} catch (Exception e) {
response.put("status", "error");
response.put("message", e.getMessage());
}
return response;
return response;
}
public int saveCommitteeData(String refId, String remarks, int meetingid, int userId) {
String remarksValue = (remarks == null || remarks.trim().isEmpty()) ? null : remarks.trim();
String remarksValue = (remarks == null || remarks.trim().isEmpty()) ? null : remarks.trim();
String sql = "INSERT INTO committee_data (ref_id, meeting_id, remarks, cby) VALUES (?, ?, ?, ?)";
String sql = "INSERT INTO committee_data (ref_id, meeting_id, remarks, cby) VALUES (?, ?, ?, ?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, refId);
ps.setInt(2, meetingid);
if (remarksValue == null) {
ps.setNull(3, Types.VARCHAR);
} else {
ps.setString(3, remarksValue);
}
ps.setInt(4, userId);
return ps;
}, keyHolder);
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, refId);
ps.setInt(2, meetingid);
if (remarksValue == null) {
ps.setNull(3, Types.VARCHAR);
} else {
ps.setString(3, remarksValue);
}
ps.setInt(4, userId);
return ps;
}, keyHolder);
return keyHolder.getKey().intValue(); // generated committee_data.id
return keyHolder.getKey().intValue(); // generated committee_data.id
}
public List<Integer> saveCommitteeTreeData(
List<Map<String, Object>> decisions,
int committeeDataId,
String refId,
int userId
) {
List<Map<String, Object>> decisions,
int committeeDataId,
String refId,
int userId) {
String sql = "INSERT INTO committee_tree_data (nooftrees, committee_action, committee_data_id, ref_id, cby) " +
"VALUES (?, ?, ?, ?, ?)";
String sql = "INSERT INTO committee_tree_data (nooftrees, committee_action, committee_data_id, ref_id, cby) " +
"VALUES (?, ?, ?, ?, ?)";
List<Integer> insertedIds = new ArrayList<>();
List<Integer> insertedIds = new ArrayList<>();
for (Map<String, Object> row : decisions) {
for (Map<String, Object> row : decisions) {
int actionId = Integer.parseInt(row.get("id").toString());
int count = Integer.parseInt(row.get("count").toString());
int actionId = Integer.parseInt(row.get("id").toString());
int count = Integer.parseInt(row.get("count").toString());
KeyHolder keyHolder = new GeneratedKeyHolder();
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setInt(1, count);
ps.setInt(2, actionId);
ps.setInt(3, committeeDataId);
ps.setString(4, refId);
ps.setInt(5, userId);
return ps;
}, keyHolder);
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setInt(1, count);
ps.setInt(2, actionId);
ps.setInt(3, committeeDataId);
ps.setString(4, refId);
ps.setInt(5, userId);
return ps;
}, keyHolder);
insertedIds.add(keyHolder.getKey().intValue());
}
insertedIds.add(keyHolder.getKey().intValue());
}
return insertedIds;
return insertedIds;
}
public List<Map<String, Object>> getvcsavedrefids() {
String sql="SELECT ref_id FROM committee_data WHERE isactive=1";
String sql = "SELECT ref_id FROM committee_data WHERE isactive=1";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
@ -408,19 +431,19 @@ public class PendinglistService {
@Transactional
public Map<String, Object> saveReInspection(String refId, int action, int meetingId,
String remarks, int userId) {
String remarks, int userId) {
Map<String, Object> response = new HashMap<>();
Map<String, Object> response = new HashMap<>();
try {
// Insert into reinspection table
String sql = "INSERT INTO reinspection (ref_id, committee_action, meeting_id, remarks, cby) " +
"VALUES (?, ?, ?, ?, ?)";
// Insert into reinspection table
String sql = "INSERT INTO reinspection (ref_id, committee_action, meeting_id, remarks, cby) " +
"VALUES (?, ?, ?, ?, ?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(connection -> {
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, refId);
ps.setInt(2, action);
@ -428,30 +451,26 @@ public class PendinglistService {
ps.setString(4, remarks);
ps.setInt(5, userId);
return ps;
}, keyHolder);
}, keyHolder);
int generatedId = keyHolder.getKey().intValue();
int generatedId = keyHolder.getKey().intValue();
// Update reg_details.reinspection_id
jdbcTemplate.update("UPDATE reg_details SET reinspection_id=? WHERE ref_id=?",generatedId, refId);
// Update reg_details.reinspection_id
jdbcTemplate.update("UPDATE reg_details SET reinspection_id=? WHERE ref_id=?", generatedId, refId);
jdbcTemplate.update("UPDATE inspection_data SET isactive=0,isdelete=1 WHERE ref_id=?", refId);
jdbcTemplate.update("UPDATE inspection_data SET isactive=0,isdelete=1 WHERE ref_id=?", refId);
response.put("status", "success");
response.put("message", "Committee decision saved!");
response.put("reinspection_id", generatedId);
response.put("status", "success");
response.put("message", "Committee decision saved!");
response.put("reinspection_id", generatedId);
}
catch (Exception e)
{
response.put("status", "error");
response.put("message", e.getMessage());
} catch (Exception e) {
response.put("status", "error");
response.put("message", e.getMessage());
}
return response;
}
}
}

226
src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/ReportService.java

@ -1,5 +1,8 @@
package in.gov.chennaicorporation.gccoffice.greencommittee.service;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -15,6 +18,12 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URL;
import java.net.URLEncoder;
import com.fasterxml.jackson.core.type.TypeReference;
@Service
public class ReportService {
@ -29,7 +38,7 @@ public class ReportService {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
public List<String> getrefnums(String meetingid, String zones) {
public List<String> getrefnums(String meetingid, String zones, String deptid, String appType) {
try {
StringBuilder sql = new StringBuilder(
@ -80,6 +89,22 @@ public class ReportService {
params.add(zones);
}
if (deptid != null && !deptid.isEmpty()) {
sql.append(
" AND ref_id IN ( " +
" SELECT ref_id FROM reg_details WHERE dept_id = ? " +
" ) ");
params.add(deptid);
}
if (appType != null && !appType.isEmpty()) {
sql.append(
" AND ref_id IN ( " +
" SELECT ref_id FROM reg_details WHERE cby = ? " +
" ) ");
params.add(appType);
}
return jdbcTemplate.queryForList(
sql.toString(),
params.toArray(),
@ -182,7 +207,7 @@ public class ReportService {
}
public Map<String, Object> getRegDetails(String ref) {
String sql = "SELECT * FROM reg_details WHERE is_active = 1 AND ref_id = ?";
String sql = "SELECT rd.*,dm.name as department_name FROM reg_details rd left join dept_master dm on dm.id=rd.dept_id WHERE rd.is_active = 1 AND rd.ref_id = ?";
return jdbcTemplate.queryForMap(sql, ref);
}
@ -518,4 +543,201 @@ public class ReportService {
return response;
}
public List<Map<String, Object>> getDepartments() {
String sql = "SELECT id, name FROM dept_master WHERE is_active = 1 ORDER BY id";
return jdbcTemplate.queryForList(sql);
}
public List<Map<String, Object>> getZones() {
String sql = """
SELECT id, zone_name
FROM gcc_street_vendor.zone_master
ORDER BY zone_name
""";
return jdbcTemplate.queryForList(sql);
}
public List<Map<String, Object>> getWards(Integer zoneId) {
String sql = """
SELECT id,
ward_name
FROM gcc_street_vendor.ward_master
WHERE zone_id=?
ORDER BY ward_name
""";
return jdbcTemplate.queryForList(sql, zoneId);
}
public List<Map<String, Object>> getReport(
String fromDate,
String toDate,
String zone,
String ward,
String status) {
List<Map<String, Object>> result = new ArrayList<>();
try {
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/newmobileservice";
StringBuilder url = new StringBuilder(externalUrl);
url.append("?serviceId=ms_dashboard_details");
// Mandatory
url.append("&From_date=").append(URLEncoder.encode(fromDate, "UTF-8"));
url.append("&To_date=").append(URLEncoder.encode(toDate, "UTF-8"));
url.append("&jsonResp=Yes");
// Status
if (status == null || status.trim().isEmpty()) {
url.append("&Status=total");
} else {
url.append("&Status=").append(URLEncoder.encode(status, "UTF-8"));
}
// Mandatory Parameters
url.append("&isQcuser=Yes");
url.append("&ComplaintType=")
.append(URLEncoder.encode("Tree Pruning", "UTF-8"));
url.append("&ComplaintGroupId=")
.append(URLEncoder.encode("Park and Playground", "UTF-8"));
// Zone
if (zone != null && !zone.trim().isEmpty()) {
url.append("&Zoneid=N")
.append(String.format("%02d", Integer.parseInt(zone)));
} else {
url.append("&Zoneid=");
}
// Mandatory blank
url.append("&RegionId=");
// Ward
if (ward != null && !ward.trim().isEmpty()) {
url.append("&WardId=N")
.append(String.format("%03d", Integer.parseInt(ward)));
} else {
url.append("&WardId=");
}
System.out.println("======================================");
System.out.println("Calling URL:");
System.out.println(url.toString());
System.out.println("======================================");
URL api = new URL(url.toString());
HttpURLConnection conn = (HttpURLConnection) api.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
int responseCode = conn.getResponseCode();
System.out.println("Response Code : " + responseCode);
BufferedReader br;
if (responseCode >= 200 && responseCode < 300) {
br = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
} else {
br = new BufferedReader(
new InputStreamReader(conn.getErrorStream()));
}
StringBuilder response = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
response.append(line);
}
br.close();
System.out.println("API Response:");
System.out.println(response.toString());
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(response.toString());
JsonNode details = root.get("Details");
if (details != null && details.isArray()) {
result = mapper.convertValue(
details,
new TypeReference<List<Map<String, Object>>>() {
});
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public Map<String, Object> getComplaintDetailsreport(String complaintId) {
try {
String url = "https://erp.chennaicorporation.gov.in/pgr/newmobileservice"
+ "?serviceId=getComplaintByID"
+ "&ComplaintId=" + URLEncoder.encode(complaintId, "UTF-8")
+ "&imgUrlonly=yes"
+ "&isQcuser=Yes"
+ "&jsonResp=Yes";
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod("GET");
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> response = mapper.readValue(
sb.toString(),
new TypeReference<List<Map<String, Object>>>() {
});
Map<String, Object> root = response.get(0);
List<Map<String, Object>> history = (List<Map<String, Object>>) root.get("ComplaintListHistory");
return history.get(0);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyMap();
}
}
}

815
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
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
src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java
File diff suppressed because it is too large
View File

57
src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/Maincontroller.java

@ -0,0 +1,57 @@
package in.gov.chennaicorporation.gccoffice.roadwar.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import in.gov.chennaicorporation.gccoffice.roadwar.service.LoginMappingService;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/gcc/roadwarweb")
@Controller("RoadWarMainController")
public class Maincontroller {
@Autowired
private LoginUserInfo loginUserInfo;
@Autowired
private LoginMappingService loginMappingService;
@GetMapping("/regform")
public String viewdashboard(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId", LoginUserId);
String zone=loginMappingService.getZoneByUserId(LoginUserId);
String ward=loginMappingService.getWardByUserId(LoginUserId);
model.addAttribute("Loginzone", zone);
model.addAttribute("Loginward", ward);
String UserRole = LoginUserInfo.getUserRole();
model.addAttribute("UserRole", UserRole);
return "modules/roadwar/regform";
}
@GetMapping("/updateform")
public String updateForm(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId", LoginUserId);
String zone=loginMappingService.getZoneByUserId(LoginUserId);
String ward=loginMappingService.getWardByUserId(LoginUserId);
model.addAttribute("Loginzone", zone);
model.addAttribute("Loginward", ward);
String UserRole = LoginUserInfo.getUserRole();
model.addAttribute("UserRole", UserRole);
return "modules/roadwar/updateform";
}
}

258
src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/RegisterApiController.java

@ -0,0 +1,258 @@
package in.gov.chennaicorporation.gccoffice.roadwar.controller;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
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.RestController;
import in.gov.chennaicorporation.gccoffice.roadwar.service.RegisterService;
@RestController
@RequestMapping("/gcc/api/roadwarweb/register")
public class RegisterApiController {
@Autowired
private RegisterService registerService;
@GetMapping("/getzones")
public Map<String, Object> ViewZoneDropdown() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> zones = registerService.ViewZoneDropdown();
if (!zones.isEmpty()) {
response.put("status", true);
response.put("message", "Zone list fetched successfully");
response.put("data", zones);
} else {
response.put("status", false);
response.put("message", "No zones found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getwardbyzone")
public Map<String, Object> ViewWardDropdown(@RequestParam String zone) {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> wards = registerService.ViewWardDropdown(zone);
if (!wards.isEmpty()) {
response.put("status", true);
response.put("message", "Ward list fetched successfully");
response.put("data", wards);
} else {
response.put("status", false);
response.put("message", "No wards found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getRoadNamesByWard")
public Map<String, Object> getRoadNamesByWard(@RequestParam String ward) {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> roads = registerService.getRoadNamesByWard(ward);
if (!roads.isEmpty()) {
response.put("status", true);
response.put("message", "Road names fetched successfully");
response.put("data", roads);
} else {
response.put("status", false);
response.put("message", "No roads found for ward: " + ward);
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getRoadType")
public Map<String, Object> getRoadType() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> roadTypes = registerService.getRoadType();
if (!roadTypes.isEmpty()) {
response.put("status", true);
response.put("message", "Road types fetched successfully");
response.put("data", roadTypes);
} else {
response.put("status", false);
response.put("message", "No road types found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getRoadTypeMaterial")
public Map<String, Object> getRoadTypeMaterial() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> roadTypes = registerService.getRoadTypeMaterial();
if (!roadTypes.isEmpty()) {
response.put("status", true);
response.put("message", "Roadtype Material fetched successfully");
response.put("data", roadTypes);
} else {
response.put("status", false);
response.put("message", "No roadtype material found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getFootpathType")
public Map<String, Object> getFootpathType() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> roadTypes = registerService.getFootpathType();
if (!roadTypes.isEmpty()) {
response.put("status", true);
response.put("message", "Footpath Types fetched successfully");
response.put("data", roadTypes);
} else {
response.put("status", false);
response.put("message", "No Footpath Types found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getRoadSide")
public Map<String, Object> getRoadSide() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> roadTypes = registerService.getRoadSide();
if (!roadTypes.isEmpty()) {
response.put("status", true);
response.put("message", "Road sides fetched successfully");
response.put("data", roadTypes);
} else {
response.put("status", false);
response.put("message", "No Road sides found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getMonthList")
public Map<String, Object> getMonthList() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> months = registerService.getMonthList();
if (!months.isEmpty()) {
response.put("status", true);
response.put("message", "Month list fetched successfully");
response.put("data", months);
} else {
response.put("status", false);
response.put("message", "No months found");
response.put("data", Collections.emptyList());
}
return response;
}
@GetMapping("/getYearList")
public Map<String, Object> getYearList() {
Map<String, Object> response = new HashMap<>();
List<Map<String, Object>> years = registerService.getYearList();
if (!years.isEmpty()) {
response.put("status", true);
response.put("message", "Year list fetched successfully");
response.put("data", years);
} else {
response.put("status", false);
response.put("message", "No Year found");
response.put("data", Collections.emptyList());
}
return response;
}
@PostMapping("/saveRoadWarDetails")
public Map<String, Object> saveRoadWarDetails(@RequestBody Map<String, Object> payload) {
return registerService.saveRoadWarDetails(payload);
}
@GetMapping("/getAllRoadWarDetails")
public ResponseEntity<?> getAllRoadWarDetails(
@RequestParam(required = false) String userid,
@RequestParam(required = false) String zone,
@RequestParam(required = false) String ward,
@RequestParam(required = false) String roadId) {
try {
List<Map<String, Object>> response =
registerService.getAllRoadWarDetails(userid,zone, ward, roadId);
return ResponseEntity.ok(response);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Collections.singletonMap("error",
"Failed to fetch data : " + e.getMessage()));
}
}
@GetMapping("/getRoadWarDetailsById")
public ResponseEntity<?> getRoadWarDetailsById(
@RequestParam String refid) {
try {
Map<String, Object> response =
registerService.getRoadWarDetailsById(refid);
return ResponseEntity.ok(response);
} catch (Exception e) {
Map<String, Object> error = new HashMap<>();
error.put("status", false);
error.put("message", "Failed to fetch data : " + e.getMessage());
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(error);
}
}
@GetMapping("/checkRoadExists")
public Map<String, Object> checkRoadExists(@RequestParam("roadId") Integer roadId) {
return registerService.checkRoadExists(roadId);
}
@PostMapping("/updateRoadWarDetails")
public Map<String, Object> updateRoadWarDetails(@RequestBody Map<String, Object> payload) {
return registerService.updateRoadWarDetails(payload);
}
@PostMapping("/deleteRoadWarDetails")
public Map<String, Object> deleteRoadWarDetails(
@RequestParam String refId,@RequestParam String updatedby) {
return registerService.deleteRoadWarDetails(refId,updatedby);
}
}

51
src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/LoginMappingService.java

@ -0,0 +1,51 @@
package in.gov.chennaicorporation.gccoffice.roadwar.service;
import java.util.Collections;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@Service
public class LoginMappingService {
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
public void setDataSource(@Qualifier("mysqlGCCUserDataSource") DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
public String getZoneByUserId(String userid) {
String sql = "SELECT zone FROM user_mapping_details WHERE userid=?";
try {
return jdbcTemplate.queryForObject(sql, String.class, userid);
}catch (EmptyResultDataAccessException e) {
return "";
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public String getWardByUserId(String userid) {
String sql = "SELECT ward FROM user_mapping_details WHERE userid=?";
try {
return jdbcTemplate.queryForObject(sql, String.class, userid);
} catch (EmptyResultDataAccessException e) {
return "";
}catch (Exception e) {
e.printStackTrace();
return "";
}
}
}

777
src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/RegisterService.java

@ -0,0 +1,777 @@
package in.gov.chennaicorporation.gccoffice.roadwar.service;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.transaction.annotation.Transactional;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@Service
public class RegisterService {
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private Environment environment;
@Autowired
public void setDataSource(@Qualifier("mysqlRoadWarDataSource") DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
public List<Map<String, Object>> ViewZoneDropdown() {
String sql = "SELECT zone_name "
+ "FROM zone_master "
+ "WHERE is_active=1 AND is_delete=0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> ViewWardDropdown(String zone) {
String sql = "SELECT ward_name "
+ "FROM ward_master "
+ "WHERE is_active=1 AND is_delete=0 AND zone_id=?";
try {
return jdbcTemplate.queryForList(sql, zone);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getRoadNamesByWard(String ward) {
try {
String encodedWard = URLEncoder.encode("'" + ward + "'", StandardCharsets.UTF_8.toString());
String url = "https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/0/query"
+ "?where=new_ward%3D" + encodedWard
+ "&fullText=&objectIds=&time=&geometry=&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Meter&relationParam="
+ "&outFields=road_id%2Croad_name%2Clocality%2Carea_name%2Ctype"
+ "&returnGeometry=false"
+ "&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=&returnTrueCurves=false&returnExceededLimitFeatures=false&quantizationParameters=&returnCentroid=false&returnEnvelope=false&timeReferenceUnknownClient=false&maxRecordCountFactor=&sqlFormat=none&resultType=&featureEncoding=esriDefault&datumTransformation=&cacheHint=false"
+ "&f=geojson";
RestTemplate restTemplate = new RestTemplate();
String responseBody = restTemplate.getForObject(URI.create(url), String.class);
ObjectMapper objectMapper = new ObjectMapper();
JsonNode root = objectMapper.readTree(responseBody);
JsonNode features = root.path("features");
List<Map<String, Object>> roadList = new ArrayList<>();
if (features.isArray()) {
for (JsonNode feature : features) {
JsonNode props = feature.path("properties");
String roadId = props.path("road_id").asText();
String roadName = props.path("road_name").asText();
String locality = props.path("locality").asText();
String areaName = props.path("area_name").asText();
String type = props.path("type").asText();
Map<String, Object> roadInfo = new HashMap<>();
roadInfo.put("road_id", roadId);
roadInfo.put("road_name", roadName);
roadInfo.put("locality", locality);
roadInfo.put("area_name", areaName);
roadInfo.put("type", type);
roadList.add(roadInfo);
}
}
return roadList;
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getRoadType() {
String sql = "Select id,road_type as roadType from road_type_master where is_active = 1 and is_delete = 0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getRoadTypeMaterial() {
String sql = "Select id,roadtype_material from roadtype_material_master where is_active = 1 and is_delete = 0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getFootpathType() {
String sql = "Select id,footpath_type_name from footpath_type_master where is_active = 1 and is_delete = 0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getRoadSide() {
String sql = "Select id,road_side_name from road_side_master where is_active = 1 and is_delete = 0";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getMonthList() {
String sql = "SELECT id, month_name FROM month_master WHERE is_active = 1 AND is_delete = 0 ORDER BY id";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public List<Map<String, Object>> getYearList() {
String sql = "SELECT id, year_name FROM year_master WHERE is_active = 1 AND is_delete = 0 ORDER BY id DESC";
try {
return jdbcTemplate.queryForList(sql);
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList();
}
}
public Map<String, Object> saveRoadWarDetails(Map<String, Object> payload) {
Map<String, Object> result = new HashMap<>();
try {
String roadId = String.valueOf(payload.get("road_id"));
Integer count = jdbcTemplate.queryForObject(
"SELECT COUNT(*) " +
"FROM road_details_master " +
"WHERE road_id = ? " +
"AND is_active = 1 " +
"AND is_delete = 0",
Integer.class,
roadId);
if (count != null && count > 0) {
result.put("status", false);
result.put("message",
"Selected road is already mapped to another Road War record");
return result;
}
String insertRoad = "INSERT INTO road_details_master "
+ "(zone, ward, road_name, road_type, road_length, road_avg_width, road_area, "
+ " footpath_material, footpath_length, footpath_width, footpath_from_location, footpath_to_location, "
+ " is_swd, swd_from, swd_to, swd_length, swd_size, "
+ " is_scp, scp_count, is_manhole, manhole_count, manhole_at, "
+ " is_cpipe, cpipe_count, is_rwh, rwh_count, "
+ " sewer_length, sewer_size, "
+ " is_electric_poles, ep_count, is_hml, culvert_bridge_count, details, "
+ " is_busshelter, busshelter_count, is_centermedian, erp_asset_code, cby,road_id,road_type_material,road_min_width,road_max_width, "
+ " hml_count,is_streetlight_poles,streetlight_poles_count,is_mml,mml_count,road_from,road_to,is_footpath,footpath_at,area_name,locality_name,road_row_width, "
+ " r_footpath_material,r_footpath_length,r_footpath_width,swd_at,rhs_swdlength,rhs_swdsize,scp_at,rhs_scpCount,r_mhCount,cp_at,r_cpCount,rwh_at,r_rwCount )"
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update((PreparedStatementCreator) con -> {
var ps = con.prepareStatement(insertRoad, new String[] { "id" });
ps.setObject(1, payload.get("zone"));
ps.setObject(2, payload.get("ward"));
ps.setObject(3, payload.get("road_name"));
ps.setObject(4, payload.get("road_type"));
// ps.setObject(5, payload.get("highway_ans"));
ps.setObject(5, payload.get("road_length"));
ps.setObject(6, payload.get("road_avg_width"));
ps.setObject(7, payload.get("road_area"));
ps.setObject(8, payload.get("footpath_material"));
ps.setObject(9, payload.get("footpath_length"));
ps.setObject(10, payload.get("footpath_width"));
ps.setObject(11, payload.get("footpath_from_location"));
ps.setObject(12, payload.get("footpath_to_location"));
ps.setObject(13, payload.get("is_swd"));
ps.setObject(14, payload.get("swd_from"));
ps.setObject(15, payload.get("swd_to"));
ps.setObject(16, payload.get("swd_length"));
ps.setObject(17, payload.get("swd_size"));
ps.setObject(18, payload.get("is_scp"));
ps.setObject(19, payload.get("scp_count"));
ps.setObject(20, payload.get("is_manhole"));
ps.setObject(21, payload.get("manhole_count"));
ps.setObject(22, payload.get("manhole_at"));
ps.setObject(23, payload.get("is_cpipe"));
ps.setObject(24, payload.get("cpipe_count"));
ps.setObject(25, payload.get("is_rwh"));
ps.setObject(26, payload.get("rwh_count"));
ps.setObject(27, payload.get("sewer_length"));
ps.setObject(28, payload.get("sewer_size"));
ps.setObject(29, payload.get("is_electric_poles"));
ps.setObject(30, payload.get("ep_count"));
ps.setObject(31, payload.get("is_hml"));
ps.setObject(32, payload.get("culvert_bridge_count"));
ps.setObject(33, payload.get("details"));
ps.setObject(34, payload.get("is_busshelter"));
ps.setObject(35, payload.get("busshelter_count"));
ps.setObject(36, payload.get("is_centermedian"));
ps.setObject(37, payload.get("erp_asset_code"));
ps.setObject(38, payload.get("cby"));
ps.setObject(39, payload.get("road_id"));
ps.setObject(40, payload.get("road_type_material"));
ps.setObject(41, payload.get("road_min_width"));
ps.setObject(42, payload.get("road_max_width"));
ps.setObject(43, payload.get("hml_count"));
ps.setObject(44, payload.get("is_streetlight_poles"));
ps.setObject(45, payload.get("streetlight_poles_count"));
ps.setObject(46, payload.get("is_mml"));
ps.setObject(47, payload.get("mml_count"));
ps.setObject(48, payload.get("roadfrom"));
ps.setObject(49, payload.get("roadto"));
ps.setObject(50, payload.get("is_footpath"));
ps.setObject(51, payload.get("footpathat"));
ps.setObject(52, payload.get("areaname"));
ps.setObject(53, payload.get("localityname"));
ps.setObject(54, payload.get("road_row_width"));
ps.setObject(55, payload.get("rhs_footpathDropdown"));
ps.setObject(56, payload.get("rhs_fplength"));
ps.setObject(57, payload.get("rhs_fpwidth"));
ps.setObject(58, payload.get("swd_at"));
ps.setObject(59, payload.get("rhs_swdlength"));
ps.setObject(60, payload.get("rhs_swdsize"));
ps.setObject(61, payload.get("scp_at"));
ps.setObject(62, payload.get("rhs_scpCount"));
ps.setObject(63, payload.get("r_mhCount"));
ps.setObject(64, payload.get("cp_at"));
ps.setObject(65, payload.get("r_cpCount"));
ps.setObject(66, payload.get("rwh_at"));
ps.setObject(67, payload.get("r_rwCount"));
return ps;
}, keyHolder);
long generatedId = keyHolder.getKey().longValue();
String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("ddMMYYYY"));
String refId = datePrefix + generatedId;
jdbcTemplate.update(
"UPDATE road_details_master SET ref_id = ? WHERE id = ?",
refId, generatedId);
List<Map<String, Object>> relayingList = (List<Map<String, Object>>) payload.get("relaying_details");
if (relayingList != null && !relayingList.isEmpty()) {
String insertRelay = "INSERT INTO relaying_details "
+ "(road_ref_id, relay_month, relay_year,road_type_material ,cr_value, road_type, remarks, cby) "
+ "VALUES (?,?,?,?,?,?,?,?)";
for (Map<String, Object> relay : relayingList) {
jdbcTemplate.update(insertRelay,
refId,
relay.get("relay_month"),
relay.get("relay_year"),
relay.get("road_type_material"),
relay.get("cr_value"),
relay.get("road_type"),
relay.get("remarks"),
payload.get("cby"));
}
}
result.put("status", true);
result.put("message", "Road war details saved successfully");
result.put("ref_id", refId);
} catch (Exception e) {
e.printStackTrace();
result.put("status", false);
result.put("message", "Failed to save road war details: " + e.getMessage());
}
return result;
}
public List<Map<String, Object>> getAllRoadWarDetails(
String userid,
String zone,
String ward,
String roadId) {
StringBuilder sql = new StringBuilder(
" SELECT rdm.*,rtm.road_type as road_type_name,rtmm.roadtype_material as roadtype_material_name,ftm.footpath_type_name as footpath_material_name FROM road_details_master rdm "
+
" LEFT JOIN road_type_master rtm ON rtm.id= rdm.road_type " +
" LEFT JOIN roadtype_material_master rtmm ON rtmm.id= rdm.road_type_material " +
" LEFT JOIN footpath_type_master ftm ON ftm.id= rdm.footpath_material " +
" WHERE 1=1 ");
List<Object> params = new ArrayList<>();
if (userid != null && !userid.isEmpty()) {
sql.append(" AND rdm.cby = ?");
params.add(userid);
}
if (zone != null && !zone.isEmpty()) {
sql.append(" AND rdm.zone = ?");
params.add(zone);
}
if (ward != null && !ward.isEmpty()) {
sql.append(" AND rdm.ward = ?");
params.add(ward);
}
if (roadId != null && !roadId.isEmpty()) {
sql.append(" AND rdm.road_id = ?");
params.add(roadId);
}
sql.append(" AND rdm.is_active=1 AND rdm.is_delete=0 ");
sql.append(" ORDER BY rdm.id DESC");
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
}
public Map<String, Object> getRoadWarDetailsById(String refid) {
Map<String, Object> result = new HashMap<>();
try {
String sql = "SELECT rdm.*, rtm.road_type As road_type_name,rtmm.roadtype_material as roadtype_material,ftm.footpath_type_name as footpath_material_name "
+
"FROM road_details_master rdm " +
"LEFT JOIN road_type_master rtm ON rtm.id = rdm.road_type " +
"LEFT JOIN roadtype_material_master rtmm ON rtmm.id = rdm.road_type_material " +
"LEFT JOIN footpath_type_master ftm ON ftm.id= rdm.footpath_material " +
"WHERE rdm.ref_id = ? AND rdm.is_active=1 AND rdm.is_delete=0 ";
Map<String, Object> road = jdbcTemplate.queryForMap(sql, refid);
result.putAll(road);
List<Map<String, Object>> relayingDetails = jdbcTemplate.queryForList(
" SELECT rd.*,mm.month_name,ym.year_name,rtmm.roadtype_material "
+ " FROM relaying_details rd "
+ " LEFT JOIN month_master mm on mm.id = rd.relay_month "
+ " LEFT JOIN year_master ym on ym.id = rd.relay_year "
+ " LEFT JOIN roadtype_material_master rtmm on rtmm.id = rd.road_type_material "
+ " WHERE rd.road_ref_id = ? AND rd.is_active=1 AND rd.is_delete=0 ",
refid);
result.put("relayingDetails", relayingDetails);
result.put("status", true);
} catch (Exception e) {
result.put("status", false);
result.put("message", e.getMessage());
}
return result;
}
public Map<String, Object> checkRoadExists(Integer roadId) {
Map<String, Object> response = new HashMap<>();
try {
String sql = " SELECT COUNT(*) FROM road_details_master "
+ " WHERE road_id = ? AND is_active=1 AND is_delete = 0 ";
Integer count = jdbcTemplate.queryForObject(
sql,
Integer.class,
roadId);
response.put("status", true);
response.put("exists", count != null && count > 0);
} catch (Exception e) {
e.printStackTrace();
response.put("status", false);
response.put("message", "Error while checking road");
}
return response;
}
@Transactional
public Map<String, Object> updateRoadWarDetails(Map<String, Object> payload) {
Map<String, Object> result = new HashMap<>();
try {
String refId = String.valueOf(payload.get("ref_id"));
String updatedBy = String.valueOf(payload.get("updated_by"));
String roadId = String.valueOf(payload.get("road_id"));
Integer count = jdbcTemplate.queryForObject(
"SELECT COUNT(*) " +
"FROM road_details_master " +
"WHERE road_id = ? " +
"AND ref_id <> ? " +
"AND is_active = 1 " +
"AND is_delete = 0",
Integer.class,
roadId,
refId);
if (count != null && count > 0) {
result.put("status", false);
result.put("message",
"Selected road is already mapped to another Road War record");
return result;
}
// COPY CURRENT RECORD TO LOG TABLE
String logSql = "INSERT INTO road_details_master_log (" +
"id, zone, ward, road_id, road_name,area_name,locality_name, road_type,road_type_material, highway_ans, "
+
"road_length,road_row_width, road_avg_width,road_min_width,road_max_width, road_area, " +
"road_from,road_to,is_footpath,footpath_at, " +
"footpath_material, footpath_length, footpath_width, " +
"r_footpath_material, r_footpath_length, r_footpath_width, " +
"footpath_from_location, footpath_to_location, " +
"swd_at,rhs_swdlength,rhs_swdsize,scp_at,rhs_scpCount,manhole_at,r_mhCount,cp_at,r_cpCount,rwh_at,r_rwCount, "
+
"is_swd, swd_from, swd_to, swd_length, swd_size, " +
"is_scp, scp_count, is_manhole, manhole_count, manhole_location, " +
"is_cpipe, cpipe_count, is_rwh, rwh_count, " +
"sewer_length, sewer_size, is_electric_poles, ep_count, is_hml,hml_count, " +
"is_streetlight_poles,streetlight_poles_count,is_mml,mml_count, " +
"culvert_bridge_count, details, is_busshelter, busshelter_count, " +
"is_centermedian, erp_asset_code, ref_id, cdate, cby, " +
"updated_date, updated_by, is_active, is_delete) " +
"SELECT " +
"id, zone, ward, road_id, road_name,area_name,locality_name, road_type,road_type_material, highway_ans, "
+
"road_length,road_row_width, road_avg_width,road_min_width,road_max_width, road_area, " +
"road_from,road_to,is_footpath,footpath_at, " +
"footpath_material, footpath_length, footpath_width, " +
"r_footpath_material, r_footpath_length, r_footpath_width, " +
"footpath_from_location, footpath_to_location, " +
"swd_at,rhs_swdlength,rhs_swdsize,scp_at,rhs_scpCount,manhole_at,r_mhCount,cp_at,r_cpCount,rwh_at,r_rwCount, "
+
"is_swd, swd_from, swd_to, swd_length, swd_size, " +
"is_scp, scp_count, is_manhole, manhole_count, manhole_location, " +
"is_cpipe, cpipe_count, is_rwh, rwh_count, " +
"sewer_length, sewer_size, is_electric_poles, ep_count, is_hml,hml_count, " +
"is_streetlight_poles,streetlight_poles_count,is_mml,mml_count, " +
"culvert_bridge_count, details, is_busshelter, busshelter_count, " +
"is_centermedian, erp_asset_code, ref_id, cdate, cby, " +
"updated_date, updated_by, is_active, is_delete " +
"FROM road_details_master " +
"WHERE ref_id=?";
jdbcTemplate.update(logSql, refId);
// 3. UPDATE ROAD MASTER
String updateSql = "UPDATE road_details_master SET " +
"zone=?, " +
"ward=?, " +
"road_id=?, " +
"road_name=?, " +
"area_name=?, " +
"locality_name=?, " +
"road_type=?, " +
"road_type_material=?, " +
"road_length=?, " +
"road_row_width=?, " +
"road_avg_width=?, " +
"road_min_width=?, " +
"road_max_width=?, " +
"road_area=?, " +
"road_from=?, " +
"road_to=?, " +
"is_footpath=?, " +
"footpath_at=?, " +
"footpath_material=?, " +
"footpath_length=?, " +
"footpath_width=?, " +
"r_footpath_material=?, " +
"r_footpath_length=?, " +
"r_footpath_width=?, " +
"footpath_from_location=?, " +
"footpath_to_location=?, " +
"is_swd=?, " +
"swd_from=?, " +
"swd_to=?, " +
"swd_at=?," +
"swd_length=?, " +
"swd_size=?, " +
"rhs_swdlength=?, " +
"rhs_swdsize=?, " +
"is_scp=?, " +
"scp_at=?, " +
"scp_count=?, " +
"rhs_scpCount=?," +
"is_manhole=?, " +
"manhole_count=?, " +
"manhole_at=?, " +
"r_mhCount=?, " +
"is_cpipe=?, " +
"cpipe_count=?, " +
"cp_at=?, " +
"r_cpCount=?, " +
"is_rwh=?, " +
"rwh_count=?, " +
"rwh_at=?, " +
"r_rwCount=?, " +
"sewer_length=?, " +
"sewer_size=?, " +
"is_electric_poles=?, " +
"ep_count=?, " +
"is_hml=?, " +
"hml_count=?, " +
"is_streetlight_poles=?, " +
"streetlight_poles_count=?, " +
"is_mml=?, " +
"mml_count=?, " +
"culvert_bridge_count=?, " +
"details=?, " +
"is_busshelter=?, " +
"busshelter_count=?, " +
"is_centermedian=?, " +
"updated_date=NOW(), " +
"updated_by=? " +
"WHERE ref_id=?";
jdbcTemplate.update(updateSql,
payload.get("zone"),
payload.get("ward"),
payload.get("road_id"),
payload.get("road_name"),
payload.get("road_areaname"),
payload.get("road_localityname"),
payload.get("road_type"),
payload.get("road_type_material"),
payload.get("road_length"),
payload.get("road_row_width"),
payload.get("road_avg_width"),
payload.get("road_min_width"),
payload.get("road_max_width"),
payload.get("road_area"),
payload.get("road_from"),
payload.get("road_to"),
payload.get("is_footpath"),
payload.get("footpath_at"),
payload.get("footpath_material"),
payload.get("footpath_length"),
payload.get("footpath_width"),
payload.get("rhs_footpathDropdown"),
payload.get("rhs_fplength"),
payload.get("rhs_fpwidth"),
payload.get("footpath_from_location"),
payload.get("footpath_to_location"),
payload.get("is_swd"),
payload.get("swd_from"),
payload.get("swd_to"),
payload.get("swd_at"),
payload.get("swd_length"),
payload.get("swd_size"),
payload.get("rhs_swdlength"),
payload.get("rhs_swdsize"),
payload.get("is_scp"),
payload.get("scp_at"),
payload.get("scp_count"),
payload.get("rhs_scpCount"),
payload.get("is_manhole"),
payload.get("manhole_count"),
payload.get("manhole_at"),
payload.get("r_mhCount"),
payload.get("is_cpipe"),
payload.get("cpipe_count"),
payload.get("cp_at"),
payload.get("r_cpCount"),
payload.get("is_rwh"),
payload.get("rwh_count"),
payload.get("rwh_at"),
payload.get("r_rwCount"),
payload.get("sewer_length"),
payload.get("sewer_size"),
payload.get("is_electric_poles"),
payload.get("ep_count"),
payload.get("is_hml"),
payload.get("hml_count"),
payload.get("is_streetlight_poles"),
payload.get("streetlight_poles_count"),
payload.get("is_mml"),
payload.get("mml_count"),
payload.get("culvert_bridge_count"),
payload.get("details"),
payload.get("is_busshelter"),
payload.get("busshelter_count"),
payload.get("is_centermedian"),
updatedBy,
refId);
// 4. SOFT DELETE OLD RELAYING RECORDS
jdbcTemplate.update(
"UPDATE relaying_details " +
"SET is_active=0, " +
"is_delete=1, " +
"updated_date=NOW(), " +
"updated_by=? " +
"WHERE road_ref_id=? " +
"AND is_active=1",
updatedBy,
refId);
// 5. INSERT NEW RELAYING RECORDS
@SuppressWarnings("unchecked")
List<Map<String, Object>> relays = (List<Map<String, Object>>) payload.get("relaying_details");
String insertRelay = "INSERT INTO relaying_details " +
"(road_ref_id, relay_month, relay_year,road_type_material, cr_value, road_type, remarks, cby) " +
"VALUES (?,?,?,?,?,?,?,?)";
if (relays != null) {
for (Map<String, Object> relay : relays) {
jdbcTemplate.update(
insertRelay,
refId,
relay.get("relay_month"),
relay.get("relay_year"),
relay.get("road_type_material"),
relay.get("cr_value"),
relay.get("road_type"),
relay.get("remarks"),
updatedBy);
}
}
result.put("status", true);
result.put("message", "Road details updated successfully");
} catch (Exception e) {
e.printStackTrace();
result.put("status", false);
result.put("message", e.getMessage());
}
return result;
}
public Map<String, Object> deleteRoadWarDetails(String refId, String updatedby) {
Map<String, Object> result = new HashMap<>();
try {
int roadUpdated = jdbcTemplate.update(
"UPDATE road_details_master " +
"SET is_active=0, " +
"is_delete=1, " +
"updated_by=?, " +
"updated_date=NOW() " +
"WHERE ref_id=? " +
"AND is_active=1",
updatedby, refId);
jdbcTemplate.update(
"UPDATE relaying_details " +
"SET is_active=0, " +
"is_delete=1, " +
"updated_by=?, " +
"updated_date=NOW() " +
"WHERE road_ref_id=? " +
"AND is_active=1",
updatedby, refId);
if (roadUpdated > 0) {
result.put("status", true);
result.put("message",
"Road War details deleted successfully");
} else {
result.put("status", false);
result.put("message", "Record not found");
}
} catch (Exception e) {
e.printStackTrace();
result.put("status", false);
result.put("message",
"Failed to delete Road War details");
}
return result;
}
}

17
src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/MainController.java

@ -195,5 +195,22 @@ public class MainController {
}
@GetMapping("/certificate")
public String viewcertificate(Model model)
{
String LoginUserId = LoginUserInfo.getLoginUserId();
int userId = Integer.parseInt(LoginUserId);
model.addAttribute("LoginUserId",LoginUserId);
String zone=streetVendorService.getloginUserZone(userId);
model.addAttribute("zone",zone);
//System.out.println("zone="+zone);
String UserRole = LoginUserInfo.getUserRole();
model.addAttribute("UserRole", UserRole);
return "modules/vendors/certificate";
}
}

2
src/main/resources/application.properties

@ -120,3 +120,5 @@ street_vendor_foldername=street_vendor_files
green_committee_foldername=green_committee_files
socialmedia_1913_regcomp_foldername=socialmedia_1913_regcompfiles
bulk_waste_foldername=bulk_waste_files

3007
src/main/resources/templates/modules/bulkwaste/requestdetails.html
File diff suppressed because it is too large
View File

17
src/main/resources/templates/modules/callcenterqaqc/agentqaqccalls.html

@ -780,17 +780,9 @@
//console.log("valid phone number");
$('.submitid').prop('disabled', false).text('Submit');
// Trigger WhatsApp message functions based on action
// if (action === "UNATTENDED") {
//sendWhatsAppMessageUnattended(name, complaintNumber, cellnumber, complaintTypeName);
// } else if (action === "REOPEN") {
//sendWhatsAppMessageReopened(name, complaintNumber, cellnumber, complaintTypeName);
// }
if (action === "UNATTENDED" || action === "COMPLETED" ) {
//checkforUnattendedwhatsappmsg(complaintNumber,action,complaintTypeName,cellnumber,name);
if (action === "UNATTENDED" || action === "COMPLETED" ) {
checkforUnattendedwhatsappmsg(complaintNumber,action,complaintTypeName,cellnumber,name);
}
}
@ -1036,12 +1028,15 @@ return detailsHtml;
//checkforwhatsappmsg
function checkforUnattendedwhatsappmsg(complaintNumber,action,complaintTypeName,cellnumber,name) {
console.log(complaintNumber);
$.ajax({
url: '/gcc/api/qaqc/whatsapp/checkforwhatsappmsg',
type: 'GET',
data: { complaintNumber: complaintNumber,action:action,
complaintTypeName:complaintTypeName,mobnumber:cellnumber,
name:pname},
pname:name},
success: function(response) {
//console.log('WhatsApp message sent successfully', response);
console.log(response);

5
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
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
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>

2
src/main/resources/templates/modules/greencommittee/monitoring.html

@ -407,7 +407,7 @@ function fetchgreenCommitteeList(){
renderDetails(details);
$('#viewModalLabel').text(`Apploication Details - ${id}`);
$('#viewModalLabel').text(`Application Details - ${id}`);
$('#viewModal').modal('show');
},
error: function (xhr) {

797
src/main/resources/templates/modules/greencommittee/pendinglist.html

@ -1,198 +1,212 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<style>
.thumb-img {
width: 90px;
height: 70px;
object-fit: cover;
cursor: pointer;
border: 2px solid #ddd;
margin-right: 5px;
}
.thumb-img:hover {
border-color: #007bff;
}
#viewModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
.thumb-img {
width: 90px;
height: 70px;
object-fit: cover;
cursor: pointer;
border: 2px solid #ddd;
margin-right: 5px;
}
.thumb-img:hover {
border-color: #007bff;
}
/* #imageViewModal .modal-body {
#viewModal .modal-body {
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
}
/* #imageViewModal .modal-body {
max-height: 60vh;
overflow-y: auto;
} */
.full-image-modal {
width: 50%;
height: 70vh; /* fixed height */
object-fit: cover; /* fills modal without distortion */
object-position: center;
background-color: #000; /* if image is smaller */
}
width: 50%;
height: 70vh;
/* fixed height */
object-fit: cover;
/* fills modal without distortion */
object-position: center;
background-color: #000;
/* if image is smaller */
}
</style>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="far fa-calendar-plus bg-blue"></i>
<div class="d-inline">
<h5>Pending Application</h5>
<span>Green Committee</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i
class="ik ik-home"></i></a></li>
<li class="breadcrumb-item" aria-current="page">Green Committee</li>
<li class="breadcrumb-item active" aria-current="page">Pending List</li>
</ol>
</nav>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12" >
<div class="card">
<div class="card-block">
<div class="row">
<div class="form-group col-sm-8">
<label for="dropdownevent">Select Meeting
<span class="text-danger">*</span></label>
<select id="dropdownevent" class="form-control">
</select>
</div>
<div class="form-group col-sm-4">
<label for="zonedropdown">Select Zone
</label>
<select id="zonedropdown" class="form-control">
<option value="">Select Zone </option>
</select>
</div>
</div>
<div class="page-header-title" >
<h5 style="margin: 0;font-weight: bold;">Green Committee Pending List</h5><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><hr>
</div>
<div>
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center">S.No</th>
<th class="text-center">Application No</th>
<th class="text-center">Zone</th>
<th class="text-center">Ward</th>
<th class="text-center">Type</th>
<th class="text-center">Name</th>
<th class="text-center">Mobile</th>
<th class="text-center">Address</th>
<th class="text-center">Remarks</th>
<th class="text-center">No of trees</th>
<th class="text-center">Details of Complaints</th>
<th class="text-center no-sort">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="far fa-calendar-plus bg-blue"></i>
<div class="d-inline">
<h5>Pending Application</h5>
<span>Green Committee</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Green Committee</li>
<li class="breadcrumb-item active" aria-current="page">Pending List</li>
</ol>
</nav>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div class="row">
<div class="form-group col-sm-8">
<label for="dropdownevent">Select Meeting
<span class="text-danger">*</span></label>
<select id="dropdownevent" class="form-control">
</select>
</div>
<div class="form-group col-sm-4">
<label for="zonedropdown">Select Zone
</label>
<select id="zonedropdown" class="form-control">
<option value="">Select Zone </option>
</select>
</div>
</div>
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;">Green Committee Pending List</h5><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span>
<hr>
</div>
<div>
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center">S.No</th>
<th class="text-center">Application No</th>
<th class="text-center">Zone</th>
<th class="text-center">Ward</th>
<th class="text-center">Type</th>
<th class="text-center">Name</th>
<th class="text-center">Mobile</th>
<th class="text-center">Address</th>
<th class="text-center">Remarks</th>
<th class="text-center">No of trees</th>
<th class="text-center">Details of Complaints</th>
<th class="text-center no-sort">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--View Modal -->
<div class="modal fade" id="viewModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="viewModalLabel">Request Details</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body" id="modalBodyContent"></div>
<div class="modal-footer">
<button class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--Image Modal -->
<div class="modal fade" id="imageViewModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body text-center p-0">
<img id="fullImagePreview" src="" class="full-image-modal" />
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--View Modal -->
<div class="modal fade" id="viewModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="viewModalLabel">Request Details</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body" id="modalBodyContent"></div>
<div class="modal-footer">
<button class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--Image Modal -->
<div class="modal fade" id="imageViewModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body text-center p-0">
<img id="fullImagePreview" src="" class="full-image-modal" />
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script type="text/javascript">
<div id="pageLoader"
style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script type="text/javascript">
let userId = document.getElementById('userIdSpan').textContent;
@ -201,15 +215,15 @@
$("#imageViewModal").modal("show");
}
$(document).ready(function() {
var table = $('#RequestListDatatable').DataTable({
$(document).ready(function () {
var table = $('#RequestListDatatable').DataTable({
dom: 'Bftip',
columnDefs: [
{ width: "150px", targets: 7 },
{width: "350px", targets: 8}
],
{ width: "150px", targets: 7 },
{ width: "350px", targets: 8 }
],
lengthMenu: [
[200, 400, -1],
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
scrollY: '50vh',
@ -254,26 +268,26 @@
});
fetchEventDropdown();
fetchZones();
fetchEventDropdown();
fetchZones();
$('#dropdownevent').on('change', function () {
$('#dropdownevent').on('change', function () {
$('#zonedropdown').val("");
$('#zonedropdown').val("");
fetchgreenCommitteeList();
});
$('#zonedropdown').on('change', function () {
let miss_meet=$('#dropdownevent').val();
$('#zonedropdown').on('change', function () {
let miss_meet = $('#dropdownevent').val();
if(!miss_meet){
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
fetchgreenCommitteeList();
if (!miss_meet) {
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
fetchgreenCommitteeList();
});
@ -282,152 +296,152 @@
$(document).on("click", "#btnCommitteeSave", function () {
const $submitBtn = $(this); // ONLY this button
const $submitBtn = $(this); // ONLY this button
$submitBtn.prop('disabled', true).text('Saving...');
let refId = $("#selectedRefId").val();
let finalTotalTrees = parseInt($("#finaltotaltrees").val());
let remarks = $("#committeeRemarks").val();
let meetingid = $('#dropdownevent').val();
// Check if user selected only Re-Inspection (ID = 8)
let isReInspection = $(".decision-check[value='8']").is(":checked");
if (isReInspection) {
// Ignore other validations → Call separate AJAX
saveReInspection(refId, meetingid, remarks, userId, $submitBtn);
return;
}
let selected = [];
let hasError = false;
let emptyField = null;
$("#decisionInputs input").each(function () {
let count = $(this).val().trim();
let id = $(this).data("id");
// If empty count → validation fail
if (count === "") {
hasError = true;
emptyField = this; // store input element
return false; // break loop
}
// Add to final data
selected.push({
id: id,
count: parseInt(count)
});
});
// Validation failed
if (hasError) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "Missing Count",
text: "Please enter number of trees for all selected decisions!",
});
// optional highlight
$(emptyField).addClass("border-danger");
setTimeout(() => {
$(emptyField).removeClass("border-danger");
}, 2000);
return; // stop further processing
}
// If selected is empty – user selected nothing
if (selected.length === 0) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "No Decision Selected",
text: "Please select at least one committee decision!",
});
return;
}
let sumCounts = selected.reduce((sum, item) => sum + item.count, 0);
if (sumCounts !== finalTotalTrees) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "Count Mismatch",
text: `Total entered trees (${sumCounts}) must equal total trees (${finalTotalTrees}).`
});
return;
}
console.log("Final Submit:",
"Ref ID:", refId,
"meetingid:",meetingid,
"userId:",userId,
"Selected decisions:", selected,
"Remarks:", remarks
);
let refId = $("#selectedRefId").val();
let finalTotalTrees = parseInt($("#finaltotaltrees").val());
let remarks = $("#committeeRemarks").val();
let meetingid = $('#dropdownevent').val();
// Check if user selected only Re-Inspection (ID = 8)
let isReInspection = $(".decision-check[value='8']").is(":checked");
if (isReInspection) {
// Ignore other validations → Call separate AJAX
saveReInspection(refId, meetingid, remarks, userId, $submitBtn);
return;
}
let selected = [];
let hasError = false;
let emptyField = null;
$("#decisionInputs input").each(function () {
let count = $(this).val().trim();
let id = $(this).data("id");
// If empty count → validation fail
if (count === "") {
hasError = true;
emptyField = this; // store input element
return false; // break loop
}
// Add to final data
selected.push({
id: id,
count: parseInt(count)
});
});
// Validation failed
if (hasError) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "Missing Count",
text: "Please enter number of trees for all selected decisions!",
});
// optional highlight
$(emptyField).addClass("border-danger");
setTimeout(() => {
$(emptyField).removeClass("border-danger");
}, 2000);
return; // stop further processing
}
// If selected is empty – user selected nothing
if (selected.length === 0) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "No Decision Selected",
text: "Please select at least one committee decision!",
});
return;
}
let sumCounts = selected.reduce((sum, item) => sum + item.count, 0);
if (sumCounts !== finalTotalTrees) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "warning",
title: "Count Mismatch",
text: `Total entered trees (${sumCounts}) must equal total trees (${finalTotalTrees}).`
});
return;
}
console.log("Final Submit:",
"Ref ID:", refId,
"meetingid:", meetingid,
"userId:", userId,
"Selected decisions:", selected,
"Remarks:", remarks
);
// 4️ Example AJAX send
$.ajax({
url: '/gcc/api/greencommittee/pendinglist/savecommittee',
method: 'POST',
contentType: 'application/json',
data: JSON.stringify({
ref_id: refId,
decisions: selected,
remarks: remarks,
userId: userId,
meetingid: meetingid
}),
success: function (res) {
$submitBtn.prop('disabled', false).text('Save');
if (res.status === "success") {
Swal.fire({
icon: 'success',
title: 'Success',
text: res.message,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showConfirmButton: true,
}).then((result) => {
if (result.isConfirmed) {
$("#viewModal").modal("hide");
console.log("ok button");
fetchgreenCommitteeList();
}
});
} else {
// If backend sent error response
Swal.fire({
icon: "error",
title: "Save Failed",
text: res.message || "Something went wrong.",
});
}
},
error: function (xhr) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "error",
title: "Error Occurred",
text: "Failed to save committee details. Please try again.",
});
console.error("Error in saving details:", xhr.responseText);
}
});
$.ajax({
url: '/gcc/api/greencommittee/pendinglist/savecommittee',
method: 'POST',
contentType: 'application/json',
data: JSON.stringify({
ref_id: refId,
decisions: selected,
remarks: remarks,
userId: userId,
meetingid: meetingid
}),
success: function (res) {
$submitBtn.prop('disabled', false).text('Save');
if (res.status === "success") {
Swal.fire({
icon: 'success',
title: 'Success',
text: res.message,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showConfirmButton: true,
}).then((result) => {
if (result.isConfirmed) {
$("#viewModal").modal("hide");
console.log("ok button");
fetchgreenCommitteeList();
}
});
} else {
// If backend sent error response
Swal.fire({
icon: "error",
title: "Save Failed",
text: res.message || "Something went wrong.",
});
}
},
error: function (xhr) {
$submitBtn.prop('disabled', false).text('Save');
Swal.fire({
icon: "error",
title: "Error Occurred",
text: "Failed to save committee details. Please try again.",
});
console.error("Error in saving details:", xhr.responseText);
}
});
});
@ -445,7 +459,7 @@
remarks: remarks,
userId: userId
}),
success: function(res) {
success: function (res) {
$submitBtn.prop("disabled", false).text("Save");
if (res.status === "success") {
@ -466,7 +480,7 @@
});
}
},
error: function(xhr) {
error: function (xhr) {
$submitBtn.prop("disabled", false).text("Save");
Swal.fire({
@ -487,7 +501,7 @@
let inspections = details.inspections;
let reinspections = details.reinspections;
// Conditional fields for Petitioner section
// Conditional fields for Petitioner section
let petitionerHtml = "";
if (app.cby === "public") {
@ -565,8 +579,62 @@
// Inspection Cards
let inspCards = inspections.map(ins => {
// Pending card
if (ins.status === "PENDING") {
return `
<div class="col-md-4">
<div class="card mb-3 shadow-sm">
<div class="card-header text-white text-center" style="background:#404e67">
<strong>${ins.inspection_by}</strong>
</div>
<div class="card-body text-center">
<h5 class="text-warning">
<i class="fa fa-clock-o"></i> Pending
</h5>
<p class="text-muted mb-0">
Inspection is yet to be completed.
</p>
</div>
</div>
</div>
`;
}
// Completed card
let recChips = (ins.recommendations || []).map(r =>
`<span class="badge badge-warning mr-1 mb-2">
${r.name}: ${r.count} (${r.treename})
</span>`
).join("");
let inspThumbs = (ins.images || []).map(i =>
`<img src="${i}" class="img-thumbnail thumb-img mb-1"
onclick="openFullImage('${i}')">`
).join("");
return `
<div class="col-md-4">
<div class="card mb-3 shadow-sm">
<div class="card-header text-white text-center" style="background:#404e67">
<strong>${ins.inspection_by}</strong>
</div>
<div class="card-body">
<p><strong>Inspector:</strong> ${ins.inspector_name}</p>
<p><strong>Date:</strong> ${ins.f_Cdate}</p>
<p><strong>Remarks:</strong> ${ins.remarks}</p>
<p><strong>Recommendation:</strong><br>${recChips}</p>
<p><strong>Images (${ins.images.length}):</strong><br>${inspThumbs}</p>
</div>
</div>
</div>
`;
}).join("");
/*let inspCards = inspections.map(ins => {
let recChips = ins.recommendations.map(r =>
`<span class="badge badge-warning mr-1">${r.name}: ${r.count}</span>`
`<span class="badge badge-warning mr-1 mb-2">${r.name}: ${r.count} (${r.treename})</span>`
).join("");
let inspThumbs = ins.images.map(i =>
@ -591,7 +659,7 @@
</div>
</div>
`;
}).join("");
}).join("");*/
let content = `
<h5>Application Information</h5>
@ -668,9 +736,9 @@
function fetchgreenCommitteeList(){
function fetchgreenCommitteeList() {
const selectedOption = $('#dropdownevent option:selected').text();
const selectedOption = $('#dropdownevent option:selected').text();
// Assuming the format is: "Event Name - yyyy-mm-dd"
const eventDateRaw = selectedOption.split(' - ')[1];
@ -690,19 +758,19 @@
const formattedDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
// Read zone dropdown value
// Read zone dropdown value
let selectedZone = $('#zonedropdown').val();
$('#pageLoader').show();
$.ajax({
url: '/gcc/api/greencommittee/pendinglist/getgreencommitteelist',
data: { date: formattedDate,zones:selectedZone },
data: { date: formattedDate, zones: selectedZone },
method: 'GET',
contentType: 'application/json',
success: function (data) {
$('#pageLoader').hide();
$('#pageLoader').hide();
let tableContainer = $('#RequestListDatatable');
// Destroy any existing DataTable instance
@ -710,7 +778,7 @@
tableContainer.DataTable().destroy();
}
// Initialize DataTable
// Initialize DataTable
tableContainer.DataTable({
destroy: true,
searching: true,
@ -783,14 +851,14 @@
{ extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
],
columnDefs: [
{ width: "150px", targets: 7 },
{width: "350px", targets: 8}
],
{ width: "150px", targets: 7 },
{ width: "350px", targets: 8 }
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
scrollY: '80vh',
scrollX: true,
@ -815,7 +883,7 @@
loadCommitteeDecisions();
$('#viewModalLabel').text(`Apploication Details - ${id}`);
$('#viewModalLabel').text(`Application Details - ${id}`);
$('#viewModal').modal('show');
},
error: function (xhr) {
@ -827,7 +895,7 @@
},
error: function (xhr, status, error) {
$('#pageLoader').hide();
$('#pageLoader').hide();
console.error("Error fetching data:", error);
alert("Failed to load green committe list.");
}
@ -839,7 +907,7 @@
$.ajax({
url: "/gcc/api/greencommittee/pendinglist/getCommitteeActions", // your API endpoint
method: "GET",
success: function(list) {
success: function (list) {
let html = "";
@ -945,11 +1013,11 @@
data.forEach(function (res) {
zoneDropdown.append(
$('<option></option>')
.val(res.zone_name)
.text(`${res.zone_name}`)
);
zoneDropdown.append(
$('<option></option>')
.val(res.zone_name)
.text(`${res.zone_name}`)
);
});
},
@ -1003,6 +1071,7 @@
});
</script>
</body>
</script>
</body>
</html>

403
src/main/resources/templates/modules/greencommittee/reports.html

@ -1,143 +1,167 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<style>
</style>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="far fa-calendar-plus bg-blue"></i>
<div class="d-inline">
<h5>Reports</h5>
<span>Green Committee</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i
class="ik ik-home"></i></a></li>
<li class="breadcrumb-item" aria-current="page">Green Committee</li>
<li class="breadcrumb-item active" aria-current="page">Reports</li>
</ol>
</nav>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="card" style="margin-top: 0px;"><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span>
<div class="card-block">
<div class="row">
<div class="form-group col-sm-8">
<label for="dropdownevent">Select Meeting
</label>
<select id="dropdownevent" class="form-control">
</select>
</div>
<div class="form-group col-sm-4">
<label for="zonedropdown">Select Zone
</label>
<select id="zonedropdown" class="form-control">
<option value="">Select Zone </option>
</select>
</div>
</div>
<div class="page-header-title" >
<h5 style="margin: 0;font-weight: bold;">Green Committee Reports</h5><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><hr>
</div>
<div>
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center" rowspan="2">S.No</th>
<th class="text-center" rowspan="2">Application No</th>
<th class="text-center" rowspan="2">Name</th>
<th class="text-center" rowspan="2">Address</th>
<th class="text-center" rowspan="2">Reason</th>
<th class="text-center" rowspan="2">No of trees</th>
<th class="text-center" colspan="3">Inspected</th>
<th class="text-center" rowspan="2">Committee Decision</th>
</tr>
<tr>
<th class="text-center">TNFD</th>
<th class="text-center">GCC</th>
<th class="text-center">NGO</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="far fa-calendar-plus bg-blue"></i>
<div class="d-inline">
<h5>Reports</h5>
<span>Green Committee</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Green Committee</li>
<li class="breadcrumb-item active" aria-current="page">Reports</li>
</ol>
</nav>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="card" style="margin-top: 0px;"><span th:text="${LoginUserId}" id="userIdSpan"
style="display: none;"></span>
<div class="card-block">
<div class="row">
<div class="form-group col-sm-8">
<label for="dropdownevent">Select Meeting
</label>
<select id="dropdownevent" class="form-control">
</select>
</div>
<div class="form-group col-sm-4">
<label for="zonedropdown">Select Zone
</label>
<select id="zonedropdown" class="form-control">
<option value="">Select Zone </option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="applicationType">Application Type</label>
<select id="applicationType" class="form-control">
<option value="">Select Application Type</option>
<option value="Department">Department</option>
<option value="Public">Public</option>
</select>
</div>
<div class="form-group col-sm-4" id="departmentdropdownDiv">
<label for="departmentdropdown">Select Department</label>
<select id="departmentdropdown" class="form-control">
<option value="">Select All</option>
</select>
</div>
</div>
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;">Green Committee Reports</h5><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span>
<hr>
</div>
<div>
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center" rowspan="2">S.No</th>
<th class="text-center" rowspan="2">Application No</th>
<th class="text-center" rowspan="2">Department Name</th>
<th class="text-center" rowspan="2">Name</th>
<th class="text-center" rowspan="2">Address</th>
<th class="text-center" rowspan="2">Reason</th>
<th class="text-center" rowspan="2">No of trees</th>
<th class="text-center" colspan="3">Inspected</th>
<th class="text-center" rowspan="2">Committee Decision</th>
</tr>
<tr>
<th class="text-center">TNFD</th>
<th class="text-center">GCC</th>
<th class="text-center">NGO</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<div id="pageLoader"
style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function() {
var table = $('#RequestListDatatable').DataTable({
$(document).ready(function () {
var table = $('#RequestListDatatable').DataTable({
dom: 'Bftip',
columnDefs: [
{ width: "150px", targets: 3 },
{width: "350px", targets: 4}
],
{ width: "150px", targets: 3 },
{ width: "350px", targets: 4 }
],
lengthMenu: [
[200, 400, -1],
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
scrollY: '50vh',
@ -182,31 +206,66 @@
});
fetchEventDropdown();
fetchZones();
fetchgreenCommitteeList();
fetchEventDropdown();
fetchZones();
loadDepartments();
fetchgreenCommitteeList();
$('#dropdownevent').on('change', function () {
$('#dropdownevent').on('change', function () {
$('#zonedropdown').val("");
$('#zonedropdown').val("");
fetchgreenCommitteeList();
});
function loadDepartments() {
$.ajax({
url: "/gcc/api/greencommittee/report/getDepartments",
type: "GET",
success: function (data) {
$("#departmentdropdown").empty();
$("#departmentdropdown").append('<option value="">Select All</option>');
$.each(data, function (i, dept) {
$("#departmentdropdown").append(
'<option value="' + dept.id + '">' +
dept.name +
'</option>'
);
});
}
});
}
$('#departmentdropdown').on('change', function () {
fetchgreenCommitteeList();
});
$('#zonedropdown').on('change', function () {
let miss_meet=$('#dropdownevent').val();
$('#zonedropdown').on('change', function () {
let miss_meet = $('#dropdownevent').val();
if(!miss_meet){
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
fetchgreenCommitteeList();
if (!miss_meet) {
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
fetchgreenCommitteeList();
});
});
$('#applicationType').on('change', function () {
if ($('#applicationType').val() == "Public") {
$('#departmentdropdown').val("");
$('#departmentdropdownDiv').hide();
} else {
$('#departmentdropdownDiv').show();
}
fetchgreenCommitteeList();
});
function fetchZones() {
@ -221,11 +280,11 @@
data.forEach(function (res) {
zoneDropdown.append(
$('<option></option>')
.val(res.zone_name)
.text(`${res.zone_name}`)
);
zoneDropdown.append(
$('<option></option>')
.val(res.zone_name)
.text(`${res.zone_name}`)
);
});
},
@ -263,34 +322,39 @@
});
}
function fetchgreenCommitteeList(){
function fetchgreenCommitteeList() {
let selectedevent = $('#dropdownevent').val();
let selectedappType = $('#applicationType').val();
let selectedevent = $('#dropdownevent').val();
let selecteddepartment = $('#departmentdropdown').val();
console.log("selecteddepartment=" + selecteddepartment);
// Read zone dropdown value
// Read zone dropdown value
let selectedZone = $('#zonedropdown').val();
console.log("selectedevent="+selectedevent+"AND selectedZone"+selectedZone);
console.log("selectedevent=" + selectedevent + "AND selectedZone" + selectedZone);
$('#pageLoader').show();
$.ajax({
$.ajax({
url: '/gcc/api/greencommittee/report/getgreencommitteelist',
data: { meetingid: selectedevent,zones:selectedZone },
data: { meetingid: selectedevent, zones: selectedZone, deptid: selecteddepartment, appType: selectedappType },
method: 'GET',
contentType: 'application/json',
success: function (data) {
console.log(data);
$('#pageLoader').hide();
$('#pageLoader').hide();
let tableContainer = $('#RequestListDatatable');
let tableContainer = $('#RequestListDatatable');
// Destroy any existing DataTable instance
if ($.fn.DataTable.isDataTable(tableContainer)) {
tableContainer.DataTable().destroy();
}
// Initialize DataTable
// Initialize DataTable
tableContainer.DataTable({
destroy: true,
searching: true,
@ -306,13 +370,21 @@
},
{ data: 'ref_id', className: 'text-center' },
{
data: null,className: 'text-center',
data: 'department_name',
className: 'text-center',
render: function (data) {
return (data === null || data === undefined || data.trim() === '') ? '-' : data;
}
},
// { data: 'department_name', className: 'text-center' },
{
data: null, className: 'text-center',
render: d => d.p_name && d.p_name.trim() !== '' ? d.p_name : d.dept_name || '-'
},
{ data: 'address',className: 'text-center' },
{ data: 'address', className: 'text-center' },
// Reason
{ data: 'remarks',className: 'text-center' },
{ data: 'remarks', className: 'text-center' },
// No of trees
{ data: 'total_trees', className: 'text-center' },
@ -380,18 +452,20 @@
],
columnDefs: [
{ width: "150px", targets: 3 },
{width: "350px", targets: 4},
{ width: "120px", targets: 6 },
{ width: "120px", targets: 7 },
{ width: "120px", targets: 8 },
{ width: "120px", targets: 9 }
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
{ width: "150px", targets: 3 },
{ width: "150px", targets: 4 },
{ width: "350px", targets: 5 },
{ width: "120px", targets: 6 },
{ width: "120px", targets: 7 },
{ width: "120px", targets: 8 },
{ width: "120px", targets: 9 }
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
scrollY: '80vh',
scrollX: true,
@ -401,7 +475,7 @@
},
error: function (xhr, status, error) {
$('#pageLoader').hide();
$('#pageLoader').hide();
console.error("Error fetching data:", error);
alert("Failed to load green committe list.");
}
@ -434,7 +508,7 @@
// Case 2: committee empty → reinspections details
if ((!row.committee || Object.keys(row.committee).length === 0) && Array.isArray(row.reinspections)
&& row.reinspections.length > 0) {
&& row.reinspections.length > 0) {
let r = row.reinspections[0];
return `
${r.event_name}<br>
@ -480,6 +554,7 @@
</script>
</body>
</script>
</body>
</html>

1136
src/main/resources/templates/modules/greencommittee/treepruningreports.html
File diff suppressed because it is too large
View File

576
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
src/main/resources/templates/modules/homelesssurvey/homelesslist.html
File diff suppressed because it is too large
View File

576
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
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
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
src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html
File diff suppressed because it is too large
View File

576
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
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
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
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
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
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
src/main/resources/templates/modules/homelesssurvey/surveyorlist.html
File diff suppressed because it is too large
View File

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

576
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>

2427
src/main/resources/templates/modules/roadwar/regform.html
File diff suppressed because it is too large
View File

3543
src/main/resources/templates/modules/roadwar/updateform.html
File diff suppressed because it is too large
View File

764
src/main/resources/templates/modules/vendors/certificate.html

@ -0,0 +1,764 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<style>
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px) {
#requestlistform label {
margin-top: 10px;
}
}
#viewModal .modal-body {
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
}
.custom-doc-btn {
height: 20px;
width: 80px;
font-size: 9px;
font-weight: bold;
text-align: center;
padding: 0px;
border: 1px solid grey;
}
.col-md-3 {
padding-bottom: 10px;
}
.comment {
margin-bottom: 20px;
}
.comment p {
margin: 0;
}
hr {
border: 1px solid #ccc;
}
.comment {
padding: 10px 0;
}
.comment .text-muted {
font-size: 0.9em;
color: #6c757d;
}
.comment hr {
border-top: 1px solid #ccc;
}
</style>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="fa fa-list-alt bg-blue"></i>
<div class="d-inline">
<h5>Vending Certificate</h5>
<span>Vending Committe</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i
class="ik ik-home"></i></a></li>
<li class="breadcrumb-item" aria-current="page">Vending Committe</li>
<li class="breadcrumb-item active" aria-current="page">Vending Certificate</li>
</ol>
</nav>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<span style="font-size: medium;font-weight: bold;"> Filters</span><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><span
th:text="${zone}" id="userzone" style="display: none;"></span>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4 mb-1">
<label for="meetingdropdown" style="font-size: medium;">Meeting:</label>
<select id="meetingdropdown" class="form-control">
<option value="">Select an Meeting</option>
</select>
</div>
<div class="col-md-3 mb-1">
<label for="zonedropdown" style="font-size: medium;">Zone:</label>
<select id="zonedropdown" class="form-control">
<option value="">Select an Zone</option>
</select>
</div>
<div class="col-md-3 mb-1">
<label for="warddropdown" style="font-size: medium;">Ward:</label>
<select id="warddropdown" class="form-control">
<option value="">Select an Ward</option>
</select>
</div>
</div>
<div class="row mt-4">
<div class="col-12 d-flex justify-content-center">
<button class="btn btn-primary" id="submitBtn">Submit</button>
<button class="btn btn-danger mx-2" id="resetBtn" name="reset"
type="reset">Reset</button>
</div>
</div>
</div>
<div class="card-block">
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;">Vendors(ID card) Approved List</h5>
<hr>
</div>
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable" role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center">S.No</th>
<th class="text-center">Request No</th>
<th class="text-center">Zone</th>
<th class="text-center">Ward</th>
<th class="text-center">Public Name</th>
<th class="text-center">Mobile</th>
<th class="text-center">ID Status</th>
<th class="text-center no-sort" width="%2">View Details</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-hidden="true"
data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="viewModalLabel">Request Details</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="modalBodyContent">
<!-- Dynamic content loads here -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Image Modal -->
<div class="modal fade" id="docModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg">
<div class="modal-content border-0">
<div class="modal-body p-0 text-center" style="background-color: #f8f9fa;">
<div id="docContainer" style="max-height: 90vh; overflow: auto;"></div>
</div>
</div>
</div>
</div>
<div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
let userzone = document.getElementById('userzone').textContent;
let userId = document.getElementById('userIdSpan').textContent;
// GLOBAL scope — must be outside any other function
function openDocModal(fileUrl) {
const container = document.getElementById('docContainer');
const ext = fileUrl.split('.').pop().toLowerCase();
if (ext === 'pdf') {
container.innerHTML = `<iframe src="${fileUrl}" style="width:100%; height:90vh;" frameborder="0"></iframe>`;
} else {
container.innerHTML = `<img src="${fileUrl}" class="img-fluid" style="max-height:90vh; max-width:100%;" onerror="this.src='/default.jpg'">`;
}
$('#docModal').modal('show');
}
$(document).ready(function () {
var table = $('#RequestListDatatable').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',
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn'
}
],
fixedHeader: false,
autoWidth: true,
responsive: true,
searching: false,
select: false,
processing: false
});
fetchEventDropdown(userId);
let zoneString = userzone; // e.g. "01,02,03,04,05"
if (zoneString) {
let zoneArray = zoneString.split(","); // ["01","02","03","04","05"]
zoneArray.forEach(z => {
$("#zonedropdown").append(
`<option value="${z}">${z}</option>`
);
});
}
$('#zonedropdown').on('change', function () {
let selectedZone = $(this).val();
// Reset ward dropdown
$('#warddropdown').html(`<option value="">Select Ward</option>`);
if (selectedZone) {
fetchWardDropdown(selectedZone);
}
});
fetchVendingCommitteeList("", "Approved", "", "", userId)
});
function fetchWardDropdown(zone) {
$.ajax({
url: "/gcc/api/streetvendor/getwardbyzone",
type: "GET",
data: { zone: zone },
success: function (data) {
if (!data || data.length === 0) {
$('#warddropdown').html(`<option value="">No wards found</option>`);
return;
}
// Clear before loading
$('#warddropdown').html(`<option value="">Select Ward</option>`);
// Append wards
data.forEach(w => {
// backend returns ward_name
$('#warddropdown').append(
`<option value="${w.ward_name}">${w.ward_name}</option>`
);
});
},
error: function (xhr) {
console.error("Error fetching wards:", xhr.responseText);
$('#warddropdown').html(`<option value="">Error loading wards</option>`);
}
});
}
$('#resetBtn').on('click', function () {
location.reload();
return;
});
$('#submitBtn').on('click', function () {
const meeting = $('#meetingdropdown').val();
const status = "Approved";
const zone = $('#zonedropdown').val();
const ward = $('#warddropdown').val();
console.log("Selected Meeting Value:", meeting);
console.log("Selected Status Value:", status);
console.log("Selected zone Value:", zone);
console.log("Selected ward Value:", ward);
// 👉 Now call your API or next function using these two
fetchVendingCommitteeList(meeting, status, zone, ward, userId);
});
function fetchVendingCommitteeList(event_req_id, status, zone, ward) {
$('#pageLoader').show();
$.ajax({
url: '/gcc/api/vending/getreports',
data: { meeting: event_req_id, status: status, zone: zone, ward: ward, userId: userId },
method: 'GET',
contentType: 'application/json',
success: function (data) {
$('#pageLoader').hide();
let tableContainer = $('#RequestListDatatable');
// Destroy any existing DataTable instance
if ($.fn.DataTable.isDataTable(tableContainer)) {
tableContainer.DataTable().destroy();
}
// Check for empty list
/* if (!data || data.length === 0) {
tableContainer.find('tbody').html(`
<tr>
<td colspan="8" class="text-center text-danger">No Data Available</td>
</tr>
`);
return;
} */
// Initialize DataTable
tableContainer.DataTable({
destroy: true,
searching: true,
autoWidth: false,
paging: true,
info: true,
data: data,
columns: [
{
data: null,
render: (data, type, row, meta) => meta.row + 1,
className: 'text-center'
},
{ data: 'vendor_req_id', defaultContent: '-', className: 'text-center' },
{ data: 'zone', defaultContent: '-', className: 'text-center' },
{ data: 'ward', defaultContent: '-', className: 'text-center' },
{ data: 'name', defaultContent: '-', className: 'text-center' },
{ data: 'mob_no', defaultContent: '-', className: 'text-center' },
{
data: 'status',
defaultContent: '-',
className: 'text-center',
createdCell: function (td, cellData, rowData, row, col) {
if (cellData === 'Approved') {
$(td).css('color', 'green').css('font-weight', 'bold');
} else if (cellData === 'Rejected') {
$(td).css('color', 'red').css('font-weight', 'bold');
}
else {
$(td).css('color', 'orange').css('font-weight', 'bold');
}
}
},
{
data: 'id',
render: function (data, type, row) {
return `<button class="btn btn-primary btn-sm btn-view" data-id="${data}">View</button>`;
},
className: 'text-center'
}
],
dom: 'Bfrtip',
buttons: [
{ extend: 'pageLength', className: 'btn btn-warning' },
{ extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
{ extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
{ extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
{ extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
],
columnDefs: [{ targets: 'no-sort', orderable: false }],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '80vh',
scrollX: true,
responsive: false
});
// Bind view buttons
tableContainer.off('click', '.btn-view');
tableContainer.on('click', '.btn-view', function () {
let id = $(this).data('id');
$.ajax({
url: `/gcc/api/vending/finalvendorDetailsById?requestId=${id}`,
method: 'GET',
success: function (detailData) {
if (!detailData || detailData.length === 0) {
$('#modalBodyContent').html("<p>No data found for this request.</p>");
$('#viewModal').modal('show');
return;
}
const details = detailData[0];
const historyList = detailData.map(h => ({
date: h.vc_Inspection_date || "N/A",
status: h.vc_status || "N/A",
remarks: h.vc_remarks || "",
event: h.event_name || "-"
}));
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-';
const pmLoanDisplay = details.pm_svanidhi_loan ? (details.pm_svanidhi_loan ? 'Yes' : 'No') : '-';
const bankAccDisplay = details.bank_acc_status ? (details.bank_acc_status === '1' ? 'Yes' : 'No') : '-';
const idCardDisplay = details.vendor_id_card ? (details.vendor_id_card === '1' ? 'Yes' : 'No') : '-';
const bankPassbookDisplay = details.bank_acc_status === '1' && details.bank_passbook
? `<img src="${details.bank_passbook}" alt="Bank Passbook" class="img-fluid" style="max-width: 150px;" onerror="this.src='/default.jpg'">`
: '-';
const aadharFrontBtn = details.aadhar_front_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.aadhar_front_photo}')">View</button>` : '-';
const rationCardBtn = details.ration_card_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.ration_card_photo}')">View</button>` : '-';
const aadharBackBtn = details.aadhar_back_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.aadhar_back_photo}')">View</button>` : '-';
const bankPassbookBtn = details.bank_acc_status === '1' && details.bank_passbook
? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.bank_passbook}')">View</button>`
: '-';
const spacePhotoBtn = details.vendor_space_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.vendor_space_photo}')">View</button>` : '-';
let historyHtml = "";
historyList.forEach(h => {
historyHtml += `
<div class="comment mb-4">
<div class="row">
<div class="col-4 text-center">
<p class="text-muted"><strong>${h.date}</strong></p>
</div>
<div class="col-8">
<p><strong>Vending Committee ${h.status} (${h.event})</strong></p>
<p><strong>Remarks: </strong>${h.remarks}</p>
</div>
</div>
</div>`;
});
const content = `
<div class="container-fluid">
<!-- Personal Details -->
<div class="card mb-3">
<div class="card-header bg-primary text-white">Personal Details</div>
<div class="card-body row">
<div class="col-md-3"><strong>Name:</strong></div>
<div class="col-md-3">${details.name || '-'}</div>
<div class="col-md-3"><strong>Father/Husband Name:</strong></div>
<div class="col-md-3">${details.f_h_name || '-'}</div>
<div class="col-md-3"><strong>Mobile:</strong></div>
<div class="col-md-3">${details.mob_no || '-'}</div>
<div class="col-md-3"><strong>Community Category:</strong></div>
<div class="col-md-3">${details.category_name || '-'}</div>
<div class="col-md-3"><strong>DOB:</strong></div>
<div class="col-md-3">${details.dob || '-'}</div>
<div class="col-md-3"><strong>Address:</strong></div>
<div class="col-md-3">${details.residental_address || '-'}</div>
<div class="col-md-3"><strong>Gender:</strong></div>
<div class="col-md-3">${details.gender || '-'}</div>
<div class="col-md-3"><strong>Differently Abled:</strong></div>
<div class="col-md-3">${diffAbledDisplay || '-'}</div>
<div class="col-md-3"><strong>Aadhaar front Image:</strong></div>
<div class="col-md-3">${aadharFrontBtn}</div>
<div class="col-md-3"><strong>Ration card Image:</strong></div>
<div class="col-md-3">${rationCardBtn}</div>
<div class="col-md-3"><strong>Aadhaar back Image:</strong></div>
<div class="col-md-3">${aadharBackBtn}</div>
</div>
</div>
<!-- Business Details -->
<div class="card mb-3">
<div class="card-header bg-success text-white">Business Details</div>
<div class="card-body row">
<div class="col-md-3"><strong>Type of Business:</strong></div>
<div class="col-md-3">${details.vending_category_name || '-'}</div>
<div class="col-md-3"><strong>Zone:</strong></div>
<div class="col-md-3">${details.zone || '-'}</div>
<div class="col-md-3"><strong>Business Space (sq.ft):</strong></div>
<div class="col-md-3">${details.vending_space || '-'}</div>
<div class="col-md-3"><strong>Ward:</strong></div>
<div class="col-md-3">${details.ward || '-'}</div>
<div class="col-md-3"><strong>Address:</strong></div>
<div class="col-md-3">${details.business_address || '-'}</div>
<div class="col-md-3"><strong>PM SVANidhi Loan Availed:</strong></div>
<div class="col-md-3">${pmLoanDisplay || '-'}</div>
<div class="col-md-3"><strong>Do you Have Bank Account?:</strong></div>
<div class="col-md-3">${bankAccDisplay || '-'}</div>
<div class="col-md-3"><strong>Bank Passbook Image:</strong></div>
<div class="col-md-3">${bankPassbookBtn}</div>
</div>
</div>
<!-- Inspection Details -->
<div class="card mb-3">
<div class="card-header bg-warning text-white">Inspection Details</div>
<div class="card-body row">
<div class="col-md-3"><strong>Vendor Type:</strong></div>
<div class="col-md-3">${details.vendor_type || '-'}</div>
<div class="col-md-3"><strong>Vendor ID Card:</strong></div>
<div class="col-md-3">${idCardDisplay}</div>
<div class="col-md-3"><strong>Vending Nature:</strong></div>
<div class="col-md-3">${details.vending_nature || '-'}</div>
<div class="col-md-3"><strong>Vending Time:</strong></div>
<div class="col-md-3">${details.vending_time || '-'}</div>
<div class="col-md-3"><strong>Transaction Mode:</strong></div>
<div class="col-md-3">${details.transaction_mode || '-'}</div>
<div class="col-md-3"><strong>Swanidi Loan Amount:</strong></div>
<div class="col-md-3">${details.swanidi_loan_amount || '-'}</div>
<div class="col-md-3"><strong>Vendor Space Image:</strong></div>
<div class="col-md-3">${spacePhotoBtn || '-'}</div>
</div>
</div>
<!-- Request History -->
<div class="card mb-3">
<div class="card-header bg-info text-white">Request History</div>
<div class="card-body">
<div class="comment mb-4">
<div class="row">
<div class="col-4 text-center">
<p class="text-muted"><strong>${details.LI_Cdate || 'N/A'}</strong></p>
</div>
<div class="col-8">
<p><strong>LI Officer ${details.LI_Status || 'N/A'}</strong></p>
<p><strong>Remarks: </strong>${details.LI_Remarks || ''}</p>
</div>
</div>
</div>
<div class="comment mb-4">
<div class="row">
<div class="col-4 text-center">
<p class="text-muted"><strong>${details.ARO_Inspection_date || 'N/A'}</strong></p>
</div>
<div class="col-8">
<p><strong>ARO Officer ${details.ARO_status || 'N/A'}</strong></p>
<p><strong>Remarks: </strong>${details.ARO_remarks || ''}</p>
</div>
</div>
</div>
<div class="comment mb-4">
<div class="row">
<div class="col-4 text-center">
<p class="text-muted"><strong>${details.EE_Inspection_date || 'N/A'}</strong></p>
</div>
<div class="col-8">
<p><strong>EE Officer ${details.EE_status || 'N/A'}</strong></p>
<p><strong>Remarks: </strong>${details.EE_remarks || ''}</p>
</div>
</div>
</div>
${historyHtml}
</div>
</div>
</div>
`;
$('#modalBodyContent').html(content);
$('#viewModalLabel').text(`Vendor Details - ${id}`);
$('#viewModal').modal('show');
},
error: function (xhr) {
console.error("Error fetching detail:", xhr.responseText);
alert("Failed to fetch vendor details.");
}
});
});
},
error: function (xhr, status, error) {
$('#pageLoader').hide();
console.error("Error fetching data:", error);
alert("Failed to load vendor list.");
}
});
}
// Call this function on page load
function fetchEventDropdown(userId) {
$.ajax({
url: '/gcc/api/vending/committedropdown',
type: 'GET',
data: { userId: userId },
dataType: 'json',
success: function (data) {
let eventDropdown = $('#meetingdropdown');
eventDropdown.empty();
eventDropdown.append('<option value="">Select an Meeting</option>');
data.forEach(function (event) {
// Optional: filter active & not deleted
eventDropdown.append(
$('<option></option>')
.val(event.req_id)
.text(`${event.event_name} - ${event.formated_date}`)
);
});
},
error: function (xhr, status, error) {
console.error('Error fetching event dropdown:', error);
Swal.fire('Error', 'Unable to load events', 'error');
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save