Browse Source

implemented department side and enhancement for public form

master
AJITHKUMAR12 2 months ago
parent
commit
ab8d7a9e0c
  1. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025124945_bird.jpg
  2. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025124945_duck-7406987.jpg
  3. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130138_bird.jpg
  4. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130138_joban-khangura-hG8B9pKiilw-unsplash.jpg
  5. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130247_bird.jpg
  6. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130247_duck-7406987.jpg
  7. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025160944_sc1.jpeg
  8. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161152_sc1.jpeg
  9. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161603_sc1.jpeg
  10. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161755_sc1.jpeg
  11. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025162323_sc1.jpeg
  12. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025162414_sc1.jpeg
  13. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025110136_sc1.jpeg
  14. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025112848_sc1.jpeg
  15. BIN
      gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025113046_sc1.jpeg
  16. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026134533_sample1.jpg
  17. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026134650_sample1.jpg
  18. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165041_newuser.jpg
  19. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165137_newuser.jpg
  20. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165232_newuser.jpg
  21. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026113726_MacBookPro14_-1.jpg
  22. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026113726_sample1.jpg
  23. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026115813_MacBookPro14_-1.jpg
  24. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026115813_sample1.jpg
  25. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026132432_MacBookPro14_-1.jpg
  26. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026132432_sample1.jpg
  27. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_22012026125708_newuser.jpg
  28. BIN
      gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_22012026125832_newuser.jpg
  29. 133
      src/main/java/com/gcc/greencommitte/controller/Apicontroller.java
  30. 128
      src/main/java/com/gcc/greencommitte/service/Greencommitteeservice.java
  31. 2
      src/main/resources/application.properties
  32. 378
      src/main/resources/templates/modules/department/form.html
  33. 116
      src/main/resources/templates/modules/public/form.html

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025124945_bird.jpg

Before

Width: 1280  |  Height: 897  |  Size: 191 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025124945_duck-7406987.jpg

Before

Width: 5401  |  Height: 3601  |  Size: 3.2 MiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130138_bird.jpg

Before

Width: 1280  |  Height: 897  |  Size: 191 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130138_joban-khangura-hG8B9pKiilw-unsplash.jpg

Before

Width: 2400  |  Height: 3001  |  Size: 2.5 MiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130247_bird.jpg

Before

Width: 1280  |  Height: 897  |  Size: 191 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025130247_duck-7406987.jpg

Before

Width: 5401  |  Height: 3601  |  Size: 3.2 MiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025160944_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161152_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161603_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025161755_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025162323_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_27122025162414_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025110136_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025112848_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2025/12/comp_image1_29122025113046_sc1.jpeg

Before

Width: 781  |  Height: 218  |  Size: 32 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026134533_sample1.jpg

Before

Width: 1181  |  Height: 781  |  Size: 278 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026134650_sample1.jpg

Before

Width: 1181  |  Height: 781  |  Size: 278 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165041_newuser.jpg

Before

Width: 1440  |  Height: 1482  |  Size: 102 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165137_newuser.jpg

Before

Width: 1440  |  Height: 1482  |  Size: 102 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_02012026165232_newuser.jpg

Before

Width: 1440  |  Height: 1482  |  Size: 102 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026113726_MacBookPro14_-1.jpg

Before

Width: 1512  |  Height: 982  |  Size: 515 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026113726_sample1.jpg

Before

Width: 1181  |  Height: 781  |  Size: 278 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026115813_MacBookPro14_-1.jpg

Before

Width: 1512  |  Height: 982  |  Size: 515 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026115813_sample1.jpg

Before

Width: 1181  |  Height: 781  |  Size: 278 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026132432_MacBookPro14_-1.jpg

Before

Width: 1512  |  Height: 982  |  Size: 515 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_12012026132432_sample1.jpg

Before

Width: 1181  |  Height: 781  |  Size: 278 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_22012026125708_newuser.jpg

Before

Width: 1440  |  Height: 1482  |  Size: 102 KiB

BIN
gcc_mobile_service_uploads/green_committee_files/2026/01/comp_image1_22012026125832_newuser.jpg

Before

Width: 1440  |  Height: 1482  |  Size: 102 KiB

133
src/main/java/com/gcc/greencommitte/controller/Apicontroller.java

@ -196,6 +196,7 @@ public class Apicontroller {
@RequestParam MultipartFile c1image, @RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image, @RequestParam MultipartFile c2image,
@RequestParam String comp_details, @RequestParam String comp_details,
@RequestParam String streetName,
@RequestParam String source) throws JsonMappingException, JsonProcessingException { @RequestParam String source) throws JsonMappingException, JsonProcessingException {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -215,7 +216,7 @@ public class Apicontroller {
// System.out.println("======="+latitude+","+longitude); // System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savepublicform(p_name, ph_no, gender, address, latitude, longitude, zone, ward, String saveStatus = gcservice.savepublicform(p_name, ph_no, gender, address, latitude, longitude, zone, ward,
remarks, c1imagePath, c2imagePath, compList, totalTreeCount, source);
remarks, c1imagePath, c2imagePath, compList, totalTreeCount, source, streetName);
if (saveStatus == null || saveStatus.equals("error")) { if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of( return ResponseEntity.ok(Map.of(
@ -352,6 +353,127 @@ public class Apicontroller {
} }
} }
@PostMapping("/savedeptpruningform")
public ResponseEntity<?> deptregisterComplaint(
@RequestParam(value = "p_name", required = false) String complainantName,
@RequestParam(value = "address", required = false) String complainantAddr,
@RequestParam(value = "ph_no", required = false) String mobileNo,
@RequestParam(value = "Email", required = false) String email,
@RequestParam(value = "ComplaintType", required = false) String complaintType,
@RequestParam(value = "ComplaintTitle", required = false) String complaintTitle,
@RequestParam(value = "remarks", required = false) String complaintDetails,
@RequestParam(value = "StreetId", required = false) String streetId,
@RequestParam(value = "c1image", required = false) MultipartFile compImage,
@RequestParam(value = "latitude", required = false) String latitude,
@RequestParam(value = "longitude", required = false) String longtitude,
@RequestParam(value = "Landmark", required = false) String landmark,
@RequestParam(value = "gender", required = false) String gender) {
complaintType = "454";
complaintTitle = "Tree Pruning";
System.out.println("========== DEPT Incoming Request ==========");
System.out.println("Complainant Name : " + complainantName);
System.out.println("Address : " + complainantAddr);
System.out.println("Mobile No : " + mobileNo);
System.out.println("Email : " + email);
System.out.println("Complaint Type : " + complaintType);
System.out.println("Complaint Title : " + complaintTitle);
System.out.println("Complaint Details: " + complaintDetails);
System.out.println("Street ID : " + streetId);
System.out.println("Latitude : " + latitude);
System.out.println("Longitude : " + longtitude);
System.out.println("Landmark : " + landmark);
System.out.println("Gender : " + gender);
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
try {
URL url = new URL(externalUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
// 1) Convert MultipartFile to Base64 string
String compImageBase64 = "";
if (compImage != null && !compImage.isEmpty()) {
byte[] bytes = compImage.getBytes();
compImageBase64 = Base64.getEncoder().encodeToString(bytes);
}
System.out.println("compImage.." + compImage);
String params = "serviceId=RegComplaint" +
"&ComplainantName=" + URLEncoder.encode(complainantName != null ? complainantName : "", "UTF-8") +
"&ComplainantAddr=" + URLEncoder.encode(complainantAddr != null ? complainantAddr : "", "UTF-8") +
"&MobileNo=" + URLEncoder.encode(mobileNo != null ? mobileNo : "", "UTF-8") +
"&Email=" + URLEncoder.encode(email != null ? email : "", "UTF-8") +
"&ComplaintType=" + URLEncoder.encode(complaintType != null ? complaintType : "", "UTF-8") +
"&ComplaintTitle=" + URLEncoder.encode(complaintTitle != null ? complaintTitle : "", "UTF-8") +
"&ComplaintDetails=" + URLEncoder.encode(complaintDetails != null ? complaintDetails : "", "UTF-8")
+
"&StreetId=" + URLEncoder.encode(streetId != null ? streetId : "", "UTF-8") +
"&Comp_Image=" + URLEncoder.encode(compImageBase64, "UTF-8") +
"&latitude=" + URLEncoder.encode(latitude != null ? latitude : "", "UTF-8") +
"&longtitude=" + URLEncoder.encode(longtitude != null ? longtitude : "", "UTF-8") +
"&Landmark=" + URLEncoder.encode(landmark != null ? landmark : "", "UTF-8") +
"&gender=" + URLEncoder.encode(gender != null ? gender : "", "UTF-8") +
"&compmode=1";
/*
* System.out.println("========================================");
* System.out.println("External URL : " + externalUrl);
*
* System.out.println("========================================");
*/
try (OutputStream os = conn.getOutputStream()) {
byte[] input = params.getBytes("UTF-8");
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
System.out.println("responseCode" + responseCode);
BufferedReader reader;
if (responseCode == HttpURLConnection.HTTP_OK) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
}
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
System.out.println("response" + response);
}
reader.close();
// ✅ Parse and return only the complaint number
ObjectMapper mapper = new ObjectMapper();
Map<String, String> responseMap = mapper.readValue(response.toString(), Map.class);
System.out.println("responseMap" + responseMap);
String complaintNo = responseMap.getOrDefault("Complaint Number", "N/A");
System.out.println("complaintNo====" + complaintNo);
return ResponseEntity.ok(
Map.of(
"status", true,
"complaintNumber", complaintNo));
/*
* return ResponseEntity.ok()
* .contentType(MediaType.APPLICATION_JSON).body(Map.of("complaintNumber",
* complaintNo));
*/
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Map.of("error", "An error occurred while processing the request."));
}
}
@PostMapping("/savedeptform") @PostMapping("/savedeptform")
public ResponseEntity<?> savedeptform( public ResponseEntity<?> savedeptform(
@RequestParam String dept_id, @RequestParam String dept_id,
@ -368,6 +490,8 @@ public class Apicontroller {
@RequestParam MultipartFile c1image, @RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image, @RequestParam MultipartFile c2image,
@RequestParam String comp_details, @RequestParam String comp_details,
@RequestParam String streetName,
@RequestParam String source) throws JsonMappingException, JsonProcessingException { @RequestParam String source) throws JsonMappingException, JsonProcessingException {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -387,7 +511,7 @@ public class Apicontroller {
// System.out.println("======="+latitude+","+longitude); // System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savedeptform(dept_id, dept_name, ph_no, designation, govt_type, address, latitude, String saveStatus = gcservice.savedeptform(dept_id, dept_name, ph_no, designation, govt_type, address, latitude,
longitude, zone, ward, remarks, c1imagePath, c2imagePath, compList, totalTreeCount, source);
longitude, zone, ward, remarks, c1imagePath, c2imagePath, compList, totalTreeCount, streetName, source);
if (saveStatus == null || saveStatus.equals("error")) { if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of( return ResponseEntity.ok(Map.of(
@ -505,7 +629,6 @@ public class Apicontroller {
"ref_id", saveStatus)); "ref_id", saveStatus));
} }
// getpurninglist // getpurninglist
@GetMapping("/getpurninglist") @GetMapping("/getpurninglist")
@ -515,7 +638,6 @@ public class Apicontroller {
} }
@PostMapping("/generatepgrcomplaints") @PostMapping("/generatepgrcomplaints")
@ResponseBody @ResponseBody
public ResponseEntity<?> generatepgrcomplaints(String refid) { public ResponseEntity<?> generatepgrcomplaints(String refid) {
@ -523,7 +645,4 @@ public class Apicontroller {
return gcservice.generatepgrcomplaints(refid); return gcservice.generatepgrcomplaints(refid);
} }
} }

128
src/main/java/com/gcc/greencommitte/service/Greencommitteeservice.java

@ -24,7 +24,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
@ -43,8 +42,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.gcc.greencommitte.config.AppConfig; import com.gcc.greencommitte.config.AppConfig;
@Service @Service
public class Greencommitteeservice { public class Greencommitteeservice {
@ -136,16 +133,18 @@ public class Greencommitteeservice {
} }
@Transactional @Transactional
public String savepublicform(String p_name, String ph_no, String gender, String address,String latitude,String longitude, String zone, String ward,String remarks,
String c1imagePath, String c2imagePath, List<Map<String, Object>> compList,int totalTreeCount ,String source) {
public String savepublicform(String p_name, String ph_no, String gender, String address, String latitude,
String longitude, String zone, String ward, String remarks,
String c1imagePath, String c2imagePath, List<Map<String, Object>> compList, int totalTreeCount,
String source, String streetName) {
String cby = "public"; String cby = "public";
String remarksVal = (remarks != null && !remarks.isEmpty()) ? remarks : null; String remarksVal = (remarks != null && !remarks.isEmpty()) ? remarks : null;
String sql = "INSERT INTO reg_details (" String sql = "INSERT INTO reg_details ("
+ "cby,p_name,ph_no,gender,address,zone,ward,total_trees,remarks,latitude,longitude,source "
+ ") VALUES (?,?, ?, ?, ?, ?, ?, ?,?,?,?,?)";
+ "cby,p_name,ph_no,gender,address,zone,ward,total_trees,remarks,latitude,longitude,source,street_name "
+ ") VALUES (?,?, ?, ?, ?, ?, ?, ?,?,?,?,?,?)";
KeyHolder keyHolder = new GeneratedKeyHolder(); KeyHolder keyHolder = new GeneratedKeyHolder();
@ -164,6 +163,7 @@ public class Greencommitteeservice {
ps.setString(10, latitude); ps.setString(10, latitude);
ps.setString(11, longitude); ps.setString(11, longitude);
ps.setString(12, source); ps.setString(12, source);
ps.setString(13, streetName);
return ps; return ps;
}, keyHolder); }, keyHolder);
// return keyHolder.getKey().intValue(); // return keyHolder.getKey().intValue();
@ -203,18 +203,20 @@ public class Greencommitteeservice {
@Transactional @Transactional
public String savedeptform(String dept_id, String dept_name, String ph_no, String designation, String govt_type, public String savedeptform(String dept_id, String dept_name, String ph_no, String designation, String govt_type,
String address,String latitude,String longitude, String zone, String ward, String remarks, String c1imagePath, String c2imagePath,
List<Map<String, Object>> compList, int totalTreeCount,String source) {
String address, String latitude, String longitude, String zone, String ward, String remarks,
String c1imagePath, String c2imagePath,
List<Map<String, Object>> compList, int totalTreeCount, String streetName, String source) {
String cby = "department"; String cby = "department";
int deptIdInt = Integer.parseInt(dept_id); int deptIdInt = Integer.parseInt(dept_id);
System.out.println("address = " + address);
System.out.println("streetName = " + streetName);
String remarksVal = (remarks != null && !remarks.isEmpty()) ? remarks : null; String remarksVal = (remarks != null && !remarks.isEmpty()) ? remarks : null;
String sql = "INSERT INTO reg_details (" String sql = "INSERT INTO reg_details ("
+ "cby,dept_id,dept_name,govt_type,designation,ph_no,address,zone,ward,total_trees,remarks,latitude,longitude,source "
+ ") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ "cby,dept_id,dept_name,govt_type,designation,ph_no,address,zone,ward,total_trees,remarks,latitude,longitude,street_name,source "
+ ") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
KeyHolder keyHolder = new GeneratedKeyHolder(); KeyHolder keyHolder = new GeneratedKeyHolder();
@ -234,7 +236,9 @@ public class Greencommitteeservice {
ps.setString(11, remarksVal); ps.setString(11, remarksVal);
ps.setString(12, latitude); ps.setString(12, latitude);
ps.setString(13, longitude); ps.setString(13, longitude);
ps.setString(14,source);
ps.setString(14, streetName);
ps.setString(15, source);
return ps; return ps;
}, keyHolder); }, keyHolder);
// return keyHolder.getKey().intValue(); // return keyHolder.getKey().intValue();
@ -289,7 +293,8 @@ public class Greencommitteeservice {
// + " WHERE id.ref_id = rd.ref_id AND id.isactive=1 " // + " WHERE id.ref_id = rd.ref_id AND id.isactive=1 "
// + " )"; // + " )";
// //
// List<String> refIds=jdbcTemplate.query(sql,new Object[]{mobile_num},(rs, rowNum) -> rs.getString("ref_id"));
// List<String> refIds=jdbcTemplate.query(sql,new Object[]{mobile_num},(rs,
// rowNum) -> rs.getString("ref_id"));
// Map<String, Object> wrapper = new HashMap<>(); // Map<String, Object> wrapper = new HashMap<>();
// List<Map<String, Object>> dataList = new ArrayList<>(); // List<Map<String, Object>> dataList = new ArrayList<>();
// //
@ -330,32 +335,28 @@ public class Greencommitteeservice {
// 1 — Application details // 1 — Application details
Map<String, Object> app = jdbcTemplate.queryForMap( Map<String, Object> app = jdbcTemplate.queryForMap(
"SELECT *,DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') as r_Cdate,IFNULL(reinspection_id, '') AS com_reinspection_id FROM reg_details WHERE ref_id=?", "SELECT *,DATE_FORMAT(cdate, '%d-%m-%Y %l:%i %p') as r_Cdate,IFNULL(reinspection_id, '') AS com_reinspection_id FROM reg_details WHERE ref_id=?",
refId
);
refId);
// 2 — Complaint details (grouped) // 2 — Complaint details (grouped)
List<Map<String, Object>> complaints = jdbcTemplate.queryForList( List<Map<String, Object>> complaints = jdbcTemplate.queryForList(
"SELECT cn.name AS nature, SUM(cd.no_of_trees) AS count " + "SELECT cn.name AS nature, SUM(cd.no_of_trees) AS count " +
"FROM complaint_details cd JOIN comp_nature cn ON cn.id=cd.comp_nature_id " + "FROM complaint_details cd JOIN comp_nature cn ON cn.id=cd.comp_nature_id " +
"WHERE cd.ref_id=? GROUP BY cn.name", refId
);
"WHERE cd.ref_id=? GROUP BY cn.name",
refId);
String compDetails = complaints.stream() String compDetails = complaints.stream()
.map(c -> c.get("nature") + "-" + c.get("count")) .map(c -> c.get("nature") + "-" + c.get("count"))
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
// 3 — Complaint images // 3 — Complaint images
List<Map<String, Object>> imagePaths =
jdbcTemplate.queryForList(
List<Map<String, Object>> imagePaths = jdbcTemplate.queryForList(
"SELECT img_path FROM img_uploads WHERE ref_id=? AND is_active=1", "SELECT img_path FROM img_uploads WHERE ref_id=? AND is_active=1",
new Object[]{refId}
).stream()
new Object[] { refId }).stream()
.map(row -> { .map(row -> {
Map<String, Object> img = new HashMap<>(); Map<String, Object> img = new HashMap<>();
img.put( img.put(
"img_path", "img_path",
appconfig.getFilebaseurl() + "/gccofficialapp/files" + row.get("img_path").toString()
);
appconfig.getFilebaseurl() + "/gccofficialapp/files" + row.get("img_path").toString());
return img; return img;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -366,8 +367,7 @@ public class Greencommitteeservice {
List<Map<String, Object>> inspectionList = new ArrayList<>(); List<Map<String, Object>> inspectionList = new ArrayList<>();
String sql =
"SELECT id.*, um.name AS inspector_name, " +
String sql = "SELECT id.*, um.name AS inspector_name, " +
" DATE_FORMAT(id.cdate, '%d-%m-%Y %l:%i %p') AS f_Cdate " + " DATE_FORMAT(id.cdate, '%d-%m-%Y %l:%i %p') AS f_Cdate " +
"FROM inspection_data id " + "FROM inspection_data id " +
"LEFT JOIN user_maping um ON um.userid = id.cby " + "LEFT JOIN user_maping um ON um.userid = id.cby " +
@ -382,9 +382,7 @@ public class Greencommitteeservice {
"ORDER BY FIELD(id.inspection_by, 'GCC', 'NGO', 'TNFD')"; "ORDER BY FIELD(id.inspection_by, 'GCC', 'NGO', 'TNFD')";
List<Map<String, Object>> rows = jdbcTemplate.queryForList( List<Map<String, Object>> rows = jdbcTemplate.queryForList(
sql, refId, refId
);
sql, refId, refId);
for (Map<String, Object> row : rows) { for (Map<String, Object> row : rows) {
@ -396,8 +394,7 @@ public class Greencommitteeservice {
"FROM inspection_tree_data itd " + "FROM inspection_tree_data itd " +
"JOIN inspection_recommend_master rm ON rm.rid = itd.action " + "JOIN inspection_recommend_master rm ON rm.rid = itd.action " +
"WHERE itd.inspection_data_id=? AND itd.isactive=1", "WHERE itd.inspection_data_id=? AND itd.isactive=1",
inspId
);
inspId);
row.put("recommendations", recommend); row.put("recommendations", recommend);
List<String> imgs = new ArrayList<>(); List<String> imgs = new ArrayList<>();
@ -418,9 +415,7 @@ public class Greencommitteeservice {
app.put("inspections", inspectionList); app.put("inspections", inspectionList);
String reSql =
"SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " +
String reSql = "SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " +
" DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " + " DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " +
" cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date, crm.name as ins_name " + " cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date, crm.name as ins_name " +
"FROM reinspection r " + "FROM reinspection r " +
@ -441,8 +436,7 @@ public class Greencommitteeservice {
"FROM committee_data cd " + "FROM committee_data cd " +
"LEFT JOIN create_meeting cm ON cm.id = cd.meeting_id " + "LEFT JOIN create_meeting cm ON cm.id = cd.meeting_id " +
"WHERE cd.ref_id = ? AND cd.isactive = 1", "WHERE cd.ref_id = ? AND cd.isactive = 1",
refId
);
refId);
if (!committeeList.isEmpty()) { if (!committeeList.isEmpty()) {
c1 = committeeList.get(0); c1 = committeeList.get(0);
@ -453,8 +447,7 @@ public class Greencommitteeservice {
"JOIN committee_recommend_master crm ON crm.id = ctd.committee_action " + "JOIN committee_recommend_master crm ON crm.id = ctd.committee_action " +
"WHERE ctd.ref_id = ? " + "WHERE ctd.ref_id = ? " +
"GROUP BY crm.name", "GROUP BY crm.name",
refId
);
refId);
c1.put("com_complaints", com_complaints); c1.put("com_complaints", com_complaints);
} }
@ -462,13 +455,11 @@ public class Greencommitteeservice {
// IMPORTANT: always put committee key (even if null) // IMPORTANT: always put committee key (even if null)
app.put("committee", c1); app.put("committee", c1);
// response.put("data", app); // response.put("data", app);
return app; return app;
} }
public List<String> getrefnums(String mobile_num) { public List<String> getrefnums(String mobile_num) {
try { try {
@ -487,7 +478,6 @@ public class Greencommitteeservice {
} }
} }
// public Map<String, Object> getlistdata(String ref) { // public Map<String, Object> getlistdata(String ref) {
// //
// Map<String, Object> regDetails = getRegDetails(ref); // Map<String, Object> regDetails = getRegDetails(ref);
@ -548,14 +538,16 @@ public class Greencommitteeservice {
// String reSql = // String reSql =
// "SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " + // "SELECT r.id AS reins_id, r.committee_action, r.remarks AS reins_remarks, " +
// " DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " + // " DATE_FORMAT(r.cdate, '%d-%m-%Y %l:%i %p') AS reins_date, " +
// " cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date, crm.name as ins_name " +
// " cm.event_name, DATE_FORMAT(cm.event_date, '%d-%m-%Y') AS event_date,
// crm.name as ins_name " +
// "FROM reinspection r " + // "FROM reinspection r " +
// "LEFT JOIN create_meeting cm ON cm.id = r.meeting_id " + // "LEFT JOIN create_meeting cm ON cm.id = r.meeting_id " +
// " LEFT JOIN committee_recommend_master crm ON crm.id=r.committee_action " + // " LEFT JOIN committee_recommend_master crm ON crm.id=r.committee_action " +
// "WHERE r.ref_id = ? AND r.isactive = 1 " + // "WHERE r.ref_id = ? AND r.isactive = 1 " +
// "ORDER BY r.id DESC"; // "ORDER BY r.id DESC";
// //
// List<Map<String, Object>> reinspectionList = jdbcTemplate.queryForList(reSql, ref);
// List<Map<String, Object>> reinspectionList = jdbcTemplate.queryForList(reSql,
// ref);
// //
// regDetails.put("reinspections", reinspectionList); // regDetails.put("reinspections", reinspectionList);
// //
@ -599,7 +591,8 @@ public class Greencommitteeservice {
// //
// public List<Map<String, Object>> getComplaintDetails(String ref) { // public List<Map<String, Object>> getComplaintDetails(String ref) {
// //
// String sql = "SELECT cn.name AS nature, SUM(cd.no_of_trees) AS total_trees " +
// String sql = "SELECT cn.name AS nature, SUM(cd.no_of_trees) AS total_trees "
// +
// "FROM complaint_details cd " + // "FROM complaint_details cd " +
// "JOIN comp_nature cn ON cn.id = cd.comp_nature_id " + // "JOIN comp_nature cn ON cn.id = cd.comp_nature_id " +
// "WHERE cd.is_active = 1 AND cd.ref_id = ? " + // "WHERE cd.is_active = 1 AND cd.ref_id = ? " +
@ -608,7 +601,6 @@ public class Greencommitteeservice {
// return jdbcTemplate.queryForList(sql, ref); // return jdbcTemplate.queryForList(sql, ref);
// } // }
@Transactional @Transactional
public String withdraw(String id, String remarks) { public String withdraw(String id, String remarks) {
@ -625,7 +617,6 @@ public class Greencommitteeservice {
} }
public List<Map<String, Object>> getpurninglist() { public List<Map<String, Object>> getpurninglist() {
String sql = " SELECT " String sql = " SELECT "
@ -683,8 +674,6 @@ public List<Map<String, Object>> getpurninglist() {
} }
} }
public ResponseEntity<?> generatepgrcomplaints(String refid) { public ResponseEntity<?> generatepgrcomplaints(String refid) {
try { try {
@ -736,8 +725,7 @@ public List<Map<String, Object>> getpurninglist() {
return ResponseEntity.ok(Map.of( return ResponseEntity.ok(Map.of(
"status", false, "status", false,
"message", "No eligible complaint found for this Ref ID."
));
"message", "No eligible complaint found for this Ref ID."));
} }
String complaintNumber = ""; String complaintNumber = "";
@ -750,7 +738,8 @@ public List<Map<String, Object>> getpurninglist() {
// String imageUrl = ""; // String imageUrl = "";
// //
// if(row.get("img_path") != null){ // if(row.get("img_path") != null){
// imageUrl = "https://gccservices.in/gccofficialapp/files" + row.get("img_path");
// imageUrl = "https://gccservices.in/gccofficialapp/files" +
// row.get("img_path");
// } // }
// String imageBase64 = convertUrlToBase64(imageUrl); // String imageBase64 = convertUrlToBase64(imageUrl);
@ -760,8 +749,7 @@ public List<Map<String, Object>> getpurninglist() {
return ResponseEntity.ok(Map.of( return ResponseEntity.ok(Map.of(
"status", false, "status", false,
"message", "ERP complaint generation failed."
));
"message", "ERP complaint generation failed."));
} }
if (complaintNumber != null && !complaintNumber.equals("N/A")) { if (complaintNumber != null && !complaintNumber.equals("N/A")) {
@ -769,16 +757,14 @@ public List<Map<String, Object>> getpurninglist() {
jdbcTemplate.update( jdbcTemplate.update(
"UPDATE reg_details SET pgrticketno=? WHERE ref_id=?", "UPDATE reg_details SET pgrticketno=? WHERE ref_id=?",
complaintNumber, complaintNumber,
refId
);
refId);
jdbcTemplate.update( jdbcTemplate.update(
"UPDATE complaint_details " "UPDATE complaint_details "
+ "SET is_active=0, is_delete=1 " + "SET is_active=0, is_delete=1 "
+ "WHERE ref_id=? " + "WHERE ref_id=? "
+ "AND comp_nature_id IN (1,3)", + "AND comp_nature_id IN (1,3)",
refId
);
refId);
System.out.println(refId + " -> " + complaintNumber); System.out.println(refId + " -> " + complaintNumber);
@ -794,19 +780,14 @@ public List<Map<String, Object>> getpurninglist() {
"status", true, "status", true,
"message", "PGR Complaint generation completed.", "message", "PGR Complaint generation completed.",
"complaintNumber", complaintNumber, "complaintNumber", complaintNumber,
"total", list.size()
));
"total", list.size()));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ResponseEntity.internalServerError().body( return ResponseEntity.internalServerError().body(
Map.of( Map.of(
"status", false, "status", false,
"message", e.getMessage()
)
);
"message", e.getMessage()));
} }
} }
@ -832,17 +813,18 @@ private String sendComplaintToERP(Map<String,Object> row) {
String complainantName = getComplainantName(row); String complainantName = getComplainantName(row);
String params =
"serviceId=RegComplaint"
String params = "serviceId=RegComplaint"
+ "&ComplainantName=" + URLEncoder.encode(complainantName, "UTF-8") + "&ComplainantName=" + URLEncoder.encode(complainantName, "UTF-8")
+ "&ComplainantAddr=" + URLEncoder.encode(getString(row.get("address")), "UTF-8") + "&ComplainantAddr=" + URLEncoder.encode(getString(row.get("address")), "UTF-8")
+ "&MobileNo=" + URLEncoder.encode(getString(row.get("ph_no")), "UTF-8") + "&MobileNo=" + URLEncoder.encode(getString(row.get("ph_no")), "UTF-8")
+ "&Email=" + URLEncoder.encode("", "UTF-8") + "&Email=" + URLEncoder.encode("", "UTF-8")
+ "&ComplaintType=" + URLEncoder.encode(complaintType, "UTF-8") + "&ComplaintType=" + URLEncoder.encode(complaintType, "UTF-8")
+ "&ComplaintTitle=" + URLEncoder.encode(complaintTitle, "UTF-8") + "&ComplaintTitle=" + URLEncoder.encode(complaintTitle, "UTF-8")
+ "&ComplaintDetails=" + URLEncoder.encode(getString(row.get("remarks")), "UTF-8")+ URLEncoder.encode(getString(row.get("ref_id")), "UTF-8")
+ "&ComplaintDetails=" + URLEncoder.encode(getString(row.get("remarks")), "UTF-8")
+ URLEncoder.encode(getString(row.get("ref_id")), "UTF-8")
+ "&StreetId=" + URLEncoder.encode(getString(row.get("streetid")), "UTF-8") + "&StreetId=" + URLEncoder.encode(getString(row.get("streetid")), "UTF-8")
//+ "&Comp_Image=" + URLEncoder.encode(imageBase64 == null ? "" : imageBase64, "UTF-8")
// + "&Comp_Image=" + URLEncoder.encode(imageBase64 == null ? "" : imageBase64,
// "UTF-8")
+ "&Comp_Image=" + URLEncoder.encode("", "UTF-8") + "&Comp_Image=" + URLEncoder.encode("", "UTF-8")
+ "&latitude=" + URLEncoder.encode(getString(row.get("latitude")), "UTF-8") + "&latitude=" + URLEncoder.encode(getString(row.get("latitude")), "UTF-8")
+ "&longtitude=" + URLEncoder.encode(getString(row.get("longitude")), "UTF-8") + "&longtitude=" + URLEncoder.encode(getString(row.get("longitude")), "UTF-8")
@ -850,8 +832,6 @@ private String sendComplaintToERP(Map<String,Object> row) {
+ "&gender=" + URLEncoder.encode(getString(row.get("gender")), "UTF-8") + "&gender=" + URLEncoder.encode(getString(row.get("gender")), "UTF-8")
+ "&compmode=1"; + "&compmode=1";
System.out.println(params); System.out.println(params);
try (OutputStream os = conn.getOutputStream()) { try (OutputStream os = conn.getOutputStream()) {
@ -887,7 +867,6 @@ private String sendComplaintToERP(Map<String,Object> row) {
reader.close(); reader.close();
String responseText = response.toString(); String responseText = response.toString();
System.out.println("================================="); System.out.println("=================================");
@ -902,13 +881,11 @@ private String sendComplaintToERP(Map<String,Object> row) {
} }
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
Map<String, Object> responseMap =
mapper.readValue(responseText, Map.class);
Map<String, Object> responseMap = mapper.readValue(responseText, Map.class);
return String.valueOf(responseMap.get("Complaint Number")); return String.valueOf(responseMap.get("Complaint Number"));
}
catch(Exception e){
} catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
@ -986,7 +963,6 @@ private String getComplainantName(Map<String, Object> row) {
return temp; return temp;
} }
// private String getComplainantName(Map<String, Object> row) { // private String getComplainantName(Map<String, Object> row) {
// //
// String pName = getString(row.get("p_name")).trim(); // String pName = getString(row.get("p_name")).trim();

2
src/main/resources/application.properties

@ -1,3 +1,3 @@
spring.application.name=greencommitte spring.application.name=greencommitte
spring.profiles.active=prod
spring.profiles.active=dev

378
src/main/resources/templates/modules/department/form.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"> <html lang="en" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>GCC Green Committee</title> <title>GCC Green Committee</title>
@ -53,7 +54,8 @@
padding: 10px; padding: 10px;
display: none; display: none;
flex-direction: column; flex-direction: column;
z-index: 1000; /* Add z-index to bring the menu above other elements */
z-index: 1000;
/* Add z-index to bring the menu above other elements */
} }
.menu-dropdown a { .menu-dropdown a {
@ -84,9 +86,11 @@
.menu-dropdown { .menu-dropdown {
right: 0; right: 0;
left: 0; left: 0;
z-index: 1000; /* Add z-index to bring the menu above other elements */
z-index: 1000;
/* Add z-index to bring the menu above other elements */
} }
} }
/*css for map in step2*/ /*css for map in step2*/
#googleMap { #googleMap {
height: 300px; height: 300px;
@ -163,9 +167,11 @@
#suggestions ul li:hover { #suggestions ul li:hover {
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.multi-select-dropdown { .multi-select-dropdown {
position: relative; position: relative;
} }
.dropdown-checkbox-menu { .dropdown-checkbox-menu {
position: absolute; position: absolute;
background: #fff; background: #fff;
@ -178,9 +184,11 @@
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
} }
#img_container input { #img_container input {
height: 45px !important; height: 45px !important;
} }
.otp-input-box { .otp-input-box {
/*display: flex; /*display: flex;
justify-content: space-between;*/ justify-content: space-between;*/
@ -297,14 +305,15 @@ textarea.form-control {
.row { .row {
row-gap: 15px; row-gap: 15px;
} }
#sendOtpButton { #sendOtpButton {
margin-top: 10px !important; margin-top: 10px !important;
} }
} }
</style> </style>
</head> </head>
<body style="background-color: #f1f3f4;"> <body style="background-color: #f1f3f4;">
<!-- Header Start--> <!-- Header Start-->
@ -347,9 +356,12 @@ textarea.form-control {
<div class="p-4"> <div class="p-4">
<form id="deptform" enctype="multipart/form-data"> <form id="deptform" enctype="multipart/form-data">
<div class="section-header text-center"><h5>GREEN COMMITTEE DEPARTMENT FORM</h5></div>
<div class="section-header text-center">
<h5>GREEN COMMITTEE DEPARTMENT FORM</h5>
</div>
<div class="text-center mt-1 mb-3"> <div class="text-center mt-1 mb-3">
<span style="color: red;font-size: small;">This form is for the department, not for the citizen(public)</span>
<span style="color: red;font-size: small;">This form is for the department, not for the
citizen(public)</span>
</div> </div>
<div class="row mb-3" style="row-gap:10px;"> <div class="row mb-3" style="row-gap:10px;">
<div class="col-md-3"> <div class="col-md-3">
@ -375,29 +387,36 @@ textarea.form-control {
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label">Applicant Designation<span class="text-danger">*</span></label> <label class="form-label">Applicant Designation<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="designation" name="designation" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" placeholder="Enter Designation" required>
<input type="text" class="form-control" id="designation" name="designation"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')"
placeholder="Enter Designation" required>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label">Mobile Number<span class="text-danger">*</span></label> <label class="form-label">Mobile Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no" oninput="validatePhoneNumber(this)" placeholder="Enter Mobile Number" required>
<input type="text" class="form-control" id="mobile_no" name="mobile_no"
oninput="validatePhoneNumber(this)" placeholder="Enter Mobile Number" required>
</div> </div>
<div class="col-md-2" id="otpbeforeverified"> <div class="col-md-2" id="otpbeforeverified">
<button type="button" class="btn btn-primary" id="sendOtpButton" style="margin-top: 32px;">Send OTP</button>
<button type="button" class="btn btn-primary" id="sendOtpButton" style="margin-top: 32px;">Send
OTP</button>
</div> </div>
<div class="col-md-2" id="otpafterverified" style="display: none;"> <div class="col-md-2" id="otpafterverified" style="display: none;">
<i class="fa-solid fa-circle-check"style="margin-top: 40px;font-size: x-large;color: green;"></i>
<i class="fa-solid fa-circle-check"
style="margin-top: 40px;font-size: x-large;color: green;"></i>
</div> </div>
</div> </div>
<!-- <div class="row mb-3"> <!-- <div class="row mb-3">
</div> --> </div> -->
<div class="row mb-3">
<!--<div class="row mb-3">
<div class="col-md-12"> <div class="col-md-12">
<label class="form-label">Tree Land Location (Also click the street in Map)<span class="text-danger">*</span></label>
<textarea class="form-control" id="address" name="address" maxlength="255" placeholder="Type Tree Address Here" required ></textarea>
</div>
<label class="form-label">Tree Land Location (Also click the street in Map)<span
class="text-danger">*</span></label>
<textarea class="form-control" id="address" name="address" maxlength="255"
placeholder="Type Tree Address Here" required></textarea>
</div> </div>
</div>-->
<div id="mapContainer" style="position: relative; height: 300px;"> <div id="mapContainer" style="position: relative; height: 300px;">
<input id="pac-input" class="controls" type="text" placeholder="Search location"> <input id="pac-input" class="controls" type="text" placeholder="Search location">
@ -417,6 +436,16 @@ textarea.form-control {
<label for="longitude">Longitude<span class="text-danger">*</span></label> <label for="longitude">Longitude<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="longitude" name="longitude" readonly> <input type="text" class="form-control" id="longitude" name="longitude" readonly>
</div> </div>
<div class="col-md-6">
<label for="streetName">Street<span class="text-danger">*</span></label>
<select id="streetName" name="streetName" class="form-control" required>
<option value="">Select Street</option>
</select>
</div>
</div>
<div class="row mb-3">
<input type="hidden" id="streetId" name="streetId">
<div class="col-md-3"> <div class="col-md-3">
<label for="zone">Zone<span class="text-danger">*</span></label> <label for="zone">Zone<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="zone" name="zone" required readonly> <input type="text" class="form-control" id="zone" name="zone" required readonly>
@ -428,16 +457,24 @@ textarea.form-control {
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label">Details of Complaint<span class="text-danger">*</span></label>
<div class="text-danger mb-2 text-nowrap">
<strong>Note:</strong> Pruning requests must be raised separately.
</div>
<label class="form-label">Request Type<span class="text-danger">*</span></label>
<!-- Dropdown clickable box --> <!-- Dropdown clickable box -->
<div class="multi-select-dropdown"> <div class="multi-select-dropdown">
<div id="dropdownToggle" class="form-control" style="cursor:pointer;" required> <div id="dropdownToggle" class="form-control" style="cursor:pointer;" required>
Select Options Select Options
</div> </div>
<!-- Checkbox list appears here --> <!-- Checkbox list appears here -->
<div id="compnature_checkbox_list" class="dropdown-checkbox-menu"></div> <div id="compnature_checkbox_list" class="dropdown-checkbox-menu"></div>
</div> </div>
@ -446,22 +483,34 @@ textarea.form-control {
<!-- Dynamic input rows --> <!-- Dynamic input rows -->
<div id="naturecontainer"></div> <div id="naturecontainer"></div>
<div class="row mb-3">
<div class="col-md-6">
<label for="address">Location of Tree<span class="text-danger">*</span></label>
<!-- <input type="text" class="form-control" id="address" name="address" placeholder="Enter Address"
required>-->
<textarea class="form-control" id="address" name="address" placeholder="Type Tree Address Here"
required></textarea>
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-12"> <div class="col-md-12">
<label class="form-label">Remarks<span class="text-danger">*</span></label> <label class="form-label">Remarks<span class="text-danger">*</span></label>
<textarea class="form-control" id="remarks" name="remarks" maxlength="255" placeholder="Enter Remarks" required></textarea>
<textarea class="form-control" id="remarks" name="remarks" maxlength="255"
placeholder="Enter Remarks" required></textarea>
</div> </div>
</div> </div>
<div class="row mb-3" id="img_container"> <div class="row mb-3" id="img_container">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Upload Image 1 (jpg/jpeg)<span class="text-danger">*</span></label> <label class="form-label">Upload Image 1 (jpg/jpeg)<span class="text-danger">*</span></label>
<input type="file" class="form-control" id="c1image" accept=".jpg,.jpeg," name="c1image" required="required">
<input type="file" class="form-control" id="c1image" accept=".jpg,.jpeg," name="c1image"
required="required">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label">Upload Image 2 (jpg/jpeg)<span class="text-danger">*</span></label> <label class="form-label">Upload Image 2 (jpg/jpeg)<span class="text-danger">*</span></label>
<input type="file" class="form-control" id="c2image" accept=".jpg,.jpeg," name="c2image" required="required">
<input type="file" class="form-control" id="c2image" accept=".jpg,.jpeg," name="c2image"
required="required">
</div> </div>
</div> </div>
@ -470,7 +519,8 @@ textarea.form-control {
<div class="form-check align-items-start"> <div class="form-check align-items-start">
<input class="form-check-input mt-1" type="checkbox" id="agreeCheck"> <input class="form-check-input mt-1" type="checkbox" id="agreeCheck">
<label class="form-check-label ms-2" for="agreeCheck" style="text-align:left;"> <label class="form-check-label ms-2" for="agreeCheck" style="text-align:left;">
I acknowledge that the information provided is accurate and I agree to the terms and conditions.
I acknowledge that the information provided is accurate and I agree to the terms and
conditions.
</label> </label>
</div> </div>
</div> </div>
@ -479,7 +529,8 @@ textarea.form-control {
<span>OTP validation is mandatory for submitting the form.<span class="text-danger">*</span></span> <span>OTP validation is mandatory for submitting the form.<span class="text-danger">*</span></span>
<div class="text-center mt-4"> <div class="text-center mt-4">
<button type="submit" class="btn btn-success" name="submitBtn" id="submitBtn" disabled>Submit</button>
<button type="submit" class="btn btn-success" name="submitBtn" id="submitBtn"
disabled>Submit</button>
</div> </div>
@ -551,7 +602,8 @@ textarea.form-control {
</div><!--end modal-dialog--> </div><!--end modal-dialog-->
</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>
@ -686,9 +738,91 @@ $(document).ready(function () {
// Handle checkbox selection // Handle checkbox selection
$(document).on("change", ".nature-check", function () { $(document).on("change", ".nature-check", function () {
let name = $(this).data("name").trim().toLowerCase();
// Pruning selected
if ($(this).is(":checked") && name === "pruning") {
if ($(".nature-check:checked").not(this).length > 0) {
$(this).prop("checked", false);
Swal.fire({
icon: "warning",
title: "Invalid Selection",
text: "Pruning cannot be selected with other complaint types."
});
return;
}
}
// Another complaint selected after pruning
if ($(this).is(":checked") && name !== "pruning") {
let pruningSelected = $(".nature-check:checked").not(this).filter(function () {
return $(this).data("name").trim().toLowerCase() === "pruning";
});
if (pruningSelected.length > 0) {
$(this).prop("checked", false);
Swal.fire({
icon: "warning",
title: "Invalid Selection",
text: "Please unselect Pruning first."
});
return;
}
// <<< ADD THIS BLOCK HERE >>>
}
let pruningChecked = $(".nature-check:checked").filter(function () {
return $(this).data("name").trim().toLowerCase() === "pruning";
}).length > 0;
/* if (pruningChecked) {
$("#c2image").closest(".col-md-6").hide();
$("#c2image").prop("required", false).val("");
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
} else {
$("#c2image").closest(".col-md-6").show();
$("#c2image").prop("required", true);
$("#address").closest(".col-md-6").show();
$("#address").prop("required", true);
}*/
let totalSelected = $(".nature-check:checked").length;
if (totalSelected === 0) {
// No complaint selected
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
$("#c2image").closest(".col-md-6").show();
$("#c2image").prop("required", true);
} else if (pruningChecked) {
// Pruning selected
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
$("#c2image").closest(".col-md-6").hide();
$("#c2image").prop("required", false).val("");
} else {
// Any complaint other than pruning
$("#address").closest(".col-md-6").show();
$("#address").prop("required", true);
$("#c2image").closest(".col-md-6").show();
$("#c2image").prop("required", true);
}
let id = $(this).data("id"); let id = $(this).data("id");
let name = $(this).data("name");
//let name = $(this).data("name");
updateDropdownLabel(); // update selected names on the dropdown updateDropdownLabel(); // update selected names on the dropdown
//console.log("id=="+id); //console.log("id=="+id);
@ -759,8 +893,11 @@ document.getElementById("backBtn").addEventListener("click", function () {
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB in bytes const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB in bytes
// Apply to all file inputs inside the form // Apply to all file inputs inside the form
$("#deptform input[type='file']").on("change", function () { $("#deptform input[type='file']").on("change", function () {
const fileInput = this; const fileInput = this;
console.log("filesize")
if (fileInput.files.length > 0) { if (fileInput.files.length > 0) {
let file = fileInput.files[0]; let file = fileInput.files[0];
@ -865,10 +1002,10 @@ function myMap() {
//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/0/query?` +
`where=&objectIds=&time=&geometry=${encodedGeometry}` + `where=&objectIds=&time=&geometry=${encodedGeometry}` +
`&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1` +
`&units=esriSRUnit_Meter&relationParam=&outFields=zone,ward` +
`&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=25` +
`&units=esriSRUnit_Meter&relationParam=&outFields=region%2Cnew_zone%2C+new_ward%2Croad_id%2C+road_name%2Cgis_id%2Ctype` +
`&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=` + `&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=` +
`&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=` + `&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=` +
`&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=` + `&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=` +
@ -889,8 +1026,8 @@ function myMap() {
const features = data.features; const features = data.features;
if (features.length > 0) { if (features.length > 0) {
const props = features[0].properties; const props = features[0].properties;
const zone = props.zone;
const ward = props.ward;
const zone = props.new_zone;
const ward = props.new_ward;
//console.log("Zone:", zone, "Ward:", ward); //console.log("Zone:", zone, "Ward:", ward);
// 👉 You can update form fields or DOM elements here // 👉 You can update form fields or DOM elements here
@ -905,7 +1042,71 @@ function myMap() {
.catch(error => { .catch(error => {
console.error("Error fetching zone/ward:", error); console.error("Error fetching zone/ward:", error);
}); });
const streetSelect = document.getElementById("streetName");
streetSelect.innerHTML = "";
const defaultOption = document.createElement("option");
defaultOption.value = "";
defaultOption.text = "-- Select Street --";
streetSelect.appendChild(defaultOption);
document.getElementById("streetId").value = "";
// Timeout mechanism: 1 seconds
const timeout = new Promise((_, reject) =>
setTimeout(() => reject(new Error("Request timed out")), 1000)
);
// Actual fetch
const fetchRequest = fetch(url).then(res => res.json());
Promise.race([fetchRequest, timeout])
.then(data => {
const features = data.features;
if (!features || features.length === 0) {
Swal.fire({
icon: 'warning',
title: 'No Street Found',
text: 'Please select the nearby street.',
});
return;
}
streetsList = features.map(f => f.properties); //Save for use in dropdown
streetsList.forEach((props, index) => {
const option = document.createElement("option");
option.value = index;
option.text = props.road_name;
streetSelect.appendChild(option);
});
})
.catch(err => {
console.error("Error fetching street:", err);
Swal.fire("Failed to load street data", '', 'error');
});
} }
document.getElementById("streetName").addEventListener("change", function () {
const selectedIndex = this.value;
console.log("heck")
console.log(selectedIndex);
if (selectedIndex !== "") {
const selectedStreet = streetsList[selectedIndex];
console.log(selectedStreet);
document.getElementById("streetId").value = selectedStreet.road_id;
console.log("Selected street:", selectedStreet);
} else {
document.getElementById("streetId").value = "";
}
});
} }
$('#deptform').submit(function (e) { $('#deptform').submit(function (e) {
@ -947,6 +1148,7 @@ $('#deptform').submit(function (e) {
setIfPresent(formData, "dept_id", $('#dept_dropdown').val()); setIfPresent(formData, "dept_id", $('#dept_dropdown').val());
setIfPresent(formData, "dept_name", $('#otherDeptName').val()); setIfPresent(formData, "dept_name", $('#otherDeptName').val());
const mobnumber = $('#mobile_no').val().trim(); const mobnumber = $('#mobile_no').val().trim();
if (mobnumber) { if (mobnumber) {
// Rule 1: Must be exactly 10 digits & must not start with 0 // Rule 1: Must be exactly 10 digits & must not start with 0
@ -1035,7 +1237,15 @@ $('#deptform').submit(function (e) {
} }
const name = $('#pname').val(); const name = $('#pname').val();
const streetName = $('#streetName option:selected').text();
const street_id = $('#streetId').val();
// console.log("cfefefef");
console.log(streetName);
console.log("Streetid");
console.log(street_id);
console.log($("#streetName").val());
console.log($("#streetName option:selected").text());
console.log(streetName);
const c1image = $('#c1image')[0]; const c1image = $('#c1image')[0];
const c2image = $('#c2image')[0]; const c2image = $('#c2image')[0];
@ -1044,9 +1254,11 @@ $('#deptform').submit(function (e) {
let invalidCount = false; let invalidCount = false;
$(".nature-check:checked").each(function () { $(".nature-check:checked").each(function () {
let id = $(this).data("id"); let id = $(this).data("id");
let count = $("#trees_" + id).val(); let count = $("#trees_" + id).val();
// Validate invalid count (empty OR zero-like OR negative) // Validate invalid count (empty OR zero-like OR negative)
if (!count || Number(count) <= 0) { if (!count || Number(count) <= 0) {
invalidCount = true; invalidCount = true;
@ -1095,6 +1307,9 @@ $('#deptform').submit(function (e) {
return; return;
} }
} }
formData.set("streetName", streetName);
let address = $("#address").val().trim();
formData.append("address", address)
formData.append("ph_no", mobnumber); formData.append("ph_no", mobnumber);
//formData.append("designation",designation); //formData.append("designation",designation);
@ -1106,9 +1321,95 @@ $('#deptform').submit(function (e) {
formData.append("source", "1"); formData.append("source", "1");
formData.append("comp_details", JSON.stringify(compDetailsList)); formData.append("comp_details", JSON.stringify(compDetailsList));
let complaintName = $(".nature-check:checked").first().data("name");
let apiUrl = "/greencommittee/api/savedeptform";
if (complaintName &&
complaintName.trim().toLowerCase() === "pruning") {
let deptId = $("#dept_dropdown").val();
let departmentName;
if (deptId == "10") {
// If "Other" department is selected
departmentName = $("#otherDeptName").val().trim();
// Validate max length only for Pruning + Other Department
if (departmentName.length > 31) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Invalid Department Name",
text: "Department name cannot exceed 31 characters."
});
return; // Stop form submission
}
} else {
// Get selected department name from dropdown
departmentName = $("#dept_dropdown option:selected").text().trim();
}
const file = $("#c1image")[0].files[0];
if (!file) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Image Required",
text: "Please upload Image 1."
});
return;
}
// Allow only JPG, JPEG, PNG
const allowedTypes = ["image/jpeg", "image/jpg", "image/png"];
if (!allowedTypes.includes(file.type)) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Invalid File",
text: "Only JPG, JPEG and PNG images are allowed."
});
$("#c1image").val("");
return;
}
// Maximum size: 1 MB
if (file.size > (1 * 1024 * 1024)) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "File Too Large",
text: "Image size should not exceed 1 MB."
});
$("#c1image").val("");
return;
}
console.log("departmentName");
console.log(departmentName);
formData.append("p_name", departmentName);
apiUrl = "/greencommittee/api/savedeptpruningform";
formData.append("StreetId", street_id);
// Only one image for pruning
formData.delete("c2image");
}
$.ajax({ $.ajax({
url: "/greencommittee/api/savedeptform",
url: apiUrl,
method: "POST", method: "POST",
data: formData, data: formData,
processData: false, processData: false,
@ -1116,6 +1417,22 @@ $('#deptform').submit(function (e) {
success: function (response) { success: function (response) {
$('#pageLoader').hide(); $('#pageLoader').hide();
if (response.status) { if (response.status) {
if (complaintName &&
complaintName.trim().toLowerCase() === "pruning") {
Swal.fire({
icon: 'success',
allowOutsideClick: false,
allowEscapeKey: false,
title: 'Complaint Registered Successfully',
html: 'Complaint Number: <b>' + response.complaintNumber + '</b>'
}).then(() => {
window.location.href = "/greencommittee/home";
});
} else {
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
allowOutsideClick: false, allowOutsideClick: false,
@ -1126,6 +1443,8 @@ $('#deptform').submit(function (e) {
window.location.href = "/greencommittee/home"; window.location.href = "/greencommittee/home";
}); });
}
} else { } else {
$('#pageLoader').hide(); $('#pageLoader').hide();
Swal.fire({ Swal.fire({
@ -1304,6 +1623,8 @@ function verifyOtp() {
} }
$(document).ready(function () { $(document).ready(function () {
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false);
$('#sendOtpButton').click(function () { $('#sendOtpButton').click(function () {
// Get the entered mobile number // Get the entered mobile number
@ -1358,4 +1679,5 @@ $('#sendOtpButton').click(function () {
}); });
</script> </script>
</body> </body>
</html> </html>

116
src/main/resources/templates/modules/public/form.html

@ -479,10 +479,13 @@
<input type="text" class="form-control" id="ward" name="ward" readonly> <input type="text" class="form-control" id="ward" name="ward" readonly>
</div> </div>
</div>
<div class="row mb-3">
<!-- Left Side --> <!-- Left Side -->
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label"> <label class="form-label">
Details of Complaint<span class="text-danger">*</span>
Request Type<span class="text-danger">*</span>
</label> </label>
<select id="complaintDropdown" class="form-control" required> <select id="complaintDropdown" class="form-control" required>
<option value="">Select Complaint</option> <option value="">Select Complaint</option>
@ -532,6 +535,15 @@
<!-- Dynamic input rows --> <!-- Dynamic input rows -->
<div id="naturecontainer"></div> <div id="naturecontainer"></div>
<div class="row mb-3">
<div class="col-md-6">
<label for="address">Location of Tree<span class="text-danger">*</span></label>
<!-- <input type="text" class="form-control" id="address" name="address" placeholder="Enter Address"
required>-->
<textarea class="form-control" id="address" name="address" placeholder="Type Tree Address Here"
required></textarea>
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-12"> <div class="col-md-12">
@ -748,13 +760,44 @@
let id = $(this).val(); let id = $(this).val();
let name = $("#complaintDropdown option:selected").data("name"); let name = $("#complaintDropdown option:selected").data("name");
if (name && name.toLowerCase() === "pruning") {
if (!name) {
// Nothing selected
$("#c2image").closest(".col-md-6").show();
$("#c2image").prop("required", true);
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
} else if (name.toLowerCase() === "pruning") {
// Pruning selected
$("#c2image").closest(".col-md-6").hide();
$("#c2image").prop("required", false).val("");
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
} else {
// Any complaint other than pruning
$("#c2image").closest(".col-md-6").show();
$("#c2image").prop("required", true);
$("#address").closest(".col-md-6").show();
$("#address").prop("required", true);
}
/* if (name && name.toLowerCase() === "pruning") {
// Hide second image // Hide second image
$("#c2image").closest(".col-md-6").hide(); $("#c2image").closest(".col-md-6").hide();
// Remove required validation // Remove required validation
$("#c2image").prop("required", false).val(""); $("#c2image").prop("required", false).val("");
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false).val("");
} else { } else {
@ -763,7 +806,9 @@
// Existing workflow // Existing workflow
$("#c2image").prop("required", true); $("#c2image").prop("required", true);
}
$("#address").closest(".col-md-6").show();
$("#address").prop("required", true);
}*/
if (!id) { if (!id) {
return; return;
@ -862,6 +907,7 @@
// Apply to all file inputs inside the form // Apply to all file inputs inside the form
$("#publicform input[type='file']").on("change", function () { $("#publicform input[type='file']").on("change", function () {
const fileInput = this; const fileInput = this;
console.log(" cehcking");
if (fileInput.files.length > 0) { if (fileInput.files.length > 0) {
let file = fileInput.files[0]; let file = fileInput.files[0];
@ -1178,7 +1224,7 @@
const name = $('#pname').val(); const name = $('#pname').val();
const streetName = $('#streetName option:selected').text(); const streetName = $('#streetName option:selected').text();
const street_id = $('#streetId').val(); const street_id = $('#streetId').val();
console.log("cfefefef");
// console.log("cfefefef");
console.log(streetName); console.log(streetName);
console.log("Streetid"); console.log("Streetid");
console.log(street_id); console.log(street_id);
@ -1254,7 +1300,10 @@
formData.append("p_name", name); formData.append("p_name", name);
formData.append("source", "1"); formData.append("source", "1");
formData.append("address", streetName)
//formData.append("address", streetName)
formData.set("streetName", streetName);
let address = $("#address").val().trim();
formData.append("address", address)
formData.append("c1image", c1image); formData.append("c1image", c1image);
@ -1264,6 +1313,61 @@
let apiUrl = "/greencommittee/api/savepublicform"; let apiUrl = "/greencommittee/api/savepublicform";
if (complaintName && if (complaintName &&
complaintName.trim().toLowerCase() === "pruning") { complaintName.trim().toLowerCase() === "pruning") {
if (name.length > 31) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Invalid Petitioner Name",
text: "Petitioner name cannot exceed 31 characters."
});
return; // Stop form submission
}
const file = $("#c1image")[0].files[0];
if (!file) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Image Required",
text: "Please upload Image 1."
});
return;
}
// Allow only JPG, JPEG, PNG
const allowedTypes = ["image/jpeg", "image/jpg", "image/png"];
if (!allowedTypes.includes(file.type)) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "Invalid File",
text: "Only JPG, JPEG and PNG images are allowed."
});
$("#c1image").val("");
return;
}
// Maximum size: 1 MB
if (file.size > (1 * 1024 * 1024)) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire({
icon: "warning",
title: "File Too Large",
text: "Image size should not exceed 1 MB."
});
$("#c1image").val("");
return;
}
apiUrl = "/greencommittee/api/savepruningform"; apiUrl = "/greencommittee/api/savepruningform";
formData.append("StreetId", street_id); formData.append("StreetId", street_id);
@ -1502,6 +1606,8 @@
} }
$(document).ready(function () { $(document).ready(function () {
$("#address").closest(".col-md-6").hide();
$("#address").prop("required", false);
$('#sendOtpButton').click(function () { $('#sendOtpButton').click(function () {
// Get the entered mobile number // Get the entered mobile number

Loading…
Cancel
Save