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. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/controller/PendinglistApicontroller.java
  3. 30
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
  4. 232
      src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/ReportService.java
  5. 310
      src/main/resources/templates/modules/childrensurvey/childlist.html
  6. 73
      src/main/resources/templates/modules/childrensurvey/surveylist.html
  7. 26
      src/main/resources/templates/modules/greencommittee/pendinglist.html
  8. 117
      src/main/resources/templates/modules/greencommittee/treepruningreports.html
  9. 166
      src/main/resources/templates/modules/roadwar/regform.html
  10. 192
      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,

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",

166
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">
@ -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(

192
src/main/resources/templates/modules/roadwar/updateform.html

@ -5,14 +5,20 @@
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<style> <style>
.custom-width1 { .custom-width1 {
width: 30%; /* Adjust the width as needed */
width: 30%;
/* Adjust the width as needed */
} }
.custom-width2 { .custom-width2 {
width: 15%; /* Adjust the width as needed */
width: 15%;
/* Adjust the width as needed */
} }
#roadWarModal .modal-body { #roadWarModal .modal-body {
max-height: 80vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 80vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
} }
</style> </style>
@ -101,7 +107,8 @@
<button type="submit" id="searchBtn" <button type="submit" id="searchBtn"
class="btn btn-primary mx-2">Search</button> class="btn btn-primary mx-2">Search</button>
<button class="btn btn-danger mx-2" id="resetBtn" name="reset" type="button">Reset</button>
<button class="btn btn-danger mx-2" id="resetBtn" name="reset"
type="button">Reset</button>
</div> </div>
@ -119,7 +126,9 @@
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<table id="ReportDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<table id="ReportDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
@ -129,8 +138,10 @@
<th class="text-center custom-width1 no-sort">Road Name</th> <th class="text-center custom-width1 no-sort">Road Name</th>
<th class="text-center custom-width2 no-sort">Road Type</th> <th class="text-center custom-width2 no-sort">Road Type</th>
<th class="text-center custom-width2 no-sort">Road Length(m)</th> <th class="text-center custom-width2 no-sort">Road Length(m)</th>
<th class="text-center custom-width2 no-sort">Road Average Width(m)</th>
<th class="text-center custom-width2 no-sort">Area(m<sup>2</sup>)</th>
<th class="text-center custom-width2 no-sort">Road Average Width(m)
</th>
<th class="text-center custom-width2 no-sort">Area(m<sup>2</sup>)
</th>
<th class="text-center no-sort">Update</th> <th class="text-center no-sort">Update</th>
<th class="text-center no-sort">Delete</th> <th class="text-center no-sort">Delete</th>
@ -172,7 +183,8 @@
<!-- modal body --> <!-- modal body -->
<div class="modal fade" id="roadWarModal" tabindex="-1" role="dialog" aria-labelledby="roadWarModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal fade" id="roadWarModal" tabindex="-1" role="dialog" aria-labelledby="roadWarModalLabel"
aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-xl" role="document" style="max-width:95%;"> <div class="modal-dialog modal-xl" role="document" style="max-width:95%;">
<div class="modal-content"> <div class="modal-content">
@ -181,9 +193,7 @@
Road War Details Road War Details
</h5> </h5>
<button type="button"
class="close"
data-dismiss="modal">
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span> <span>&times;</span>
</button> </button>
</div> </div>
@ -216,16 +226,12 @@
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Area Name<span class="text-danger">*</span></label> <label class="form-label">Area Name<span class="text-danger">*</span></label>
<input type="text"
id="view_areaname"
class="form-control">
<input type="text" id="view_areaname" class="form-control">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Locality Name<span class="text-danger">*</span></label> <label class="form-label">Locality Name<span class="text-danger">*</span></label>
<input type="text"
id="view_localityname"
class="form-control">
<input type="text" id="view_localityname" class="form-control">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
@ -244,47 +250,36 @@
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Length of Road (m)<span class="text-danger">*</span></label> <label class="form-label">Length of Road (m)<span class="text-danger">*</span></label>
<input type="text"
id="view_road_length"
class="form-control decimal-only">
<input type="text" id="view_road_length" class="form-control decimal-only">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Right of Way(ROW) Width of Road (m)</label> <label class="form-label">Right of Way(ROW) Width of Road (m)</label>
<input type="text"
id="view_road_row_width"
class="form-control decimal-only" >
<input type="text" id="view_road_row_width" class="form-control decimal-only">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Average Carriage way Width of Road (m)</label> <label class="form-label">Average Carriage way Width of Road (m)</label>
<input type="text"
id="view_road_avg_width"
class="form-control decimal-only" >
<input type="text" id="view_road_avg_width" class="form-control decimal-only">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Area of Road (m<sup>2</sup>)<span class="text-danger">*</span></label>
<input type="text"
id="view_road_area"
class="form-control decimal-only" >
<label class="form-label">Area of Road (m<sup>2</sup>)<span
class="text-danger">*</span></label>
<input type="text" id="view_road_area" class="form-control decimal-only">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Min Width of Road (m)</label> <label class="form-label">Min Width of Road (m)</label>
<input type="text"
id="view_road_min_width"
class="form-control decimal-only" >
<input type="text" id="view_road_min_width" class="form-control decimal-only">
</div> </div>
<div class="col-md-3 mb-3"> <div class="col-md-3 mb-3">
<label class="form-label">Max Width of Road (m)</label> <label class="form-label">Max Width of Road (m)</label>
<input type="text"
id="view_road_max_width"
class="form-control decimal-only" >
<input type="text" id="view_road_max_width" class="form-control decimal-only">
</div> </div>
<div class="col-md-12 mb-3"> <div class="col-md-12 mb-3">
@ -292,14 +287,12 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label for="view_roadFrom">From</label> <label for="view_roadFrom">From</label>
<input type="text" class="form-control" id="view_roadFrom"
name="view_roadFrom">
<input type="text" class="form-control" id="view_roadFrom" name="view_roadFrom">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="view_roadTo">To</label> <label for="view_roadTo">To</label>
<input type="text" class="form-control" id="view_roadTo"
name="view_roadTo">
<input type="text" class="form-control" id="view_roadTo" name="view_roadTo">
</div> </div>
</div> </div>
</div> </div>
@ -352,19 +345,22 @@
<div id="lhs_fsection" style="display: none;"> <div id="lhs_fsection" style="display: none;">
<div class="row"> <div class="row">
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label class="form-label">LHS Footpath Material Type<span class="text-danger">*</span></label>
<label class="form-label">LHS Footpath Material Type<span
class="text-danger">*</span></label>
<select id="view_footpath_material" class="form-control"> <select id="view_footpath_material" class="form-control">
<option value="">Select Material</option> <option value="">Select Material</option>
</select> </select>
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label class="form-label">LHS Length of Footpath (m)<span class="text-danger">*</span></label>
<label class="form-label">LHS Length of Footpath (m)<span
class="text-danger">*</span></label>
<input type="text" id="view_footpath_length" class="form-control decimal-only"> <input type="text" id="view_footpath_length" class="form-control decimal-only">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="view_fpwidth" class="form-label">LHS Average Width of Footpath(m)<span class="text-danger">*</span></label>
<label for="view_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="view_fpwidth"> <input type="text" class="form-control decimal-only" id="view_fpwidth">
</div> </div>
</div> </div>
@ -372,19 +368,22 @@
<div id="rhs_fsection" style="display: none;"> <div id="rhs_fsection" style="display: none;">
<div class="row"> <div class="row">
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label class="form-label">RHS Footpath Material Type<span class="text-danger">*</span></label>
<label class="form-label">RHS Footpath Material Type<span
class="text-danger">*</span></label>
<select id="view_rfootpath_material" class="form-control"> <select id="view_rfootpath_material" class="form-control">
<option value="">Select Material</option> <option value="">Select Material</option>
</select> </select>
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label class="form-label">RHS Length of Footpath (m)<span class="text-danger">*</span></label>
<label class="form-label">RHS Length of Footpath (m)<span
class="text-danger">*</span></label>
<input type="text" id="view_rfootpath_length" class="form-control decimal-only"> <input type="text" id="view_rfootpath_length" class="form-control decimal-only">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
<label for="view_rfpwidth" class="form-label">RHS Average Width of Footpath(m)<span class="text-danger">*</span></label>
<label for="view_rfpwidth" class="form-label">RHS Average Width of Footpath(m)<span
class="text-danger">*</span></label>
<input type="text" class="form-control decimal-only" id="view_rfpwidth"> <input type="text" class="form-control decimal-only" id="view_rfpwidth">
</div> </div>
</div> </div>
@ -447,12 +446,14 @@
<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>
<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"> <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>
<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"> <input type="text" class="form-control decimal-only" id="rhs_swdsize">
</div> </div>
</div> </div>
@ -496,11 +497,13 @@
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_scp" style="display: none;"> <div class="col-md-3" id="lhs_scp" style="display: none;">
<label for="update_scpCount"> LHS Count<span class="text-danger">*</span></label>
<label for="update_scpCount"> LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="update_scpCount"> <input type="text" class="form-control integer-only" id="update_scpCount">
</div> </div>
<div class="col-md-3" id="rhs_scp" style="display: none;"> <div class="col-md-3" id="rhs_scp" style="display: none;">
<label for="rhs_scpCount"> RHS Count<span class="text-danger">*</span></label>
<label for="rhs_scpCount"> RHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="rhs_scpCount"> <input type="text" class="form-control integer-only" id="rhs_scpCount">
</div> </div>
@ -543,12 +546,14 @@
</div> </div>
<div class="col-md-3" id="lhs_mh" style="display: none;"> <div class="col-md-3" id="lhs_mh" style="display: none;">
<label for="update_mhCount">LHS Count<span class="text-danger">*</span></label>
<label for="update_mhCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="update_mhCount"> <input type="text" class="form-control integer-only" id="update_mhCount">
</div> </div>
<div class="col-md-3" id="rhs_mh" style="display: none;"> <div class="col-md-3" id="rhs_mh" style="display: none;">
<label for="r_mhCount">RHS Count<span class="text-danger">*</span></label> <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">
<input type="text" class="form-control integer-only" id="r_mhCount"
name="r_mhCount">
</div> </div>
@ -587,7 +592,8 @@
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_cp" style="display: none;"> <div class="col-md-3" id="lhs_cp" style="display: none;">
<label for="update_cpCount">LHS Count<span class="text-danger">*</span></label>
<label for="update_cpCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="update_cpCount"> <input type="text" class="form-control integer-only" id="update_cpCount">
</div> </div>
<div class="col-md-3" id="rhs_cp" style="display: none;"> <div class="col-md-3" id="rhs_cp" style="display: none;">
@ -627,7 +633,8 @@
</select> </select>
</div> </div>
<div class="col-md-3" id="lhs_rwh" style="display: none;"> <div class="col-md-3" id="lhs_rwh" style="display: none;">
<label for="update_rwCount">LHS Count<span class="text-danger">*</span></label>
<label for="update_rwCount">LHS Count<span
class="text-danger">*</span></label>
<input type="text" class="form-control integer-only" id="update_rwCount"> <input type="text" class="form-control integer-only" id="update_rwCount">
</div> </div>
<div class="col-md-3" id="rhs_rwh" style="display: none;"> <div class="col-md-3" id="rhs_rwh" style="display: none;">
@ -658,28 +665,21 @@
<div> <div>
<label class="mr-3"> <label class="mr-3">
<input type="radio"
name="update_epAvailable"
value="yes">
<input type="radio" name="update_epAvailable" value="yes">
Yes Yes
</label> </label>
<label> <label>
<input type="radio"
name="update_epAvailable"
value="no">
<input type="radio" name="update_epAvailable" value="no">
No No
</label> </label>
</div> </div>
<div class="col-md-6" id="update_epSection"
style="display:none;margin-top:15px;">
<div class="col-md-6" id="update_epSection" style="display:none;margin-top:15px;">
<label>Count<span class="text-danger">*</span></label> <label>Count<span class="text-danger">*</span></label>
<input type="text"
class="form-control integer-only"
id="update_epCount">
<input type="text" class="form-control integer-only" id="update_epCount">
</div> </div>
@ -694,28 +694,21 @@
<div> <div>
<label class="mr-3"> <label class="mr-3">
<input type="radio"
name="update_bsAvailable"
value="yes">
<input type="radio" name="update_bsAvailable" value="yes">
Yes Yes
</label> </label>
<label> <label>
<input type="radio"
name="update_bsAvailable"
value="no">
<input type="radio" name="update_bsAvailable" value="no">
No No
</label> </label>
</div> </div>
<div class="col-md-6" id="update_bsSection"
style="display:none;margin-top:15px;">
<div class="col-md-6" id="update_bsSection" style="display:none;margin-top:15px;">
<label>Count<span class="text-danger">*</span></label> <label>Count<span class="text-danger">*</span></label>
<input type="text"
class="form-control integer-only"
id="update_bsCount">
<input type="text" class="form-control integer-only" id="update_bsCount">
</div> </div>
@ -790,16 +783,12 @@
<div> <div>
<label class="mr-3"> <label class="mr-3">
<input type="radio"
name="update_cmAvailable"
value="yes">
<input type="radio" name="update_cmAvailable" value="yes">
Yes Yes
</label> </label>
<label> <label>
<input type="radio"
name="update_cmAvailable"
value="no">
<input type="radio" name="update_cmAvailable" value="no">
No No
</label> </label>
</div> </div>
@ -816,9 +805,7 @@
Length Of Sewer(CMWSSB) (m) Length Of Sewer(CMWSSB) (m)
</label> </label>
<input type="text"
class="form-control decimal-only"
id="update_sewerLength">
<input type="text" class="form-control decimal-only" id="update_sewerLength">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
@ -826,9 +813,7 @@
Size of Sewer (feet or cm) Size of Sewer (feet or cm)
</label> </label>
<input type="text"
class="form-control decimal-only"
id="update_sewerSize">
<input type="text" class="form-control decimal-only" id="update_sewerSize">
</div> </div>
<div class="col-md-4 mb-3"> <div class="col-md-4 mb-3">
@ -836,9 +821,7 @@
No of Culverts & Bridges No of Culverts & Bridges
</label> </label>
<input type="text"
class="form-control integer-only"
id="update_noofcb">
<input type="text" class="form-control integer-only" id="update_noofcb">
</div> </div>
<div class="col-md-12 mb-3"> <div class="col-md-12 mb-3">
@ -846,10 +829,9 @@
Details of Culverts & Bridges With Date of Construction Details of Culverts & Bridges With Date of Construction
</label> </label>
<textarea class="form-control"
id="update_detailsofcb"
rows="4"></textarea>
</div></div>
<textarea class="form-control" id="update_detailsofcb" rows="4"></textarea>
</div>
</div>
@ -860,23 +842,17 @@
<div id="relayingContainer"></div> <div id="relayingContainer"></div>
<div class="text-left mb-3"> <div class="text-left mb-3">
<button type="button"
class="btn btn-primary"
id="btnAddRelay">
<button type="button" class="btn btn-primary" id="btnAddRelay">
+ Add More + Add More
</button> </button>
</div> </div>
<div class="text-center mt-4"> <div class="text-center mt-4">
<button type="button"
class="btn btn-success"
id="btnUpdateRoadWar">
<button type="button" class="btn btn-success" id="btnUpdateRoadWar">
Update Update
</button> </button>
<button type="button"
class="btn btn-secondary ml-2"
data-dismiss="modal">
<button type="button" class="btn btn-secondary ml-2" data-dismiss="modal">
Cancel Cancel
</button> </button>
</div> </div>
@ -2259,8 +2235,7 @@ $(document).on('change', 'input[name="update_rwAvailable"]', function () {
} }
else if(response.is_scp === 'no')
{
else if (response.is_scp === 'no') {
$('input[name="update_scpAvailable"][value="no"]').prop('checked', true); $('input[name="update_scpAvailable"][value="no"]').prop('checked', true);
$('#update_scpSection').hide(); $('#update_scpSection').hide();
@ -2739,7 +2714,7 @@ $(document).on('change', 'input[name="update_rwAvailable"]', function () {
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Completion Report Value (CR)<span class="text-danger">*</span></label>
<label>Amount Value<span class="text-danger">*</span></label>
<input type="text" <input type="text"
class="form-control cr_value decimal-only" class="form-control cr_value decimal-only"
@ -3540,4 +3515,5 @@ $(document).on('change', 'input[name="update_rwAvailable"]', function () {
</body> </body>
</html> </html>
Loading…
Cancel
Save