23 changed files with 3735 additions and 486 deletions
-
32.classpath
-
23.project
-
4.settings/org.eclipse.core.resources.prefs
-
9.settings/org.eclipse.jdt.core.prefs
-
4.settings/org.eclipse.m2e.core.prefs
-
BINgccoffice_uploads/socialmedia_1913_regcompfiles/2026/08/resolved_img_06082026175501_Screenshot(11).png
-
5src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/SocialMediaApiController.java
-
317src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/SocialMediaService.java
-
4src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
26src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/ApiController.java
-
70src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/CreateEventAPIController.java
-
29src/main/java/in/gov/chennaicorporation/gccoffice/vendor/controller/MainController.java
-
214src/main/java/in/gov/chennaicorporation/gccoffice/vendor/service/StreetVendorService.java
-
198src/main/java/in/gov/chennaicorporation/gccoffice/vendor/service/createventService.java
-
1src/main/resources/application-local.properties
-
67src/main/resources/templates/modules/callcenterqaqc/socialmediaregcompclosing.html
-
68src/main/resources/templates/modules/vendors/EventList.html
-
69src/main/resources/templates/modules/vendors/RequestList.html
-
891src/main/resources/templates/modules/vendors/approvedcertificates.html
-
716src/main/resources/templates/modules/vendors/certificate.html
-
658src/main/resources/templates/modules/vendors/streetVendorRequestForm.html
-
225src/main/resources/templates/modules/vendors/streetVendorRequestList.html
-
591src/main/resources/templates/modules/vendors/zonerequests.html
@ -0,0 +1,32 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<classpath> |
||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
||||
|
<attributes> |
||||
|
<attribute name="optional" value="true"/> |
||||
|
<attribute name="maven.pomderived" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
||||
|
<attributes> |
||||
|
<attribute name="maven.pomderived" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
||||
|
<attributes> |
||||
|
<attribute name="optional" value="true"/> |
||||
|
<attribute name="maven.pomderived" value="true"/> |
||||
|
<attribute name="test" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> |
||||
|
<attributes> |
||||
|
<attribute name="maven.pomderived" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
||||
|
<attributes> |
||||
|
<attribute name="maven.pomderived" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="output" path="target/classes"/> |
||||
|
</classpath> |
||||
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<projectDescription> |
||||
|
<name>gccoffice</name> |
||||
|
<comment></comment> |
||||
|
<projects> |
||||
|
</projects> |
||||
|
<buildSpec> |
||||
|
<buildCommand> |
||||
|
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
|
<arguments> |
||||
|
</arguments> |
||||
|
</buildCommand> |
||||
|
<buildCommand> |
||||
|
<name>org.eclipse.m2e.core.maven2Builder</name> |
||||
|
<arguments> |
||||
|
</arguments> |
||||
|
</buildCommand> |
||||
|
</buildSpec> |
||||
|
<natures> |
||||
|
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
||||
|
</natures> |
||||
|
</projectDescription> |
||||
@ -0,0 +1,4 @@ |
|||||
|
eclipse.preferences.version=1 |
||||
|
encoding//src/main/java=UTF-8 |
||||
|
encoding//src/main/resources=UTF-8 |
||||
|
encoding/<project>=UTF-8 |
||||
@ -0,0 +1,9 @@ |
|||||
|
eclipse.preferences.version=1 |
||||
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate |
||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 |
||||
|
org.eclipse.jdt.core.compiler.compliance=17 |
||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled |
||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning |
||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore |
||||
|
org.eclipse.jdt.core.compiler.release=disabled |
||||
|
org.eclipse.jdt.core.compiler.source=17 |
||||
@ -0,0 +1,4 @@ |
|||||
|
activeProfiles= |
||||
|
eclipse.preferences.version=1 |
||||
|
resolveWorkspaceProjects=true |
||||
|
version=1 |
||||
|
After Width: 1920 | Height: 1080 | Size: 285 KiB |
@ -1,3 +1,4 @@ |
|||||
assets.base-url=/assets/ |
assets.base-url=/assets/ |
||||
|
|
||||
|
|
||||
fileBaseUrl=http://localhost:8064 |
fileBaseUrl=http://localhost:8064 |
||||
@ -0,0 +1,891 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
|
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<style> |
||||
|
.custom-width1 { |
||||
|
width: 30%; /* Adjust the width as needed */ |
||||
|
} |
||||
|
.custom-width2 { |
||||
|
width: 15%; /* Adjust the width as needed */ |
||||
|
} |
||||
|
#viewModal .modal-body { |
||||
|
max-height: 70vh; |
||||
|
/* Limit the height to 70% of the viewport */ |
||||
|
overflow-y: auto; |
||||
|
/* Enable vertical scrolling */ |
||||
|
} |
||||
|
|
||||
|
.custom-doc-btn { |
||||
|
height: 20px; |
||||
|
width: 80px; |
||||
|
font-size: 9px; |
||||
|
font-weight: bold; |
||||
|
text-align: center; |
||||
|
padding: 0px; |
||||
|
border: 1px solid grey; |
||||
|
} |
||||
|
|
||||
|
.col-md-3 { |
||||
|
padding-bottom: 10px; |
||||
|
} |
||||
|
|
||||
|
.comment { |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.comment p { |
||||
|
margin: 0; |
||||
|
} |
||||
|
|
||||
|
hr { |
||||
|
border: 1px solid #ccc; |
||||
|
} |
||||
|
|
||||
|
.comment { |
||||
|
padding: 10px 0; |
||||
|
} |
||||
|
|
||||
|
.comment .text-muted { |
||||
|
font-size: 0.9em; |
||||
|
color: #6c757d; |
||||
|
} |
||||
|
|
||||
|
.comment hr { |
||||
|
border-top: 1px solid #ccc; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header mb-2"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-8"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fa fa-list-alt bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>Approved Certificate</h5> |
||||
|
<span>Vending certificate approved list</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-4"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item" aria-current="page">Vending Committe</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">Certificate Approved</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row mt-4"> |
||||
|
<div class="col-12"> |
||||
|
<div class="card"> |
||||
|
<div class="card-header"> |
||||
|
<span style="font-size: medium;font-weight: bold;"> Filters</span> |
||||
|
<span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><span |
||||
|
th:text="${zone}" id="userzone" style="display: none;"></span> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="col-md-4 mb-3"> |
||||
|
<label for="zonedropdown" class="form-label"> Select |
||||
|
Zone |
||||
|
</label> <select id="zonedropdown" class="form-control"> |
||||
|
<option value="">Select Zone</option> |
||||
|
<!-- Zones will be loaded dynamically --> |
||||
|
</select> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-4 mb-3"> |
||||
|
|
||||
|
<label for="warddropdown" class="form-label"> Select |
||||
|
Ward |
||||
|
</label> <select id="warddropdown" class="form-control"> |
||||
|
<option value="">Select Ward</option> |
||||
|
<!-- Wards will be loaded based on selected zone --> |
||||
|
</select> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-md-4 mb-3"> |
||||
|
<label for="streetdropdown" class="form-label"> |
||||
|
Street Name |
||||
|
</label> |
||||
|
|
||||
|
<select id="streetdropdown" class="form-control"> |
||||
|
<option value="">Select Street</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-md-12 mb-2 d-flex justify-content-center"> |
||||
|
<button type="submit" id="searchBtn" |
||||
|
class="btn btn-primary mx-2">Search</button> |
||||
|
|
||||
|
<button class="btn btn-danger mx-2" id="resetBtn" name="reset" type="button">Reset</button> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
<div class="card-header"> |
||||
|
<span style="font-size: medium;font-weight: bold;">Certificate Approved List</span> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="table-responsive" > |
||||
|
|
||||
|
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr role="row"> |
||||
|
|
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center no-sort">Zone</th> |
||||
|
<th class="text-center no-sort">Ward</th> |
||||
|
<th class="text-center no-sort">Vendor Name</th> |
||||
|
<th class="text-center no-sort">Mobile Number</th> |
||||
|
<th class="text-center custom-width1 no-sort">Street</th> |
||||
|
<th class="text-center no-sort">View</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Modal --> |
||||
|
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-hidden="true" |
||||
|
data-bs-backdrop="static" data-bs-keyboard="false"> |
||||
|
<div class="modal-dialog modal-lg"> |
||||
|
<div class="modal-content"> |
||||
|
<div class="modal-header"> |
||||
|
<h5 class="modal-title" id="viewModalLabel">Request Details</h5> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
||||
|
<span aria-hidden="true">×</span> |
||||
|
</button> |
||||
|
</div> |
||||
|
<div class="modal-body" id="modalBodyContent"> |
||||
|
<!-- Dynamic content loads here --> |
||||
|
</div> |
||||
|
<div class="modal-footer"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Image Modal --> |
||||
|
<div class="modal fade" id="docModal" tabindex="-1" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-dialog-scrollable modal-lg"> |
||||
|
<div class="modal-content border-0"> |
||||
|
<div class="modal-body p-0 text-center" style="background-color: #f8f9fa;"> |
||||
|
<div id="docContainer" style="max-height: 90vh; overflow: auto;"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div id="pageLoader" |
||||
|
style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;"> |
||||
|
<div style="position: relative; top: 50%; transform: translateY(-50%);"> |
||||
|
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> |
||||
|
<span class="sr-only">Loading...</span> |
||||
|
</div> |
||||
|
<!-- Add the 'Please wait' text below the spinner --> |
||||
|
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script> |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
let userzone = document.getElementById('userzone').textContent; |
||||
|
function openDocModal(fileUrl) { |
||||
|
const container = document.getElementById('docContainer'); |
||||
|
const ext = fileUrl.split('.').pop().toLowerCase(); |
||||
|
|
||||
|
if (ext === 'pdf') { |
||||
|
container.innerHTML = `<iframe src="${fileUrl}" style="width:100%; height:90vh;" frameborder="0"></iframe>`; |
||||
|
} else { |
||||
|
container.innerHTML = `<img src="${fileUrl}" class="img-fluid" style="max-height:90vh; max-width:100%;" onerror="this.src='/default.jpg'">`; |
||||
|
} |
||||
|
|
||||
|
$('#docModal').modal('show'); |
||||
|
} |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
|
||||
|
var table = $('#RequestListDatatable').DataTable({ |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[50, 100, 200, 500, -1], |
||||
|
['50 rows', '100 rows', '200 rows', 'Show all'] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
buttons: [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn' |
||||
|
} |
||||
|
], |
||||
|
fixedHeader: false, |
||||
|
autoWidth: true, |
||||
|
responsive: true, |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
|
||||
|
let zoneString = userzone; // e.g. "01,02,03,04,05" |
||||
|
|
||||
|
if (zoneString) { |
||||
|
let zoneArray = zoneString.split(","); // ["01","02","03","04","05"] |
||||
|
|
||||
|
zoneArray.forEach(z => { |
||||
|
$("#zonedropdown").append( |
||||
|
`<option value="${z}">${z}</option>` |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
$('#zonedropdown').on('change', function () { |
||||
|
$('#streetdropdown').empty() |
||||
|
.append('<option value="">Select Street</option>'); |
||||
|
|
||||
|
let selectedZone = $(this).val(); |
||||
|
|
||||
|
// Reset ward dropdown |
||||
|
$('#warddropdown').html(`<option value="">Select Ward</option>`); |
||||
|
|
||||
|
if (selectedZone) { |
||||
|
fetchWardDropdown(selectedZone); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
loadCertificateList(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
function fetchWardDropdown(zone) { |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: "/gcc/api/streetvendor/getwardbyzone", |
||||
|
type: "GET", |
||||
|
data: { zone: zone }, |
||||
|
success: function (data) { |
||||
|
|
||||
|
if (!data || data.length === 0) { |
||||
|
$('#warddropdown').html(`<option value="">No wards found</option>`); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// Clear before loading |
||||
|
$('#warddropdown').html(`<option value="">Select Ward</option>`); |
||||
|
|
||||
|
// Append wards |
||||
|
data.forEach(w => { |
||||
|
// backend returns ward_name |
||||
|
$('#warddropdown').append( |
||||
|
`<option value="${w.ward_name}">${w.ward_name}</option>` |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
error: function (xhr) { |
||||
|
console.error("Error fetching wards:", xhr.responseText); |
||||
|
$('#warddropdown').html(`<option value="">Error loading wards</option>`); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$('#warddropdown').change(function () { |
||||
|
|
||||
|
|
||||
|
let ward = $(this).val(); |
||||
|
|
||||
|
$('#streetdropdown').empty() |
||||
|
.append('<option value="">Select Street</option>'); |
||||
|
|
||||
|
if (ward) { |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: '/gcc/api/vending/getstreetsbyward', |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
ward: ward |
||||
|
}, |
||||
|
beforeSend: function () { |
||||
|
$("#pageLoader").show(); |
||||
|
}, |
||||
|
success: function (data) { |
||||
|
|
||||
|
//console.log("API Response:", data); |
||||
|
|
||||
|
// Clear existing options |
||||
|
$("#streetdropdown").empty(); |
||||
|
|
||||
|
// Default option |
||||
|
$("#streetdropdown").append( |
||||
|
'<option value="">Select Street</option>' |
||||
|
); |
||||
|
|
||||
|
data.forEach(function(street) { |
||||
|
|
||||
|
$("#streetdropdown").append( |
||||
|
`<option value="${street.streetid}"> |
||||
|
${street.street}, ${street.location}, ${street.area} |
||||
|
</option>` |
||||
|
); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
// Destroy if already initialized |
||||
|
if ($("#streetdropdown").hasClass("select2-hidden-accessible")) { |
||||
|
$("#streetdropdown").select2("destroy"); |
||||
|
} |
||||
|
|
||||
|
// Initialize Select2 |
||||
|
$("#streetdropdown").select2({ |
||||
|
width: "100%", |
||||
|
placeholder: "Search Street", |
||||
|
allowClear: true, |
||||
|
}); |
||||
|
}, |
||||
|
error: function (xhr, status, error) { |
||||
|
console.log("Error:", error); |
||||
|
console.log(xhr.responseText); |
||||
|
}, |
||||
|
complete: function () { |
||||
|
$("#pageLoader").hide(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
$("#searchBtn").click(function () { |
||||
|
|
||||
|
loadCertificateList(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
$('#resetBtn').on('click', function () { |
||||
|
location.reload(); |
||||
|
return; |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function loadCertificateList() { |
||||
|
|
||||
|
let cby = document.getElementById('userIdSpan').textContent; |
||||
|
|
||||
|
let zone = $("#zonedropdown").val(); |
||||
|
let ward = $("#warddropdown").val(); |
||||
|
let street_id = $("#streetdropdown").val(); |
||||
|
|
||||
|
$("#pageLoader").show(); |
||||
|
|
||||
|
$.ajax({ |
||||
|
|
||||
|
url: "/gcc/api/vending/getapprovedcertificates", |
||||
|
type: "GET", |
||||
|
|
||||
|
data: { |
||||
|
zone: zone, |
||||
|
ward: ward, |
||||
|
street_id: street_id |
||||
|
}, |
||||
|
|
||||
|
success: function (data) { |
||||
|
$('#pageLoader').hide(); |
||||
|
|
||||
|
let tableContainer = $('#RequestListDatatable'); |
||||
|
|
||||
|
// Destroy any existing DataTable instance |
||||
|
if ($.fn.DataTable.isDataTable(tableContainer)) { |
||||
|
tableContainer.DataTable().destroy(); |
||||
|
} |
||||
|
|
||||
|
// Initialize DataTable |
||||
|
tableContainer.DataTable({ |
||||
|
destroy: true, |
||||
|
searching: true, |
||||
|
autoWidth: false, |
||||
|
paging: true, |
||||
|
info: true, |
||||
|
data: data, |
||||
|
columns: [ |
||||
|
{ |
||||
|
data: null, |
||||
|
render: (data, type, row, meta) => meta.row + 1, |
||||
|
className: 'text-center' |
||||
|
}, |
||||
|
{ data: 'zone', defaultContent: '-', className: 'text-center' }, |
||||
|
{ data: 'ward', defaultContent: '-', className: 'text-center' }, |
||||
|
{ data: 'name', defaultContent: '-', className: 'text-center' }, |
||||
|
{ data: 'mob_no', defaultContent: '-', className: 'text-center' }, |
||||
|
{ data: 'street_name', defaultContent: '-', className: 'text-center' }, |
||||
|
{ |
||||
|
data: 'id', |
||||
|
render: function (data, type, row) { |
||||
|
return `<button class="btn btn-primary btn-sm btn-view" data-id="${data}">View</button>`; |
||||
|
}, |
||||
|
className: 'text-center' |
||||
|
} |
||||
|
|
||||
|
], |
||||
|
dom: 'Bfrtip', |
||||
|
buttons: [ |
||||
|
{ extend: 'pageLength', className: 'btn btn-warning' }, |
||||
|
{ extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' }, |
||||
|
{ extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' }, |
||||
|
{ extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' }, |
||||
|
{ extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' } |
||||
|
], |
||||
|
columnDefs: [{ targets: 'no-sort', orderable: false }], |
||||
|
lengthMenu: [ |
||||
|
[50, 100, 200, 500, -1], |
||||
|
['50 rows', '100 rows', '200 rows', 'Show all'] |
||||
|
], |
||||
|
scrollY: '80vh', |
||||
|
scrollX: true, |
||||
|
responsive: false |
||||
|
}); |
||||
|
|
||||
|
// Bind view buttons |
||||
|
tableContainer.off('click', '.btn-view'); |
||||
|
tableContainer.on('click', '.btn-view', function () { |
||||
|
let id = $(this).data('id'); |
||||
|
$.ajax({ |
||||
|
url: `/gcc/api/vending/finalvendorDetailsById?requestId=${id}`, |
||||
|
method: 'GET', |
||||
|
success: function (detailData) { |
||||
|
|
||||
|
|
||||
|
if (!detailData || detailData.length === 0) { |
||||
|
$('#modalBodyContent').html("<p>No data found for this request.</p>"); |
||||
|
$('#viewModal').modal('show'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
const details = detailData[0]; |
||||
|
|
||||
|
const historyList = detailData.map(h => ({ |
||||
|
date: h.vc_Inspection_date || "N/A", |
||||
|
status: h.vc_status || "N/A", |
||||
|
remarks: h.vc_remarks || "", |
||||
|
event: h.event_name || "-" |
||||
|
})); |
||||
|
|
||||
|
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-'; |
||||
|
const pmLoanDisplay = details.pm_svanidhi_loan ? (details.pm_svanidhi_loan ? 'Yes' : 'No') : '-'; |
||||
|
const bankAccDisplay = details.bank_acc_status ? (details.bank_acc_status === '1' ? 'Yes' : 'No') : '-'; |
||||
|
const idCardDisplay = details.vendor_id_card ? (details.vendor_id_card === '1' ? 'Yes' : 'No') : '-'; |
||||
|
const bankPassbookDisplay = details.bank_acc_status === '1' && details.bank_passbook |
||||
|
? `<img src="${details.bank_passbook}" alt="Bank Passbook" class="img-fluid" style="max-width: 150px;" onerror="this.src='/default.jpg'">` |
||||
|
: '-'; |
||||
|
|
||||
|
const aadharFrontBtn = details.aadhar_front_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.aadhar_front_photo}')">View</button>` : '-'; |
||||
|
const rationCardBtn = details.ration_card_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.ration_card_photo}')">View</button>` : '-'; |
||||
|
const aadharBackBtn = details.aadhar_back_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.aadhar_back_photo}')">View</button>` : '-'; |
||||
|
const bankPassbookBtn = details.bank_acc_status === '1' && details.bank_passbook |
||||
|
? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.bank_passbook}')">View</button>` |
||||
|
: '-'; |
||||
|
|
||||
|
const spacePhotoBtn = details.vendor_space_photo ? `<button class="btn btn-sm btn-light custom-doc-btn" onclick="openDocModal('${details.vendor_space_photo}')">View</button>` : '-'; |
||||
|
|
||||
|
const familyMembers = details.familymembers_details || []; |
||||
|
|
||||
|
let familyHtml = "-"; |
||||
|
|
||||
|
if (familyMembers.length > 0) { |
||||
|
|
||||
|
familyHtml = ` |
||||
|
<table class="table table-bordered table-sm mb-0"> |
||||
|
<thead class="table-light"> |
||||
|
<tr> |
||||
|
<th>S.No</th> |
||||
|
<th>Name</th> |
||||
|
<th>Age</th> |
||||
|
<th>Relationship</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
${familyMembers.map((member, index) => ` |
||||
|
<tr> |
||||
|
<td>${index + 1}</td> |
||||
|
<td>${member.name || '-'}</td> |
||||
|
<td>${member.age || '-'}</td> |
||||
|
<td>${member.relation_name || '-'}</td> |
||||
|
</tr> |
||||
|
`).join('')} |
||||
|
</tbody> |
||||
|
</table> |
||||
|
`; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
let historyHtml = ""; |
||||
|
historyList.forEach(h => { |
||||
|
historyHtml += ` |
||||
|
<div class="comment mb-4"> |
||||
|
<div class="row"> |
||||
|
<div class="col-4 text-center"> |
||||
|
<p class="text-muted"><strong>${h.date}</strong></p> |
||||
|
</div> |
||||
|
<div class="col-8"> |
||||
|
<p><strong>Vending Committee ${h.status} (${h.event})</strong></p> |
||||
|
<p><strong>Remarks: </strong>${h.remarks}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div>`; |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
const certificateDetails = details.certificate_details || []; |
||||
|
|
||||
|
let certificateCard = ""; |
||||
|
|
||||
|
if (certificateDetails.length > 0) { |
||||
|
|
||||
|
const cert = certificateDetails[0]; // Active certificate |
||||
|
|
||||
|
certificateCard = ` |
||||
|
<div class="card mb-3"> |
||||
|
<div class="card-header bg-secondary text-white"> |
||||
|
Certificate Details |
||||
|
</div> |
||||
|
|
||||
|
<div class="card-body row"> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Alloted Zone:</strong></div> |
||||
|
<div class="col-md-3">${cert.zone || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Alloted Ward:</strong></div> |
||||
|
<div class="col-md-3">${cert.ward || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Alloted Street Name:</strong></div> |
||||
|
<div class="col-md-3">${cert.street_name || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Status:</strong></div> |
||||
|
<div class="col-md-3"> |
||||
|
<span class="badge badge-success"> |
||||
|
${cert.status || '-'} |
||||
|
</span> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Generated Date:</strong></div> |
||||
|
<div class="col-md-3">${cert.cdate || '-'}</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
`; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
const content = ` |
||||
|
<div class="container-fluid"> |
||||
|
<!-- Personal Details --> |
||||
|
<div class="card mb-3"> |
||||
|
<div class="card-header bg-primary text-white">Personal Details</div> |
||||
|
<div class="card-body row"> |
||||
|
<div class="col-md-3"><strong>Name:</strong></div> |
||||
|
<div class="col-md-3">${details.name || '-'}</div> |
||||
|
<div class="col-md-3"><strong>Father/Husband Name:</strong></div> |
||||
|
<div class="col-md-3">${details.f_h_name || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Mobile:</strong></div> |
||||
|
<div class="col-md-3">${details.mob_no || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Community Category:</strong></div> |
||||
|
<div class="col-md-3">${details.category_name || '-'}</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-md-3"><strong>DOB:</strong></div> |
||||
|
<div class="col-md-3">${formatDateForDisplay(details.dob_format)}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Address:</strong></div> |
||||
|
<div class="col-md-3">${details.residental_address || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Gender:</strong></div> |
||||
|
<div class="col-md-3">${details.gender || '-'}</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="col-md-3"><strong>Differently Abled:</strong></div> |
||||
|
<div class="col-md-3">${diffAbledDisplay || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Type of Disability:</strong></div> |
||||
|
<div class="col-md-3">${details.diff_name || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Specify the Disability:</strong></div> |
||||
|
<div class="col-md-3">${details.other_disability || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Religion:</strong></div> |
||||
|
<div class="col-md-3">${details.religion_name || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Aadhaar front Image:</strong></div> |
||||
|
<div class="col-md-3">${aadharFrontBtn}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Ration card Image:</strong></div> |
||||
|
<div class="col-md-3">${rationCardBtn}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Aadhaar back Image:</strong></div> |
||||
|
<div class="col-md-3">${aadharBackBtn}</div> |
||||
|
|
||||
|
<div class="col-md-12 mt-3"> |
||||
|
<strong>Family Members:</strong> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-12 mt-3"> |
||||
|
${familyHtml} |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Business Details --> |
||||
|
<div class="card mb-3"> |
||||
|
<div class="card-header bg-success text-white">Business Details</div> |
||||
|
<div class="card-body row"> |
||||
|
<div class="col-md-3"><strong>Type of Business:</strong></div> |
||||
|
<div class="col-md-3">${details.vending_category_name || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Zone:</strong></div> |
||||
|
<div class="col-md-3">${details.zone || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Business Space (sq.ft):</strong></div> |
||||
|
<div class="col-md-3">${details.vending_space || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Ward:</strong></div> |
||||
|
<div class="col-md-3">${details.ward || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Address:</strong></div> |
||||
|
<div class="col-md-3">${details.business_address || '-'}</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="col-md-3"><strong>PM SVANidhi Loan Availed:</strong></div> |
||||
|
<div class="col-md-3">${pmLoanDisplay || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Do you Have Bank Account?:</strong></div> |
||||
|
<div class="col-md-3">${bankAccDisplay || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Bank Passbook Image:</strong></div> |
||||
|
<div class="col-md-3">${bankPassbookBtn}</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Inspection Details --> |
||||
|
<div class="card mb-3"> |
||||
|
<div class="card-header bg-warning text-white">Inspection Details</div> |
||||
|
<div class="card-body row"> |
||||
|
<div class="col-md-3"><strong>Vendor Type:</strong></div> |
||||
|
<div class="col-md-3">${details.vendor_type || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Vendor ID Card:</strong></div> |
||||
|
<div class="col-md-3">${idCardDisplay}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Vending Nature:</strong></div> |
||||
|
<div class="col-md-3">${details.vending_nature || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Vending Time:</strong></div> |
||||
|
<div class="col-md-3">${details.vending_time || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Transaction Mode:</strong></div> |
||||
|
<div class="col-md-3">${details.transaction_mode || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Swanidi Loan Amount:</strong></div> |
||||
|
<div class="col-md-3">${details.swanidi_loan_amount || '-'}</div> |
||||
|
|
||||
|
<div class="col-md-3"><strong>Vendor Space Image:</strong></div> |
||||
|
<div class="col-md-3">${spacePhotoBtn || '-'}</div> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Request History --> |
||||
|
<div class="card mb-3"> |
||||
|
<div class="card-header bg-info text-white">Request History</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="comment mb-4"> |
||||
|
<div class="row"> |
||||
|
<div class="col-4 text-center"> |
||||
|
<p class="text-muted"><strong>${details.LI_Cdate || 'N/A'}</strong></p> |
||||
|
</div> |
||||
|
<div class="col-8"> |
||||
|
<p><strong>LI Officer ${details.LI_Status || 'N/A'}</strong></p> |
||||
|
<p><strong>Remarks: </strong>${details.LI_Remarks || ''}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="comment mb-4"> |
||||
|
<div class="row"> |
||||
|
<div class="col-4 text-center"> |
||||
|
<p class="text-muted"><strong>${details.ARO_Inspection_date || 'N/A'}</strong></p> |
||||
|
</div> |
||||
|
<div class="col-8"> |
||||
|
<p><strong>ARO Officer ${details.ARO_status || 'N/A'}</strong></p> |
||||
|
<p><strong>Remarks: </strong>${details.ARO_remarks || ''}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="comment mb-4"> |
||||
|
<div class="row"> |
||||
|
<div class="col-4 text-center"> |
||||
|
<p class="text-muted"><strong>${details.EE_Inspection_date || 'N/A'}</strong></p> |
||||
|
</div> |
||||
|
<div class="col-8"> |
||||
|
<p><strong>EE Officer ${details.EE_status || 'N/A'}</strong></p> |
||||
|
<p><strong>Remarks: </strong>${details.EE_remarks || ''}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
${historyHtml} |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
${certificateCard} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
`; |
||||
|
|
||||
|
$('#modalBodyContent').html(content); |
||||
|
$('#viewModalLabel').text(`Vendor Details - ${id}`); |
||||
|
$('#viewModal').modal('show'); |
||||
|
}, |
||||
|
error: function (xhr) { |
||||
|
console.error("Error fetching detail:", xhr.responseText); |
||||
|
alert("Failed to fetch vendor details."); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
error: function () { |
||||
|
|
||||
|
$('#pageLoader').hide(); |
||||
|
Swal.fire( |
||||
|
'Error', |
||||
|
'Failed to load Road War details', |
||||
|
'error' |
||||
|
); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
function formatDateForDisplay(dateStr) { |
||||
|
|
||||
|
if (!dateStr) return "-"; |
||||
|
|
||||
|
// Already dd-MM-yyyy |
||||
|
if (/^\d{2}-\d{2}-\d{4}$/.test(dateStr)) { |
||||
|
return dateStr; |
||||
|
} |
||||
|
|
||||
|
// yyyy-MM-dd -> dd-MM-yyyy |
||||
|
if (/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) { |
||||
|
const [year, month, day] = dateStr.split("-"); |
||||
|
return `${day}-${month}-${year}`; |
||||
|
} |
||||
|
|
||||
|
return dateStr; |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue