Browse Source

Clean and safe message template added

main
kanimozhi 8 months ago
parent
commit
d61a07540f
  1. 79
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/CreateEventAPIController.java
  2. 447
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vendor/service/createventService.java
  3. 25
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java
  4. 92
      gcc_officer_portal/src/main/resources/templates/modules/vendors/EventList.html
  5. 100
      gcc_officer_portal/src/main/resources/templates/modules/vendors/RequestList.html
  6. 329
      gcc_officer_portal/src/main/resources/templates/modules/vendors/streetVendorRequestForm.html

79
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/CreateEventAPIController.java

@ -38,8 +38,8 @@ public class CreateEventAPIController {
@Autowired @Autowired
private StreetVendorService StreetVendorService; private StreetVendorService StreetVendorService;
// @Autowired
// private Environment environment;
// @Autowired
// private Environment environment;
@PostMapping("/save") @PostMapping("/save")
public ResponseEntity<Map<String, Object>> saveEventWithFile( public ResponseEntity<Map<String, Object>> saveEventWithFile(
@ -76,7 +76,6 @@ public class CreateEventAPIController {
return ResponseEntity.badRequest().body(response); return ResponseEntity.badRequest().body(response);
} }
String eventFilePath = StreetVendorService.fileUpload(file, "event_file"); String eventFilePath = StreetVendorService.fileUpload(file, "event_file");
if (eventFilePath == null) { if (eventFilePath == null) {
@ -86,7 +85,6 @@ public class CreateEventAPIController {
return ResponseEntity.internalServerError().body(response); return ResponseEntity.internalServerError().body(response);
} }
String saveStatus = createventservices.insertEvent(eventName, eventDate, eventFilePath, cby); String saveStatus = createventservices.insertEvent(eventName, eventDate, eventFilePath, cby);
if (saveStatus == null || saveStatus.equalsIgnoreCase("error")) { if (saveStatus == null || saveStatus.equalsIgnoreCase("error")) {
@ -96,7 +94,6 @@ public class CreateEventAPIController {
return ResponseEntity.internalServerError().body(response); return ResponseEntity.internalServerError().body(response);
} }
response.put("status", true); response.put("status", true);
response.put("message", "success"); response.put("message", "success");
response.put("description", "Details saved successfully"); response.put("description", "Details saved successfully");
@ -112,37 +109,36 @@ public class CreateEventAPIController {
} }
} }
//save file and get path
// private String saveFile(MultipartFile file) throws IOException {
//
// String uploadDirectory = environment.getProperty("file.upload.directory");
//
// String folderName = environment.getProperty("vending.foldername");
//
// String fileName = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss")) + "_" + file.getOriginalFilename();
//
// String folderPath = uploadDirectory + "/" + folderName + "/";
//
//
// Path dirPath = Paths.get(folderPath);
// if (!Files.exists(dirPath)) {
// Files.createDirectories(dirPath);
// }
//
// Path filePath = dirPath.resolve(fileName);
//
// Files.write(filePath, file.getBytes());
//
// return filePath.toAbsolutePath().toString();
// }
// save file and get path
// private String saveFile(MultipartFile file) throws IOException {
//
// String uploadDirectory = environment.getProperty("file.upload.directory");
//
// String folderName = environment.getProperty("vending.foldername");
//
// String fileName =
// LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss")) +
// "_" + file.getOriginalFilename();
//
// String folderPath = uploadDirectory + "/" + folderName + "/";
//
//
// Path dirPath = Paths.get(folderPath);
// if (!Files.exists(dirPath)) {
// Files.createDirectories(dirPath);
// }
//
// Path filePath = dirPath.resolve(fileName);
//
// Files.write(filePath, file.getBytes());
//
// return filePath.toAbsolutePath().toString();
// }
@GetMapping("/dropdown-Event") @GetMapping("/dropdown-Event")
public ResponseEntity<List<Map<String, Object>>> ViewDropdownEvent() {
public ResponseEntity<List<Map<String, Object>>> ViewDropdownEvent(@RequestParam String userId) {
try { try {
List<Map<String, Object>> result = createventservices.ViewDropdownEvent();
List<Map<String, Object>> result = createventservices.ViewDropdownEvent(userId);
return ResponseEntity.ok(result); return ResponseEntity.ok(result);
} catch (Exception e) { } catch (Exception e) {
Map<String, Object> error = new HashMap<>(); Map<String, Object> error = new HashMap<>();
@ -153,11 +149,10 @@ public class CreateEventAPIController {
} }
} }
@GetMapping("/committedropdown") @GetMapping("/committedropdown")
public List<Map<String, Object>> ViewCommitteeDropdownEvent() {
public List<Map<String, Object>> ViewCommitteeDropdownEvent(@RequestParam String userId) {
return createventservices.ViewCommitteeDropdownEvent();
return createventservices.ViewCommitteeDropdownEvent(userId);
} }
@ -169,16 +164,17 @@ public class CreateEventAPIController {
@RequestParam(required = false) String ward, @RequestParam(required = false) String ward,
@RequestParam String userId) { @RequestParam String userId) {
List<Map<String, Object>> streetdb = StreetVendorService.getdataforreport(zone,ward); // BASE LIST
List<Map<String, Object>> vendingdb = createventservices.getdataforreport(meeting, status,userId); // FILTERED REQUEST LIST
List<Map<String, Object>> streetdb = StreetVendorService.getdataforreport(zone, ward); // BASE LIST
List<Map<String, Object>> vendingdb = createventservices.getdataforreport(meeting, status, userId); // FILTERED
// REQUEST
// LIST
// Convert vendingdb to map: vdid → vendor record // Convert vendingdb to map: vdid → vendor record
Map<Integer, Map<String, Object>> vendingMap = vendingdb.stream() Map<Integer, Map<String, Object>> vendingMap = vendingdb.stream()
.filter(m -> m.get("vdid") != null) .filter(m -> m.get("vdid") != null)
.collect(Collectors.toMap( .collect(Collectors.toMap(
m -> Integer.parseInt(m.get("vdid").toString()), m -> Integer.parseInt(m.get("vdid").toString()),
m -> m
));
m -> m));
List<Map<String, Object>> finalList = new ArrayList<>(); List<Map<String, Object>> finalList = new ArrayList<>();
@ -208,10 +204,9 @@ public class CreateEventAPIController {
} }
@GetMapping("/finalvendorDetailsById") @GetMapping("/finalvendorDetailsById")
public List<Map<String, Object>> finalvendorDetailsById(String requestId){
public List<Map<String, Object>> finalvendorDetailsById(String requestId) {
return createventservices.finalvendorDetailsById(requestId); return createventservices.finalvendorDetailsById(requestId);
} }
} }

447
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vendor/service/createventService.java

@ -29,7 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
@Service @Service
public class createventService { public class createventService {
private JdbcTemplate jdbcTemplate;
private JdbcTemplate jdbcTemplate;
@Autowired @Autowired
public void setDataSource(@Qualifier("mysqlVendingCommitteDataSource") DataSource dataSource) { public void setDataSource(@Qualifier("mysqlVendingCommitteDataSource") DataSource dataSource) {
@ -39,18 +39,20 @@ private JdbcTemplate jdbcTemplate;
@Autowired @Autowired
public StreetVendorService streetVendorService; public StreetVendorService streetVendorService;
// public boolean isFileExists(String originalFilename) {
// String sql = "SELECT COUNT(*) FROM create_event " +
// "WHERE file_url LIKE ?";
// String filenamePattern = "%" + originalFilename; // Match filename at the end of the path
// Integer count = jdbcTemplate.queryForObject(sql, Integer.class, filenamePattern);
// return count != null && count > 0;
// }
public String insertEvent(String eventName, LocalDate eventDate, String fileUrl,String cby) {
// public boolean isFileExists(String originalFilename) {
// String sql = "SELECT COUNT(*) FROM create_event " +
// "WHERE file_url LIKE ?";
// String filenamePattern = "%" + originalFilename; // Match filename at the end
// of the path
// Integer count = jdbcTemplate.queryForObject(sql, Integer.class,
// filenamePattern);
// return count != null && count > 0;
// }
public String insertEvent(String eventName, LocalDate eventDate, String fileUrl, String cby) {
String sql = "INSERT INTO create_event (event_name, event_date, file_url,cby) VALUES (?, ?, ?,?)"; String sql = "INSERT INTO create_event (event_name, event_date, file_url,cby) VALUES (?, ?, ?,?)";
try { try {
jdbcTemplate.update(sql, eventName, eventDate, fileUrl,cby);
jdbcTemplate.update(sql, eventName, eventDate, fileUrl, cby);
return "success"; return "success";
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
@ -59,18 +61,18 @@ private JdbcTemplate jdbcTemplate;
return "error"; return "error";
} }
//SELECT * FROM vendingcommitte.create_event
public List<Map<String, Object>> ViewDropdownEvent() {
String sql = "SELECT * FROM create_event WHERE isactive=1 AND isdelete=0";
return jdbcTemplate.queryForList(sql);
// SELECT * FROM vendingcommitte.create_event
public List<Map<String, Object>> ViewDropdownEvent(String userId) {
String sql = "SELECT * FROM create_event WHERE cby=? AND isactive=1 AND isdelete=0 ";
return jdbcTemplate.queryForList(sql, userId);
} }
public List<Map<String, Object>> ViewCommitteeDropdownEvent() {
public List<Map<String, Object>> ViewCommitteeDropdownEvent(String userId) {
String sql = "SELECT req_id,event_name,event_date,DATE_FORMAT(event_date, '%d-%m-%Y') as formated_date " String sql = "SELECT req_id,event_name,event_date,DATE_FORMAT(event_date, '%d-%m-%Y') as formated_date "
+ "FROM create_event " + "FROM create_event "
+ "WHERE isactive=1 AND isdelete=0";
+ "WHERE isactive=1 AND isdelete=0 AND cby=?";
try { try {
return jdbcTemplate.queryForList(sql);
return jdbcTemplate.queryForList(sql, userId);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); e.printStackTrace();
@ -96,16 +98,19 @@ private JdbcTemplate jdbcTemplate;
try { try {
/* ============================================================
/*
* ============================================================
* CHECK IF vendor is already inside vendor_postponed_list * CHECK IF vendor is already inside vendor_postponed_list
* ============================================================ */
* ============================================================
*/
String checkPostponedSQL = "SELECT * FROM vendor_postponed_list WHERE vdid=? AND isactive=1"; String checkPostponedSQL = "SELECT * FROM vendor_postponed_list WHERE vdid=? AND isactive=1";
List<Map<String, Object>> existingPostponed =
jdbcTemplate.queryForList(checkPostponedSQL, vendor_req_id);
List<Map<String, Object>> existingPostponed = jdbcTemplate.queryForList(checkPostponedSQL, vendor_req_id);
/* ============================================================
/*
* ============================================================
* BACKUP METHOD: insert into postponed_history_log * BACKUP METHOD: insert into postponed_history_log
* ============================================================ */
* ============================================================
*/
if (!existingPostponed.isEmpty()) { if (!existingPostponed.isEmpty()) {
String backupSQL = "INSERT INTO postponed_history_log " String backupSQL = "INSERT INTO postponed_history_log "
@ -116,9 +121,11 @@ private JdbcTemplate jdbcTemplate;
jdbcTemplate.update(backupSQL, vendor_req_id); jdbcTemplate.update(backupSQL, vendor_req_id);
} }
/* ============================================================
/*
* ============================================================
* CASE 1: POSTPONED * CASE 1: POSTPONED
* ============================================================ */
* ============================================================
*/
if ("Postponed".equalsIgnoreCase(status)) { if ("Postponed".equalsIgnoreCase(status)) {
if (existingPostponed.isEmpty()) { if (existingPostponed.isEmpty()) {
@ -145,9 +152,11 @@ private JdbcTemplate jdbcTemplate;
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
/* ============================================================
/*
* ============================================================
* CASE 2: APPROVED / REJECTED → Insert into vendor_request_list * CASE 2: APPROVED / REJECTED → Insert into vendor_request_list
* ============================================================ */
* ============================================================
*/
String insertRequestSQL = "INSERT INTO vendor_request_list " String insertRequestSQL = "INSERT INTO vendor_request_list "
+ "(vdid, status, remarks, event_req_id, cby) VALUES (?, ?, ?, ?, ?)"; + "(vdid, status, remarks, event_req_id, cby) VALUES (?, ?, ?, ?, ?)";
@ -166,9 +175,11 @@ private JdbcTemplate jdbcTemplate;
int generatedId = keyHolder.getKey().intValue(); int generatedId = keyHolder.getKey().intValue();
/* ============================================================
/*
* ============================================================
* Assign UID only for APPROVED * Assign UID only for APPROVED
* ============================================================ */
* ============================================================
*/
if ("Approved".equalsIgnoreCase(status)) { if ("Approved".equalsIgnoreCase(status)) {
String currentYear = java.time.Year.now().toString(); String currentYear = java.time.Year.now().toString();
String uid_no = zone + "_" + ward + "_" + currentYear + "_" + generatedId; String uid_no = zone + "_" + ward + "_" + currentYear + "_" + generatedId;
@ -176,9 +187,11 @@ private JdbcTemplate jdbcTemplate;
jdbcTemplate.update("UPDATE vendor_request_list SET uid_no=? WHERE id=?", uid_no, generatedId); jdbcTemplate.update("UPDATE vendor_request_list SET uid_no=? WHERE id=?", uid_no, generatedId);
} }
/* ============================================================
/*
* ============================================================
* If POSTPONED ENTRY already exists → update it (after backup) * If POSTPONED ENTRY already exists → update it (after backup)
* ============================================================ */
* ============================================================
*/
if (!existingPostponed.isEmpty()) { if (!existingPostponed.isEmpty()) {
String updSQL = "UPDATE vendor_postponed_list SET " String updSQL = "UPDATE vendor_postponed_list SET "
@ -188,9 +201,11 @@ private JdbcTemplate jdbcTemplate;
jdbcTemplate.update(updSQL, status, remarks, event_req_id, cby, vendor_req_id); jdbcTemplate.update(updSQL, status, remarks, event_req_id, cby, vendor_req_id);
} }
/* ============================================================
/*
* ============================================================
* Send WhatsApp notification * Send WhatsApp notification
* ============================================================ */
* ============================================================
*/
String result = sendWhatsappMsg(mob_no, status, vendor_req_number); String result = sendWhatsappMsg(mob_no, status, vendor_req_number);
response.put("status", "success"); response.put("status", "success");
@ -207,19 +222,22 @@ private JdbcTemplate jdbcTemplate;
} }
} }
private String sendWhatsappMsg(String mob_no, String status, String vendor_req_number) {
String urlString = "";
private String sendWhatsappMsg(String mob_no, String status,String vendor_req_number) {
String urlString="";
if("Approved".equals(status)) {
urlString="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+mob_no+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=You+are+recognized+as+a+roadside+vendor.+Registration+number%3A+"+vendor_req_number+".&isTemplate=true&footer=GCC+-+IT+Cell";
}
else {
urlString="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+mob_no+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+application+is+rejected+because+your+roadside+vendor+details+are+incorrect.+%0A%0ARegistration+Number%3A+"+vendor_req_number+".";
if ("Approved".equals(status)) {
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ mob_no
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=You+are+recognized+as+a+roadside+vendor.+Registration+number%3A+"
+ vendor_req_number + ".&isTemplate=true&footer=GCC+-+IT+Cell";
} else {
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ mob_no
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+application+is+rejected+because+your+roadside+vendor+details+are+incorrect.+%0A%0ARegistration+Number%3A+"
+ vendor_req_number + ".";
} }
String res=hitURL(urlString);
String res = hitURL(urlString);
return res; return res;
} }
@ -237,7 +255,7 @@ private JdbcTemplate jdbcTemplate;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
System.out.println("response="+response);
System.out.println("response=" + response);
return response; return response;
} }
@ -245,123 +263,131 @@ private JdbcTemplate jdbcTemplate;
String sql = "SELECT * " String sql = "SELECT * "
+ "FROM vendor_request_list " + "FROM vendor_request_list "
+ "WHERE event_req_id=? "; + "WHERE event_req_id=? ";
return jdbcTemplate.queryForList(sql,event_req_id);
return jdbcTemplate.queryForList(sql, event_req_id);
} }
public List<String> removeSavedVendorDetails() { public List<String> removeSavedVendorDetails() {
String sql="SELECT request_no FROM vendor_request_list";
return jdbcTemplate.queryForList(sql,String.class);
}
// @Transactional
// public ResponseEntity<Map<String, Object>> saveBulkVendorDetails(Map<String, Object> payload) {
//
// Map<String, Object> response = new HashMap<>();
//
// try {
//
// String status = payload.get("status").toString();
// String remarks = payload.get("remarks").toString();
// int eventReqId = Integer.parseInt(payload.get("event_req_id").toString());
// String cby = payload.get("cby").toString();
//
// List<Map<String, Object>> vendorList =
// (List<Map<String, Object>>) payload.get("vendorList");
//
// if (vendorList == null || vendorList.isEmpty()) {
// return ResponseEntity.badRequest()
// .body(Map.of("status", "Error", "message", "No vendor records provided"));
// }
//
// String insertSQL = "INSERT INTO vendor_request_list " +
// "(vdid, status, remarks, event_req_id, uid_no, cby) VALUES (?, ?, ?, ?, '', ?)";
//
// try {
// jdbcTemplate.batchUpdate(insertSQL, vendorList, vendorList.size(),
// (ps, vendor) -> {
// ps.setInt(1, Integer.parseInt(vendor.get("vendor_req_id").toString()));
// ps.setString(2, status);
// ps.setString(3, remarks);
// ps.setInt(4, eventReqId);
// ps.setString(5, cby);
// }
// );
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Batch insert failed: " + e.getMessage()));
// }
//
//
//
// List<Map<String, Object>> insertedIds;
// try {
// insertedIds = jdbcTemplate.queryForList(
// "SELECT id, vdid FROM vendor_request_list ORDER BY id DESC LIMIT ?",
// vendorList.size());
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Failed to fetch inserted IDs: " + e.getMessage()));
// }
//
//
// List<Object[]> updateParams = new ArrayList<>();
// int currentYear = java.time.Year.now().getValue();
//
// for (int i = 0; i < vendorList.size(); i++) {
//
// Map<String, Object> vendor = vendorList.get(i);
// Map<String, Object> inserted = insertedIds.get(i);
//
// int insertedId = (int) inserted.get("id");
// String zone = vendor.get("zone").toString();
// String ward = vendor.get("ward").toString();
//
// // Assign UID only if Approved
// if ("Approved".equalsIgnoreCase(status)) {
// String uidNo = zone + "_" + ward + "_" + currentYear + "_" + insertedId;
// updateParams.add(new Object[]{uidNo, insertedId});
// }
//
// // Send WhatsApp for Approved/Rejected
// try {
// if ("Approved".equalsIgnoreCase(status) || "Rejected".equalsIgnoreCase(status)) {
// sendWhatsappMsg(
// vendor.get("mob_no").toString(),
// status,
// vendor.get("vendor_req_number").toString()
// );
// }
// } catch (Exception e) {
// // WhatsApp failure should NOT stop DB operation
// e.printStackTrace();
// }
// }
//
// if (!updateParams.isEmpty()) {
// try {
// jdbcTemplate.batchUpdate("UPDATE vendor_request_list SET uid_no=? WHERE id=?", updateParams);
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Failed to update UID numbers: " + e.getMessage()));
// }
// }
//
// response.put("status", "success");
// response.put("message", "Details submitted successfully!");
//
// return ResponseEntity.ok(response);
//
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Unexpected error: " + e.getMessage()));
// }
// }
String sql = "SELECT request_no FROM vendor_request_list";
return jdbcTemplate.queryForList(sql, String.class);
}
// @Transactional
// public ResponseEntity<Map<String, Object>> saveBulkVendorDetails(Map<String,
// Object> payload) {
//
// Map<String, Object> response = new HashMap<>();
//
// try {
//
// String status = payload.get("status").toString();
// String remarks = payload.get("remarks").toString();
// int eventReqId = Integer.parseInt(payload.get("event_req_id").toString());
// String cby = payload.get("cby").toString();
//
// List<Map<String, Object>> vendorList =
// (List<Map<String, Object>>) payload.get("vendorList");
//
// if (vendorList == null || vendorList.isEmpty()) {
// return ResponseEntity.badRequest()
// .body(Map.of("status", "Error", "message", "No vendor records provided"));
// }
//
// String insertSQL = "INSERT INTO vendor_request_list " +
// "(vdid, status, remarks, event_req_id, uid_no, cby) VALUES (?, ?, ?, ?, '',
// ?)";
//
// try {
// jdbcTemplate.batchUpdate(insertSQL, vendorList, vendorList.size(),
// (ps, vendor) -> {
// ps.setInt(1, Integer.parseInt(vendor.get("vendor_req_id").toString()));
// ps.setString(2, status);
// ps.setString(3, remarks);
// ps.setInt(4, eventReqId);
// ps.setString(5, cby);
// }
// );
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Batch insert failed: " +
// e.getMessage()));
// }
//
//
//
// List<Map<String, Object>> insertedIds;
// try {
// insertedIds = jdbcTemplate.queryForList(
// "SELECT id, vdid FROM vendor_request_list ORDER BY id DESC LIMIT ?",
// vendorList.size());
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Failed to fetch inserted IDs: " +
// e.getMessage()));
// }
//
//
// List<Object[]> updateParams = new ArrayList<>();
// int currentYear = java.time.Year.now().getValue();
//
// for (int i = 0; i < vendorList.size(); i++) {
//
// Map<String, Object> vendor = vendorList.get(i);
// Map<String, Object> inserted = insertedIds.get(i);
//
// int insertedId = (int) inserted.get("id");
// String zone = vendor.get("zone").toString();
// String ward = vendor.get("ward").toString();
//
// // Assign UID only if Approved
// if ("Approved".equalsIgnoreCase(status)) {
// String uidNo = zone + "_" + ward + "_" + currentYear + "_" + insertedId;
// updateParams.add(new Object[]{uidNo, insertedId});
// }
//
// // Send WhatsApp for Approved/Rejected
// try {
// if ("Approved".equalsIgnoreCase(status) ||
// "Rejected".equalsIgnoreCase(status)) {
// sendWhatsappMsg(
// vendor.get("mob_no").toString(),
// status,
// vendor.get("vendor_req_number").toString()
// );
// }
// } catch (Exception e) {
// // WhatsApp failure should NOT stop DB operation
// e.printStackTrace();
// }
// }
//
// if (!updateParams.isEmpty()) {
// try {
// jdbcTemplate.batchUpdate("UPDATE vendor_request_list SET uid_no=? WHERE
// id=?", updateParams);
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Failed to update UID numbers: " +
// e.getMessage()));
// }
// }
//
// response.put("status", "success");
// response.put("message", "Details submitted successfully!");
//
// return ResponseEntity.ok(response);
//
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Map.of("status", "Error", "message", "Unexpected error: " +
// e.getMessage()));
// }
// }
@Transactional @Transactional
public ResponseEntity<Map<String, Object>> saveBulkVendorDetails(Map<String, Object> payload) { public ResponseEntity<Map<String, Object>> saveBulkVendorDetails(Map<String, Object> payload) {
@ -374,8 +400,7 @@ private JdbcTemplate jdbcTemplate;
int eventReqId = Integer.parseInt(payload.get("event_req_id").toString()); int eventReqId = Integer.parseInt(payload.get("event_req_id").toString());
String cby = payload.get("cby").toString(); String cby = payload.get("cby").toString();
List<Map<String, Object>> vendorList =
(List<Map<String, Object>>) payload.get("vendorList");
List<Map<String, Object>> vendorList = (List<Map<String, Object>>) payload.get("vendorList");
if (vendorList == null || vendorList.isEmpty()) { if (vendorList == null || vendorList.isEmpty()) {
return ResponseEntity.badRequest() return ResponseEntity.badRequest()
@ -384,9 +409,11 @@ private JdbcTemplate jdbcTemplate;
int currentYear = java.time.Year.now().getValue(); int currentYear = java.time.Year.now().getValue();
/* ============================================================
/*
* ============================================================
* PROCESS EACH VENDOR ONE BY ONE * PROCESS EACH VENDOR ONE BY ONE
* ============================================================ */
* ============================================================
*/
for (Map<String, Object> vendor : vendorList) { for (Map<String, Object> vendor : vendorList) {
int vendorReqId = Integer.parseInt(vendor.get("vendor_req_id").toString()); int vendorReqId = Integer.parseInt(vendor.get("vendor_req_id").toString());
@ -395,18 +422,21 @@ private JdbcTemplate jdbcTemplate;
String mob_no = vendor.get("mob_no").toString(); String mob_no = vendor.get("mob_no").toString();
String vendor_req_number = vendor.get("vendor_req_number").toString(); String vendor_req_number = vendor.get("vendor_req_number").toString();
/* ============================================================
/*
* ============================================================
* STEP 1: Check if vendor already exists in postponed list * STEP 1: Check if vendor already exists in postponed list
* ============================================================ */
* ============================================================
*/
String checkSQL = "SELECT * FROM vendor_postponed_list WHERE vdid=? AND isactive=1"; String checkSQL = "SELECT * FROM vendor_postponed_list WHERE vdid=? AND isactive=1";
List<Map<String, Object>> existingPostponed =
jdbcTemplate.queryForList(checkSQL, vendorReqId);
List<Map<String, Object>> existingPostponed = jdbcTemplate.queryForList(checkSQL, vendorReqId);
boolean postponedExists = !existingPostponed.isEmpty(); boolean postponedExists = !existingPostponed.isEmpty();
/* ============================================================
/*
* ============================================================
* STEP 2: BACKUP OLD POSTPONED ROW → postponed_history_log * STEP 2: BACKUP OLD POSTPONED ROW → postponed_history_log
* ============================================================ */
* ============================================================
*/
if (postponedExists) { if (postponedExists) {
String backupSQL = "INSERT INTO postponed_history_log " String backupSQL = "INSERT INTO postponed_history_log "
+ "(vdid, event_req_id, status, remarks, cby, cdate, updated_by, updated_date, isactive, isdelete) " + "(vdid, event_req_id, status, remarks, cby, cdate, updated_by, updated_date, isactive, isdelete) "
@ -416,23 +446,25 @@ private JdbcTemplate jdbcTemplate;
jdbcTemplate.update(backupSQL, vendorReqId); jdbcTemplate.update(backupSQL, vendorReqId);
} }
/* ============================================================
/*
* ============================================================
* CASE 1: STATUS = POSTPONED * CASE 1: STATUS = POSTPONED
* ============================================================ */
* ============================================================
*/
if ("Postponed".equalsIgnoreCase(status)) { if ("Postponed".equalsIgnoreCase(status)) {
if (!postponedExists) { if (!postponedExists) {
// INSERT NEW POSTPONED ROW // INSERT NEW POSTPONED ROW
String insertPostSQL =
"INSERT INTO vendor_postponed_list (vdid, status, remarks, event_req_id, cby) " +
String insertPostSQL = "INSERT INTO vendor_postponed_list (vdid, status, remarks, event_req_id, cby) "
+
"VALUES (?, ?, ?, ?, ?)"; "VALUES (?, ?, ?, ?, ?)";
jdbcTemplate.update(insertPostSQL, vendorReqId, status, remarks, eventReqId, cby); jdbcTemplate.update(insertPostSQL, vendorReqId, status, remarks, eventReqId, cby);
} else { } else {
// UPDATE EXISTING POSTPONED ROW // UPDATE EXISTING POSTPONED ROW
String updatePostSQL =
"UPDATE vendor_postponed_list SET status=?, remarks=?, event_req_id=?, updated_by=?, updated_date=NOW() " +
String updatePostSQL = "UPDATE vendor_postponed_list SET status=?, remarks=?, event_req_id=?, updated_by=?, updated_date=NOW() "
+
"WHERE vdid=?"; "WHERE vdid=?";
jdbcTemplate.update(updatePostSQL, status, remarks, eventReqId, cby, vendorReqId); jdbcTemplate.update(updatePostSQL, status, remarks, eventReqId, cby, vendorReqId);
@ -441,14 +473,15 @@ private JdbcTemplate jdbcTemplate;
continue; // SKIP REQUEST LIST INSERTION continue; // SKIP REQUEST LIST INSERTION
} }
/* ============================================================
/*
* ============================================================
* CASE 2: APPROVED / REJECTED → INSERT INTO vendor_request_list * CASE 2: APPROVED / REJECTED → INSERT INTO vendor_request_list
* ============================================================ */
* ============================================================
*/
KeyHolder keyHolder = new GeneratedKeyHolder(); KeyHolder keyHolder = new GeneratedKeyHolder();
String insertReqSQL =
"INSERT INTO vendor_request_list (vdid, status, remarks, event_req_id, cby) " +
String insertReqSQL = "INSERT INTO vendor_request_list (vdid, status, remarks, event_req_id, cby) " +
"VALUES (?, ?, ?, ?, ?)"; "VALUES (?, ?, ?, ?, ?)";
jdbcTemplate.update(connection -> { jdbcTemplate.update(connection -> {
@ -463,33 +496,38 @@ private JdbcTemplate jdbcTemplate;
int generatedId = keyHolder.getKey().intValue(); int generatedId = keyHolder.getKey().intValue();
/* ============================================================
/*
* ============================================================
* UID GENERATION FOR APPROVED * UID GENERATION FOR APPROVED
* ============================================================ */
* ============================================================
*/
if ("Approved".equalsIgnoreCase(status)) { if ("Approved".equalsIgnoreCase(status)) {
String uidNo = zone + "_" + ward + "_" + currentYear + "_" + generatedId; String uidNo = zone + "_" + ward + "_" + currentYear + "_" + generatedId;
jdbcTemplate.update( jdbcTemplate.update(
"UPDATE vendor_request_list SET uid_no=? WHERE id=?", "UPDATE vendor_request_list SET uid_no=? WHERE id=?",
uidNo, generatedId
);
uidNo, generatedId);
} }
/* ============================================================
/*
* ============================================================
* UPDATE POSTPONED LIST ALSO IF VENDOR EXISTS (AFTER BACKUP) * UPDATE POSTPONED LIST ALSO IF VENDOR EXISTS (AFTER BACKUP)
* ============================================================ */
* ============================================================
*/
if (postponedExists) { if (postponedExists) {
String updatePostSQL =
"UPDATE vendor_postponed_list SET status=?, remarks=?, event_req_id=?, updated_by=?, updated_date=NOW(),isactive=0,isdelete=1 " +
String updatePostSQL = "UPDATE vendor_postponed_list SET status=?, remarks=?, event_req_id=?, updated_by=?, updated_date=NOW(),isactive=0,isdelete=1 "
+
"WHERE vdid=?"; "WHERE vdid=?";
jdbcTemplate.update(updatePostSQL, status, remarks, eventReqId, cby, vendorReqId); jdbcTemplate.update(updatePostSQL, status, remarks, eventReqId, cby, vendorReqId);
} }
/* ============================================================
/*
* ============================================================
* SEND WHATSAPP (NON-BLOCKING) * SEND WHATSAPP (NON-BLOCKING)
* ============================================================ */
* ============================================================
*/
try { try {
if ("Approved".equalsIgnoreCase(status) || "Rejected".equalsIgnoreCase(status)) { if ("Approved".equalsIgnoreCase(status) || "Rejected".equalsIgnoreCase(status)) {
sendWhatsappMsg(mob_no, status, vendor_req_number); sendWhatsappMsg(mob_no, status, vendor_req_number);
@ -499,9 +537,11 @@ private JdbcTemplate jdbcTemplate;
} }
} }
/* ============================================================
/*
* ============================================================
* SUCCESS RESPONSE * SUCCESS RESPONSE
* ============================================================ */
* ============================================================
*/
response.put("status", "success"); response.put("status", "success");
response.put("message", "Vendor details submitted successfully!"); response.put("message", "Vendor details submitted successfully!");
@ -515,11 +555,8 @@ private JdbcTemplate jdbcTemplate;
} }
} }
public List<Map<String, Object>> getsavedids() { public List<Map<String, Object>> getsavedids() {
String sql="SELECT vdid FROM vendor_request_list WHERE isactive=1";
String sql = "SELECT vdid FROM vendor_request_list WHERE isactive=1";
try { try {
return jdbcTemplate.queryForList(sql); return jdbcTemplate.queryForList(sql);
} catch (Exception e) { } catch (Exception e) {
@ -538,7 +575,7 @@ private JdbcTemplate jdbcTemplate;
} }
} }
public List<Map<String, Object>> getdataforreport(String meeting, String status,String cby) {
public List<Map<String, Object>> getdataforreport(String meeting, String status, String cby) {
StringBuilder sql = new StringBuilder( StringBuilder sql = new StringBuilder(
"SELECT * FROM (" + "SELECT * FROM (" +
@ -547,9 +584,7 @@ private JdbcTemplate jdbcTemplate;
" UNION ALL " + " UNION ALL " +
" SELECT vdid, status, remarks, NULL AS uid_no, event_req_id, cdate,cby " + " SELECT vdid, status, remarks, NULL AS uid_no, event_req_id, cdate,cby " +
" FROM vendor_postponed_list " + " FROM vendor_postponed_list " +
") AS all_requests WHERE 1=1"
);
") AS all_requests WHERE 1=1");
List<Object> params = new ArrayList<>(); List<Object> params = new ArrayList<>();
@ -578,7 +613,6 @@ private JdbcTemplate jdbcTemplate;
} }
} }
public List<Map<String, Object>> finalvendorDetailsById(String requestId) { public List<Map<String, Object>> finalvendorDetailsById(String requestId) {
// Base vendor details (1 row) // Base vendor details (1 row)
@ -605,12 +639,9 @@ private JdbcTemplate jdbcTemplate;
return output; return output;
} }
private List<Map<String, Object>> getvendingfinaldata(String requestId) { private List<Map<String, Object>> getvendingfinaldata(String requestId) {
String sql =
"SELECT all_logs.vdid, " +
String sql = "SELECT all_logs.vdid, " +
" all_logs.vc_status, " + " all_logs.vc_status, " +
" all_logs.vc_remarks, " + " all_logs.vc_remarks, " +
" CONCAT_WS('- ', ce.event_name, DATE_FORMAT(ce.event_date, '%d-%m-%Y')) AS event_name, " + " CONCAT_WS('- ', ce.event_name, DATE_FORMAT(ce.event_date, '%d-%m-%Y')) AS event_name, " +
@ -650,14 +681,12 @@ private JdbcTemplate jdbcTemplate;
} }
} }
public Map<String, Object> getLatestPostponed(String vdid) { public Map<String, Object> getLatestPostponed(String vdid) {
String sql = "SELECT status, remarks, DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') AS date " + String sql = "SELECT status, remarks, DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') AS date " +
"FROM vendor_postponed_list WHERE vdid = ? ORDER BY cdate DESC LIMIT 1"; "FROM vendor_postponed_list WHERE vdid = ? ORDER BY cdate DESC LIMIT 1";
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql, vdid);
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, vdid);
return list.isEmpty() ? null : list.get(0); return list.isEmpty() ? null : list.get(0);
} }
@ -670,7 +699,6 @@ private JdbcTemplate jdbcTemplate;
return jdbcTemplate.queryForList(sql, vdid); return jdbcTemplate.queryForList(sql, vdid);
} }
public Map<String, Object> checkVendorInVendingTables(Integer vdid) { public Map<String, Object> checkVendorInVendingTables(Integer vdid) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -684,8 +712,7 @@ private JdbcTemplate jdbcTemplate;
} }
// 2. Check vendor_request_list (latest status) // 2. Check vendor_request_list (latest status)
String sqlRequest =
"SELECT status FROM vendor_request_list WHERE vdid=? AND isactive=1 ORDER BY id DESC LIMIT 1";
String sqlRequest = "SELECT status FROM vendor_request_list WHERE vdid=? AND isactive=1 ORDER BY id DESC LIMIT 1";
List<Map<String, Object>> reqList = jdbcTemplate.queryForList(sqlRequest, vdid); List<Map<String, Object>> reqList = jdbcTemplate.queryForList(sqlRequest, vdid);
if (reqList.isEmpty()) { if (reqList.isEmpty()) {
@ -699,6 +726,4 @@ private JdbcTemplate jdbcTemplate;
return result; return result;
} }
} }

25
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java

@ -671,7 +671,7 @@ public class VehicleService {
break; break;
case "23": case "23":
System.out.println("TempID is 22 (1590940 - Green Committee Report - IMAGE - STATIC)");
System.out.println("TempID is 23 (1590940 - Green Committee Report - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?" urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username + "userid=" + username
+ "&password=" + password + "&password=" + password
@ -693,6 +693,29 @@ public class VehicleService {
break; break;
case "24":
System.out.println("TempID is 24 (1590940 - Clean and Safe Guidelines - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json"
+ "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943"
+ "&url=" + fileURL
+ "&placeholders=Clean%20and%20Safe%20Construction%20-%20Vehicle%20Violation";
break;
default: default:
System.out.println("TempID (" + tempid + ") is unknown"); System.out.println("TempID (" + tempid + ") is unknown");
} }

92
gcc_officer_portal/src/main/resources/templates/modules/vendors/EventList.html

@ -1,39 +1,42 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<style> <style>
.required{
.required {
color: red; color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px)
{
#requestlistform label{
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px) {
#requestlistform label {
margin-top: 10px; margin-top: 10px;
} }
}
}
#viewModal .modal-body { #viewModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
} }
.custom-doc-btn { .custom-doc-btn {
height: 20px; height: 20px;
width: 80px; width: 80px;
font-size: 9px; font-size: 9px;
font-weight:bold;
font-weight: bold;
text-align: center; text-align: center;
padding: 0px; padding: 0px;
border:1px solid grey;
}
border: 1px solid grey;
}
.col-md-3{
padding-bottom: 10px;
}
.col-md-3 {
padding-bottom: 10px;
}
.comment {
.comment {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -58,7 +61,8 @@ padding-bottom: 10px;
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
</style> </style>
<body>
<body>
<!--[if lt IE 8]> <!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@ -89,8 +93,8 @@ padding-bottom: 10px;
<div class="col-lg-4"> <div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb"> <nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i
class="ik ik-home"></i></a></li>
<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" aria-current="page">Vending Committe</li>
<li class="breadcrumb-item active" aria-current="page">Meeting List</li> <li class="breadcrumb-item active" aria-current="page">Meeting List</li>
</ol> </ol>
@ -102,13 +106,15 @@ padding-bottom: 10px;
<div class="row"> <div class="row">
<div class="col-md-12" >
<div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<span style="font-size: medium;font-weight: bold;">Reports Filters</span><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><span th:text="${zone}" id="userzone" style="display: none;"></span>
<span style="font-size: medium;font-weight: bold;">Reports Filters</span><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><span
th:text="${zone}" id="userzone" style="display: none;"></span>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row" >
<div class="row">
<div class="col-md-4 mb-1"> <div class="col-md-4 mb-1">
<label for="meetingdropdown" style="font-size: medium;">Meeting:</label> <label for="meetingdropdown" style="font-size: medium;">Meeting:</label>
@ -153,20 +159,22 @@ padding-bottom: 10px;
<div class="col-12 d-flex justify-content-center"> <div class="col-12 d-flex justify-content-center">
<button class="btn btn-primary" id="submitBtn">Submit</button> <button class="btn btn-primary" id="submitBtn">Submit</button>
<button class="btn btn-danger mx-2" id="resetBtn"
name="reset" type="reset">Reset</button>
<button class="btn btn-danger mx-2" id="resetBtn" name="reset"
type="reset">Reset</button>
</div> </div>
</div> </div>
</div> </div>
<div class="card-block"> <div class="card-block">
<div class="page-header-title" >
<h5 style="margin: 0;font-weight: bold;">Vendors Meeting List</h5><hr>
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;">Vendors Meeting List</h5>
<hr>
</div> </div>
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable" role="grid">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th class="text-center">S.No</th> <th class="text-center">S.No</th>
@ -213,7 +221,8 @@ padding-bottom: 10px;
<!-- Modal --> <!-- 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 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-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -245,7 +254,8 @@ padding-bottom: 10px;
</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 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 style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
@ -293,7 +303,7 @@ padding-bottom: 10px;
$('#docModal').modal('show'); $('#docModal').modal('show');
} }
$(document).ready(function() {
$(document).ready(function () {
var table = $('#RequestListDatatable').DataTable({ var table = $('#RequestListDatatable').DataTable({
dom: 'Bftip', dom: 'Bftip',
@ -347,7 +357,7 @@ padding-bottom: 10px;
}); });
fetchEventDropdown();
fetchEventDropdown(userId);
let zoneString = userzone; // e.g. "01,02,03,04,05" let zoneString = userzone; // e.g. "01,02,03,04,05"
if (zoneString) { if (zoneString) {
@ -369,7 +379,7 @@ padding-bottom: 10px;
fetchWardDropdown(selectedZone); fetchWardDropdown(selectedZone);
} }
}); });
fetchVendingCommitteeList("","","","",userId)
fetchVendingCommitteeList("", "", "", "", userId)
}); });
@ -427,17 +437,17 @@ padding-bottom: 10px;
console.log("Selected ward Value:", ward); console.log("Selected ward Value:", ward);
// 👉 Now call your API or next function using these two // 👉 Now call your API or next function using these two
fetchVendingCommitteeList (meeting, status , zone , ward,userId);
fetchVendingCommitteeList(meeting, status, zone, ward, userId);
}); });
function fetchVendingCommitteeList(event_req_id,status,zone,ward) {
function fetchVendingCommitteeList(event_req_id, status, zone, ward) {
$('#pageLoader').show(); $('#pageLoader').show();
$.ajax({ $.ajax({
url: '/gcc/api/vending/getreports', url: '/gcc/api/vending/getreports',
data: { meeting: event_req_id,status:status,zone:zone,ward:ward,userId:userId },
data: { meeting: event_req_id, status: status, zone: zone, ward: ward, userId: userId },
method: 'GET', method: 'GET',
contentType: 'application/json', contentType: 'application/json',
success: function (data) { success: function (data) {
@ -488,7 +498,7 @@ padding-bottom: 10px;
} else if (cellData === 'Rejected') { } else if (cellData === 'Rejected') {
$(td).css('color', 'red').css('font-weight', 'bold'); $(td).css('color', 'red').css('font-weight', 'bold');
} }
else{
else {
$(td).css('color', 'orange').css('font-weight', 'bold'); $(td).css('color', 'orange').css('font-weight', 'bold');
} }
} }
@ -549,7 +559,7 @@ padding-bottom: 10px;
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-'; const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-';
const pmLoanDisplay = details.pm_svanidhi_loan ? (details.pm_svanidhi_loan ? '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 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 idCardDisplay = details.vendor_id_card ? (details.vendor_id_card === '1' ? 'Yes' : 'No') : '-';
const bankPassbookDisplay = details.bank_acc_status === '1' && details.bank_passbook 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'">` ? `<img src="${details.bank_passbook}" alt="Bank Passbook" class="img-fluid" style="max-width: 150px;" onerror="this.src='/default.jpg'">`
: '-'; : '-';
@ -561,7 +571,7 @@ padding-bottom: 10px;
? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.bank_passbook}')">View</button>` ? `<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>` : '-';
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 = ""; let historyHtml = "";
@ -758,10 +768,11 @@ padding-bottom: 10px;
} }
// Call this function on page load // Call this function on page load
function fetchEventDropdown() {
function fetchEventDropdown(userId) {
$.ajax({ $.ajax({
url: '/gcc/api/vending/committedropdown', url: '/gcc/api/vending/committedropdown',
type: 'GET', type: 'GET',
data: { userId: userId },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
let eventDropdown = $('#meetingdropdown'); let eventDropdown = $('#meetingdropdown');
@ -789,5 +800,6 @@ padding-bottom: 10px;
</script> </script>
</body>
</body>
</html> </html>

100
gcc_officer_portal/src/main/resources/templates/modules/vendors/RequestList.html

@ -1,39 +1,42 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<style> <style>
.required{
.required {
color: red; color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px)
{
#requestlistform label{
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px) {
#requestlistform label {
margin-top: 10px; margin-top: 10px;
} }
}
}
#viewModal .modal-body { #viewModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
} }
.custom-doc-btn { .custom-doc-btn {
height: 20px; height: 20px;
width: 80px; width: 80px;
font-size: 9px; font-size: 9px;
font-weight:bold;
font-weight: bold;
text-align: center; text-align: center;
padding: 0px; padding: 0px;
border:1px solid grey;
}
border: 1px solid grey;
}
.col-md-3{
padding-bottom: 10px;
}
.col-md-3 {
padding-bottom: 10px;
}
.comment {
.comment {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -58,7 +61,8 @@ padding-bottom: 10px;
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
</style> </style>
<body>
<body>
<!--[if lt IE 8]> <!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@ -89,8 +93,8 @@ padding-bottom: 10px;
<div class="col-lg-4"> <div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb"> <nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i
class="ik ik-home"></i></a></li>
<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" aria-current="page">Vending Committe</li>
<li class="breadcrumb-item active" aria-current="page">Request List</li> <li class="breadcrumb-item active" aria-current="page">Request List</li>
</ol> </ol>
@ -104,7 +108,7 @@ padding-bottom: 10px;
<div class="row"> <div class="row">
<div class="col-md-12" >
<div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-block"> <div class="card-block">
<div class="row"> <div class="row">
@ -123,12 +127,17 @@ padding-bottom: 10px;
</select> </select>
</div> </div>
</div> </div>
<div class="page-header-title" >
<h5 style="margin: 0;font-weight: bold;"><span th:text="${zone}" id="userzone" style="display: none;"></span>Vendors Request List</h5><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><hr>
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;"><span th:text="${zone}" id="userzone"
style="display: none;"></span>Vendors Request List</h5><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span>
<hr>
</div> </div>
<div> <div>
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th class="text-center">S.No</th> <th class="text-center">S.No</th>
@ -167,7 +176,8 @@ padding-bottom: 10px;
<div class="card-block"> <div class="card-block">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label for="bulkstatus">Select Status<span class="text-danger">*</span> </label>
<label for="bulkstatus">Select Status<span class="text-danger">*</span>
</label>
<select id="bulkstatus" class="form-control"> <select id="bulkstatus" class="form-control">
<option value="">Select</option> <option value="">Select</option>
<option value="Approved">Approved</option> <option value="Approved">Approved</option>
@ -176,12 +186,14 @@ padding-bottom: 10px;
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="bulkremarks">Remarks<span class="text-danger">*</span></label><br>
<label for="bulkremarks">Remarks<span
class="text-danger">*</span></label><br>
<textarea rows="2" id="bulkremarks" class="form-control"></textarea> <textarea rows="2" id="bulkremarks" class="form-control"></textarea>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="text-center mt-4"> <div class="text-center mt-4">
<button type="button" class="btn btn-primary" id="bulksubmitBtn">Submit</button>
<button type="button" class="btn btn-primary"
id="bulksubmitBtn">Submit</button>
</div> </div>
</div> </div>
</div> </div>
@ -200,7 +212,8 @@ padding-bottom: 10px;
<!-- Modal --> <!-- Modal -->
<!-- Modal --> <!-- 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 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-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -232,7 +245,8 @@ padding-bottom: 10px;
</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 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 style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
@ -279,7 +293,7 @@ padding-bottom: 10px;
$('#docModal').modal('show'); $('#docModal').modal('show');
} }
$(document).ready(function() {
$(document).ready(function () {
@ -287,7 +301,7 @@ padding-bottom: 10px;
dom: 'Bftip', dom: 'Bftip',
columnDefs: [ columnDefs: [
{ width: "150px", targets: 7 }, { width: "150px", targets: 7 },
{width: "150px", targets: 10}
{ width: "150px", targets: 10 }
], ],
lengthMenu: [ lengthMenu: [
[200, 400, -1], [200, 400, -1],
@ -337,7 +351,7 @@ padding-bottom: 10px;
// Trigger on page load // Trigger on page load
fetchEventDropdown();
fetchEventDropdown(userId);
let zoneString = userzone; // e.g. "01,02,03,04,05" let zoneString = userzone; // e.g. "01,02,03,04,05"
@ -362,9 +376,9 @@ padding-bottom: 10px;
$('#zonedropdown').on('change', function () { $('#zonedropdown').on('change', function () {
let miss_meet=$('#dropdownevent').val();
let miss_meet = $('#dropdownevent').val();
if(!miss_meet){
if (!miss_meet) {
Swal.fire("Warning", "Please select an meeting!", "warning"); Swal.fire("Warning", "Please select an meeting!", "warning");
return; return;
} }
@ -510,7 +524,7 @@ padding-bottom: 10px;
$.ajax({ $.ajax({
url: '/gcc/api/streetvendor/getvedingcommitteelist', url: '/gcc/api/streetvendor/getvedingcommitteelist',
data: { date: formattedDate,zones:finalZone },
data: { date: formattedDate, zones: finalZone },
method: 'GET', method: 'GET',
contentType: 'application/json', contentType: 'application/json',
success: function (data) { success: function (data) {
@ -611,7 +625,7 @@ padding-bottom: 10px;
], ],
columnDefs: [ columnDefs: [
{ width: "150px", targets: 7 }, { width: "150px", targets: 7 },
{width: "150px", targets: 10}
{ width: "150px", targets: 10 }
], ],
lengthMenu: [ lengthMenu: [
@ -734,7 +748,7 @@ padding-bottom: 10px;
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-'; const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-';
const pmLoanDisplay = details.pm_svanidhi_loan ? (details.pm_svanidhi_loan ? '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 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 idCardDisplay = details.vendor_id_card ? (details.vendor_id_card === '1' ? 'Yes' : 'No') : '-';
const bankPassbookDisplay = details.bank_acc_status === '1' && details.bank_passbook 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'">` ? `<img src="${details.bank_passbook}" alt="Bank Passbook" class="img-fluid" style="max-width: 150px;" onerror="this.src='/default.jpg'">`
: '-'; : '-';
@ -746,7 +760,7 @@ padding-bottom: 10px;
? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.bank_passbook}')">View</button>` ? `<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>` : '-';
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 postponedHTML = ""; let postponedHTML = "";
@ -1029,8 +1043,8 @@ padding-bottom: 10px;
event_req_id: eventReqId, event_req_id: eventReqId,
zone: rowData.zone, zone: rowData.zone,
ward: rowData.ward, ward: rowData.ward,
cby:userId,
mob_no:rowData.mob_no
cby: userId,
mob_no: rowData.mob_no
}; };
console.log("payload = " + JSON.stringify(payload, null, 2)); console.log("payload = " + JSON.stringify(payload, null, 2));
@ -1064,7 +1078,7 @@ padding-bottom: 10px;
}); });
} }
else if(response.status === "Error"){
else if (response.status === "Error") {
Swal.fire({ Swal.fire({
icon: 'error', icon: 'error',
@ -1096,10 +1110,11 @@ padding-bottom: 10px;
} }
// Call this function on page load // Call this function on page load
function fetchEventDropdown() {
function fetchEventDropdown(userId) {
$.ajax({ $.ajax({
url: '/gcc/api/vending/dropdown-Event', url: '/gcc/api/vending/dropdown-Event',
type: 'GET', type: 'GET',
data: { userId: userId },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
let eventDropdown = $('#dropdownevent'); let eventDropdown = $('#dropdownevent');
@ -1124,5 +1139,6 @@ padding-bottom: 10px;
} }
</script> </script>
</body>
</body>
</html> </html>

329
gcc_officer_portal/src/main/resources/templates/modules/vendors/streetVendorRequestForm.html

@ -1,10 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"> <html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<style> <style>
.required{
.required {
color: red; color: red;
} }
#modalBody h4 { #modalBody h4 {
font-weight: bold; font-weight: bold;
margin-top: 15px; margin-top: 15px;
@ -18,6 +20,7 @@
#modalBody hr { #modalBody hr {
margin: 15px 0; margin: 15px 0;
} }
.comment { .comment {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -38,10 +41,11 @@
} }
/* Limit the height of the dropdown menu and make it scrollable */ /* Limit the height of the dropdown menu and make it scrollable */
.dropdown-menu {
max-height: 200px; /* Adjust this value as needed */
.dropdown-menu {
max-height: 200px;
/* Adjust this value as needed */
overflow-y: auto; overflow-y: auto;
}
}
.col-4 { .col-4 {
@ -71,10 +75,13 @@
text-decoration: underline; text-decoration: underline;
color: #007bff; color: #007bff;
} }
/* Make the modal body scrollable */ /* Make the modal body scrollable */
#detailsModal .modal-body { #detailsModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
} }
.card-box { .card-box {
@ -83,42 +90,47 @@
} }
#followupCard { #followupCard {
transition: transform 0.2s ease; /* Smooth scaling transition */
cursor: pointer; /* Default cursor change */
}
transition: transform 0.2s ease;
/* Smooth scaling transition */
cursor: pointer;
/* Default cursor change */
}
#followupCard:hover {
transform: scale(1.05); /* Slightly scale up on hover */
cursor: pointer; /* Change cursor to hand symbol */
}
#followupCard:hover {
transform: scale(1.05);
/* Slightly scale up on hover */
cursor: pointer;
/* Change cursor to hand symbol */
}
.card-block {
.card-block {
padding: 20px; padding: 20px;
}
}
.form-label {
.form-label {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
}
}
/* input.form-control {
/* input.form-control {
padding: 10px; padding: 10px;
} */ } */
.form-select {
.form-select {
padding: 10px; padding: 10px;
height: 40px; height: 40px;
}
}
#employeeCard label{
padding-top: 2%;
}
#employeeCard label {
padding-top: 2%;
}
.form-section h5 {
.form-section h5 {
background-color: #0d6efd; background-color: #0d6efd;
color: white; color: white;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.upload-box { .upload-box {
border: 2px dashed #999; border: 2px dashed #999;
padding: 20px; padding: 20px;
@ -230,6 +242,7 @@ padding-top: 2%;
line-height: 1.4; line-height: 1.4;
} }
</style> </style>
<body> <body>
<!--[if lt IE 8]> <!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@ -259,7 +272,8 @@ padding-top: 2%;
<div class="col-lg-4"> <div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb"> <nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
<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" aria-current="page">Vending Committe</li>
<li class="breadcrumb-item active" aria-current="page">Add Street vendor</li> <li class="breadcrumb-item active" aria-current="page">Add Street vendor</li>
</ol> </ol>
@ -270,12 +284,14 @@ padding-top: 2%;
<div class="container my-4"> <div class="container my-4">
<div class="card p-4 shadow"><span th:text="${LoginUserId}" style="display:none;" id="userIdSpan"></span>
<form id="vendorForm" enctype="multipart/form-data" >
<div class="card p-4 shadow"><span th:text="${LoginUserId}" style="display:none;"
id="userIdSpan"></span>
<form id="vendorForm" enctype="multipart/form-data">
<!-- Business Details --> <!-- Business Details -->
<div class="section-header"> <div class="section-header">
<h5>Business Details | வியாபார விவரங்கள்</h5></div>
<h5>Business Details | வியாபார விவரங்கள்</h5>
</div>
<div id="mapContainer" style="position: relative; height: 500px;"> <div id="mapContainer" style="position: relative; height: 500px;">
<input id="pac-input" class="controls" type="text" placeholder="Search location"> <input id="pac-input" class="controls" type="text" placeholder="Search location">
<div id="googleMap" style="height: 90%; width: 100%;"></div> <div id="googleMap" style="height: 90%; width: 100%;"></div>
@ -290,13 +306,15 @@ padding-top: 2%;
<!-- <label for="latitude_field">Latitide</label> <!-- <label for="latitude_field">Latitide</label>
<input type="text" class="form-control" id="latitude_field"> --> <input type="text" class="form-control" id="latitude_field"> -->
<label for="latitude_field">Latitude</label> <label for="latitude_field">Latitude</label>
<input type="text" class="form-control" id="latitude_field" name="latitude_field" readonly >
<input type="text" class="form-control" id="latitude_field"
name="latitude_field" readonly>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<!-- <label for="longitude_field">Longtitude</label> <!-- <label for="longitude_field">Longtitude</label>
<input type="text" class="form-control" id="longitude_field" name="longtitude"> --> <input type="text" class="form-control" id="longitude_field" name="longtitude"> -->
<label for="longitude_field">Longitude</label> <label for="longitude_field">Longitude</label>
<input type="text" class="form-control" id="longitude_field" name="longitude_field" readonly >
<input type="text" class="form-control" id="longitude_field"
name="longitude_field" readonly>
</div> </div>
</div> </div>
@ -343,21 +361,26 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Landmark (maximum 255 characters)</label> <label class="form-label">Landmark (maximum 255 characters)</label>
<textarea class="form-control" id="landmark" name="landmark" maxlength="255"></textarea>
<textarea class="form-control" id="landmark" name="landmark"
maxlength="255"></textarea>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">விற்பனை பகுதி</label> <label class="form-label">விற்பனை பகுதி</label>
<textarea class="form-control" id="landmark_tamil" name="landmark_tamil" placeholder="தமிழில் பதிவு செய்யவும்"></textarea>
<textarea class="form-control" id="landmark_tamil" name="landmark_tamil"
placeholder="தமிழில் பதிவு செய்யவும்"></textarea>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">District</label> <label class="form-label">District</label>
<input type="text" class="form-control" id="vendor_district" name="vendor_district" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
<input type="text" class="form-control" id="vendor_district"
name="vendor_district"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label"> மாவட்டம்</label> <label class="form-label"> மாவட்டம்</label>
<input type="text" class="form-control" id="vendor_district_tamil" name="vendor_district_tamil" placeholder="தமிழில் பதிவு செய்யவும்">
<input type="text" class="form-control" id="vendor_district_tamil"
name="vendor_district_tamil" placeholder="தமிழில் பதிவு செய்யவும்">
</div> </div>
</div> </div>
@ -365,7 +388,8 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Pincode</label> <label class="form-label">Pincode</label>
<input type="text" class="form-control" id="vendor_pincode" name="vendor_pincode" oninput="validatePincode(this)" >
<input type="text" class="form-control" id="vendor_pincode"
name="vendor_pincode" oninput="validatePincode(this)">
</div> </div>
</div> </div>
@ -373,12 +397,14 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label for="businesstype" class="form-label">Type of Business <span class="text-danger">*</span>
<label for="businesstype" class="form-label">Type of Business <span
class="text-danger">*</span>
</label> </label>
<select id="businesstype" name="businesstype" class="form-control" required> <select id="businesstype" name="businesstype" class="form-control" required>
<option value="">-- Select Business Type --</option> <option value="">-- Select Business Type --</option>
<th:block th:each="vendingCategory : ${vendingCategories}"> <th:block th:each="vendingCategory : ${vendingCategories}">
<option th:value="${vendingCategory.id}" th:text="${vendingCategory.vending_category_name}"></option>
<option th:value="${vendingCategory.id}"
th:text="${vendingCategory.vending_category_name}"></option>
</th:block> </th:block>
</select> </select>
@ -386,12 +412,16 @@ padding-top: 2%;
<div class="col-md-6"> <div class="col-md-6">
<label for="tamilbusinesstype" class="form-label"> வியாபார வகை <span class="text-danger">*</span>
<label for="tamilbusinesstype" class="form-label"> வியாபார வகை <span
class="text-danger">*</span>
</label> </label>
<select id="tamilbusinesstype" name="tamilbusinesstype" class="form-control" required>
<select id="tamilbusinesstype" name="tamilbusinesstype" class="form-control"
required>
<option value="">-- வியாபார வகையைத் தேர்ந்தெடுக்கவும் --</option> <option value="">-- வியாபார வகையைத் தேர்ந்தெடுக்கவும் --</option>
<th:block th:each="tamilvendingCategory : ${tamilvendingCategories}"> <th:block th:each="tamilvendingCategory : ${tamilvendingCategories}">
<option th:value="${tamilvendingCategory.id}" th:text="${tamilvendingCategory.tamil_vending_category_name}"></option>
<option th:value="${tamilvendingCategory.id}"
th:text="${tamilvendingCategory.tamil_vending_category_name}">
</option>
</th:block> </th:block>
</select> </select>
</div> </div>
@ -400,27 +430,32 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Business Space (Sq ft)| வியாபார இடம் </label> <label class="form-label">Business Space (Sq ft)| வியாபார இடம் </label>
<input type="text" class="form-control" id="business_space" name="business_space">
<input type="text" class="form-control" id="business_space"
name="business_space">
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Did you get SVANIDHI loan? | ஸ்வநிதி கடன் வாங்கினீங்களா? </label><br>
<input type="radio" name="svanidhi" value="Yes" > Yes
<label class="form-label">Did you get SVANIDHI loan? | ஸ்வநிதி கடன்
வாங்கினீங்களா? </label><br>
<input type="radio" name="svanidhi" value="Yes"> Yes
<input type="radio" name="svanidhi" value="No" class="ms-3"> No <input type="radio" name="svanidhi" value="No" class="ms-3"> No
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Do you have a Bank Account? | வங்கி கணக்கு உள்ளதா? </label><br>
<input type="radio" name="bank_account" value="Yes" > Yes
<label class="form-label">Do you have a Bank Account? | வங்கி கணக்கு உள்ளதா?
</label><br>
<input type="radio" name="bank_account" value="Yes"> Yes
<input type="radio" name="bank_account" value="No" class="ms-3"> No <input type="radio" name="bank_account" value="No" class="ms-3"> No
</div> </div>
<div class="col-md-6" id="bank_passbook_container" style="display:none;"> <div class="col-md-6" id="bank_passbook_container" style="display:none;">
<label for="bank_passbook" class="form-label">Upload Bank Passbook (jpg/jpeg/pdf)
<label for="bank_passbook" class="form-label">Upload Bank Passbook
(jpg/jpeg/pdf)
</label> </label>
<input type="file" class="form-control" id="bank_passbook" name="bank_passbook" accept=".jpg,.jpeg,.pdf,application/pdf" >
<input type="file" class="form-control" id="bank_passbook" name="bank_passbook"
accept=".jpg,.jpeg,.pdf,application/pdf">
</div> </div>
</div> </div>
@ -434,27 +469,31 @@ padding-top: 2%;
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Profile Image (jpg/jpeg/pdf)</label> <label class="form-label">Profile Image (jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="profileimage" <input type="file" class="form-control" id="profileimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage" >
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage">
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label"> Name<span class="required">*</span></label> <label class="form-label"> Name<span class="required">*</span></label>
<input type="text" class="form-control" id="name" name="name" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
<input type="text" class="form-control" id="name" name="name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">பெயர் <span class="required">*</span></label> <label class="form-label">பெயர் <span class="required">*</span></label>
<input type="text" class="form-control" id="name_tamil" name="name_tamil" placeholder="தமிழில் பதிவு செய்யவும்" required>
<input type="text" class="form-control" id="name_tamil" name="name_tamil"
placeholder="தமிழில் பதிவு செய்யவும்" required>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Father's / Husband's Name </label> <label class="form-label">Father's / Husband's Name </label>
<input type="text" class="form-control" id="father_name" name="father_name" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
<input type="text" class="form-control" id="father_name" name="father_name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label"> தந்தை/கணவர் பெயர் </label> <label class="form-label"> தந்தை/கணவர் பெயர் </label>
<input type="text" class="form-control" id="father_name_tamil" name="father_name_tamil" placeholder="தமிழில் பதிவு செய்யவும்" >
<input type="text" class="form-control" id="father_name_tamil"
name="father_name_tamil" placeholder="தமிழில் பதிவு செய்யவும்">
</div> </div>
</div> </div>
@ -462,23 +501,26 @@ padding-top: 2%;
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Gender | பாலினம் </label><br> <label class="form-label">Gender | பாலினம் </label><br>
<input type="radio" name="gender" value="Male" > Male
<input type="radio" name="gender" value="Male"> Male
<input type="radio" name="gender" value="Female" class="ms-3"> Female <input type="radio" name="gender" value="Female" class="ms-3"> Female
<input type="radio" name="gender" value="Transgender" class="ms-3">Transgender <input type="radio" name="gender" value="Transgender" class="ms-3">Transgender
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label"> பாலினம் </label><br> <label class="form-label"> பாலினம் </label><br>
<input type="radio" name="gender_tamil" value="ஆண்" > ஆண்
<input type="radio" name="gender_tamil" value="ஆண்"> ஆண்
<input type="radio" name="gender_tamil" value="பெண்" class="ms-3"> பெண் <input type="radio" name="gender_tamil" value="பெண்" class="ms-3"> பெண்
<input type="radio" name="gender_tamil" value="பிற்பாலினர்" class="ms-3">பிற்பாலினர்
<input type="radio" name="gender_tamil" value="பிற்பாலினர்"
class="ms-3">பிற்பாலினர்
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Mobile Number | மொபைல் எண் <span class="required">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no" oninput="validatePhoneNumber(this)" required>
<label class="form-label">Mobile Number | மொபைல் எண் <span
class="required">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no"
oninput="validatePhoneNumber(this)" required>
</div> </div>
</div> </div>
@ -486,11 +528,11 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Date of Birth | பிறந்த தேதி </label> <label class="form-label">Date of Birth | பிறந்த தேதி </label>
<input type="date" id="dob" class="form-control" name="dob" >
<input type="date" id="dob" class="form-control" name="dob">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Community Category | சமூக வகை </label> <label class="form-label">Community Category | சமூக வகை </label>
<select class="form-control" id="community" name="community" >
<select class="form-control" id="community" name="community">
<option value="">-- Select Community --</option> <option value="">-- Select Community --</option>
<th:block th:each="com : ${communities}"> <th:block th:each="com : ${communities}">
<option th:value="${com.id}" th:text="${com.category_name}"></option> <option th:value="${com.id}" th:text="${com.category_name}"></option>
@ -502,15 +544,16 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Differently Abled | இயலாமை உள்ளவரா? </label><br> <label class="form-label">Differently Abled | இயலாமை உள்ளவரா? </label><br>
<input type="radio" name="differently_abled" value="Yes" > Yes
<input type="radio" name="differently_abled" value="Yes"> Yes
<input type="radio" name="differently_abled" value="No" class="ms-3"> No <input type="radio" name="differently_abled" value="No" class="ms-3"> No
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Street Vendor’s educational status | தெருவணிகரின் கல்வித்தகுதி </label>
<select class="form-control" id="education" name="education" >
<label class="form-label">Street Vendor’s educational status | தெருவணிகரின்
கல்வித்தகுதி </label>
<select class="form-control" id="education" name="education">
<option value="">-- Select Education Status--</option> <option value="">-- Select Education Status--</option>
<th:block th:each="edu : ${educationList}"> <th:block th:each="edu : ${educationList}">
<option th:value="${edu.id}" th:text="${edu.education}"></option> <option th:value="${edu.id}" th:text="${edu.education}"></option>
@ -522,23 +565,28 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label for="maritalstatus" class="form-label"> Marital Status | திருமண நிலை </label>
<select class="form-control" id="maritalStatus" name="maritalStatus" >
<label for="maritalstatus" class="form-label"> Marital Status | திருமண நிலை
</label>
<select class="form-control" id="maritalStatus" name="maritalStatus">
<option value="">-- Select Marital Status --</option> <option value="">-- Select Marital Status --</option>
<th:block th:each="status : ${maritalStatuses}"> <th:block th:each="status : ${maritalStatuses}">
<option th:value="${status.id}" th:text="${status.marital_status}"></option>
<option th:value="${status.id}" th:text="${status.marital_status}">
</option>
</th:block> </th:block>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="familymembers" class="form-label">Number of Family Members | குடும்ப உறுப்பினர்கள் எண்ணிக்கை </label>
<input type="number" class="form-control" name="familymembers" id="familymembers">
<label for="familymembers" class="form-label">Number of Family Members | குடும்ப
உறுப்பினர்கள் எண்ணிக்கை </label>
<input type="number" class="form-control" name="familymembers"
id="familymembers">
</div> </div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Are any of your family member involved in street vending | உங்கள் குடும்ப உறுப்பினர் வியாபாரத்தில் உள்ளவரா? </label><br>
<input type="radio" name="fam_vendor" value="Yes" > Yes
<label class="form-label">Are any of your family member involved in street vending |
உங்கள் குடும்ப உறுப்பினர் வியாபாரத்தில் உள்ளவரா? </label><br>
<input type="radio" name="fam_vendor" value="Yes"> Yes
<input type="radio" name="fam_vendor" value="No" class="ms-3"> No <input type="radio" name="fam_vendor" value="No" class="ms-3"> No
</div> </div>
@ -549,34 +597,37 @@ padding-top: 2%;
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Door No | கதவு எண் </label> <label class="form-label">Door No | கதவு எண் </label>
<input type="text" class="form-control" name="doorno" id="doorno" >
<input type="text" class="form-control" name="doorno" id="doorno">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Street Name | தெரு பெயர் </label> <label class="form-label">Street Name | தெரு பெயர் </label>
<input type="text" class="form-control" name="streetname" id="streetname" >
<input type="text" class="form-control" name="streetname" id="streetname">
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Area Name | பகுதி பெயர் </label> <label class="form-label">Area Name | பகுதி பெயர் </label>
<input type="text" class="form-control" name="areaname" id="areaname" >
<input type="text" class="form-control" name="areaname" id="areaname">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">District | மாவட்டம் </label> <label class="form-label">District | மாவட்டம் </label>
<input type="text" class="form-control" name="district" id="district" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
<input type="text" class="form-control" name="district" id="district"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Pincode | அஞ்சல் குறியீடு </label> <label class="form-label">Pincode | அஞ்சல் குறியீடு </label>
<input type="text" class="form-control" name="pincode" id="pincode" oninput="validatePincode(this)" >
<input type="text" class="form-control" name="pincode" id="pincode"
oninput="validatePincode(this)">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Aadhaar Number | ஆதார் எண் </label> <label class="form-label">Aadhaar Number | ஆதார் எண் </label>
<input type="text" class="form-control" id="aadhar_number" name="aadhar_number" maxlength="12" oninput="validateAadhar(this)" >
<input type="text" class="form-control" id="aadhar_number" name="aadhar_number"
maxlength="12" oninput="validateAadhar(this)">
</div> </div>
</div> </div>
@ -587,21 +638,24 @@ padding-top: 2%;
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Aadhaar Front Image | ஆதார் முன்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Aadhaar Front Image | ஆதார் முன்னணி படத்தை
பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="aadharfrontimage" <input type="file" class="form-control" id="aadharfrontimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharfrontimage" >
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharfrontimage">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Aadhaar Back Image | ஆதார் பின்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Aadhaar Back Image | ஆதார் பின்னணி படத்தை பதிவேற்றவும்
(jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="aadharbackimage" <input type="file" class="form-control" id="aadharbackimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharbackimage" >
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharbackimage">
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Take Ration Card Front Image | ரேஷன் கார்டு முன்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Take Ration Card Front Image | ரேஷன் கார்டு முன்னணி
படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="ration_card_photo" <input type="file" class="form-control" id="ration_card_photo"
accept=".jpg,.jpeg,.pdf,application/pdf" name="ration_card_photo" >
accept=".jpg,.jpeg,.pdf,application/pdf" name="ration_card_photo">
</div> </div>
</div> </div>
@ -610,34 +664,45 @@ padding-top: 2%;
<div class="note-row"> <div class="note-row">
<input type="checkbox"> <input type="checkbox">
<div class="note-text">I have no other means of livelihood except street vending / எனக்கு சாலையோர வியாபாரத்தைத் தவிர வேறு எந்த வாழ்வாதாரமும் இல்லை.</div>
<div class="note-text">I have no other means of livelihood except street vending
/ எனக்கு வேறு வாழ்வாதார வழிகள் எதுவும் இல்லை.</div>
</div> </div>
<div class="note-row"> <div class="note-row">
<input type="checkbox"> <input type="checkbox">
<div class="note-text">I am not carrying out vending at any other place at the same time / ஒரே நேரத்தில் வேறு எந்த இடத்திலும் வியாபாரம் செய்யவில்லை.</div>
<div class="note-text">I shall carry on the business of street vending myself or
through any of my family member / நான் அல்லது என்னுடைய குடும்ப உறுப்பினர்
வாயிலாக தெரு விற்பனை தொழிலை மேற்கொள்வேன்.</div>
</div> </div>
<div class="note-row"> <div class="note-row">
<input type="checkbox"> <input type="checkbox">
<div class="note-text">I and/or my family members are engaged only in this roadside vending activity / நானோ அல்லது எனது குடும்ப உறுப்பினர்கள் மூலம் சாலையோர வியாபாரம் செய்கிறேன்.</div>
<div class="note-text">I shall not transfer in any manner whatsoever, including
rent, the Certificate of Vending or the place specified therein to any other
person. / வாடகை, விற்பனைச் சான்றிதழ் அல்லது குறிப்பிடப்பட்டுள்ள இடம் உட்பட
எதையும் நான் வேறு எந்த நபருக்கும் எந்த வகையிலும் மாற்றம் செய்யமாட்டேன்.
</div>
</div> </div>
<div class="note-row"> <div class="note-row">
<input type="checkbox"> <input type="checkbox">
<div class="note-text">I have completed fourteen years of age / நான், பதினான்கு வயது பூர்த்தி அடைந்துள்ளேன்.</div>
<div class="note-text">I certify that I have attained the age of 14 (fourteen
years). / எனக்கு 14 வயது (பதினான்கு வயது) பூர்த்தி அடைந்துவிட்டது,என்று
உறுதி அளிக்கிறேன்.</div>
</div> </div>
</div> </div>
<div class="text-center mt-2"> <div class="text-center mt-2">
<span class="text-danger">*</span>Note: Click all the checkboxes above to submit the form.
<span class="text-danger">*</span>Note: Click all the checkboxes above to submit the
form.
</div> </div>
<!-- Submit --> <!-- Submit -->
<div class="text-center mt-4"> <div class="text-center mt-4">
<button type="submit" class="btn btn-success" name="submitBtn" id="submitBtn">Submit</button>
<button type="submit" class="btn btn-success" name="submitBtn"
id="submitBtn">Submit</button>
</div> </div>
</form> </form>
@ -652,7 +717,8 @@ padding-top: 2%;
</div> </div>
</div> </div>
</div> </div>
<div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
<div 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 style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
@ -674,15 +740,15 @@ padding-top: 2%;
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script> <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Bootstrap 5 JS --> <!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script sync defer <script sync defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCi7N6uW5MZaSkd50Kzw7ax2GkMN1vjE-E&callback=myMap&libraries=places"> src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCi7N6uW5MZaSkd50Kzw7ax2GkMN1vjE-E&callback=myMap&libraries=places">
</script> </script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://www.gstatic.com/inputtools/js/ln/13/en.js"></script>
<script>
function allowTamilAndSymbols(id) {
<script src="https://www.gstatic.com/inputtools/js/ln/13/en.js"></script>
<script>
function allowTamilAndSymbols(id) {
const el = document.getElementById(id); const el = document.getElementById(id);
el.addEventListener("input", function () { el.addEventListener("input", function () {
@ -697,15 +763,15 @@ function allowTamilAndSymbols(id) {
// Newline → \n (included in \s) // Newline → \n (included in \s)
this.value = this.value.replace(/[^\u0B80-\u0BFF0-9.,\/\-\s]/g, ""); this.value = this.value.replace(/[^\u0B80-\u0BFF0-9.,\/\-\s]/g, "");
}); });
}
}
allowTamilAndSymbols("landmark_tamil");
allowTamilAndSymbols("vendor_district_tamil");
allowTamilAndSymbols("name_tamil");
allowTamilAndSymbols("father_name_tamil");
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
allowTamilAndSymbols("landmark_tamil");
allowTamilAndSymbols("vendor_district_tamil");
allowTamilAndSymbols("name_tamil");
allowTamilAndSymbols("father_name_tamil");
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const checkboxes = document.querySelectorAll(".section-notes input[type='checkbox']"); const checkboxes = document.querySelectorAll(".section-notes input[type='checkbox']");
const submitBtn1 = document.getElementById("submitBtn"); const submitBtn1 = document.getElementById("submitBtn");
@ -721,8 +787,8 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
}); });
});
</script>
});
</script>
<script> <script>
@ -881,7 +947,7 @@ document.addEventListener("DOMContentLoaded", function () {
//const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/ //const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/
//FeatureServer/2/query?where=&objectIds=&time=&geometry={encodedGeometry}&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1&units=esriSRUnit_Meter&outFields=zone,ward&returnGeometry=false&f=geojson`; //FeatureServer/2/query?where=&objectIds=&time=&geometry={encodedGeometry}&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1&units=esriSRUnit_Meter&outFields=zone,ward&returnGeometry=false&f=geojson`;
const url=`https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/2/query?` +
const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/2/query?` +
`where=&objectIds=&time=&geometry=${encodedGeometry}` + `where=&objectIds=&time=&geometry=${encodedGeometry}` +
`&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1` + `&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1` +
`&units=esriSRUnit_Meter&relationParam=&outFields=zone,ward` + `&units=esriSRUnit_Meter&relationParam=&outFields=zone,ward` +
@ -1119,7 +1185,7 @@ document.addEventListener("DOMContentLoaded", function () {
console.log("Check-mobile response:", resp); console.log("Check-mobile response:", resp);
if (resp.exists === false) { if (resp.exists === false) {
//console.log("New mobile → allowed"); //console.log("New mobile → allowed");
proceedSubmission(mobileNumber,formData);
proceedSubmission(mobileNumber, formData);
return; return;
} }
if (resp.blocked === true) { if (resp.blocked === true) {
@ -1132,7 +1198,7 @@ document.addEventListener("DOMContentLoaded", function () {
return; return;
} }
//console.log("Mobile exists but allowed (Rejected case)"); //console.log("Mobile exists but allowed (Rejected case)");
proceedSubmission(mobileNumber,formData);
proceedSubmission(mobileNumber, formData);
}, },
error: function () { error: function () {
$('#pageLoader').hide(); $('#pageLoader').hide();
@ -1149,7 +1215,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
function proceedSubmission(mobileNumber,formData){
function proceedSubmission(mobileNumber, formData) {
$('#pageLoader').show(); $('#pageLoader').show();
function setIfPresent(formData, key, value) { function setIfPresent(formData, key, value) {
if (value !== undefined && value !== null && value !== "") { if (value !== undefined && value !== null && value !== "") {
@ -1172,7 +1238,7 @@ document.addEventListener("DOMContentLoaded", function () {
// bank_acc_status // bank_acc_status
let bankVal = $("input[name='bank_account']:checked").val(); let bankVal = $("input[name='bank_account']:checked").val();
setIfPresent(formData, "bank_acc_status",bankVal === undefined ? "" : bankVal === "Yes");
setIfPresent(formData, "bank_acc_status", bankVal === undefined ? "" : bankVal === "Yes");
// diff_abled // diff_abled
let diffVal = $("input[name='differently_abled']:checked").val(); let diffVal = $("input[name='differently_abled']:checked").val();
@ -1192,7 +1258,12 @@ document.addEventListener("DOMContentLoaded", function () {
$('#submitBtn').prop('disabled', false).text('Submit'); $('#submitBtn').prop('disabled', false).text('Submit');
return; return;
} }
if (isBankYes) setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0].files[0]);
if (isBankYes) {
setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0]);
}
//if (isBankYes) setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0]);
// Lat/Lng // Lat/Lng
const latitude = $('#latitude_field').val().trim(); const latitude = $('#latitude_field').val().trim();
@ -1218,7 +1289,7 @@ document.addEventListener("DOMContentLoaded", function () {
// Pincode validation // Pincode validation
const vendingPincode = $('#vendor_pincode').val().trim(); const vendingPincode = $('#vendor_pincode').val().trim();
if (vendingPincode !=="" && !/^\d{6}$/.test(vendingPincode)) {
if (vendingPincode !== "" && !/^\d{6}$/.test(vendingPincode)) {
$('#pageLoader').hide(); $('#pageLoader').hide();
Swal.fire("Invalid vending place pincode", "Pincode must be 6 digits.", "error"); Swal.fire("Invalid vending place pincode", "Pincode must be 6 digits.", "error");
$('#submitBtn').prop('disabled', false).text('Submit'); $('#submitBtn').prop('disabled', false).text('Submit');
@ -1227,7 +1298,7 @@ document.addEventListener("DOMContentLoaded", function () {
setIfPresent(formData, "vending_pincode", vendingPincode); setIfPresent(formData, "vending_pincode", vendingPincode);
const presentPincode = $('#pincode').val().trim(); const presentPincode = $('#pincode').val().trim();
if (presentPincode !=="" && !/^\d{6}$/.test(presentPincode)) {
if (presentPincode !== "" && !/^\d{6}$/.test(presentPincode)) {
$('#pageLoader').hide(); $('#pageLoader').hide();
Swal.fire("Invalid Present place Pincode", "Pincode must be 6 digits.", "error"); Swal.fire("Invalid Present place Pincode", "Pincode must be 6 digits.", "error");
$('#submitBtn').prop('disabled', false).text('Submit'); $('#submitBtn').prop('disabled', false).text('Submit');
@ -1237,7 +1308,7 @@ document.addEventListener("DOMContentLoaded", function () {
// Aadhaar validation // Aadhaar validation
const aadharNo = $('#aadhar_number').val().trim(); const aadharNo = $('#aadhar_number').val().trim();
if (aadharNo !=="" && !/^\d{12}$/.test(aadharNo)) {
if (aadharNo !== "" && !/^\d{12}$/.test(aadharNo)) {
$('#pageLoader').hide(); $('#pageLoader').hide();
Swal.fire("Invalid Aadhaar Number", "Aadhaar number must be 12 digits.", "error"); Swal.fire("Invalid Aadhaar Number", "Aadhaar number must be 12 digits.", "error");
$('#submitBtn').prop('disabled', false).text('Submit'); $('#submitBtn').prop('disabled', false).text('Submit');
@ -1258,6 +1329,20 @@ document.addEventListener("DOMContentLoaded", function () {
setIfPresent(formData, "name", $('#name').val()); setIfPresent(formData, "name", $('#name').val());
setIfPresent(formData, "f_h_name", $('#father_name').val()); setIfPresent(formData, "f_h_name", $('#father_name').val());
const dobValue = new Date($('#dob').val());
const today = new Date();
const age14Date = new Date(
today.getFullYear() - 14,
today.getMonth(),
today.getDate()
);
if (dobValue > age14Date) {
Swal.fire("Invalid Age", "Applicant must be at least 14 years old.", "error");
return;
}
setIfPresent(formData, "dob", $('#dob').val()); setIfPresent(formData, "dob", $('#dob').val());
@ -1351,14 +1436,31 @@ document.addEventListener("DOMContentLoaded", function () {
// DOB max date // DOB max date
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const dobInput = document.getElementById("dob"); const dobInput = document.getElementById("dob");
const today = new Date().toISOString().split("T")[0];
dobInput.setAttribute("max", today);
const today = new Date();
// Subtract 14 years
const minAgeDate = new Date(
today.getFullYear() - 14,
today.getMonth(),
today.getDate()
);
// Format to yyyy-mm-dd
const formattedDate = minAgeDate.toISOString().split("T")[0];
// Set maximum allowed date
dobInput.setAttribute("max", formattedDate);
// Open picker on focus (optional)
dobInput.addEventListener("focus", function () { dobInput.addEventListener("focus", function () {
if (typeof dobInput.showPicker === "function") { if (typeof dobInput.showPicker === "function") {
dobInput.showPicker(); dobInput.showPicker();
} }
}); });
}); });
@ -1367,4 +1469,5 @@ document.addEventListener("DOMContentLoaded", function () {
</body> </body>
</html> </html>
Loading…
Cancel
Save