Browse Source

last commit

master
kirubaasagar.R 2 years ago
parent
commit
aeb146e44e
  1. 314
      src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java
  2. 5
      src/main/java/com/gcc/publicgrievance/controller/UserController.java
  3. BIN
      src/main/resources/static/images/Thin broken ring.gif
  4. 494
      src/main/resources/static/images/ack.pdf
  5. BIN
      src/main/resources/static/images/minus.png
  6. BIN
      src/main/resources/static/images/plus.png
  7. 1505
      src/main/resources/templates/Tradelicence/tradelicence.html
  8. 65
      src/main/resources/templates/User/home.html
  9. 525
      src/main/resources/templates/User/registercomplaints.html
  10. 160
      src/main/resources/templates/checklistofficer/checklistofficer.html
  11. 223
      src/main/resources/templates/staff/appoinment.html
  12. 101
      src/main/resources/templates/staff/createorder.html
  13. 197
      src/main/resources/templates/staff/schemegroup.html

314
src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java

@ -1,29 +1,35 @@
package com.gcc.publicgrievance.controller; package com.gcc.publicgrievance.controller;
import java.io.IOException;
import java.util.Base64; import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.util.UriComponentsBuilder;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import com.gcc.publicgrievance.Service.ComplaintService; import com.gcc.publicgrievance.Service.ComplaintService;
@CrossOrigin @CrossOrigin
@RestController @RestController
public class ComplaintController { public class ComplaintController {
@ -53,91 +59,253 @@ public class ComplaintController {
} }
// save api // save api
/*@PostMapping("/register")
public ResponseEntity<String> registerComplaint(
@RequestParam("ComplainantName") String complainantName,
@RequestParam("ComplainantAddr") String complainantAddr,
@RequestParam("MobileNo") String mobileNo,
@RequestParam("Email") String email,
@RequestParam("ComplaintType") String complaintType,
@RequestParam("ComplaintTitle") String complaintTitle,
@RequestParam("ComplaintDetails") String complaintDetails,
@RequestParam("StreetId") String streetId,
@RequestParam("Comp_Image") String compImage,
@RequestParam("latitude") String latitude,
@RequestParam("longtitude") String longtitude,
@RequestParam("Landmark") String landmark,
@RequestParam("gender") String gender) {
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; // // //
// Build the URI with parameters
UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromHttpUrl(externalUrl)
.queryParam("serviceId", "RegComplaint").queryParam("ComplainantName", complainantName)
.queryParam("ComplainantAddr", complainantAddr).queryParam("MobileNo", mobileNo)
.queryParam("Email", email).queryParam("ComplaintType", complaintType)
.queryParam("ComplaintTitle", complaintTitle).queryParam("ComplaintDetails", complaintDetails)
.queryParam("StreetId", streetId).queryParam("Comp_Image", compImage).queryParam("latitude", latitude)
.queryParam("longtitude", longtitude).queryParam("Landmark", landmark).queryParam("gender", gender); // //
// the
// external API
ResponseEntity<String> response = restTemplate.postForEntity(uriBuilder.toUriString(), null, String.class); //
// // Return the response from the external API
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
}*/
/* /*
* @PostMapping("/register") public ResponseEntity<String> registerComplaint(
*
* @RequestParam("ComplainantName") String complainantName,
* @PostMapping("/register") public ResponseEntity<String>
* registerComplaint(@RequestParam("ComplainantName") String complainantName,
* *
* @RequestParam("ComplainantAddr") String complainantAddr,
* @RequestParam("ComplainantAddr") String
* complainantAddr, @RequestParam("MobileNo") String mobileNo,
* *
* @RequestParam("MobileNo") String mobileNo,
* @RequestParam("Email") String email, @RequestParam("ComplaintType") String
* complaintType,
* *
* @RequestParam("Email") String email,
* @RequestParam("ComplaintTitle") String complaintTitle,
* *
* @RequestParam("ComplaintType") String complaintType,
* @RequestParam("ComplaintDetails") String
* complaintDetails, @RequestParam("StreetId") String streetId,
* *
* @RequestParam("ComplaintTitle") String complaintTitle,
* @RequestParam("Comp_Image") MultipartFile
* compImage, @RequestParam("latitude") String latitude,
* *
* @RequestParam("ComplaintDetails") String complaintDetails,
* @RequestParam("longtitude") String longtitude, @RequestParam("Landmark")
* String landmark,
* *
* @RequestParam("StreetId") String streetId,
* @RequestParam("gender") String gender) {
* *
* @RequestParam("Comp_Image") String compImage,
* String externalUrl =
* "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
* *
* @RequestParam("latitude") String latitude,
* // Convert the image to a Base64 string String base64Image = ""; if
* (!compImage.isEmpty()) { try { byte[] imageBytes = compImage.getBytes();
* base64Image = Base64.getEncoder().encodeToString(imageBytes); } catch
* (IOException e) { return
* ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).
* body("Error encoding image."); } }
* *
* @RequestParam("longtitude") String longtitude,
* // Build the URI with parameters UriComponentsBuilder uriBuilder =
* UriComponentsBuilder.fromHttpUrl(externalUrl) .queryParam("serviceId",
* "RegComplaint").queryParam("ComplainantName", complainantName)
* .queryParam("ComplainantAddr", complainantAddr).queryParam("MobileNo",
* mobileNo) .queryParam("Email", email).queryParam("ComplaintType",
* complaintType) .queryParam("ComplaintTitle",
* complaintTitle).queryParam("ComplaintDetails", complaintDetails)
* .queryParam("StreetId", streetId).queryParam("Comp_Image", base64Image) //
* Use base64 image here .queryParam("latitude",
* latitude).queryParam("longtitude", longtitude).queryParam("Landmark",
* landmark) .queryParam("gender", gender);
* *
* @RequestParam("Landmark") String landmark,
* // Make a POST request to the external API ResponseEntity<String> response =
* restTemplate.postForEntity(uriBuilder.toUriString(), null, String.class);
* *
* @RequestParam("gender") String gender) {
* // Return the response from the external API return
* ResponseEntity.status(response.getStatusCode()).body(response.getBody());
* *
* String externalUrl =
* "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; // // //
* Build the URI with parameters UriComponentsBuilder uriBuilder =
* UriComponentsBuilder.fromHttpUrl(externalUrl) .queryParam("serviceId",
* "RegComplaint") .queryParam("ComplainantName", complainantName)
* .queryParam("ComplainantAddr", complainantAddr) .queryParam("MobileNo",
* mobileNo) .queryParam("Email", email) .queryParam("ComplaintType",
* complaintType) .queryParam("ComplaintTitle", complaintTitle)
* .queryParam("ComplaintDetails", complaintDetails) .queryParam("StreetId",
* streetId) .queryParam("Comp_Image", compImage) .queryParam("latitude",
* latitude) .queryParam("longtitude", longtitude) .queryParam("Landmark",
* landmark) .queryParam("gender", gender); // // // Make a POST request to the
* external API ResponseEntity<String> response =
* restTemplate.postForEntity(uriBuilder.toUriString(), null, String.class); //
* // // Return the response from the external API return
* ResponseEntity.status(response.getStatusCode()).body(response.getBody()); }
* }
*/ */
/*@PostMapping("/register")
public ResponseEntity<String> registerComplaint(
@RequestParam("ComplainantName") String complainantName,
@RequestParam("ComplainantAddr") String complainantAddr,
@RequestParam("MobileNo") String mobileNo,
@RequestParam("Email") String email,
@RequestParam("ComplaintType") String complaintType,
@RequestParam("ComplaintTitle") String complaintTitle,
@RequestParam("ComplaintDetails") String complaintDetails,
@RequestParam("StreetId") String streetId,
@RequestParam("Comp_Image") String compImage,
@RequestParam("latitude") String latitude,
@RequestParam("longtitude") String longtitude,
@RequestParam("Landmark") String landmark,
@RequestParam("gender") String gender) {
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
try {
// Create the URL object
URL url = new URL(externalUrl);
// Create the HttpURLConnection object
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
// Create the parameters string
String params = "serviceId=RegComplaint" +
"&ComplainantName=" + URLEncoder.encode(complainantName, "UTF-8") +
"&ComplainantAddr=" + URLEncoder.encode(complainantAddr, "UTF-8") +
"&MobileNo=" + URLEncoder.encode(mobileNo, "UTF-8") +
"&Email=" + URLEncoder.encode(email, "UTF-8") +
"&ComplaintType=" + URLEncoder.encode(complaintType, "UTF-8") +
"&ComplaintTitle=" + URLEncoder.encode(complaintTitle, "UTF-8") +
"&ComplaintDetails=" + URLEncoder.encode(complaintDetails, "UTF-8") +
"&StreetId=" + URLEncoder.encode(streetId, "UTF-8") +
"&Comp_Image=" + URLEncoder.encode(compImage, "UTF-8") +
"&latitude=" + URLEncoder.encode(latitude, "UTF-8") +
"&longtitude=" + URLEncoder.encode(longtitude, "UTF-8") +
"&Landmark=" + URLEncoder.encode(landmark, "UTF-8") +
"&gender=" + URLEncoder.encode(gender, "UTF-8");
// Write parameters to request body
try (OutputStream os = conn.getOutputStream()) {
byte[] input = params.getBytes("UTF-8");
os.write(input, 0, input.length);
}
// Read the response
int responseCode = conn.getResponseCode();
BufferedReader reader;
if (responseCode == HttpURLConnection.HTTP_OK) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
}
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
// Return the response from the external API
return ResponseEntity.status(responseCode).body(response.toString());
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("An error occurred while processing the request.");
}
}
*/
@PostMapping("/register") @PostMapping("/register")
public ResponseEntity<String> registerComplaint(@RequestParam("ComplainantName") String complainantName,
@RequestParam("ComplainantAddr") String complainantAddr, @RequestParam("MobileNo") String mobileNo,
@RequestParam("Email") String email, @RequestParam("ComplaintType") String complaintType,
@RequestParam("ComplaintTitle") String complaintTitle,
@RequestParam("ComplaintDetails") String complaintDetails, @RequestParam("StreetId") String streetId,
@RequestParam("Comp_Image") MultipartFile compImage, @RequestParam("latitude") String latitude,
@RequestParam("longtitude") String longtitude, @RequestParam("Landmark") String landmark,
@RequestParam("gender") String gender) {
public ResponseEntity<String> registerComplaint(
@RequestParam(value = "ComplainantName", required = false) String complainantName,
@RequestParam(value = "ComplainantAddr", required = false) String complainantAddr,
@RequestParam(value = "MobileNo", required = false) String mobileNo,
@RequestParam(value = "Email", required = false) String email,
@RequestParam(value = "ComplaintType", required = false) String complaintType,
@RequestParam(value = "ComplaintTitle", required = false) String complaintTitle,
@RequestParam(value = "ComplaintDetails", required = false) String complaintDetails,
@RequestParam(value = "StreetId", required = false) String streetId,
@RequestParam(value = "Comp_Image", required = false) String compImage,
@RequestParam(value = "latitude", required = false) String latitude,
@RequestParam(value = "longtitude", required = false) String longtitude,
@RequestParam(value = "Landmark", required = false) String landmark,
@RequestParam(value = "gender", required = false) String gender) {
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
// Convert the image to a Base64 string
String base64Image = "";
if (!compImage.isEmpty()) {
try {
byte[] imageBytes = compImage.getBytes();
base64Image = Base64.getEncoder().encodeToString(imageBytes);
} catch (IOException e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Error encoding image.");
}
}
try {
// Create the URL object
URL url = new URL(externalUrl);
// Build the URI with parameters
UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromHttpUrl(externalUrl)
.queryParam("serviceId", "RegComplaint").queryParam("ComplainantName", complainantName)
.queryParam("ComplainantAddr", complainantAddr).queryParam("MobileNo", mobileNo)
.queryParam("Email", email).queryParam("ComplaintType", complaintType)
.queryParam("ComplaintTitle", complaintTitle).queryParam("ComplaintDetails", complaintDetails)
.queryParam("StreetId", streetId).queryParam("Comp_Image", base64Image) // Use base64 image here
.queryParam("latitude", latitude).queryParam("longtitude", longtitude).queryParam("Landmark", landmark)
.queryParam("gender", gender);
// Create the HttpURLConnection object
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
// Make a POST request to the external API
ResponseEntity<String> response = restTemplate.postForEntity(uriBuilder.toUriString(), null, String.class);
// Create the parameters string, handling null values
String params = "serviceId=RegComplaint" +
"&ComplainantName=" + URLEncoder.encode(complainantName != null ? complainantName : "", "UTF-8") +
"&ComplainantAddr=" + URLEncoder.encode(complainantAddr != null ? complainantAddr : "", "UTF-8") +
"&MobileNo=" + URLEncoder.encode(mobileNo != null ? mobileNo : "", "UTF-8") +
"&Email=" + URLEncoder.encode(email != null ? email : "", "UTF-8") +
"&ComplaintType=" + URLEncoder.encode(complaintType != null ? complaintType : "", "UTF-8") +
"&ComplaintTitle=" + URLEncoder.encode(complaintTitle != null ? complaintTitle : "", "UTF-8") +
"&ComplaintDetails=" + URLEncoder.encode(complaintDetails != null ? complaintDetails : "", "UTF-8") +
"&StreetId=" + URLEncoder.encode(streetId != null ? streetId : "", "UTF-8") +
"&Comp_Image=" + URLEncoder.encode(compImage != null ? compImage : "", "UTF-8") +
"&latitude=" + URLEncoder.encode(latitude != null ? latitude : "", "UTF-8") +
"&longtitude=" + URLEncoder.encode(longtitude != null ? longtitude : "", "UTF-8") +
"&Landmark=" + URLEncoder.encode(landmark != null ? landmark : "", "UTF-8") +
"&gender=" + URLEncoder.encode(gender != null ? gender : "", "UTF-8");
// Return the response from the external API
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
// Write parameters to request body
try (OutputStream os = conn.getOutputStream()) {
byte[] input = params.getBytes("UTF-8");
os.write(input, 0, input.length);
}
// Read the response
int responseCode = conn.getResponseCode();
BufferedReader reader;
if (responseCode == HttpURLConnection.HTTP_OK) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
}
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
// Return the response from the external API
return ResponseEntity.status(responseCode).body(response.toString());
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("An error occurred while processing the request.");
}
} }
} }

5
src/main/java/com/gcc/publicgrievance/controller/UserController.java

@ -48,4 +48,9 @@ public class UserController {
public String appoinment(Model model) { public String appoinment(Model model) {
return "staff/appoinment"; return "staff/appoinment";
} }
//tradelicence
@GetMapping("/tradelicence")
public String tradelicence(Model model) {
return "Tradelicence/tradelicence";
}
} }

BIN
src/main/resources/static/images/Thin broken ring.gif

After

Width: 64  |  Height: 64  |  Size: 7.6 KiB

494
src/main/resources/static/images/ack.pdf

@ -0,0 +1,494 @@
%PDF-1.3
%ºß¬à
3 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/MediaBox [0 0 595.2799999999999727 841.8899999999999864]
/Contents 4 0 R
>>
endobj
4 0 obj
<<
/Length 4438
>>
stream
0.5670000000000001 w
0 G
BT
/F9 10 Tf
11.5 TL
0 g
56.6929133858267775 813.5435433070865656 Td
(Information) Tj
ET
0.09 0.63 0.52 rg
0.78 G
0. w
40. 785.1970866141731449 265.9382208588956473 -21.4999999999999964 re
f
BT
/F10 10 Tf
11.5 TL
1. g
45. 771.6970866141732586 Td
(Company) Tj
ET
0.09 0.63 0.52 rg
0.78 G
0. w
305.9382208588956473 785.1970866141731449 156.283159509202477 -21.4999999999999964 re
f
BT
/F10 10 Tf
11.5 TL
1. g
310.9382208588956473 771.6970866141732586 Td
(Contact) Tj
ET
0.09 0.63 0.52 rg
0.78 G
0. w
462.2213803680980959 785.1970866141731449 93.0586196319018342 -21.4999999999999964 re
f
BT
/F10 10 Tf
11.5 TL
1. g
467.2213803680980959 771.6970866141732586 Td
(Country) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 763.6970866141731449 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 750.1970866141732586 Td
(Alfreds Futterkiste) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 763.6970866141731449 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 750.1970866141732586 Td
( ’ ª Í ª Á • È) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 763.6970866141731449 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 750.1970866141732586 Td
(Germany) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 742.1970866141732586 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 728.6970866141732586 Td
(Centro comercial Moctezuma) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 742.1970866141732586 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 728.6970866141732586 Td
(Francisco Chang) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 742.1970866141732586 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 728.6970866141732586 Td
( ’ ª Í ª Á • È) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 720.6970866141731449 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 707.1970866141732586 Td
(Ernst Handel) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 720.6970866141731449 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 707.1970866141732586 Td
(Roland Mendel) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 720.6970866141731449 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 707.1970866141732586 Td
(Austria) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 699.1970866141732586 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 685.6970866141732586 Td
(Island Trading) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 699.1970866141732586 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 685.6970866141732586 Td
(Helen Bennett) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 699.1970866141732586 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 685.6970866141732586 Td
(UK) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 677.6970866141732586 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 664.1970866141732586 Td
(Laughing Bacchus Winecellars) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 677.6970866141732586 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 664.1970866141732586 Td
(Yoshi Tannamuri) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 677.6970866141732586 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 664.1970866141732586 Td
(Canada) Tj
ET
1. g
0.78 G
0.2834645669291339 w
40. 656.1970866141732586 265.9382208588956473 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
45. 642.6970866141732586 Td
(Magazzini Alimentari Riuniti) Tj
ET
1. g
0.78 G
0.2834645669291339 w
305.9382208588956473 656.1970866141732586 156.283159509202477 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
310.9382208588956473 642.6970866141732586 Td
(Giovanni Rovelli) Tj
ET
1. g
0.78 G
0.2834645669291339 w
462.2213803680980959 656.1970866141732586 93.0586196319018342 -21.4999999999999964 re
B
BT
/F9 10 Tf
11.5 TL
0.314 g
467.2213803680980959 642.6970866141732586 Td
(Italy) Tj
ET
0.78 G
0. w
endstream
endobj
1 0 obj
<</Type /Pages
/Kids [3 0 R ]
/Count 1
>>
endobj
5 0 obj
<<
/Type /Font
/BaseFont /Helvetica
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
6 0 obj
<<
/Type /Font
/BaseFont /Helvetica-Bold
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
7 0 obj
<<
/Type /Font
/BaseFont /Helvetica-Oblique
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
8 0 obj
<<
/Type /Font
/BaseFont /Helvetica-BoldOblique
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
9 0 obj
<<
/Type /Font
/BaseFont /Courier
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
10 0 obj
<<
/Type /Font
/BaseFont /Courier-Bold
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
11 0 obj
<<
/Type /Font
/BaseFont /Courier-Oblique
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
12 0 obj
<<
/Type /Font
/BaseFont /Courier-BoldOblique
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
13 0 obj
<<
/Type /Font
/BaseFont /Times-Roman
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
14 0 obj
<<
/Type /Font
/BaseFont /Times-Bold
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
15 0 obj
<<
/Type /Font
/BaseFont /Times-Italic
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
16 0 obj
<<
/Type /Font
/BaseFont /Times-BoldItalic
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
>>
endobj
17 0 obj
<<
/Type /Font
/BaseFont /ZapfDingbats
/Subtype /Type1
/FirstChar 32
/LastChar 255
>>
endobj
18 0 obj
<<
/Type /Font
/BaseFont /Symbol
/Subtype /Type1
/FirstChar 32
/LastChar 255
>>
endobj
2 0 obj
<<
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
/Font <<
/F1 5 0 R
/F2 6 0 R
/F3 7 0 R
/F4 8 0 R
/F5 9 0 R
/F6 10 0 R
/F7 11 0 R
/F8 12 0 R
/F9 13 0 R
/F10 14 0 R
/F11 15 0 R
/F12 16 0 R
/F13 17 0 R
/F14 18 0 R
>>
/XObject <<
>>
>>
endobj
19 0 obj
<<
/Producer (jsPDF 2.4.0)
/CreationDate (D:20240904105942+05'30')
>>
endobj
20 0 obj
<<
/Type /Catalog
/Pages 1 0 R
/OpenAction [3 0 R /FitH null]
/PageLayout /OneColumn
>>
endobj
xref
0 21
0000000000 65535 f
0000004642 00000 n
0000006459 00000 n
0000000015 00000 n
0000000152 00000 n
0000004699 00000 n
0000004824 00000 n
0000004954 00000 n
0000005087 00000 n
0000005224 00000 n
0000005347 00000 n
0000005476 00000 n
0000005608 00000 n
0000005744 00000 n
0000005872 00000 n
0000005999 00000 n
0000006128 00000 n
0000006261 00000 n
0000006363 00000 n
0000006707 00000 n
0000006793 00000 n
trailer
<<
/Size 21
/Root 20 0 R
/Info 19 0 R
/ID [ <3A32A17A0E0AEAFDBC2A7A55641F52D9> <3A32A17A0E0AEAFDBC2A7A55641F52D9> ]
>>
startxref
6897
%%EOF

BIN
src/main/resources/static/images/minus.png

After

Width: 512  |  Height: 512  |  Size: 17 KiB

BIN
src/main/resources/static/images/plus.png

After

Width: 512  |  Height: 512  |  Size: 25 KiB

1505
src/main/resources/templates/Tradelicence/tradelicence.html
File diff suppressed because it is too large
View File

65
src/main/resources/templates/User/home.html

@ -178,6 +178,8 @@
<body> <body>
<div th:insert="~{fragments/accessibility :: accessibility}"></div> <div th:insert="~{fragments/accessibility :: accessibility}"></div>
<!-- <div class="header"> <!-- <div class="header">
<div class="logo-left"> <div class="logo-left">
@ -199,7 +201,7 @@
<!-- Insert the header fragment --> <!-- Insert the header fragment -->
<div th:insert="fragments/header :: headerFragment"></div>
<div th:insert="fragments/header :: headerFragment"></div>=
<!--<button id="reader-btn" onclick="toggleReader()">Enable Reader</button>--> <!--<button id="reader-btn" onclick="toggleReader()">Enable Reader</button>-->
@ -250,24 +252,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!--<div class="col-md-4">
<div class="card readable">
<div class="card-body">
<img src="images/contract.png" alt="Paper" class="card-img">
<div class="card-content">
<h5 class="card-title">Complaint via Paper Form</h5>
<p class="card-text">Send your Grievance to<br><strong>The Commissioner,<br>Greater Chennai
Corporation,<br>Ripon Building, EVR Salai, Chennai - 600003.</strong></p>
</div>
</div>
</div>
</div>-->
</div>
</div> </div>
<div class="row"> <div class="row">
@ -309,6 +294,8 @@
<script src="https://kit.fontawesome.com/a076d05399.js"></script> <script src="https://kit.fontawesome.com/a076d05399.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#check-now-btn').click(function () { $('#check-now-btn').click(function () {
var complaintNumber = $('#complaint-number').val(); var complaintNumber = $('#complaint-number').val();
@ -322,44 +309,8 @@
// Script for reader functionality
let readerActive = false;
function toggleReader() {
const readerBtn = document.getElementById('reader-btn');
readerActive = !readerActive;
if (readerActive) {
readerBtn.classList.add('active');
readerBtn.textContent = 'Disable Reader';
enableReading();
} else {
readerBtn.classList.remove('active');
readerBtn.textContent = 'Enable Reader';
disableReading();
}
}
function enableReading() {
document.querySelectorAll('.readable').forEach(element => {
element.addEventListener('mouseenter', speakText);
element.addEventListener('click', speakText);
});
}
function disableReading() {
document.querySelectorAll('.readable').forEach(element => {
element.removeEventListener('mouseenter', speakText);
element.removeEventListener('click', speakText);
});
}
function speakText(event) {
if (readerActive) {
const text = event.target.textContent;
const utterance = new SpeechSynthesisUtterance(text);
window.speechSynthesis.speak(utterance);
}
}
</script> </script>
</body> </body>

525
src/main/resources/templates/User/registercomplaints.html

@ -256,6 +256,109 @@
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.loader {
border: 16px solid #f3f3f3;
/* Light grey */
border-top: 16px solid #3498db;
/* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
position: absolute;
top: 50%;
left: 50%;
margin: -60px 0 0 -100px;
/* Center the loader */
z-index: 9999;
/* Ensure it's on top of everything */
display: none;
/* Initially hidden */
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/*for snack bar*/
#snackbar {
visibility: hidden;
min-width: 250px;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 1;
left: 50%;
bottom: 30px;
font-size: 17px;
transform: translateX(-50%);
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
}
}
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
}
}
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
/*for snack bar*/
</style> </style>
</style> </style>
</head> </head>
@ -263,6 +366,7 @@
<body> <body>
<div th:insert="~{fragments/header :: headerFragment}"></div> <div th:insert="~{fragments/header :: headerFragment}"></div>
<div th:insert="~{fragments/accessibility :: accessibility}"></div> <div th:insert="~{fragments/accessibility :: accessibility}"></div>
<div id="snackbar"></div>
<!-- Progress Bar Section --> <!-- Progress Bar Section -->
<div class="container resizable-content"> <div class="container resizable-content">
@ -298,27 +402,9 @@
<div class="input-group"> <div class="input-group">
<input type="number" class="form-control" id="mobile" <input type="number" class="form-control" id="mobile"
placeholder="Enter your Mobile Number"> placeholder="Enter your Mobile Number">
<!--<div class="input-group-append">
<button type="button" id="getOtpBtn" class="btn btn-primary"
style="background-color: #414f69;">Get OTP</button>
</div>-->
</div> </div>
</div> </div>
<!--<div class="col-md-4">
<div class="input-group" id="otpSection" style="display: none;">
<label for="verify">Verify OTP:</label>
<div class="input-group">
<input type="number" class="form-control" id="otp" placeholder="Enter OTP">
<div class="input-group-append">
<button type="button" id="verifyBtn" class="btn btn-success">Verify</button>
</div>
</div>
</div>
</div>-->
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col-md-4"> <div class="col-md-4">
<label for="name">Name:</label> <label for="name">Name:</label>
@ -351,13 +437,15 @@
style="background-color: #414f69;">Next</button> style="background-color: #414f69;">Next</button>
</div> </div>
</div> </div>
<!--step-2--> <!--step-2-->
<div class="card form-step readable" id="step-2"> <div class="card form-step readable" id="step-2">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">2. Complaint Location Details:</h5> <h5 class="card-title">2. Complaint Location Details:</h5>
<div class="form-row"> <div class="form-row">
<!-- loader section -->
<div id="loader" class="loader" style="display: none;"></div>
<!--map fields--> <!--map fields-->
<div class="col-md-12"> <div class="col-md-12">
@ -388,12 +476,8 @@
<label for="landmark">Landmark</label> <label for="landmark">Landmark</label>
<input type="text" class="form-control" id="landmark"> <input type="text" class="form-control" id="landmark">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<button id="prevStep2" class="btn btn-secondary" onclick="prevStep('prevStep2')">Previous</button> <button id="prevStep2" class="btn btn-secondary" onclick="prevStep('prevStep2')">Previous</button>
<button id="nextStep2" class="btn btn-primary float-right" onclick="nextStep('nextStep2')" <button id="nextStep2" class="btn btn-primary float-right" onclick="nextStep('nextStep2')"
@ -504,8 +588,8 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col-md-6"> <div class="col-md-6">
<label for="othercomplaint-details">Details of Complaint:</label>
<textarea class="form-control" id="othercomplaint-details" rows="3"
<label for="othercomplaintdetailsss">Details of Complaint:</label>
<textarea class="form-control" id="othercomplaintdetailsss" rows="3"
placeholder="Enter complaint details" maxlength="400"></textarea> placeholder="Enter complaint details" maxlength="400"></textarea>
</div> </div>
</div> </div>
@ -594,13 +678,33 @@
<!-- Progress Bar Script --> <!-- Progress Bar Script -->
<script> <script>
//for snackbar script
function showSnackbar(message) {
var snackbar = document.getElementById("snackbar");
snackbar.innerHTML = message;
snackbar.className = "show";
setTimeout(function () {snackbar.className = snackbar.className.replace("show", "");}, 3000);
}
//for snackbar script
let currentStep = 1; let currentStep = 1;
let mapInitialized = false;
function showStep(step) { function showStep(step) {
$('.form-step').removeClass('active'); $('.form-step').removeClass('active');
$('#step-' + step).addClass('active'); $('#step-' + step).addClass('active');
updateProgressBar(step); updateProgressBar(step);
if (step === 2 && !mapInitialized) {
document.getElementById('loader').style.display = 'block'; // Show loader before map initialization
setTimeout(initializeMap, 3000); // Load the map after 3 seconds
mapInitialized = true; // Ensure the map is only initialized once
}
// If we're on step 4, populate the summary fields // If we're on step 4, populate the summary fields
if (step === 4) { if (step === 4) {
populateSummary(); populateSummary();
@ -609,8 +713,11 @@
function nextStep() { function nextStep() {
if (currentStep < 4) { if (currentStep < 4) {
currentStep++;
showStep(currentStep);
// Perform validation for the current step
if (validateStep(currentStep)) {
currentStep++;
showStep(currentStep);
}
} }
} }
@ -626,46 +733,162 @@
$('.progress-bar').css('width', progress + '%').attr('aria-valuenow', progress); $('.progress-bar').css('width', progress + '%').attr('aria-valuenow', progress);
} }
function validateStep(step) {
let isValid = true;
if (step === 1) {
const mobile = $('#mobile').val().trim();
const name = $('#name').val().trim();
const email = $('#email').val().trim();
// Validate mobile number
if (mobile === '' || !/^\d{10}$/.test(mobile)) {
isValid = false;
showSnackbar("Please enter a valid 10-digit mobile number.");
}
// Validate name
if (name === '') {
isValid = false;
showSnackbar("Please enter your name.");
}
// Validate email
if (email === '' || !/^\S+@\S+\.\S+$/.test(email)) {
isValid = false;
showSnackbar("Please enter a valid email address.");
}
} else if (step === 2) {
const street = $('#street').val().trim();
const longitude = $('#longitude_field').val().trim();
const latitude = $('#latitude_field').val().trim();
const streetId = $('#street_id').val().trim();
const landmark = $('#landmark').val().trim();
// Validate street
if (street === '') {
isValid = false;
showSnackbar("Please enter the street.");
}
// Validate longitude and latitude
if (longitude === '' || isNaN(longitude)) {
isValid = false;
showSnackbar("Please enter a valid longitude.");
}
if (latitude === '' || isNaN(latitude)) {
isValid = false;
showSnackbar("Please enter a valid latitude.");
}
// Validate street ID
if (streetId === '') {
isValid = false;
showSnackbar("Please enter the street ID.");
}
// Validate landmark
if (landmark === '') {
isValid = false;
showSnackbar("Please enter the landmark.");
}
}
return isValid;
}
function populateSummary() { function populateSummary() {
const name = $('#name').val(); const name = $('#name').val();
const street = $('#street').val(); const street = $('#street').val();
const mobile = $('#mobile').val(); const mobile = $('#mobile').val();
const gender = $('input[name="gender"]:checked').val(); const gender = $('input[name="gender"]:checked').val();
const email = $('#email').val(); const email = $('#email').val();
const complaintTitle = $('#complaint-title').val();
const complaintid = $('#complaint-id').val();
const complaintDetails = $('#othercomplaint-details').val();
// Check if 'specific-fields' is active and use its values
if ($('#specific-fields').hasClass('active')) {
const complaintTitle = $('#complaint-title').val();
const complaintid = $('#complaint-id').val();
const complaintDetails = $('#othercomplaint-details').val(); // Specific complaint details
$('#summaryComplaintTitle').text(complaintTitle);
$('#summaryComplaintType').text(complaintid);
$('#summaryDescription').text(complaintDetails);
} else if ($('#others-fields').hasClass('active')) {
const complaintTitle = $('#type').find('option:selected').text();
const complaintSubType = $('#sub-type').find('option:selected').text();
const complaintDetails = $('#othercomplaintdetailsss').val(); // Others complaint details
$('#summaryComplaintTitle').text(complaintTitle + ' - ' + complaintSubType);
$('#summaryComplaintType').text('Other Complaint');
$('#summaryDescription').text(complaintDetails);
}
const streetid = $('#street_id').val(); const streetid = $('#street_id').val();
const landmark = $('#landmark').val(); const landmark = $('#landmark').val();
const latitude = $('#latitude_field').val(); const latitude = $('#latitude_field').val();
const longtitude = $('#longitude_field ').val();
const longtitude = $('#longitude_field').val();
$('#summaryName').text(name); $('#summaryName').text(name);
$('#summaryStreet').text(street); $('#summaryStreet').text(street);
$('#summaryMobile').text(mobile); $('#summaryMobile').text(mobile);
$('#summaryGender').text(gender); $('#summaryGender').text(gender);
$('#summaryEmail').text(email); $('#summaryEmail').text(email);
$('#summaryComplaintTitle').text(complaintTitle);
$('#summaryComplaintType').text(complaintid);
$('#summaryDescription').text(complaintDetails);
$('#summaryStreetId').text(streetid); $('#summaryStreetId').text(streetid);
$('#summaryLandmark').text(landmark); $('#summaryLandmark').text(landmark);
$('#summaryLatitude').text(latitude); $('#summaryLatitude').text(latitude);
$('#summaryLongitude').text(longtitude); $('#summaryLongitude').text(longtitude);
const fileInput = $('#complaint-image')[0];
if (fileInput.files && fileInput.files[0]) {
const reader = new FileReader();
reader.onload = function (e) {
$('#summaryImage').attr('src', e.target.result).show();
// Handle image preview
/* const fileInput = $('#complaint-image')[0]; // Assuming this is for the "Others" section
if (fileInput.files && fileInput.files[0]) {
const reader = new FileReader();
reader.onload = function (e) {
$('#summaryImage').attr('src', e.target.result).show();
}
reader.readAsDataURL(fileInput.files[0]);
} else {
$('#summaryImage').hide();
}*/
// If there's a separate image input for the specific form, handle it similarly:
// Check if specific fields section is active
if ($('#specific-fields').hasClass('active')) {
const specificFileInput = $('#complaint-image')[0]; // Example ID for specific form
if (specificFileInput.files && specificFileInput.files[0]) {
const reader = new FileReader();
reader.onload = function (e) {
$('#summaryImage').attr('src', e.target.result).show();
};
reader.readAsDataURL(specificFileInput.files[0]);
} else {
$('#summaryImage').hide(); // Hide the image if no file is selected
}
}
// Check if "Others" section is active
else if ($('#others-fields').hasClass('active')) {
const fileInput = $('#uploadothers')[0]; // Assuming this is for the "Others" section
if (fileInput.files && fileInput.files[0]) {
const reader = new FileReader();
reader.onload = function (e) {
$('#summaryImage').attr('src', e.target.result).show();
};
reader.readAsDataURL(fileInput.files[0]);
} else {
$('#summaryImage').hide(); // Hide the image if no file is selected
} }
reader.readAsDataURL(fileInput.files[0]);
} else { } else {
$('#summaryImage').hide();
$('#summaryImage').hide(); // Default hide if no section is active
} }
} }
$(document).ready(function () { $(document).ready(function () {
showStep(currentStep); showStep(currentStep);
}); });
@ -689,12 +912,15 @@
// Toggle complaint fields based on type // Toggle complaint fields based on type
$('.complaint-fields').removeClass('active'); $('.complaint-fields').removeClass('active');
if (type === 'specific') { if (type === 'specific') {
$('#specific-fields').addClass('active');
$('#specific-fields').addClass('active'); // Show specific fields form
$('#others-fields').removeClass('active'); // Hide others form
$('#complaint-title').val(title); // Set the complaint title to the icon name $('#complaint-title').val(title); // Set the complaint title to the icon name
$('#complaint-id').val(complaintId); // Set the complaint ID to the corresponding ID $('#complaint-id').val(complaintId); // Set the complaint ID to the corresponding ID
} else if (type === 'others') { } else if (type === 'others') {
$('#others-fields').addClass('active');
$('#others-fields').addClass('active'); // Show others form
$('#specific-fields').removeClass('active'); // Hide specific fields form
$('#complaint-title').val(''); // Clear the complaint title for 'Others' $('#complaint-title').val(''); // Clear the complaint title for 'Others'
$('#complaint-id').val(''); // Clear the complaint ID for 'Others' $('#complaint-id').val(''); // Clear the complaint ID for 'Others'
} }
@ -702,6 +928,7 @@
}); });
//for complaint group and complainttype wise options dropdown api //for complaint group and complainttype wise options dropdown api
$(document).ready(function () { $(document).ready(function () {
const $type = $('#type'); const $type = $('#type');
@ -836,15 +1063,24 @@
var suggestedRoadId; var suggestedRoadId;
function initializeMap() { function initializeMap() {
// Create the map
var map = L.map('map', {attributionControl: false}).setView([13.0827, 80.2707], 9); var map = L.map('map', {attributionControl: false}).setView([13.0827, 80.2707], 9);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
// Add tile layer and track loading status
var tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19, maxZoom: 19,
attributionControl: false, attributionControl: false,
}).addTo(map); }).addTo(map);
// Hide loader once the map tiles are fully loaded
tileLayer.on('load', function () {
document.getElementById('loader').style.display = 'none';
document.getElementById('map').style.visibility = 'visible'; // Ensure map is visible
});
var currentMarker = null; var currentMarker = null;
// Handle map click events
map.on('click', function (e) { map.on('click', function (e) {
var lat = e.latlng.lat; var lat = e.latlng.lat;
var lng = e.latlng.lng; var lng = e.latlng.lng;
@ -858,6 +1094,7 @@
fetchLocationInfoByMap(lat, lng, currentMarker); fetchLocationInfoByMap(lat, lng, currentMarker);
}); });
// Handle input events in the search box
document.getElementById('search-box').addEventListener('input', function () { document.getElementById('search-box').addEventListener('input', function () {
var query = this.value.trim(); var query = this.value.trim();
if (query.length > 2) { if (query.length > 2) {
@ -867,8 +1104,8 @@
} }
}); });
// Handle click events on suggestions
document.getElementById('suggestions').addEventListener('click', function (e) { document.getElementById('suggestions').addEventListener('click', function (e) {
if (e.target.tagName === 'LI') { if (e.target.tagName === 'LI') {
var latlngArray = JSON.parse(e.target.dataset.latlng); var latlngArray = JSON.parse(e.target.dataset.latlng);
@ -952,11 +1189,9 @@
// Hide the suggestions // Hide the suggestions
document.getElementById('suggestions').style.display = 'none'; document.getElementById('suggestions').style.display = 'none';
} }
} }
}); });
} }
function fetchSuggestions(query) { function fetchSuggestions(query) {
@ -1013,7 +1248,6 @@
const ward = properties.ward || 'N/A'; const ward = properties.ward || 'N/A';
const roadId = properties.road_id || 'N/A'; const roadId = properties.road_id || 'N/A';
info = `Road Name: ${roadName}<br>Zone: ${zone}<br>Ward: ${ward}<br>Latitude: ${lat}<br>Longitude: ${lng}`; info = `Road Name: ${roadName}<br>Zone: ${zone}<br>Ward: ${ward}<br>Latitude: ${lat}<br>Longitude: ${lng}`;
document.getElementById("street").value = roadName; document.getElementById("street").value = roadName;
document.getElementById("latitude_field").value = lat; document.getElementById("latitude_field").value = lat;
@ -1024,11 +1258,10 @@
} else { } else {
document.getElementById("street").value = "No road data found for this location"; document.getElementById("street").value = "No road data found for this location";
document.getElementById("latitude_field").value = "No latitude data found for this location"; document.getElementById("latitude_field").value = "No latitude data found for this location";
document.getElementById("x_field").value = "No latitude data found for this location";
document.getElementById("longitude_field").value = "No latitude data found for this location";
document.getElementById("street_id").value = "No street id data found for this location"; document.getElementById("street_id").value = "No street id data found for this location";
document.getElementById("landmark").value = "No landmark data found for this location"; document.getElementById("landmark").value = "No landmark data found for this location";
info = `No road data found for this location.<br>Latitude: ${lat}<br>Longitude: ${lng}`
info = `No road data found for this location`
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip(); marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
} }
}) })
@ -1075,18 +1308,80 @@
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip(); marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip();
}); });
} }
document.addEventListener('DOMContentLoaded', function () {
setTimeout(initializeMap, 3000); // Delay map initialization by 3000 milliseconds (3 seconds)
});
//script for map
//for saving... //for saving...
/*$(document).ready(function () {
/* $(document).ready(function () {
$('#submitButton').click(function (e) {
e.preventDefault(); // Prevent the default form submission
var complainantName = $('#summaryName').text().trim();
var complainantAddr = $('#summaryStreet').text().trim();
var mobileNo = $('#summaryMobile').text().trim();
var email = $('#summaryEmail').text().trim();
var complaintType = $('#summaryComplaintType').text().trim();
var complaintTitle = $('#summaryComplaintTitle').text().trim();
var complaintDetails = $('#summaryDescription').text().trim();
var streetId = $('#summaryStreetId').text().trim();
var landmark = $('#summaryLandmark').text().trim();
var latitude = $('#summaryLatitude').text().trim();
var longtitude = $('#summaryLongitude').text().trim();
var gender = $('#summaryGender').text().trim();
var imageSrc = $('#summaryImage').attr('src');
console.log({
serviceId: 'RegComplaint',
ComplainantName: complainantName,
ComplainantAddr: complainantAddr,
MobileNo: mobileNo,
Email: email,
ComplaintType: complaintType,
ComplaintTitle: complaintTitle,
ComplaintDetails: complaintDetails,
StreetId: streetId,
Comp_Image: imageSrc,
latitude: latitude,
longtitude: longtitude,
Landmark: landmark,
gender: gender
});
// AJAX call to the API
$.ajax({
url: 'https://erp.chennaicorporation.gov.in/pgr/external/mobileservice',
type: 'POST',
data: {
serviceId: 'RegComplaint',
ComplainantName: complainantName,
ComplainantAddr: complainantAddr,
MobileNo: mobileNo,
Email: email,
ComplaintType: complaintType,
ComplaintTitle: complaintTitle,
ComplaintDetails: complaintDetails,
StreetId: streetId,
Comp_Image: imageSrc,
latitude: latitude,
longtitude: longtitude,
Landmark: landmark,
gender: gender
},
success: function (response) {
// Handle success response
console.log('Success:', response);
alert('Complaint registered successfully!');
// You can also redirect or reset the form here
},
error: function (xhr, status, error) {
// Improved error handling
console.log('Error:', xhr.responseText, status, error);
alert('Error: ' + xhr.status + ' ' + xhr.statusText);
}
});
});
}); */
$(document).ready(function () {
$('#submitButton').click(function (e) { $('#submitButton').click(function (e) {
e.preventDefault(); // Prevent the default form submission e.preventDefault(); // Prevent the default form submission
// Collect form values
// Collect data from the form fields
var complainantName = $('#summaryName').text().trim(); var complainantName = $('#summaryName').text().trim();
var complainantAddr = $('#summaryStreet').text().trim(); var complainantAddr = $('#summaryStreet').text().trim();
var mobileNo = $('#summaryMobile').text().trim(); var mobileNo = $('#summaryMobile').text().trim();
@ -1097,13 +1392,11 @@
var streetId = $('#summaryStreetId').text().trim(); var streetId = $('#summaryStreetId').text().trim();
var landmark = $('#summaryLandmark').text().trim(); var landmark = $('#summaryLandmark').text().trim();
var latitude = $('#summaryLatitude').text().trim(); var latitude = $('#summaryLatitude').text().trim();
var longtitude = $('#summaryLongitude').text().trim(); // Using 'longtitude' as per your API requirement
var longtitude = $('#summaryLongitude').text().trim(); // Note the misspelling: it should match the controller parameter
var gender = $('#summaryGender').text().trim(); var gender = $('#summaryGender').text().trim();
var imageSrc = $('#summaryImage').attr('src'); var imageSrc = $('#summaryImage').attr('src');
// Debugging: Log the data to be sent
console.log({ console.log({
serviceId: 'RegComplaint',
ComplainantName: complainantName, ComplainantName: complainantName,
ComplainantAddr: complainantAddr, ComplainantAddr: complainantAddr,
MobileNo: mobileNo, MobileNo: mobileNo,
@ -1119,12 +1412,11 @@
gender: gender gender: gender
}); });
// AJAX call to the API
// AJAX call to your backend controller
$.ajax({ $.ajax({
url: 'https://erp.chennaicorporation.gov.in/pgr/external/mobileservice',
type: 'GET', // Use 'POST' if your API supports it
url: '/register', // Update to your Spring Boot endpoint
type: 'POST',
data: { data: {
serviceId: 'RegComplaint',
ComplainantName: complainantName, ComplainantName: complainantName,
ComplainantAddr: complainantAddr, ComplainantAddr: complainantAddr,
MobileNo: mobileNo, MobileNo: mobileNo,
@ -1135,7 +1427,7 @@
StreetId: streetId, StreetId: streetId,
Comp_Image: imageSrc, Comp_Image: imageSrc,
latitude: latitude, latitude: latitude,
longtitude: longtitude,
longtitude: longtitude, // Ensure this matches the controller parameter name
Landmark: landmark, Landmark: landmark,
gender: gender gender: gender
}, },
@ -1152,103 +1444,6 @@
} }
}); });
}); });
});*/
$(document).ready(function () {
$('#submitButton').click(function (e) {
e.preventDefault(); // Prevent the default form submission
// Collect form values
var complainantName = $('#summaryName').text().trim();
var complainantAddr = $('#summaryStreet').text().trim();
var mobileNo = $('#summaryMobile').text().trim();
var email = $('#summaryEmail').text().trim();
var complaintType = $('#summaryComplaintType').text().trim();
var complaintTitle = $('#summaryComplaintTitle').text().trim();
var complaintDetails = $('#summaryDescription').text().trim();
var streetId = $('#summaryStreetId').text().trim();
var landmark = $('#summaryLandmark').text().trim();
var latitude = $('#summaryLatitude').text().trim();
var longtitude = $('#summaryLongitude').text().trim(); // Using 'longtitude' as per your API requirement
var gender = $('#summaryGender').text().trim();
var imageSrc = $('#summaryImage').attr('src');
// Convert image to Base64
var imageBase64 = '';
if (imageSrc) {
var img = new Image();
img.crossOrigin = 'Anonymous'; // Handle CORS if the image is from another domain
img.onload = function () {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0);
imageBase64 = canvas.toDataURL('image/png').split(',')[1]; // Get Base64 data
submitForm(); // Call the function to submit the form after image conversion
};
img.onerror = function () {
console.log('Error loading image');
alert('Error loading image. Please try again.');
};
img.src = imageSrc;
} else {
// Handle the case where there is no image
submitForm();
}
//saving
function submitForm() {
// Debugging: Log the data to be sent
console.log({
serviceId: 'RegComplaint',
ComplainantName: complainantName,
ComplainantAddr: complainantAddr,
MobileNo: mobileNo,
Email: email,
ComplaintType: complaintType,
ComplaintTitle: complaintTitle,
ComplaintDetails: complaintDetails,
StreetId: streetId,
Comp_Image: imageBase64, // Send the Base64 image data
latitude: latitude,
longtitude: longtitude,
Landmark: landmark,
gender: gender
});
// AJAX call to the API
$.ajax({
url: 'https://erp.chennaicorporation.gov.in/pgr/external/mobileservice',
type: 'POST', // Use 'POST' if your API supports it
data: {
serviceId: 'RegComplaint',
ComplainantName: complainantName,
ComplainantAddr: complainantAddr,
MobileNo: mobileNo,
Email: email,
ComplaintType: complaintType,
ComplaintTitle: complaintTitle,
ComplaintDetails: complaintDetails,
StreetId: streetId,
Comp_Image: imageBase64, // Send the Base64 image data
latitude: latitude,
longtitude: longtitude,
Landmark: landmark,
gender: gender
},
success: function (response) {
// Handle success response
console.log('Success:', response);
alert('Complaint registered successfully!');
// You can also redirect or reset the form here
},
error: function (xhr, status, error) {
// Improved error handling
console.log('Error:', xhr.responseText, status, error);
alert('Error: ' + xhr.status + ' ' + xhr.statusText);
}
});
}
});
}); });
</script> </script>

160
src/main/resources/templates/checklistofficer/checklistofficer.html

@ -49,12 +49,17 @@
<body> <body>
<!-- Insert the header fragment --> <!-- Insert the header fragment -->
<div th:insert="~{fragments/header :: headerFragment}"></div> <div th:insert="~{fragments/header :: headerFragment}"></div>
<div class="container mt-4"> <div class="container mt-4">
<!--<button class="plus btn btn-primary">A+</button> <!--<button class="plus btn btn-primary">A+</button>
<button class="minus btn btn-secondary">A-</button>--> <button class="minus btn btn-secondary">A-</button>-->
<!-- Loader GIF -->
<div id="loader" style="display: none; text-align: center;">
<img src="images/Thin broken ring.gif" alt="Loading..." />
</div>
@ -89,19 +94,19 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
Complainant Mobile Number: Complainant Mobile Number:
<input type="text" id="complaint-mobile-number" class="form-control" value="">
<input type="text" id="complaint-mobile-number" class="form-control" value="" disabled>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
Complainant Name: Complainant Name:
<input type="text" id="complaint-customer-name" class="form-control" value="">
<input type="text" id="complaint-customer-name" class="form-control" value="" disabled>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
Complainant Email: Complainant Email:
<input type="email" class="form-control" value="">
<input type="email" class="form-control" value="" disabled>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
Gender: Gender:
<select class="form-control">
<select class="form-control" disabled>
<option value="0">Select Gender</option> <option value="0">Select Gender</option>
<option value="male">Male</option> <option value="male">Male</option>
<option value="female">Female</option> <option value="female">Female</option>
@ -119,23 +124,23 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
Complainant Street: Complainant Street:
<input type="text" id="street" class="form-control" >
<input type="text" id="street" class="form-control" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Zone: Complainant Zone:
<input type="text" class="form-control" id="zone" >
<input type="text" class="form-control" id="zone" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Ward: Complainant Ward:
<input type="text" class="form-control" id="ward">
<input type="text" class="form-control" id="ward" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Area: Complainant Area:
<input type="text" class="form-control" id="area">
<input type="text" class="form-control" id="area" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Locality: Complainant Locality:
<input type="text" class="form-control" id="location">
<input type="text" class="form-control" id="location" disabled>
</div> </div>
</div> </div>
</div> </div>
@ -147,19 +152,20 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
Complainant Type: Complainant Type:
<input type="text" class="form-control" id="complaintType">
<input type="text" class="form-control" id="complaintType" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Sub-Type: Complainant Sub-Type:
<input type="text" class="form-control" >
<input type="text" class="form-control" disabled>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
Complainant Title: Complainant Title:
<input type="text" class="form-control" >
<input type="text" class="form-control" disabled>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
Complainant Description: Complainant Description:
<input type="text" class="form-control" id="">
<input type="text" class="form-control" id="" disabled>
</div> </div>
</div> </div>
</div> </div>
@ -170,25 +176,24 @@
<div class="card-header text-white" style="background-color: #414f69;">Complaint Action</div> <div class="card-header text-white" style="background-color: #414f69;">Complaint Action</div>
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-2">Aug 24<br>7.00 pm</div>
<div class="col-md-8">Officer - AE Zone 15<br>Lorem ipsum dolor sit amet, consectetur adipiscing
elit. In sit arcu aliquet ut dui egestas.</div>
<div class="col-md-2"><button class="btn btn-sm"
style="background-color: #414f69;color: white;">Redressed</button></div>
</div>
<div class="row mt-3">
<div class="col-md-2">Aug 25<br>10.00 am</div>
<div class="col-md-8">Citizen<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Ullamcorper ullamcorper quis.</div>
<div class="col-md-2"><button class="btn btn-secondary btn-sm">Reopened</button></div>
</div>
<div class="row mt-3">
<div class="col-md-2">Aug 26<br>3.00 pm</div>
<div class="col-md-8">Officer - AE Zone 15<br>Lorem ipsum dolor sit amet, consectetur adipiscing
elit. In sit arcu aliquet ut dui egestas.</div>
<div class="col-md-2"><button class="btn btn-sm"
style="background-color: #414f69;color: white;">Redressed</button></div>
<!--<div class="col-md-2" id="">Aug 24<br>7.00 pm</div>-->
<div class="col-md-4">
<input type="text" class="form-control" id="commentDate" disabled>
</div>
<div class="col-md-4">
<input type="text" class="form-control" id="commentuser" disabled>
</div>
<!--<div class="col-md-2"><button class="btn btn-sm"
style="background-color: #414f69;color: white;" id="status"></button></div>-->
<div class="col-md-4">
<input type="text" class="form-control" id="status"
style="background-color: #414f69;color: white;" disabled>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -244,15 +249,18 @@
<!-- JavaScript to handle button clicks --> <!-- JavaScript to handle button clicks -->
<script> <script>
//for getting values.
// /api/getComplaintDetailsbyId
$(document).ready(function () { $(document).ready(function () {
// Get the complaint number from the URL // Get the complaint number from the URL
var urlParams = new URLSearchParams(window.location.search); var urlParams = new URLSearchParams(window.location.search);
var complaintNo = urlParams.get('complaintno'); var complaintNo = urlParams.get('complaintno');
if (complaintNo) { if (complaintNo) {
$('#loader').show();
$.ajax({ $.ajax({
url: '/api/getComplaintDetailsbyId', // Replace with your actual API endpoint url: '/api/getComplaintDetailsbyId', // Replace with your actual API endpoint
type: 'GET', type: 'GET',
@ -260,44 +268,64 @@
success: function (response) { success: function (response) {
console.log('API response:', response); // Log response for debugging console.log('API response:', response); // Log response for debugging
//document.getElementById("complaint-mobile-number").value = response.CustomerMobile;
if (Array.isArray(response) && response.length > 0) {
var complaintListHistory = response[0].ComplaintListHistory;
if (Array.isArray(complaintListHistory) && complaintListHistory.length > 0) {
var complaintDetails = complaintListHistory[0];
// Populate the form fields
document.getElementById("complaint-mobile-number").value = complaintDetails.CustomerMobile || '';
document.getElementById("complaint-customer-name").value = complaintDetails.CustomerName || '';
document.getElementById("street").value = complaintDetails.Street || '';
document.getElementById("zone").value = complaintDetails.Zone || '';
document.getElementById("ward").value = complaintDetails.Division || '';
document.getElementById("area").value = complaintDetails.Area || '';
document.getElementById("location").value = complaintDetails.Location || '';
document.getElementById("complaintType").value = complaintDetails.complainttype || '';
document.getElementById("complaintDesc").value = complaintDetails.complaintdetails || '';
} else {
alert('No complaint details found in ComplaintListHistory.');
}
} else {
alert('Unexpected response structure.');
}
$('#loader').hide();
// Check if response is an array and has data
if (Array.isArray(response) && response.length > 0) {
var complaintListHistory = response[0].ComplaintListHistory;
// Check if complaintListHistory is an array and has data
if (Array.isArray(complaintListHistory) && complaintListHistory.length > 0) {
var complaintDetails = complaintListHistory[0];
// Populate the form fields with null/undefined checks
document.getElementById("complaint-mobile-number").value = complaintDetails.CustomerMobile || '';
document.getElementById("complaint-customer-name").value = complaintDetails.CustomerName || '';
document.getElementById("street").value = complaintDetails.Street || '';
document.getElementById("zone").value = complaintDetails.Zone || '';
document.getElementById("ward").value = complaintDetails.Division || '';
document.getElementById("area").value = complaintDetails.Area || '';
document.getElementById("location").value = complaintDetails.Location || '';
document.getElementById("complaintType").value = complaintDetails.complainttype || '';
document.getElementById("status").value = complaintDetails.complaintcurrentstatus || '';
// Handle nested Comments array safely
if (Array.isArray(complaintDetails.Comments) && complaintDetails.Comments.length > 0) {
// Assuming we want to use the first comment
var firstComment = complaintDetails.Comments[0];
document.getElementById("commentDate").value = firstComment.comment_date || '';
document.getElementById("commentuser").value = firstComment.user || '';
document.getElementById("complaintOfficer").value = firstComment.user || '';
} else {
// Clear fields if Comments are not present
document.getElementById("commentDate").value = '';
document.getElementById("commentuser").value = '';
document.getElementById("complaintOfficer").value = '';
}
} else {
alert('No complaint details found in ComplaintListHistory.');
}
} else {
alert('Unexpected response structure.');
}
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error('Error fetching complaint details:', error);
alert('Error fetching complaint details. Please try again.');
}
console.log('Error:', xhr.responseText);
alert('An error occurred while fetching complaint details.');
$('#loader').hide();
},
}); });
} else {
}
else {
alert('No complaint number provided.'); alert('No complaint number provided.');
} }
}); });
// Utility function to format date and time from datetime string
</script> </script>

223
src/main/resources/templates/staff/appoinment.html

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Appoinment</title>
<title>Create Order</title>
<!-- Google Font --> <!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
@ -18,6 +18,54 @@
font-weight: 700; font-weight: 700;
color: #2d5263; color: #2d5263;
} }
/*for uploading fields*/
.custom-file-upload {
position: relative;
display: flex;
align-items: center;
border: 1px solid #d9dde4;
border-radius: 5px;
padding: 5px;
background-color: #f9fafb;
cursor: pointer;
margin-top: 5px;
}
.custom-file-upload input[type="file"] {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
.custom-file-upload label {
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
}
.upload-text {
color: #a6adb5;
font-weight: 700;
}
.upload-icon i {
color: #a6adb5;
font-size: 18px;
}
.file-name {
margin-left: 10px;
color: #414f69;
font-size: 14px;
}
</style> </style>
</head> </head>
@ -26,110 +74,68 @@
<div class="row align-items-center justify-content-center" <div class="row align-items-center justify-content-center"
style="color: white;background-color:#414f69 ;padding: 10px;"> style="color: white;background-color:#414f69 ;padding: 10px;">
<h3 class="title resizable-content">Appoinment</h3>
<h3 class="title resizable-content">Create Order</h3>
</div> </div>
<div class="container mt-4"> <div class="container mt-4">
<div class="mt-1"> <div class="mt-1">
</div> </div>
<!-- Card Section -->
<!-- Card Content -->
<div class="card p-3 resizable-content" style="margin-bottom: 8px;color: #414f69;"> <div class="card p-3 resizable-content" style="margin-bottom: 8px;color: #414f69;">
<!-- Error message container -->
<div id="errorMessages" style="background-color: #ff6666;color: white;"></div>
<!-- Add the resizable-content class to the card sections -->
<!-- Card Content -->
<div class="card mb-3 resizable-content"> <div class="card mb-3 resizable-content">
<div class="card-header text-white" style="background-color: #414f69;">Order Details</div>
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label>Order :</label>
<select class="form-control">
<option value="0">Select Order</option>
<option value="1">Order 1</option>
<option value="2">Order 2</option>
</select>
<label>Order Number:</label>
<input type="text" class="form-control" id="orderNumber" placeholder="Enter Order Number">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Zone:</label>
<select class="form-control">
<option value="0">Select Zone</option>
<option value="1">Zone 1</option>
<option value="2">Zone 2</option>
</select>
<label>Order Date:</label>
<input type="date" class="form-control" id="orderDate">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Order Title:</label> <label>Order Title:</label>
<select class="form-control">
<option value="0">Select Qualification</option>
<option value="1">B.E</option>
<option value="2">Bcom</option>
</select>
</div>
<div class="col-md-6">
<label>Ward:</label>
<select class="form-control">
<option value="0">Select Ward</option>
<option value="1">Ward 1</option>
<option value="2">Ward 2</option>
</select>
<input type="text" class="form-control" id="orderTitle" placeholder="Enter Order Title">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Deaprtment:</label>
<select class="form-control">
<option value="0">Select Deaprtment</option>
<option value="1">Deaprtment 1</option>
<option value="2">Deaprtment 2</option>
</select>
<label>Number Of Staff Required:</label>
<input type="number" class="form-control" id="staffRequired"
placeholder="Enter Staff Required...">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Supervisor:</label>
<select class="form-control">
<option value="0">Select Supervisor</option>
<option value="1">Supervisor 1</option>
<option value="2">Supervisor 2</option>
</select>
<label>Order Description:</label>
<textarea class="form-control" id="details" rows="3" placeholder="description..."
maxlength="400"></textarea>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Scheme Group:</label>
<select class="form-control">
<option value="0">Select Scheme Group</option>
<option value="1">Group 1</option>
<option value="2">Group 2</option>
</select>
<label>Order Document:</label>
<div class="custom-file-upload">
<input type="file" id="file-upload" class="form-control" onchange="displayFileName()">
<label for="file-upload" id="file-label">
<span class="upload-text" id="upload-text">Upload Order Document</span>
<span class="upload-icon">
<i class="fas fa-file-upload"></i>
</span>
</label>
<span id="file-name" class="file-name"></span>
</div>
</div> </div>
<div class="col-md-6">
<label>Add Staff:</label>
<select class="form-control">
<option value="0">Select Option</option>
<option value="1"> 1</option>
<option value="2"> 2</option>
</select>
</div>
<div class="col-md-6">
<label>Date Of Appoinment:</label>
<input type="date" class="form-control" value="">
</div>
</div> </div>
</div> </div>
</div> </div>
<button class="btn btn-sm" style="background-color: #414f69; color: white;" id="createorder">Create <button class="btn btn-sm" style="background-color: #414f69; color: white;" id="createorder">Create
Appoinment</button>
Order</button>
</div> </div>
</div> </div>
<!-- Bootstrap JS --> <!-- Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
@ -139,21 +145,72 @@
<!-- JavaScript to handle button clicks --> <!-- JavaScript to handle button clicks -->
<script> <script>
function displayFileName() {
const fileInput = document.getElementById('file-upload');
const fileNameSpan = document.getElementById('file-name');
const fileName = fileInput.files[0].name;
fileNameSpan.textContent = fileName;
}
$(document).ready(function () { $(document).ready(function () {
$('#createorder').click(function () { $('#createorder').click(function () {
Swal.fire({
title: 'Success!',
text: 'Appoinment Created Successfully',
icon: 'success',
confirmButtonText: 'OK',
background: '#f5f5f5',
confirmButtonColor: '#414f69'
});
let isValid = true;
let errorMessages = [];
// Clear previous error messages
$('#errorMessages').addClass('d-none').html('');
// Validate Order Number
if ($('#orderNumber').val().trim() == '') {
errorMessages.push('Enter the Order Number.');
isValid = false;
}
// Validate Order Date
if ($('#orderDate').val().trim() === '') {
errorMessages.push('Enter the Order Date.');
isValid = false;
}
// Validate Order Title
if ($('#orderTitle').val().trim() === '') {
errorMessages.push('Enter the Order Title.');
isValid = false;
}
// Validate Number Of Staff Required
if ($('#staffRequired').val().trim() === '') {
errorMessages.push('Enter the Number Of Staff Required.');
isValid = false;
}
// Validate Order Description
if ($('#details').val().trim() === '') {
errorMessages.push('Enter the Order Description.');
isValid = false;
}
// Validate Order Document
if ($('#file-upload').val().trim() === '') {
errorMessages.push('Upload the Order Document.');
isValid = false;
}
// Display error messages if any
if (!isValid) {
$('#errorMessages').removeClass('d-none').html(errorMessages.join('<br>'));
} else {
Swal.fire({
title: 'Success!',
text: 'Order Created Successfully',
icon: 'success',
confirmButtonText: 'OK',
background: '#f5f5f5',
confirmButtonColor: '#414f69'
});
}
}); });
}); });
</script> </script>
</body> </body>

101
src/main/resources/templates/staff/createorder.html

@ -71,14 +71,15 @@
<body> <body>
<div class="row align-items-center justify-content-center" style="color: white;background-color:#414f69 ;padding: 10px;">
<h3 class="title resizable-content" >Create Order</h3>
</div>
<div class="row align-items-center justify-content-center"
style="color: white;background-color:#414f69 ;padding: 10px;">
<h3 class="title resizable-content">Create Order</h3>
</div>
<div class="container mt-4"> <div class="container mt-4">
<div class="mt-1"> <div class="mt-1">
</div> </div>
<!-- Card Section --> <!-- Card Section -->
<div class="card p-3 resizable-content" style="margin-bottom: 8px;color: #414f69;"> <div class="card p-3 resizable-content" style="margin-bottom: 8px;color: #414f69;">
@ -92,27 +93,31 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label>Order Number:</label> <label>Order Number:</label>
<input type="text" class="form-control" value="" placeholder="Enter Order Number">
<input type="text" class="form-control" id="orderNumber" placeholder="Enter Order Number">
<span class="text-danger" id="orderNumberError"></span> <!-- Validation message -->
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Order Date:</label> <label>Order Date:</label>
<input type="date" class="form-control" value="">
<input type="date" class="form-control" id="orderDate">
<span class="text-danger" id="orderDateError"></span>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Order Title:</label> <label>Order Title:</label>
<input type="email" class="form-control" value="" placeholder="Enter Order Title">
<input type="text" class="form-control" id="orderTitle" placeholder="Enter Order Title">
<span class="text-danger" id="orderTitleError"></span>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Number Of Staff Required:</label> <label>Number Of Staff Required:</label>
<input type="number" class="form-control" value="" placeholder="Enter Staff Required...">
<input type="number" class="form-control" id="staffRequired"
placeholder="Enter Staff Required...">
<span class="text-danger" id="staffRequiredError"></span>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Order Description:</label> <label>Order Description:</label>
<textarea class="form-control" id="details" rows="3" placeholder="description..." <textarea class="form-control" id="details" rows="3" placeholder="description..."
maxlength="400"></textarea> maxlength="400"></textarea>
<span class="text-danger" id="detailsError"></span>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Order Document:</label> <label>Order Document:</label>
<div class="custom-file-upload"> <div class="custom-file-upload">
@ -124,15 +129,18 @@
</span> </span>
</label> </label>
<span id="file-name" class="file-name"></span> <span id="file-name" class="file-name"></span>
<span class="text-danger" id="fileUploadError"></span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<button class="btn btn-sm" style="background-color: #414f69; color: white;" id="createorder">Create Order</button>
<button class="btn btn-sm" style="background-color: #414f69; color: white;" id="createorder">Create
Order</button>
@ -158,18 +166,63 @@
const fileName = fileInput.files[0].name; const fileName = fileInput.files[0].name;
fileNameSpan.textContent = fileName; fileNameSpan.textContent = fileName;
} }
$(document).ready(function () {
$('#createorder').click(function () {
Swal.fire({
title: 'Success!',
text: 'Order Created Successfully',
icon: 'success',
confirmButtonText: 'OK',
background: '#f5f5f5',
confirmButtonColor: '#414f69'
});
});
});
$(document).ready(function () {
$('#createorder').click(function () {
let isValid = true;
// Clear previous error messages
$('.text-danger').text('');
// Validate Order Number
if ($('#orderNumber').val().trim() == '') {
$('#orderNumberError').text('Enter the Order Number.');
isValid = false;
}
// Validate Order Date
if ($('#orderDate').val().trim() === '') {
$('#orderDateError').text('Enter the Order Date.');
isValid = false;
}
// Validate Order Title
if ($('#orderTitle').val().trim() === '') {
$('#orderTitleError').text('Enter the Order Title.');
isValid = false;
}
// Validate Number Of Staff Required
if ($('#staffRequired').val().trim() === '') {
$('#staffRequiredError').text('Enter the Number Of Staff Required.');
isValid = false;
}
// Validate Order Description
if ($('#details').val().trim() === '') {
$('#detailsError').text('Enter the Order Description.');
isValid = false;
}
// Validate Order Document
if ($('#file-upload').val().trim() === '') {
$('#fileUploadError').text('Upload the Order Document.');
isValid = false;
}
// If all fields are valid, show success message
if (isValid) {
Swal.fire({
title: 'Success!',
text: 'Order Created Successfully',
icon: 'success',
confirmButtonText: 'OK',
background: '#f5f5f5',
confirmButtonColor: '#414f69'
});
}
});
});
</script> </script>
</body> </body>

197
src/main/resources/templates/staff/schemegroup.html

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Scheme Group</title>
<title>CheckList User</title>
<!-- Google Font --> <!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
@ -11,99 +11,176 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<!-- Include Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
<style>
label {
font-weight: 700;
color: #2d5263;
}
</style>
</head> </head>
<body> <body>
<!-- Insert the header fragment -->
<div th:insert="fragments/header :: headerFragment"></div>
<div class="row align-items-center justify-content-center"
style="color: white;background-color:#414f69 ;padding: 10px;">
<h3 class="title resizable-content">Add Scheme Group</h3>
</div>
<div class="container mt-4">
<div class="mt-1">
</div>
<!-- Card Section -->
<div class="card p-3 resizable-content" style="margin-bottom: 8px;color: #414f69;">
<!-- Add the resizable-content class to the card sections -->
<div class="card mb-3 resizable-content">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<label>Scheme Group Name:</label>
<input type="text" class="form-control" value="" placeholder="Enter Scheme Group Name">
</div>
<div class="col-md-6">
<label>Scheme Group Id:</label>
<input type="text" class="form-control" value="" placeholder="Enter Scheme Group Id">
</div>
<div class="col-md-6">
<label>Incharge Name:</label>
<input type="text" class="form-control" value="" placeholder="Enter Incharge Name">
</div>
<div class="col-md-6">
<label>Incharge Phone Number:</label>
<input type="text" class="form-control" value="" placeholder="Enter Incharge Phone Number">
<div class="mt-1">
<div class="row align-items-center justify-content-center">
</div>
<h4 class="title" style="color: #414f69;">Acknowledgement</h4>
</div>
</div>
<!-- Card Section -->
<div class="card p-3" style="margin-bottom: 8px;color: #414f69;">
<div class="row">
<!-- First two cards side by side -->
<div class="col-md-6">
<div class="card mb-3">
<div class="card-header text-white" style="background-color: #414f69;">
1. User Details
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<td>Name:</td>
<td>Yogesh</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Name:</td>
<td>John Doe</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Email:</td>
<td>john.doe@example.com</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Gender:</td>
<td>Male</td> <!-- Replace this value with dynamic data -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card ">
<div class="card-header text-white" style="background-color: #414f69;">
2. Complaint Location Details
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<td>Name:</td>
<td>Yogesh</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Name:</td>
<td>John Doe</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Email:</td>
<td>john.doe@example.com</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Gender:</td>
<td>Male</td> <!-- Replace this value with dynamic data -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Third card full width -->
<div class="row mb-3">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white" style="background-color: #414f69;">
3. Complaint Type
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<td>Name:</td>
<td>Yogesh</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Name:</td>
<td>John Doe</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Email:</td>
<td>john.doe@example.com</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Gender:</td>
<td>Male</td> <!-- Replace this value with dynamic data -->
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white" style="background-color: #414f69;">
3. Complaint Type
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<td>Name:</td>
<td>Yogesh</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Name:</td>
<td>John Doe</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Complainant Email:</td>
<td>john.doe@example.com</td> <!-- Replace this value with dynamic data -->
</tr>
<tr>
<td>Gender:</td>
<td>Male</td> <!-- Replace this value with dynamic data -->
</tr>
</tbody>
</table>
</div>
</div>
</div> </div>
<button class="btn btn-sm" style="background-color: #414f69; color: white;" id="createorder">Create
Group</button>
</div>
</div>
</div>
</div>
<!-- Bootstrap JS --> <!-- Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- JavaScript to handle button clicks -->
<script> <script>
$(document).ready(function () {
$('#createorder').click(function () {
Swal.fire({
title: 'Success!',
text: 'Group Created Successfully',
icon: 'success',
confirmButtonText: 'OK',
background: '#f5f5f5',
confirmButtonColor: '#414f69'
});
});
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save