Browse Source

implemented child survey and green commitee changes

master
AJITHKUMAR12 3 months ago
parent
commit
684abcf800
  1. 75
      src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java
  2. 6
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  3. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/PendinglistApicontroller.java
  4. 30
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
  5. 232
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/ReportService.java
  6. 310
      src/main/resources/templates/modules/childrensurvey/childlist.html
  7. 73
      src/main/resources/templates/modules/childrensurvey/surveylist.html
  8. 26
      src/main/resources/templates/modules/greencommittee/pendinglist.html
  9. 117
      src/main/resources/templates/modules/greencommittee/treepruningreports.html
  10. 428
      src/main/resources/templates/modules/roadwar/regform.html
  11. 760
      src/main/resources/templates/modules/roadwar/updateform.html

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

@ -263,6 +263,26 @@ public class ChildrenSurveyService {
masterTable, masterTable,
rawAnswer, rawAnswer,
othersAnswer); othersAnswer);
if (qid == 58) {
personalInfo.put(question, finalAnswer);
int count = 0;
try {
count = Integer.parseInt(finalAnswer);
} catch (Exception e) {
}
if (count > 0) {
finalResponse.put(
"familyMembers",
getFamilyMembers(surveyId));
}
continue;
}
// PERSONAL INFORMATION // PERSONAL INFORMATION
/* /*
@ -530,6 +550,61 @@ public class ChildrenSurveyService {
return rawAnswer; return rawAnswer;
} }
private List<Map<String, Object>> getFamilyMembers(String surveyId) {
String sql = """
SELECT
fm.id,
fm.qid,
fm.answer,
qm.q_english
FROM child_survey_response_family_members fm
INNER JOIN child_survey_questions_master qm
ON qm.qid = fm.qid
WHERE fm.survey_id = ?
AND fm.isactive = 1
AND fm.isdelete = 0
ORDER BY fm.id
""";
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, surveyId);
List<Map<String, Object>> members = new ArrayList<>();
Map<String, Object> member = null;
for (Map<String, Object> row : rows) {
Integer qid = ((Number) row.get("qid")).intValue();
String question = row.get("q_english").toString();
String answer = row.get("answer") == null
? ""
: row.get("answer").toString();
// Every Name starts a new member
if (qid == 6) {
if (member != null) {
members.add(member);
}
member = new LinkedHashMap<>();
}
if (member != null) {
member.put(question, answer);
}
}
if (member != null) {
members.add(member);
}
return members;
}
private String resolveAnswer1( private String resolveAnswer1(
String questionType, String questionType,
String masterTable, String masterTable,

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

@ -24,8 +24,8 @@ import java.util.Properties;
@EnableTransactionManagement @EnableTransactionManagement
public class DataSourceConfig { public class DataSourceConfig {
// private static String host = "localhost:3306";
// private static String dbpassword = "root";
// private static String host = "localhost:3306";
// private static String dbpassword = "root";
// private static String dbpassword = "gccroot"; // private static String dbpassword = "gccroot";
@ -442,7 +442,7 @@ public class DataSourceConfig {
return dataSource; return dataSource;
} }
//////////////////////////////(For GCC USER) ////////////////////////
////////////////////////////// (For GCC USER) ////////////////////////
@Bean(name = "mysqlGCCUserDataSource") @Bean(name = "mysqlGCCUserDataSource")
public DataSource mysqlGCCUserDataSource() { public DataSource mysqlGCCUserDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource(); DriverManagerDataSource dataSource = new DriverManagerDataSource();

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

@ -94,9 +94,10 @@ public class PendinglistApicontroller {
@GetMapping("/getgreencommitteelist") @GetMapping("/getgreencommitteelist")
public List<Map<String, Object>> getgreencommitteelist( public List<Map<String, Object>> getgreencommitteelist(
@RequestParam String date, @RequestParam String zones) {
@RequestParam String date, @RequestParam String zones, @RequestParam String appType,
@RequestParam String compType) {
List<Map<String, Object>> refnums = pendinglistService.getrefnums(date, zones);
List<Map<String, Object>> refnums = pendinglistService.getrefnums(date, zones, appType, compType);
System.out.println("refnums=" + refnums); System.out.println("refnums=" + refnums);
List<Map<String, Object>> savedIds = pendinglistService.getvcsavedrefids(); List<Map<String, Object>> savedIds = pendinglistService.getvcsavedrefids();
System.out.println("savedIds=" + savedIds); System.out.println("savedIds=" + savedIds);

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

@ -109,7 +109,7 @@ public class PendinglistService {
// } // }
// } // }
public List<Map<String, Object>> getrefnums(String date, String zones) {
public List<Map<String, Object>> getrefnums(String date, String zones, String appType, String compType) {
System.out.println(date + " " + zones); System.out.println(date + " " + zones);
try { try {
@ -132,6 +132,34 @@ public class PendinglistService {
sql.append(" AND zone = ? "); sql.append(" AND zone = ? ");
params.add(zones); params.add(zones);
} }
if (appType != null && !appType.isEmpty()) {
sql.append(
" AND ref_id IN ( " +
" SELECT ref_id FROM reg_details WHERE cby = ? " +
" ) ");
params.add(appType);
}
if (compType != null && !compType.isEmpty()) {
if ("Felling".equalsIgnoreCase(compType)) {
sql.append(
" AND ref_id IN ( " +
" SELECT ref_id " +
" FROM complaint_details " +
" WHERE comp_nature_id IN (2,4) " +
" ) ");
} else if ("Transplantation".equalsIgnoreCase(compType)) {
sql.append(
" AND ref_id IN ( " +
" SELECT ref_id " +
" FROM complaint_details " +
" WHERE comp_nature_id IN (5,6) " +
" ) ");
}
}
sql.append( sql.append(
" GROUP BY ref_id, inspection_by " + " GROUP BY ref_id, inspection_by " +

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

@ -575,7 +575,130 @@ public class ReportService {
} }
public List<Map<String, Object>> getReport(
/*
* public List<Map<String, Object>> getReport(
* String fromDate,
* String toDate,
* String zone,
* String ward,
* String status) {
*
* List<Map<String, Object>> result = new ArrayList<>();
*
* try {
*
* String externalUrl =
* "https://erp.chennaicorporation.gov.in/pgr/newmobileservice";
*
* StringBuilder url = new StringBuilder(externalUrl);
*
* url.append("?serviceId=ms_dashboard_details");
*
* // Mandatory
* url.append("&From_date=").append(URLEncoder.encode(fromDate, "UTF-8"));
* url.append("&To_date=").append(URLEncoder.encode(toDate, "UTF-8"));
* url.append("&jsonResp=Yes");
*
* // Status
* if (status == null || status.trim().isEmpty()) {
* url.append("&Status=total");
* } else if ("processing".equalsIgnoreCase(status)) {
* url.append("&Status=processing,redressed");
* } else {
* url.append("&Status=").append(URLEncoder.encode(status, "UTF-8"));
* }
*
* // Mandatory Parameters
* url.append("&isQcuser=Yes");
* url.append("&ComplaintType=")
* .append(URLEncoder.encode("Tree Pruning", "UTF-8"));
*
* url.append("&ComplaintGroupId=")
* .append(URLEncoder.encode("Park and Playground", "UTF-8"));
*
* // Zone
* if (zone != null && !zone.trim().isEmpty()) {
* url.append("&Zoneid=N")
* .append(String.format("%02d", Integer.parseInt(zone)));
* } else {
* url.append("&Zoneid=");
* }
*
* // Mandatory blank
* url.append("&RegionId=");
*
* // Ward
* if (ward != null && !ward.trim().isEmpty()) {
* url.append("&WardId=N")
* .append(String.format("%03d", Integer.parseInt(ward)));
* } else {
* url.append("&WardId=");
* }
*
* System.out.println("======================================");
* System.out.println("Calling URL:");
* System.out.println(url.toString());
* System.out.println("======================================");
*
* URL api = new URL(url.toString());
*
* HttpURLConnection conn = (HttpURLConnection) api.openConnection();
* conn.setRequestMethod("GET");
* conn.setRequestProperty("Accept", "application/json");
*
* int responseCode = conn.getResponseCode();
*
* System.out.println("Response Code : " + responseCode);
*
* BufferedReader br;
*
* if (responseCode >= 200 && responseCode < 300) {
* br = new BufferedReader(
* new InputStreamReader(conn.getInputStream()));
* } else {
* br = new BufferedReader(
* new InputStreamReader(conn.getErrorStream()));
* }
*
* StringBuilder response = new StringBuilder();
*
* String line;
*
* while ((line = br.readLine()) != null) {
* response.append(line);
* }
*
* br.close();
*
* System.out.println("API Response:");
* System.out.println(response.toString());
*
* ObjectMapper mapper = new ObjectMapper();
*
* JsonNode root = mapper.readTree(response.toString());
*
* JsonNode details = root.get("Details");
*
* if (details != null && details.isArray()) {
*
* result = mapper.convertValue(
* details,
* new TypeReference<List<Map<String, Object>>>() {
* });
*
* }
*
* } catch (Exception e) {
*
* e.printStackTrace();
*
* }
*
* return result;
* }
*/
private List<Map<String, Object>> callApi(
String fromDate, String fromDate,
String toDate, String toDate,
String zone, String zone,
@ -592,20 +715,17 @@ public class ReportService {
url.append("?serviceId=ms_dashboard_details"); url.append("?serviceId=ms_dashboard_details");
// Mandatory
url.append("&From_date=").append(URLEncoder.encode(fromDate, "UTF-8")); url.append("&From_date=").append(URLEncoder.encode(fromDate, "UTF-8"));
url.append("&To_date=").append(URLEncoder.encode(toDate, "UTF-8")); url.append("&To_date=").append(URLEncoder.encode(toDate, "UTF-8"));
url.append("&jsonResp=Yes"); url.append("&jsonResp=Yes");
// Status // Status
if (status == null || status.trim().isEmpty()) {
url.append("&Status=total");
} else {
url.append("&Status=").append(URLEncoder.encode(status, "UTF-8")); url.append("&Status=").append(URLEncoder.encode(status, "UTF-8"));
}
// Mandatory Parameters
// Mandatory
url.append("&isQcuser=Yes"); url.append("&isQcuser=Yes");
url.append("&ComplaintType=") url.append("&ComplaintType=")
.append(URLEncoder.encode("Tree Pruning", "UTF-8")); .append(URLEncoder.encode("Tree Pruning", "UTF-8"));
@ -614,31 +734,42 @@ public class ReportService {
// Zone // Zone
if (zone != null && !zone.trim().isEmpty()) { if (zone != null && !zone.trim().isEmpty()) {
url.append("&Zoneid=N") url.append("&Zoneid=N")
.append(String.format("%02d", Integer.parseInt(zone)));
.append(String.format("%02d",
Integer.parseInt(zone)));
} else { } else {
url.append("&Zoneid="); url.append("&Zoneid=");
} }
// Mandatory blank
// Region
url.append("&RegionId="); url.append("&RegionId=");
// Ward // Ward
if (ward != null && !ward.trim().isEmpty()) { if (ward != null && !ward.trim().isEmpty()) {
url.append("&WardId=N") url.append("&WardId=N")
.append(String.format("%03d", Integer.parseInt(ward)));
.append(String.format("%03d",
Integer.parseInt(ward)));
} else { } else {
url.append("&WardId="); url.append("&WardId=");
} }
System.out.println("======================================");
System.out.println("Calling URL:");
System.out.println("-----------------------------------");
System.out.println("Calling API");
System.out.println(url.toString()); System.out.println(url.toString());
System.out.println("======================================");
System.out.println("-----------------------------------");
URL api = new URL(url.toString()); URL api = new URL(url.toString());
HttpURLConnection conn = (HttpURLConnection) api.openConnection(); HttpURLConnection conn = (HttpURLConnection) api.openConnection();
conn.setRequestMethod("GET"); conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Accept", "application/json");
@ -649,11 +780,15 @@ public class ReportService {
BufferedReader br; BufferedReader br;
if (responseCode >= 200 && responseCode < 300) { if (responseCode >= 200 && responseCode < 300) {
br = new BufferedReader( br = new BufferedReader(
new InputStreamReader(conn.getInputStream())); new InputStreamReader(conn.getInputStream()));
} else { } else {
br = new BufferedReader( br = new BufferedReader(
new InputStreamReader(conn.getErrorStream())); new InputStreamReader(conn.getErrorStream()));
} }
StringBuilder response = new StringBuilder(); StringBuilder response = new StringBuilder();
@ -661,13 +796,14 @@ public class ReportService {
String line; String line;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
response.append(line); response.append(line);
} }
br.close(); br.close();
System.out.println("API Response:");
System.out.println(response.toString());
System.out.println(response);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -675,6 +811,16 @@ public class ReportService {
JsonNode details = root.get("Details"); JsonNode details = root.get("Details");
/*
* if (details != null && details.isArray()) {
*
* result = mapper.convertValue(
* details,
* new TypeReference<List<Map<String, Object>>>() {
* });
*
* }
*/
if (details != null && details.isArray()) { if (details != null && details.isArray()) {
result = mapper.convertValue( result = mapper.convertValue(
@ -682,6 +828,18 @@ public class ReportService {
new TypeReference<List<Map<String, Object>>>() { new TypeReference<List<Map<String, Object>>>() {
}); });
// Get latest status from complaint details API
for (Map<String, Object> row : result) {
String complaintNo = String.valueOf(row.get("Complaint Number"));
Map<String, Object> complaintDetails = getComplaintDetailsreport(complaintNo);
if (!complaintDetails.isEmpty()) {
row.put("complaintcurrentstatus",
complaintDetails.get("complaintcurrentstatus"));
}
}
} }
} catch (Exception e) { } catch (Exception e) {
@ -693,6 +851,50 @@ public class ReportService {
return result; return result;
} }
public List<Map<String, Object>> getReport(
String fromDate,
String toDate,
String zone,
String ward,
String status) {
List<Map<String, Object>> result = new ArrayList<>();
try {
if (status == null || status.trim().isEmpty()) {
// Default
result = callApi(fromDate, toDate, zone, ward, "total");
} else if ("processing".equalsIgnoreCase(status)) {
// Fetch Processing
result.addAll(callApi(fromDate, toDate, zone, ward, "processing"));
// Fetch Redressed
result.addAll(callApi(fromDate, toDate, zone, ward, "redressed"));
} else if ("closed".equalsIgnoreCase(status)) {
// Completed
// result = callApi(fromDate, toDate, zone, ward, status);
result.addAll(callApi(fromDate, toDate, zone, ward, "completed"));
// Fetch Redressed
result.addAll(callApi(fromDate, toDate, zone, ward, "closed"));
} else {
result = callApi(fromDate, toDate, zone, ward, status);
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public Map<String, Object> getComplaintDetailsreport(String complaintId) { public Map<String, Object> getComplaintDetailsreport(String complaintId) {
try { try {

310
src/main/resources/templates/modules/childrensurvey/childlist.html

@ -544,14 +544,18 @@
let slno = 1; let slno = 1;
/*for (const rowNode of rows) {
// GET SURVEY ID FROM TABLE
for (const rowNode of rows) {
let surveyId = $(rowNode[1]).text() || rowNode[1]; let surveyId = $(rowNode[1]).text() || rowNode[1];
surveyId = surveyId.toString().trim(); surveyId = surveyId.toString().trim();
// CALL DETAILS API
// SKIP EMPTY ROWS
if (!surveyId || surveyId === "") {
continue;
}
let surveyData = await $.ajax({ let surveyData = await $.ajax({
url: "/gcc/api/children-survey/details", url: "/gcc/api/children-survey/details",
type: "GET", type: "GET",
@ -560,24 +564,23 @@
} }
}); });
// MERGE ALL SECTIONS
let allQuestions = {
...surveyData.personalInformation,
/*let allQuestions = {
...surveyData.locationDetails, ...surveyData.locationDetails,
...surveyData.personalInformation,
...surveyData.educationDetails, ...surveyData.educationDetails,
...surveyData.healthDetails, ...surveyData.healthDetails,
...surveyData.documentDetails, ...surveyData.documentDetails,
...surveyData.vulnerabilityDetails ...surveyData.vulnerabilityDetails
}; };
// CREATE ROW OBJECT
let rowData = { let rowData = {
"S.No": slno, "S.No": slno,
"Survey ID": surveyId "Survey ID": surveyId
}; };
// ADD ALL QUESTIONS AS COLUMNS
Object.keys(allQuestions).forEach(function (question) { Object.keys(allQuestions).forEach(function (question) {
rowData[question] = allQuestions[question]; rowData[question] = allQuestions[question];
@ -586,31 +589,81 @@
excelData.push(rowData); excelData.push(rowData);
slno++;*/
/*const familyMembers = surveyData.familyMembers || [];
// Common survey data
let commonData = {
...surveyData.locationDetails,
...surveyData.personalInformation,
...surveyData.educationDetails,
...surveyData.healthDetails,
...surveyData.documentDetails,
...surveyData.vulnerabilityDetails
};
if (familyMembers.length > 0) {
familyMembers.forEach(function (member) {
let rowData = {
"S.No": slno,
"Survey ID": surveyId
};
// Survey Questions
Object.keys(commonData).forEach(function (question) {
rowData[question] = commonData[question];
});
// Family Member Columns
rowData["Family Member Name"] =
member["Name of the Child "] || "";
rowData["Family Member Age"] =
member["Age"] || "";
rowData["Family Member Relationship"] =
member["Relationship"] || "";
rowData["Family Member Occupation"] =
member["Occupation"] || "";
rowData["Family Member Gender"] =
member["Gender"] || "";
rowData["Family Member Education"] =
member["Education Status"] || "";
excelData.push(rowData);
slno++; slno++;
}*/
for (const rowNode of rows) {
let surveyId = $(rowNode[1]).text() || rowNode[1];
});
surveyId = surveyId.toString().trim();
} else {
// SKIP EMPTY ROWS
if (!surveyId || surveyId === "") {
continue;
}
let rowData = {
"S.No": slno,
"Survey ID": surveyId
};
let surveyData = await $.ajax({
url: "/gcc/api/children-survey/details",
type: "GET",
data: {
surveyId: surveyId
}
Object.keys(commonData).forEach(function (question) {
rowData[question] = commonData[question];
}); });
rowData["Family Member Name"] = "";
rowData["Family Member Age"] = "";
rowData["Family Member Relationship"] = "";
rowData["Family Member Occupation"] = "";
rowData["Family Member Gender"] = "";
rowData["Family Member Education"] = "";
let allQuestions = {
excelData.push(rowData);
slno++;*/ const familyMembers = surveyData.familyMembers || [];
let commonData = {
...surveyData.locationDetails, ...surveyData.locationDetails,
...surveyData.personalInformation, ...surveyData.personalInformation,
...surveyData.educationDetails, ...surveyData.educationDetails,
@ -619,15 +672,39 @@
...surveyData.vulnerabilityDetails ...surveyData.vulnerabilityDetails
}; };
// ONLY ONE ROW PER SURVEY
let rowData = { let rowData = {
"S.No": slno, "S.No": slno,
"Survey ID": surveyId "Survey ID": surveyId
}; };
Object.keys(allQuestions).forEach(function (question) {
// Survey Questions
Object.keys(commonData).forEach(function (question) {
rowData[question] = commonData[question];
});
rowData[question] = allQuestions[question];
// Add every family member dynamically
familyMembers.forEach(function (member, index) {
let no = index + 1;
rowData["Family Member " + no + " Name"] =
member["Name of the Child"] || "";
rowData["Family Member " + no + " Age"] =
member["Age"] || "";
rowData["Family Member " + no + " Relationship"] =
member["Relationship"] || "";
rowData["Family Member " + no + " Occupation"] =
member["Occupation"] || "";
rowData["Family Member " + no + " Gender"] =
member["Gender"] || "";
rowData["Family Member " + no + " Education Status"] =
member["Education Status"] || "";
}); });
excelData.push(rowData); excelData.push(rowData);
@ -671,6 +748,14 @@
"Occupation", "Occupation",
"Family Monthly Income", "Family Monthly Income",
"Contact Number", "Contact Number",
/*"How many members are in the Family",
"Below that need to collect below details for Each Family Members",*/
/*"Family Member Name",
"Family Member Age",
"Family Member Relationship",
"Family Member Occupation",
"Family Member Gender",
"Family Member Education",*/
// EDUCATION // EDUCATION
"Are they Currently Studying", "Are they Currently Studying",
@ -686,6 +771,11 @@
"Are you Staying in any Educational Hostel", "Are you Staying in any Educational Hostel",
"Name of the Hostel?", "Name of the Hostel?",
"Location of the Hostel?", "Location of the Hostel?",
/*"Does any family members need job/skill training?",
"Need skill training ?",
"select skill training",
"Job Required?",
"select job",*/
// HEALTH // HEALTH
"Does the child have any history of health issues?", "Does the child have any history of health issues?",
@ -708,8 +798,57 @@
"Vulnerability Assessment", "Vulnerability Assessment",
"Any Other Support Needed?", "Any Other Support Needed?",
"Comments & Remarks", "Comments & Remarks",
"How many members are in the Family",
"Below that need to collect below details for Each Family Members",
"Does any family members need job/skill training?",
"Need skill training ?",
"select skill training",
"Job Required?",
"select job",
]; ];
// Find maximum family members
// Find maximum family members
let maxFamilyMembers = 0;
excelData.forEach(function (row) {
Object.keys(row).forEach(function (key) {
let match = key.match(/^Family Member (\d+) Name$/);
if (match) {
maxFamilyMembers = Math.max(maxFamilyMembers, parseInt(match[1]));
}
});
});
// Find the position after q58
const insertIndex = headers.indexOf(
"Below that need to collect below details for Each Family Members"
) + 1;
// Create dynamic headers
let familyHeaders = [];
for (let i = 1; i <= maxFamilyMembers; i++) {
familyHeaders.push(
"Family Member " + i + " Name",
"Family Member " + i + " Age",
"Family Member " + i + " Gender",
"Family Member " + i + " Relationship",
"Family Member " + i + " Education Status",
"Family Member " + i + " Occupation"
);
}
// Insert after q58
headers.splice(insertIndex, 0, ...familyHeaders);
// CREATE NEW ORDERED DATA // CREATE NEW ORDERED DATA
let orderedExcelData = []; let orderedExcelData = [];
@ -927,6 +1066,28 @@
"Personal Information", "Personal Information",
data.personalInformation data.personalInformation
); );
html += `
<div id="familyMemberSection" style="display:none;" class="mb-4">
<h5 class="section-heading">
Family Member Details
</h5>
<div class="table-responsive">
<table class="table table-bordered" id="familyTable">
<thead></thead>
<tbody></tbody>
</table>
</div>
</div>
`;
html += buildSection( html += buildSection(
"Education Details", "Education Details",
@ -949,6 +1110,105 @@
); );
$("#surveyDetails").html(html); $("#surveyDetails").html(html);
//console.log(data);
//console.log(data.familyMembers);
//const members = data.familyMembers;
//console.log($("#familyMemberSection").length);
/*if (members && members.length > 0) {
let headers = Object.keys(members[0]);
let thead = "<tr><th>S.No</th>";
headers.forEach(function (h) {
thead += "<th>" + h + "</th>";
});
thead += "</tr>";
$("#familyTable thead").html(thead);
let tbody = "";
members.forEach(function (member, index) {
tbody += "<tr>";
tbody += "<td>" + (index + 1) + "</td>";
headers.forEach(function (h) {
tbody += "<td>" + (member[h] || "-") + "</td>";
});
tbody += "</tr>";
});
$("#familyTable tbody").html(tbody);
$("#familyMemberSection").show();
} else {
$("#familyMemberSection").hide();
}*/ const members = data.familyMembers;
if (members && members.length > 0) {
let headers = [
"Name of the Child",
"Age",
"Gender",
"Relationship",
"Occupation",
"Education Status"
];
let thead = "<tr><th>S.No</th>";
headers.forEach(function (h) {
let title = h.trim();
thead += "<th>" + title + "</th>";
});
thead += "</tr>";
$("#familyTable thead").html(thead);
let tbody = "";
members.forEach(function (member, index) {
tbody += "<tr>";
tbody += "<td>" + (index + 1) + "</td>";
headers.forEach(function (h) {
tbody += "<td>" + (member[h] || "-") + "</td>";
});
tbody += "</tr>";
});
$("#familyTable tbody").html(tbody);
$("#familyMemberSection").show();
} else {
$("#familyMemberSection").hide();
}
let modal = new bootstrap.Modal( let modal = new bootstrap.Modal(
document.getElementById('surveyModal') document.getElementById('surveyModal')

73
src/main/resources/templates/modules/childrensurvey/surveylist.html

@ -285,6 +285,7 @@
</div> </div>
</div> </div>
</div>
<div class="modal fade" id="surveyModal" tabindex="-1"> <div class="modal fade" id="surveyModal" tabindex="-1">
<div class="modal-dialog modal-dialog-scrollable" style="max-width:70%; width:70%;"> <div class="modal-dialog modal-dialog-scrollable" style="max-width:70%; width:70%;">
@ -327,7 +328,7 @@
</div> </div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div> </div>
</div> </div>
@ -473,6 +474,8 @@
success: function (data) { success: function (data) {
let html = ""; let html = "";
function buildSection(title, sectionData) { function buildSection(title, sectionData) {
@ -527,6 +530,27 @@
"Personal Information", "Personal Information",
data.personalInformation data.personalInformation
); );
html += `
<div id="familyMemberSection" style="display:none;" class="mb-4">
<h5 class="section-heading">
Family Member Details
</h5>
<div class="table-responsive">
<table class="table table-bordered" id="familyTable">
<thead></thead>
<tbody></tbody>
</table>
</div>
</div>
`;
@ -551,6 +575,52 @@
); );
$("#surveyDetails").html(html); $("#surveyDetails").html(html);
console.log(data);
console.log(data.familyMembers);
const members = data.familyMembers;
console.log($("#familyMemberSection").length);
if (members && members.length > 0) {
let headers = Object.keys(members[0]);
let thead = "<tr><th>S.No</th>";
headers.forEach(function (h) {
thead += "<th>" + h + "</th>";
});
thead += "</tr>";
$("#familyTable thead").html(thead);
let tbody = "";
members.forEach(function (member, index) {
tbody += "<tr>";
tbody += "<td>" + (index + 1) + "</td>";
headers.forEach(function (h) {
tbody += "<td>" + (member[h] || "") + "</td>";
});
tbody += "</tr>";
});
$("#familyTable tbody").html(tbody);
$("#familyMemberSection").show();
} else {
$("#familyMemberSection").hide();
}
let modal = new bootstrap.Modal( let modal = new bootstrap.Modal(
document.getElementById('surveyModal') document.getElementById('surveyModal')
@ -872,6 +942,7 @@
data: { surveyId: surveyId }, data: { surveyId: surveyId },
success: function (data) { success: function (data) {
alert("checking");
let html = ""; let html = "";

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

@ -101,6 +101,22 @@
<option value="">Select Zone </option> <option value="">Select Zone </option>
</select> </select>
</div> </div>
<div class="form-group col-sm-4">
<label for="applicationType">Application Type</label>
<select id="applicationType" class="form-control">
<option value="">Select Application Type</option>
<option value="Department">Department</option>
<option value="Public">Public</option>
</select>
</div>
<div class="form-group col-sm-4">
<label for="complaintType">Complaint Type</label>
<select id="complaintType" class="form-control">
<option value="">Select Complaint Type</option>
<option value="Felling">Felling</option>
<option value="Transplantation">Transplantation</option>
</select>
</div>
</div> </div>
<div class="page-header-title"> <div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;">Green Committee Pending List</h5><span <h5 style="margin: 0;font-weight: bold;">Green Committee Pending List</h5><span
@ -732,6 +748,12 @@
$("#modalBodyContent").html(content); $("#modalBodyContent").html(content);
} }
$('#applicationType').on('change', function () {
fetchgreenCommitteeList();
});
$('#complaintType').on('change', function () {
fetchgreenCommitteeList();
});
@ -739,6 +761,8 @@
function fetchgreenCommitteeList() { function fetchgreenCommitteeList() {
const selectedOption = $('#dropdownevent option:selected').text(); const selectedOption = $('#dropdownevent option:selected').text();
let selectedappType = $('#applicationType').val();
let selectedcomType = $('#complaintType').val();
// Assuming the format is: "Event Name - yyyy-mm-dd" // Assuming the format is: "Event Name - yyyy-mm-dd"
const eventDateRaw = selectedOption.split(' - ')[1]; const eventDateRaw = selectedOption.split(' - ')[1];
@ -765,7 +789,7 @@
$.ajax({ $.ajax({
url: '/gcc/api/greencommittee/pendinglist/getgreencommitteelist', url: '/gcc/api/greencommittee/pendinglist/getgreencommitteelist',
data: { date: formattedDate, zones: selectedZone },
data: { date: formattedDate, zones: selectedZone, appType: selectedappType, compType: selectedcomType },
method: 'GET', method: 'GET',
contentType: 'application/json', contentType: 'application/json',
success: function (data) { success: function (data) {

117
src/main/resources/templates/modules/greencommittee/treepruningreports.html

@ -49,6 +49,11 @@
.img-thumbnail { .img-thumbnail {
border-radius: 8px; border-radius: 8px;
} }
#complaintModal label {
font-size: 17px;
font-weight: 600;
}
</style> </style>
<body> <body>
@ -72,7 +77,7 @@
<div class="page-header-title"> <div class="page-header-title">
<i class="far fa-calendar-plus bg-blue"></i> <i class="far fa-calendar-plus bg-blue"></i>
<div class="d-inline"> <div class="d-inline">
<h5>Reports</h5>
<h5>Tree Pruning Reports</h5>
<span>Green Committee</span> <span>Green Committee</span>
</div> </div>
</div> </div>
@ -83,7 +88,7 @@
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a> <li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a>
</li> </li>
<li class="breadcrumb-item" aria-current="page">Green Committee</li> <li class="breadcrumb-item" aria-current="page">Green Committee</li>
<li class="breadcrumb-item active" aria-current="page">Reports</li>
<li class="breadcrumb-item active" aria-current="page">Tree Pruning Reports</li>
</ol> </ol>
</nav> </nav>
</div> </div>
@ -203,8 +208,8 @@
</div> </div>
</div>
</div>
<!-- Complaint Details Modal --> <!-- Complaint Details Modal -->
<div class="modal fade" id="complaintModal" tabindex="-1"> <div class="modal fade" id="complaintModal" tabindex="-1">
<div class="modal-dialog modal-xl modal-dialog-scrollable"> <div class="modal-dialog modal-xl modal-dialog-scrollable">
@ -380,10 +385,12 @@
<div class="row"> <div class="row">
<div class="col-md-6 text-center"> <div class="col-md-6 text-center">
<label>Before (Citizen)</label>
<label><b style="font-size:18px;">Before Image</b> </label>
<img id="citizenImg" class="img-thumbnail"
style="width:100%;height:220px;object-fit:cover;display:none;">
<!-- <img id="citizenImg" class="img-thumbnail"
style="width:100%;height:220px;object-fit:cover;display:none;">-->
<img id="citizenImg" class="img-thumbnail preview-img"
style="width:100%; height:auto; display:none; cursor:pointer;">
<div id="citizenNoImage" class="border p-5 mt-2 text-muted"> <div id="citizenNoImage" class="border p-5 mt-2 text-muted">
No Image Available No Image Available
@ -391,10 +398,12 @@
</div> </div>
<div class="col-md-6 text-center"> <div class="col-md-6 text-center">
<label>After (Official)</label>
<label><b style="font-size:18px;">After Image</b></label>
<img id="officialImg" class="img-thumbnail"
style="width:100%;height:220px;object-fit:cover;display:none;">
<!-- <img id="officialImg" class="img-thumbnail"
style="width:100%;height:220px;object-fit:cover;display:none;">-->
<img id="officialImg" class="img-thumbnail preview-img"
style="width:100%; height:auto; display:none; cursor:pointer;">
<div id="officialNoImage" class="border p-5 mt-2 text-muted"> <div id="officialNoImage" class="border p-5 mt-2 text-muted">
No Image Available No Image Available
@ -699,6 +708,7 @@
$("#citizenImg") $("#citizenImg")
.attr("src", data.userimages[0].Comp_Image) .attr("src", data.userimages[0].Comp_Image)
.addClass("preview-img") .addClass("preview-img")
.css("cursor", "pointer") .css("cursor", "pointer")
.show(); .show();
@ -710,7 +720,7 @@
$("#citizenNoImage").show(); $("#citizenNoImage").show();
} }
if (data.empimages &&
/* if (data.empimages &&
data.empimages.length > 0 && data.empimages.length > 0 &&
data.empimages[0].Comp_Image && data.empimages[0].Comp_Image &&
data.empimages[0].Comp_Image !== "null") { data.empimages[0].Comp_Image !== "null") {
@ -723,6 +733,47 @@
$("#officialNoImage").hide(); $("#officialNoImage").hide();
} else {
$("#officialImg").hide();
$("#officialNoImage").show();
}*/
let officerImage = null;
let latestDate = null;
if (data.Comments && data.Comments.length > 0) {
data.Comments.forEach(function (comment) {
// Only Park users
if (comment.user &&
comment.user.startsWith("Park") &&
comment.userimages &&
comment.userimages.length > 0 &&
comment.userimages[0].Comp_Image &&
comment.userimages[0].Comp_Image !== "null") {
let currentDate = new Date(comment.comment_date);
if (latestDate == null || currentDate > latestDate) {
latestDate = currentDate;
officerImage = comment.userimages[0].Comp_Image;
}
}
});
}
if (officerImage) {
$("#officialImg")
.attr("src", officerImage)
.addClass("preview-img")
.css("cursor", "pointer")
.show();
$("#officialNoImage").hide();
} else { } else {
$("#officialImg").hide(); $("#officialImg").hide();
@ -804,7 +855,49 @@
{ data: "Address" }, { data: "Address" },
{ data: "Complaint Mode" }, { data: "Complaint Mode" },
{ data: "Complaint Opened Date" }, { data: "Complaint Opened Date" },
/* {
data: null,
render: function (data, type, row) {
let status = (row["Current Status"] || "").trim().toLowerCase();
let badgeClass = "badge-secondary";
if (status === "closed") {
badgeClass = "badge-success";
} else if (status === "processing" || status === "redressed") {
badgeClass = "badge-warning";
}
return `
<span class="badge ${badgeClass}">
${row["Current Status"]}
</span>
<br>
<small>${row["complaintcurrentstatus"] || "-"}</small>
`;
}
},*/
{ {
data: null,
render: function (data, type, row) {
console.log(row["Current Status"]);
let badge = "";
if (row["Current Status"] === "Completed" || row["Current Status"] === "Closed") {
badge = '<span class="badge badge-success">Completed</span>';
} else {
badge = '<span class="badge badge-warning">Processing</span>';
}
return badge +
'<br><small>' +
(row["complaintcurrentstatus"] || "-") +
'</small>';
}
},
/* {
data: "Current Status", data: "Current Status",
render: function (data) { render: function (data) {
if (data === "Completed") { if (data === "Completed") {
@ -812,7 +905,7 @@
} }
return '<span class="badge badge-warning">Processing</span>'; return '<span class="badge badge-warning">Processing</span>';
} }
},
},*/
{ {
data: null, data: null,
className: "text-center", className: "text-center",

428
src/main/resources/templates/modules/roadwar/regform.html

@ -97,8 +97,8 @@
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label for="areaname" class="form-label">Area Name<span <label for="areaname" class="form-label">Area Name<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="areaname"
name="areaname" required="required">
<input type="text" class="form-control" id="areaname" name="areaname"
required="required">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
@ -137,13 +137,15 @@
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label for="row_width" class="form-label">Right of Way(ROW) Width of Road (m)</label>
<label for="row_width" class="form-label">Right of Way(ROW) Width of
Road (m)</label>
<input type="text" class="form-control decimal-only" id="row_width" <input type="text" class="form-control decimal-only" id="row_width"
name="row_width" placeholder="e.g. 200.5"> name="row_width" placeholder="e.g. 200.5">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label for="averageWidth" class="form-label">Average Carriageway Width of Road (m)</label>
<label for="averageWidth" class="form-label">Average Carriageway Width
of Road (m)</label>
<input type="text" class="form-control decimal-only" id="averageWidth" <input type="text" class="form-control decimal-only" id="averageWidth"
name="averageWidth" placeholder="e.g. 6.5"> name="averageWidth" placeholder="e.g. 6.5">
</div> </div>
@ -250,13 +252,15 @@
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="fplength" class="form-label">LHS Length of Footpath (m)<span class="text-danger">*</span> </label>
<label for="fplength" class="form-label">LHS Length of Footpath
(m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only" id="fplength" <input type="text" class="form-control decimal-only" id="fplength"
name="fplength" required="required" placeholder="e.g. 180.0"> name="fplength" required="required" placeholder="e.g. 180.0">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="fpwidth" class="form-label">LHS Average Width of Footpath (m)<span class="text-danger">*</span> </label>
<label for="fpwidth" class="form-label">LHS Average Width of
Footpath (m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only" id="fpwidth" <input type="text" class="form-control decimal-only" id="fpwidth"
name="fpwidth" required="required" placeholder="e.g. 1.5"> name="fpwidth" required="required" placeholder="e.g. 1.5">
</div> </div>
@ -280,15 +284,19 @@
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="rhs_fplength" class="form-label">RHS Length of Footpath (m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only" id="rhs_fplength"
name="rhs_fplength" required="required" placeholder="e.g. 180.0">
<label for="rhs_fplength" class="form-label">RHS Length of Footpath
(m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only"
id="rhs_fplength" name="rhs_fplength" required="required"
placeholder="e.g. 180.0">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="rhs_fpwidth" class="form-label">RHS Average Width of Footpath (m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only" id="rhs_fpwidth"
name="rhs_fpwidth" required="required" placeholder="e.g. 1.5">
<label for="rhs_fpwidth" class="form-label">RHS Average Width of
Footpath (m)<span class="text-danger">*</span> </label>
<input type="text" class="form-control decimal-only"
id="rhs_fpwidth" name="rhs_fpwidth" required="required"
placeholder="e.g. 1.5">
</div> </div>
</div> </div>
@ -345,13 +353,17 @@
<div class="col-md-6 mb-3" id="lhs_swd" style="display: none;"> <div class="col-md-6 mb-3" id="lhs_swd" style="display: none;">
<div class="row"> <div class="row">
<div class="col-md-6 mb-3"> <div class="col-md-6 mb-3">
<label for="swdlength">LHS SWD Length (m)<span class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only" id="swdlength">
<label for="swdlength">LHS SWD Length (m)<span
class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only"
id="swdlength">
</div> </div>
<div class="col-md-6 mb-3"> <div class="col-md-6 mb-3">
<label for="swdsize">LHS SWD Size (m)<span class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only" id="size">
<label for="swdsize">LHS SWD Size (m)<span
class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only"
id="size">
</div> </div>
</div> </div>
</div> </div>
@ -359,13 +371,17 @@
<div class="col-md-6 mb-3" id="rhs_swd" style="display: none;"> <div class="col-md-6 mb-3" id="rhs_swd" style="display: none;">
<div class="row"> <div class="row">
<div class="col-md-6 mb-3"> <div class="col-md-6 mb-3">
<label for="rhs_swdlength">RHS SWD Length (m)<span class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only" id="rhs_swdlength">
<label for="rhs_swdlength">RHS SWD Length (m)<span
class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only"
id="rhs_swdlength">
</div> </div>
<div class="col-md-6 mb-3"> <div class="col-md-6 mb-3">
<label for="rhs_swdsize">RHS SWD Size (m)<span class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only" id="rhs_swdsize">
<label for="rhs_swdsize">RHS SWD Size (m)<span
class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only"
id="rhs_swdsize">
</div> </div>
</div> </div>
</div> </div>
@ -395,18 +411,26 @@
<div id="scpSection" style="display:none; margin-top:15px;"> <div id="scpSection" style="display:none; margin-top:15px;">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label for="scp_at"> Slit catch pit Present at ?</label>
<select class="form-control" id="scp_at" name="scp_at">
<label for="scp_at"> Slit catch pit Present at
?</label>
<select class="form-control" id="scp_at"
name="scp_at">
<option value="">Select </option> <option value="">Select </option>
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_scp" style="display: none;">
<label for="scpCount"> LHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="scpCount">
<div class="col-md-3" id="lhs_scp"
style="display: none;">
<label for="scpCount"> LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="scpCount">
</div> </div>
<div class="col-md-3" id="rhs_scp" style="display: none;">
<label for="rhs_scpCount"> RHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="rhs_scpCount">
<div class="col-md-3" id="rhs_scp"
style="display: none;">
<label for="rhs_scpCount"> RHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="rhs_scpCount">
</div> </div>
</div> </div>
@ -429,20 +453,28 @@
<div id="mhSection" style="display:none; margin-top:15px;"> <div id="mhSection" style="display:none; margin-top:15px;">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label for="mhType">Manhole / Machine hole present at?</label>
<select class="form-control" id="mhType" name="mhType">
<label for="mhType">Manhole / Machine hole present
at?</label>
<select class="form-control" id="mhType"
name="mhType">
<option value="">Select </option> <option value="">Select </option>
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_mh" style="display: none;">
<label for="mhCount">LHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="mhCount" name="mhCount">
<div class="col-md-3" id="lhs_mh"
style="display: none;">
<label for="mhCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="mhCount" name="mhCount">
</div> </div>
<div class="col-md-3" id="rhs_mh" style="display: none;">
<label for="r_mhCount">RHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="r_mhCount" name="r_mhCount">
<div class="col-md-3" id="rhs_mh"
style="display: none;">
<label for="r_mhCount">RHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="r_mhCount" name="r_mhCount">
</div> </div>
</div> </div>
@ -466,17 +498,24 @@
<div class="col-md-6"> <div class="col-md-6">
<label for="cp_at">ChutPipe present at?</label> <label for="cp_at">ChutPipe present at?</label>
<select class="form-control" id="cp_at" name="cp_at">
<select class="form-control" id="cp_at"
name="cp_at">
<option value="">Select </option> <option value="">Select </option>
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_cp" style="display: none;">
<label for="cpCount">LHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="cpCount">
<div class="col-md-3" id="lhs_cp"
style="display: none;">
<label for="cpCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="cpCount">
</div> </div>
<div class="col-md-3" id="rhs_cp" style="display: none;">
<label for="r_cpCount">RHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="r_cpCount">
<div class="col-md-3" id="rhs_cp"
style="display: none;">
<label for="r_cpCount">RHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="r_cpCount">
</div> </div>
</div> </div>
@ -499,17 +538,24 @@
<div class="col-md-6"> <div class="col-md-6">
<label for="rwh_at">RWH present at?</label> <label for="rwh_at">RWH present at?</label>
<select class="form-control" id="rwh_at" name="rwh_at">
<select class="form-control" id="rwh_at"
name="rwh_at">
<option value="">Select </option> <option value="">Select </option>
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_rwh" style="display: none;">
<label for="rwCount">LHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="rwCount">
<div class="col-md-3" id="lhs_rwh"
style="display: none;">
<label for="rwCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="rwCount">
</div> </div>
<div class="col-md-3" id="rhs_rwh" style="display: none;">
<label for="r_rwCount">RHS Count<span class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="r_rwCount">
<div class="col-md-3" id="rhs_rwh"
style="display: none;">
<label for="r_rwCount">RHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only"
id="r_rwCount">
</div> </div>
</div> </div>
</div> </div>
@ -572,7 +618,8 @@
</label> </label>
</div> </div>
<div id="slpSection" style="display:none; margin-top:15px;"> <div id="slpSection" style="display:none; margin-top:15px;">
<label for="slpCount">Count<span class="text-danger">*</span></label>
<label for="slpCount">Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="slpCount"> <input type="text" class="form-control integer-only" id="slpCount">
</div> </div>
</div> </div>
@ -590,7 +637,8 @@
</label> </label>
</div> </div>
<div id="hmlSection" style="display:none; margin-top:15px;"> <div id="hmlSection" style="display:none; margin-top:15px;">
<label for="hmlCount">Count<span class="text-danger">*</span></label>
<label for="hmlCount">Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="hmlCount"> <input type="text" class="form-control integer-only" id="hmlCount">
</div> </div>
</div> </div>
@ -609,7 +657,8 @@
</label> </label>
</div> </div>
<div id="mmlSection" style="display:none; margin-top:15px;"> <div id="mmlSection" style="display:none; margin-top:15px;">
<label for="mmlCount">Count<span class="text-danger">*</span></label>
<label for="mmlCount">Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="mmlCount"> <input type="text" class="form-control integer-only" id="mmlCount">
</div> </div>
</div> </div>
@ -651,7 +700,8 @@
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label for="noofcb" class="form-label">No of Culverts &amp; <label for="noofcb" class="form-label">No of Culverts &amp;
Bridges</label> Bridges</label>
<input type="text" class="form-control integer-only" id="noofcb" name="noofcb">
<input type="text" class="form-control integer-only" id="noofcb"
name="noofcb">
</div> </div>
<div class="col-md-12 mb-3"> <div class="col-md-12 mb-3">
@ -707,10 +757,11 @@
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label"> <label class="form-label">
Completion Report Value (CR)
Amount Value
<span class="text-danger">*</span> <span class="text-danger">*</span>
</label> </label>
<input type="text" class="form-control decimal-only" name="crValue[]">
<input type="text" class="form-control decimal-only"
name="crValue[]">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
@ -958,7 +1009,7 @@
$('#roadDropdown').append( $('#roadDropdown').append(
$('<option>', { $('<option>', {
value: road.road_id, value: road.road_id,
text: road.road_name+","+road.locality+","+road.area_name+","+"("+road.road_id+")"
text: road.road_name + "," + road.locality + "," + road.area_name + "," + "(" + road.road_id + ")"
}).attr('data-road-name', road.road_name) }).attr('data-road-name', road.road_name)
); );
}); });
@ -996,19 +1047,19 @@
$('#lhs_section').find('input, select').val(''); $('#lhs_section').find('input, select').val('');
let fpat = $(this).val(); let fpat = $(this).val();
if (fpat==='1') {
if (fpat === '1') {
$('#lhs_section').slideDown(); $('#lhs_section').slideDown();
$('#rhs_section').hide(); $('#rhs_section').hide();
} }
else if(fpat==='2'){
else if (fpat === '2') {
$('#rhs_section').slideDown(); $('#rhs_section').slideDown();
$('#lhs_section').hide(); $('#lhs_section').hide();
} }
else if(fpat==='3'){
else if (fpat === '3') {
$('#rhs_section').slideDown(); $('#rhs_section').slideDown();
$('#lhs_section').slideDown(); $('#lhs_section').slideDown();
} }
else{
else {
$('#rhs_section').slideUp(); $('#rhs_section').slideUp();
$('#lhs_section').slideUp(); $('#lhs_section').slideUp();
} }
@ -1022,19 +1073,19 @@
$('#lhs_swd').find('input, select').val(''); $('#lhs_swd').find('input, select').val('');
let swdat = $(this).val(); let swdat = $(this).val();
if (swdat==='1') {
if (swdat === '1') {
$('#lhs_swd').slideDown(); $('#lhs_swd').slideDown();
$('#rhs_swd').hide(); $('#rhs_swd').hide();
} }
else if(swdat==='2'){
else if (swdat === '2') {
$('#rhs_swd').slideDown(); $('#rhs_swd').slideDown();
$('#lhs_swd').hide(); $('#lhs_swd').hide();
} }
else if(swdat==='3'){
else if (swdat === '3') {
$('#rhs_swd').slideDown(); $('#rhs_swd').slideDown();
$('#lhs_swd').slideDown(); $('#lhs_swd').slideDown();
} }
else{
else {
$('#rhs_swd').slideUp(); $('#rhs_swd').slideUp();
$('#lhs_swd').slideUp(); $('#lhs_swd').slideUp();
} }
@ -1047,20 +1098,20 @@
$('#lhs_scp').find('input, select').val(''); $('#lhs_scp').find('input, select').val('');
let scpat = $(this).val(); let scpat = $(this).val();
if (scpat==='1') {
if (scpat === '1') {
$('#lhs_scp').slideDown(); $('#lhs_scp').slideDown();
$('#rhs_scp').hide(); $('#rhs_scp').hide();
} }
else if(scpat==='2'){
else if (scpat === '2') {
$('#rhs_scp').slideDown(); $('#rhs_scp').slideDown();
$('#lhs_scp').hide(); $('#lhs_scp').hide();
} }
else if(scpat==='3'){
else if (scpat === '3') {
$('#rhs_scp').slideDown(); $('#rhs_scp').slideDown();
$('#lhs_scp').slideDown(); $('#lhs_scp').slideDown();
} }
else{
else {
$('#rhs_scp').slideUp(); $('#rhs_scp').slideUp();
$('#lhs_scp').slideUp(); $('#lhs_scp').slideUp();
} }
@ -1074,20 +1125,20 @@
$('#rhs_mh').find('input, select').val(''); $('#rhs_mh').find('input, select').val('');
let mhat = $(this).val(); let mhat = $(this).val();
if (mhat==='1') {
if (mhat === '1') {
$('#lhs_mh').slideDown(); $('#lhs_mh').slideDown();
$('#rhs_mh').hide(); $('#rhs_mh').hide();
} }
else if(mhat==='2'){
else if (mhat === '2') {
$('#rhs_mh').slideDown(); $('#rhs_mh').slideDown();
$('#lhs_mh').hide(); $('#lhs_mh').hide();
} }
else if(mhat==='3'){
else if (mhat === '3') {
$('#rhs_mh').slideDown(); $('#rhs_mh').slideDown();
$('#lhs_mh').slideDown(); $('#lhs_mh').slideDown();
} }
else{
else {
$('#rhs_mh').slideUp(); $('#rhs_mh').slideUp();
$('#lhs_mh').slideUp(); $('#lhs_mh').slideUp();
} }
@ -1100,20 +1151,20 @@
$('#rhs_cp').find('input, select').val(''); $('#rhs_cp').find('input, select').val('');
let cpat = $(this).val(); let cpat = $(this).val();
if (cpat==='1') {
if (cpat === '1') {
$('#lhs_cp').slideDown(); $('#lhs_cp').slideDown();
$('#rhs_cp').hide(); $('#rhs_cp').hide();
} }
else if(cpat==='2'){
else if (cpat === '2') {
$('#rhs_cp').slideDown(); $('#rhs_cp').slideDown();
$('#lhs_cp').hide(); $('#lhs_cp').hide();
} }
else if(cpat==='3'){
else if (cpat === '3') {
$('#rhs_cp').show(); $('#rhs_cp').show();
$('#lhs_cp').show(); $('#lhs_cp').show();
} }
else{
else {
$('#rhs_cp').hide(); $('#rhs_cp').hide();
$('#lhs_cp').hide(); $('#lhs_cp').hide();
} }
@ -1126,20 +1177,20 @@
$('#rhs_rwh').find('input, select').val(''); $('#rhs_rwh').find('input, select').val('');
let rwhat = $(this).val(); let rwhat = $(this).val();
if (rwhat==='1') {
if (rwhat === '1') {
$('#lhs_rwh').slideDown(); $('#lhs_rwh').slideDown();
$('#rhs_rwh').hide(); $('#rhs_rwh').hide();
} }
else if(rwhat==='2'){
else if (rwhat === '2') {
$('#rhs_rwh').slideDown(); $('#rhs_rwh').slideDown();
$('#lhs_rwh').hide(); $('#lhs_rwh').hide();
} }
else if(rwhat==='3'){
else if (rwhat === '3') {
$('#rhs_rwh').show(); $('#rhs_rwh').show();
$('#lhs_rwh').show(); $('#lhs_rwh').show();
} }
else{
else {
$('#rhs_rwh').hide(); $('#rhs_rwh').hide();
$('#lhs_rwh').hide(); $('#lhs_rwh').hide();
} }
@ -1266,7 +1317,7 @@
if (response.status) { if (response.status) {
fpMaterialList=response.data;
fpMaterialList = response.data;
populatefootpathmaterialDropdown($("#footpathDropdown")); populatefootpathmaterialDropdown($("#footpathDropdown"));
populatefootpathmaterialDropdown($("#rhs_footpathDropdown")); populatefootpathmaterialDropdown($("#rhs_footpathDropdown"));
@ -1607,25 +1658,25 @@
let fpVal = $('input[name="fpAvailable"]:checked').val(); let fpVal = $('input[name="fpAvailable"]:checked').val();
let footpathfrom=$("#footPathFrom").val().trim();
let footpathto=$("#footPathTo").val().trim();
let footpathfrom = $("#footPathFrom").val().trim();
let footpathto = $("#footPathTo").val().trim();
let footpathat =$("#fpat").val() ;
let footpathat = $("#fpat").val();
let footpathDropdown =$("#footpathDropdown").val() ;
let footpathDropdown = $("#footpathDropdown").val();
let fpLen = $("#fplength").val().trim(); let fpLen = $("#fplength").val().trim();
let fpWidth = $("#fpwidth").val().trim(); let fpWidth = $("#fpwidth").val().trim();
let rhs_footpathDropdown =$("#rhs_footpathDropdown").val() ;
let rhs_footpathDropdown = $("#rhs_footpathDropdown").val();
let rhs_fplength = $("#rhs_fplength").val().trim(); let rhs_fplength = $("#rhs_fplength").val().trim();
let rhs_fpwidth = $("#rhs_fpwidth").val().trim(); let rhs_fpwidth = $("#rhs_fpwidth").val().trim();
let swdVal = $('input[name="swdAvailable"]:checked').val(); let swdVal = $('input[name="swdAvailable"]:checked').val();
let swd_at =$("#swd_at").val();
let scp_at=$("#scp_at").val();
let mhType=$("#mhType").val();
let cp_at=$("#cp_at").val();
let rwh_at=$("#rwh_at").val();
let swd_at = $("#swd_at").val();
let scp_at = $("#scp_at").val();
let mhType = $("#mhType").val();
let cp_at = $("#cp_at").val();
let rwh_at = $("#rwh_at").val();
let scpVal = $('input[name="scpAvailable"]:checked').val() || ""; let scpVal = $('input[name="scpAvailable"]:checked').val() || "";
let mhVal = $('input[name="mhAvailable"]:checked').val(); let mhVal = $('input[name="mhAvailable"]:checked').val();
@ -1636,12 +1687,12 @@
let epVal = $('input[name="epAvailable"]:checked').val(); let epVal = $('input[name="epAvailable"]:checked').val();
let bsVal = $('input[name="bsAvailable"]:checked').val(); let bsVal = $('input[name="bsAvailable"]:checked').val();
let hmlVal= $('input[name="hmlAvailable"]:checked').val();
let mmlVal= $('input[name="mmlAvailable"]:checked').val();
let slpVal= $('input[name="slpAvailable"]:checked').val();
let hmlVal = $('input[name="hmlAvailable"]:checked').val();
let mmlVal = $('input[name="mmlAvailable"]:checked').val();
let slpVal = $('input[name="slpAvailable"]:checked').val();
let sewerLength=$("#sewerLength").val().trim();
let sewerSize=$("#sewerSize").val().trim();
let sewerLength = $("#sewerLength").val().trim();
let sewerSize = $("#sewerSize").val().trim();
// Zone // Zone
if (!$("#zoneDropdown").val()) { if (!$("#zoneDropdown").val()) {
@ -1704,7 +1755,7 @@
return; return;
} }
/* if (!rowWidth) {
/* if (!rowWidth) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
Swal.fire("Missing Field", "Please enter Right of Way Width.", "warning"); Swal.fire("Missing Field", "Please enter Right of Way Width.", "warning");
return; return;
@ -1731,8 +1782,8 @@
if (!validate(minWidth, "Road Min Width")) return; if (!validate(minWidth, "Road Min Width")) return;
if (!validate(maxWidth, "Road Max Width")) return; if (!validate(maxWidth, "Road Max Width")) return;
if(footpathat){
if(footpathat==='1'){
if (footpathat) {
if (footpathat === '1') {
if (!footpathDropdown) { if (!footpathDropdown) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
Swal.fire("Missing Field", "Please select LHS Footpath Material Type", "warning"); Swal.fire("Missing Field", "Please select LHS Footpath Material Type", "warning");
@ -1749,7 +1800,7 @@
return; return;
} }
} }
if(footpathat==='2'){
if (footpathat === '2') {
if (!rhs_footpathDropdown) { if (!rhs_footpathDropdown) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
Swal.fire("Missing Field", "Please select RHS Footpath Material Type", "warning"); Swal.fire("Missing Field", "Please select RHS Footpath Material Type", "warning");
@ -1766,7 +1817,7 @@
return; return;
} }
} }
if(footpathat==='3'){
if (footpathat === '3') {
if (!footpathDropdown) { if (!footpathDropdown) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
Swal.fire("Missing Field", "Please select LHS Footpath Material Type", "warning"); Swal.fire("Missing Field", "Please select LHS Footpath Material Type", "warning");
@ -1808,14 +1859,14 @@
if (swdVal === "yes") { if (swdVal === "yes") {
let swdlength=$("#swdlength").val().trim();
let swdsize=$("#size").val().trim();
let rhs_swdlength=$("#rhs_swdlength").val().trim();
let rhs_swdsize=$("#rhs_swdsize").val().trim();
let swdlength = $("#swdlength").val().trim();
let swdsize = $("#size").val().trim();
let rhs_swdlength = $("#rhs_swdlength").val().trim();
let rhs_swdsize = $("#rhs_swdsize").val().trim();
if(swd_at){
if(swd_at==='1'){
if (swd_at) {
if (swd_at === '1') {
if (!swdlength) { if (!swdlength) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1828,7 +1879,7 @@
return; return;
} }
} }
if(swd_at==='2'){
if (swd_at === '2') {
if (!rhs_swdlength) { if (!rhs_swdlength) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1841,7 +1892,7 @@
return; return;
} }
} }
if(swd_at==='3'){
if (swd_at === '3') {
if (!swdlength) { if (!swdlength) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1880,13 +1931,13 @@
} }
if(scpVal==="yes"){
if (scpVal === "yes") {
let scpCount =$("#scpCount").val().trim();
let rhs_scpCount =$("#rhs_scpCount").val().trim();
let scpCount = $("#scpCount").val().trim();
let rhs_scpCount = $("#rhs_scpCount").val().trim();
if(scp_at){
if(scp_at==='1'){
if (scp_at) {
if (scp_at === '1') {
if (!scpCount) { if (!scpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1894,7 +1945,7 @@
return; return;
} }
} }
if(scp_at==='2'){
if (scp_at === '2') {
if (!rhs_scpCount) { if (!rhs_scpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1902,7 +1953,7 @@
return; return;
} }
} }
if(scp_at==='3'){
if (scp_at === '3') {
if (!scpCount) { if (!scpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1923,14 +1974,14 @@
} }
if(mhVal==="yes"){
if (mhVal === "yes") {
let mhCount =$("#mhCount").val().trim();
let r_mhCount =$("#r_mhCount").val().trim();
let mhCount = $("#mhCount").val().trim();
let r_mhCount = $("#r_mhCount").val().trim();
if(mhType){
if(mhType==='1'){
if (mhType) {
if (mhType === '1') {
if (!mhCount) { if (!mhCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1938,7 +1989,7 @@
return; return;
} }
} }
if(mhType==='2'){
if (mhType === '2') {
if (!r_mhCount) { if (!r_mhCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1946,7 +1997,7 @@
return; return;
} }
} }
if(mhType==='3'){
if (mhType === '3') {
if (!mhCount) { if (!mhCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1967,14 +2018,14 @@
} }
if(cpVal === "yes"){
if (cpVal === "yes") {
let cpCount =$("#cpCount").val().trim();
let r_cpCount=$("#r_cpCount").val().trim();
let cpCount = $("#cpCount").val().trim();
let r_cpCount = $("#r_cpCount").val().trim();
if(cp_at){
if(cp_at==='1'){
if (cp_at) {
if (cp_at === '1') {
if (!cpCount) { if (!cpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1982,7 +2033,7 @@
return; return;
} }
} }
if(cp_at==='2'){
if (cp_at === '2') {
if (!r_cpCount) { if (!r_cpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -1990,7 +2041,7 @@
return; return;
} }
} }
if(cp_at==='3'){
if (cp_at === '3') {
if (!cpCount) { if (!cpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2010,13 +2061,13 @@
} }
if(rwVal === "yes"){
if (rwVal === "yes") {
let rwCount =$("#rwCount").val().trim();
let r_rwCount =$("#r_rwCount").val().trim();
let rwCount = $("#rwCount").val().trim();
let r_rwCount = $("#r_rwCount").val().trim();
if(rwh_at){
if(rwh_at==='1'){
if (rwh_at) {
if (rwh_at === '1') {
if (!rwCount) { if (!rwCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2024,7 +2075,7 @@
return; return;
} }
} }
if(rwh_at==='2'){
if (rwh_at === '2') {
if (!r_rwCount) { if (!r_rwCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2032,7 +2083,7 @@
return; return;
} }
} }
if(rwh_at==='3'){
if (rwh_at === '3') {
if (!rwCount) { if (!rwCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2053,9 +2104,9 @@
} }
if(epVal === "yes"){
if (epVal === "yes") {
let epCount =$("#epCount").val().trim();
let epCount = $("#epCount").val().trim();
if (!epCount) { if (!epCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2069,9 +2120,9 @@
} }
if(bsVal === "yes"){
if (bsVal === "yes") {
let bsCount =$("#bsCount").val().trim();
let bsCount = $("#bsCount").val().trim();
if (!bsCount) { if (!bsCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2082,9 +2133,9 @@
} }
if(slpVal === "yes"){
if (slpVal === "yes") {
let slpCount =$("#slpCount").val().trim();
let slpCount = $("#slpCount").val().trim();
if (!slpCount) { if (!slpCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2095,9 +2146,9 @@
} }
if(hmlVal === "yes"){
if (hmlVal === "yes") {
let hmlCount =$("#hmlCount").val().trim();
let hmlCount = $("#hmlCount").val().trim();
if (!hmlCount) { if (!hmlCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2108,9 +2159,9 @@
} }
if(mmlVal === "yes"){
if (mmlVal === "yes") {
let mmlCount =$("#mmlCount").val().trim();
let mmlCount = $("#mmlCount").val().trim();
if (!mmlCount) { if (!mmlCount) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
@ -2125,7 +2176,7 @@
if (!validate(sewerSize, "Sewer Size")) return; if (!validate(sewerSize, "Sewer Size")) return;
let noofcb = $("#noofcb").val().trim(); let noofcb = $("#noofcb").val().trim();
if(noofcb){
if (noofcb) {
if (!validate(noofcb, "No of Culverts & Bridges ")) return; if (!validate(noofcb, "No of Culverts & Bridges ")) return;
} }
@ -2174,8 +2225,7 @@
return false; return false;
} }
if (crValue !== '' &&(isNaN(crValue) ||parseFloat(crValue) <= 0))
{
if (crValue !== '' && (isNaN(crValue) || parseFloat(crValue) <= 0)) {
$('#saveBtn').prop('disabled', false); $('#saveBtn').prop('disabled', false);
relayingError = true; relayingError = true;
Swal.fire( Swal.fire(
@ -2204,7 +2254,7 @@
relayingDetails.push({ relayingDetails.push({
relay_month: month, relay_month: month,
relay_year: year, relay_year: year,
road_type_material:rrmtype,
road_type_material: rrmtype,
cr_value: crValue, cr_value: crValue,
road_type: roadType, road_type: roadType,
remarks: remarks remarks: remarks
@ -2216,7 +2266,7 @@
return; return;
} }
console.log("road id>>>>>",$("#roadDropdown").val());
console.log("road id>>>>>", $("#roadDropdown").val());
let payload = { let payload = {
@ -2227,44 +2277,44 @@
road_id: $("#roadDropdown").val(), road_id: $("#roadDropdown").val(),
road_name: $("#roadDropdown option:selected").data("road-name"), road_name: $("#roadDropdown option:selected").data("road-name"),
areaname:$("#areaname").val(),
localityname:$("#localityname").val(),
areaname: $("#areaname").val(),
localityname: $("#localityname").val(),
road_type: $("#roadTypeDropdown").val(), road_type: $("#roadTypeDropdown").val(),
road_type_material: $("#roadTypeMaterialDropdown").val(), road_type_material: $("#roadTypeMaterialDropdown").val(),
road_length: $("#length").val(), road_length: $("#length").val(),
road_row_width: $("#row_width").val().trim()|| null,
road_avg_width: $("#averageWidth").val().trim()|| null,
road_row_width: $("#row_width").val().trim() || null,
road_avg_width: $("#averageWidth").val().trim() || null,
road_min_width: $("#minWidth").val().trim()|| null,
road_max_width: $("#maxWidth").val().trim()|| null,
road_min_width: $("#minWidth").val().trim() || null,
road_max_width: $("#maxWidth").val().trim() || null,
road_area: $("#area").val(), road_area: $("#area").val(),
roadfrom:$("#roadFrom").val().trim()|| null,
roadto:$("#roadTo").val().trim()|| null,
roadfrom: $("#roadFrom").val().trim() || null,
roadto: $("#roadTo").val().trim() || null,
is_footpath:$('input[name="fpAvailable"]:checked').val(),
footpath_from_location: $("#footPathFrom").val()|| null,
footpath_to_location: $("#footPathTo").val()|| null,
is_footpath: $('input[name="fpAvailable"]:checked').val(),
footpath_from_location: $("#footPathFrom").val() || null,
footpath_to_location: $("#footPathTo").val() || null,
footpathat: $("#fpat").val()|| null,
footpathat: $("#fpat").val() || null,
footpath_material: $("#footpathDropdown").val()|| null,
footpath_length: $("#fplength").val()|| null,
footpath_width: $("#fpwidth").val()|| null,
footpath_material: $("#footpathDropdown").val() || null,
footpath_length: $("#fplength").val() || null,
footpath_width: $("#fpwidth").val() || null,
rhs_footpathDropdown :$("#rhs_footpathDropdown").val() || null,
rhs_fplength : $("#rhs_fplength").val().trim()|| null,
rhs_fpwidth :$("#rhs_fpwidth").val().trim()|| null,
rhs_footpathDropdown: $("#rhs_footpathDropdown").val() || null,
rhs_fplength: $("#rhs_fplength").val().trim() || null,
rhs_fpwidth: $("#rhs_fpwidth").val().trim() || null,
is_swd: $('input[name="swdAvailable"]:checked').val() || "", is_swd: $('input[name="swdAvailable"]:checked').val() || "",
swd_from: $("#fromswd").val() || null, swd_from: $("#fromswd").val() || null,
swd_to:$("#toswd").val() || null,
swd_to: $("#toswd").val() || null,
swd_at :$("#swd_at").val()|| null,
swd_at: $("#swd_at").val() || null,
swd_length: $("#swdlength").val() || null, swd_length: $("#swdlength").val() || null,
swd_size: $("#size").val() || null, swd_size: $("#size").val() || null,
@ -2272,42 +2322,42 @@
rhs_swdsize: $("#rhs_swdsize").val() || null, rhs_swdsize: $("#rhs_swdsize").val() || null,
is_scp: $('input[name="scpAvailable"]:checked').val() || "", is_scp: $('input[name="scpAvailable"]:checked').val() || "",
scp_at:$("#scp_at").val()|| null,
scp_at: $("#scp_at").val() || null,
scp_count: $("#scpCount").val().trim() || null, scp_count: $("#scpCount").val().trim() || null,
rhs_scpCount: $("#rhs_scpCount").val().trim() || null, rhs_scpCount: $("#rhs_scpCount").val().trim() || null,
is_manhole: $('input[name="mhAvailable"]:checked').val() || "", is_manhole: $('input[name="mhAvailable"]:checked').val() || "",
manhole_at :$("#mhType").val()|| null,
manhole_at: $("#mhType").val() || null,
manhole_count: $("#mhCount").val().trim() || null, manhole_count: $("#mhCount").val().trim() || null,
r_mhCount: $("#r_mhCount").val().trim() || null, r_mhCount: $("#r_mhCount").val().trim() || null,
is_cpipe: $('input[name="cpAvailable"]:checked').val() || "", is_cpipe: $('input[name="cpAvailable"]:checked').val() || "",
cp_at:$("#cp_at").val()|| null,
cpipe_count:$("#cpCount").val().trim() || null,
r_cpCount:$("#r_cpCount").val().trim() || null,
cp_at: $("#cp_at").val() || null,
cpipe_count: $("#cpCount").val().trim() || null,
r_cpCount: $("#r_cpCount").val().trim() || null,
is_rwh: $('input[name="rwAvailable"]:checked').val() || "", is_rwh: $('input[name="rwAvailable"]:checked').val() || "",
rwh_at :$("#rwh_at").val()|| null,
rwh_count:$("#rwCount").val().trim() || null,
r_rwCount:$("#r_rwCount").val().trim() || null,
rwh_at: $("#rwh_at").val() || null,
rwh_count: $("#rwCount").val().trim() || null,
r_rwCount: $("#r_rwCount").val().trim() || null,
sewer_length: $("#sewerLength").val().trim()|| null,
sewer_size: $("#sewerSize").val().trim()|| null,
sewer_length: $("#sewerLength").val().trim() || null,
sewer_size: $("#sewerSize").val().trim() || null,
is_electric_poles: $('input[name="epAvailable"]:checked').val() || "", is_electric_poles: $('input[name="epAvailable"]:checked').val() || "",
ep_count: $('input[name="epAvailable"]:checked').val() === "yes" ? ($("#epCount").val().trim() || null) : null, ep_count: $('input[name="epAvailable"]:checked').val() === "yes" ? ($("#epCount").val().trim() || null) : null,
is_streetlight_poles: $('input[name="slpAvailable"]:checked').val() || "", is_streetlight_poles: $('input[name="slpAvailable"]:checked').val() || "",
streetlight_poles_count:$('input[name="slpAvailable"]:checked').val() === "yes" ? ($("#slpCount").val().trim() || null) : null,
streetlight_poles_count: $('input[name="slpAvailable"]:checked').val() === "yes" ? ($("#slpCount").val().trim() || null) : null,
is_hml: $('input[name="hmlAvailable"]:checked').val() || "", is_hml: $('input[name="hmlAvailable"]:checked').val() || "",
hml_count:$('input[name="hmlAvailable"]:checked').val() === "yes" ? ($("#hmlCount").val().trim() || null) : null,
hml_count: $('input[name="hmlAvailable"]:checked').val() === "yes" ? ($("#hmlCount").val().trim() || null) : null,
is_mml:$('input[name="mmlAvailable"]:checked').val() || "",
mml_count:$('input[name="mmlAvailable"]:checked').val() === "yes" ? ($("#mmlCount").val().trim() || null) : null,
is_mml: $('input[name="mmlAvailable"]:checked').val() || "",
mml_count: $('input[name="mmlAvailable"]:checked').val() === "yes" ? ($("#mmlCount").val().trim() || null) : null,
culvert_bridge_count: $("#noofcb").val().trim()|| null,
details: $("#detailsofcb").val().trim()|| null,
culvert_bridge_count: $("#noofcb").val().trim() || null,
details: $("#detailsofcb").val().trim() || null,
is_busshelter: $('input[name="bsAvailable"]:checked').val() || "", is_busshelter: $('input[name="bsAvailable"]:checked').val() || "",
busshelter_count: $('input[name="bsAvailable"]:checked').val() === "yes" ? ($("#bsCount").val().trim() || null) : null, busshelter_count: $('input[name="bsAvailable"]:checked').val() === "yes" ? ($("#bsCount").val().trim() || null) : null,

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

Loading…
Cancel
Save