66 changed files with 40815 additions and 1188 deletions
-
2.gitignore
-
244src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/APIController.java
-
38src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Controller/MainController.java
-
65src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkMasterService.java
-
456src/main/java/in/gov/chennaicorporation/gccoffice/bulkwaste/Service/BulkWasteService.java
-
245src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/WhatsappController.java
-
65src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/WhatsappqaqcMsgService.java
-
54src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java
-
45src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
11src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/Maincontroller.java
-
17src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/PendinglistApicontroller.java
-
60src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/ReportApicontroller.java
-
97src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
-
226src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/ReportService.java
-
815src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java
-
168src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java
-
4103src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java
-
57src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/Maincontroller.java
-
258src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/RegisterApiController.java
-
51src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/LoginMappingService.java
-
777src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/RegisterService.java
-
17src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/MainController.java
-
2src/main/resources/application.properties
-
3007src/main/resources/templates/modules/bulkwaste/requestdetails.html
-
15src/main/resources/templates/modules/callcenterqaqc/agentqaqccalls.html
-
5src/main/resources/templates/modules/childrensurvey/childlist.html
-
5src/main/resources/templates/modules/childrensurvey/nonchildlist.html
-
5src/main/resources/templates/modules/childrensurvey/surveylist.html
-
2src/main/resources/templates/modules/greencommittee/monitoring.html
-
95src/main/resources/templates/modules/greencommittee/pendinglist.html
-
91src/main/resources/templates/modules/greencommittee/reports.html
-
1136src/main/resources/templates/modules/greencommittee/treepruningreports.html
-
576src/main/resources/templates/modules/homelesssurvey/aadhar.html
-
576src/main/resources/templates/modules/homelesssurvey/bankpassbook.html
-
576src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html
-
576src/main/resources/templates/modules/homelesssurvey/caste.html
-
576src/main/resources/templates/modules/homelesssurvey/cminsurance.html
-
576src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html
-
576src/main/resources/templates/modules/homelesssurvey/communitynoreason.html
-
576src/main/resources/templates/modules/homelesssurvey/currentlyliving.html
-
576src/main/resources/templates/modules/homelesssurvey/disability.html
-
576src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html
-
576src/main/resources/templates/modules/homelesssurvey/discontinued.html
-
576src/main/resources/templates/modules/homelesssurvey/driver.html
-
576src/main/resources/templates/modules/homelesssurvey/education.html
-
576src/main/resources/templates/modules/homelesssurvey/employmenttype.html
-
576src/main/resources/templates/modules/homelesssurvey/gccshelter.html
-
576src/main/resources/templates/modules/homelesssurvey/gendermaster.html
-
576src/main/resources/templates/modules/homelesssurvey/healthcondition.html
-
2085src/main/resources/templates/modules/homelesssurvey/homelesslist.html
-
576src/main/resources/templates/modules/homelesssurvey/homelessreason.html
-
576src/main/resources/templates/modules/homelesssurvey/martial.html
-
576src/main/resources/templates/modules/homelesssurvey/movingreason.html
-
1007src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html
-
576src/main/resources/templates/modules/homelesssurvey/notemployed.html
-
576src/main/resources/templates/modules/homelesssurvey/occupation.html
-
576src/main/resources/templates/modules/homelesssurvey/relationtype.html
-
576src/main/resources/templates/modules/homelesssurvey/religion.html
-
576src/main/resources/templates/modules/homelesssurvey/sleepingspace.html
-
576src/main/resources/templates/modules/homelesssurvey/smart.html
-
1257src/main/resources/templates/modules/homelesssurvey/surveyorlist.html
-
1012src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html
-
576src/main/resources/templates/modules/homelesssurvey/voterid.html
-
2427src/main/resources/templates/modules/roadwar/regform.html
-
3543src/main/resources/templates/modules/roadwar/updateform.html
-
764src/main/resources/templates/modules/vendors/certificate.html
@ -0,0 +1,2 @@ |
|||
/target |
|||
hs_err_pid38028.log |
|||
@ -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 " |
|||
)); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -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"; |
|||
} |
|||
|
|||
} |
|||
@ -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); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -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"; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -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)); |
|||
} |
|||
|
|||
} |
|||
@ -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
File diff suppressed because it is too large
View File
@ -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"; |
|||
} |
|||
|
|||
} |
|||
@ -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); |
|||
} |
|||
|
|||
} |
|||
@ -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 ""; |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
3007
src/main/resources/templates/modules/bulkwaste/requestdetails.html
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1136
src/main/resources/templates/modules/greencommittee/treepruningreports.html
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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
File diff suppressed because it is too large
View File
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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
File diff suppressed because it is too large
View File
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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> |
|||
@ -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"> |
|||
× |
|||
</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
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
File diff suppressed because it is too large
View File
@ -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"> |
|||
× |
|||
</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
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
File diff suppressed because it is too large
View File
@ -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">×</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> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue