@ -1,39 +1,42 @@
<!DOCTYPE html>
<!DOCTYPE html>
< html xmlns:th = "http://www.thymeleaf.org" >
< html xmlns:th = "http://www.thymeleaf.org" >
< head th:replace = "~{fragments/modules/base/head :: head}" > < / head >
< head th:replace = "~{fragments/modules/base/head :: head}" > < / head >
< style >
< style >
.required{
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px)
{
#requestlistform label {
margin-top: 10px;
}
}
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px) {
#requestlistform label {
margin-top: 10px;
}
}
#viewModal .modal-body {
#viewModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
}
}
.custom-doc-btn {
.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 {
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;
margin-bottom: 20px;
}
}
@ -58,239 +61,250 @@ padding-bottom: 10px;
border-top: 1px solid #ccc;
border-top: 1px solid #ccc;
}
}
< / style >
< / style >
< body >
<!-- [if lt IE 8]>
< body >
<!-- [if lt IE 8]>
< p class = "browserupgrade" > You are using an < strong > outdated< / strong > browser. Please < a href = "http://browsehappy.com/" > upgrade your browser< / a > to improve your experience.< / p >
< p class = "browserupgrade" > You are using an < strong > outdated< / strong > browser. Please < a href = "http://browsehappy.com/" > upgrade your browser< / a > to improve your experience.< / p >
<![endif]-->
<![endif]-->
< div class = "wrapper" >
<!-- header top menu Start -->
< header th:replace = "~{fragments/modules/base/header :: header}" > < / header >
<!-- header top menu end -->
< div class = "page-wrap" >
<!-- =============== Left Menu side Start ================ -->
< div th:replace = "~{fragments/modules/base/menu :: menu}" > < / div >
<!-- =============== Left side End ================ -->
< 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 = "far fa-calendar-plus bg-blue" > < / i >
< div class = "d-inline" >
< h5 > Request List< / h5 >
< span > Vending Committe< / 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" > Request List< / li >
< / ol >
< / nav >
< / div >
< / div >
< / div >
<!-- <h4 class="h4 text - right text - mute" style="font - size: 12px;">
< div class = "wrapper" >
<!-- header top menu Start -->
< header th:replace = "~{fragments/modules/base/header :: header}" > < / header >
<!-- header top menu end -->
< div class = "page-wrap" >
<!-- =============== Left Menu side Start ================ -->
< div th:replace = "~{fragments/modules/base/menu :: menu}" > < / div >
<!-- =============== Left side End ================ -->
< 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 = "far fa-calendar-plus bg-blue" > < / i >
< div class = "d-inline" >
< h5 > Request List< / h5 >
< span > Vending Committe< / 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" > Request List< / li >
< / ol >
< / nav >
< / div >
< / div >
< / div >
<!-- <h4 class="h4 text - right text - mute" style="font - size: 12px;">
Auto refresh in < font id = "refresh-countdown" > 00< / font > seconds
Auto refresh in < font id = "refresh-countdown" > 00< / font > seconds
< / h4 > -->
< / h4 > -->
< div class = "row" >
< div class = "col-md-12" >
< div class = "card" >
< div class = "card-block" >
< div class = "row" >
< div class = "form-group col-sm-8" >
< label for = "dropdownevent" > Select Meeting
< span class = "text-danger" > *< / span > < / label >
< select id = "dropdownevent" class = "form-control" >
< / select >
< / div >
< div class = "form-group col-sm-4" >
< label for = "zonedropdown" > Select Zone
< / label >
< select id = "zonedropdown" class = "form-control" >
< option value = "" > Select Zone < / option >
< / select >
< / div >
< / div >
< div class = "page-header-title" >
< h5 style = "margin: 0;font-weight: bold;" > < span th:text = "${zone}" id = "userzone" style = "display: none;" > < / span > Vendors Request List< / h5 > < span th:text = "${LoginUserId}" id = "userIdSpan" style = "display: none;" > < / span > < hr >
< / div >
< div >
< 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" > S.No< / th >
< th class = "text-center" >
< input type = "checkbox" id = "selectAll" > Select first 20
< / th >
< th class = "text-center" > Request No< / th >
< th class = "text-center" > Zone< / th >
< th class = "text-center" > Ward< / th >
< th class = "text-center" > Name< / th >
< th class = "text-center" > Mobile< / th >
< th class = "text-center" > Address< / th >
< th class = "text-center" > View Details< / th >
< th class = "text-center" > Status< / th >
< th class = "text-center" > Remarks< / th >
< th class = "text-center no-sort" width = "%2" > Action< / th >
< / tr >
< / thead >
< tbody >
< / tbody >
< / table >
< / div >
< / div >
< / div >
< / div >
< div class = "col-md-12" id = "bulksavecontainer" style = "display: none;" >
< div class = "card" >
< div class = "card-block" >
< div class = "row" >
< div class = "col-md-6" >
< label for = "bulkstatus" > Select Status< span class = "text-danger" > *< / span > < / label >
< select id = "bulkstatus" class = "form-control" >
< option value = "" > Select< / option >
< option value = "Approved" > Approved< / option >
< option value = "Rejected" > Rejected< / option >
< option value = "Postponed" > Postponed< / option >
< / select >
< / div >
< div class = "col-md-6" >
< label for = "bulkremarks" > Remarks< span class = "text-danger" > *< / span > < / label > < br >
< textarea rows = "2" id = "bulkremarks" class = "form-control" > < / textarea >
< / div >
< div class = "col-md-12" >
< div class = "text-center mt-4" >
< button type = "button" class = "btn btn-primary" id = "bulksubmitBtn" > Submit< / button >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-md-12" >
< div class = "card" >
< div class = "card-block" >
< div class = "row" >
< div class = "form-group col-sm-8" >
< label for = "dropdownevent" > Select Meeting
< span class = "text-danger" > *< / span > < / label >
< select id = "dropdownevent" class = "form-control" >
< / select >
< / div >
< div class = "form-group col-sm-4" >
< label for = "zonedropdown" > Select Zone
< / label >
< select id = "zonedropdown" class = "form-control" >
< option value = "" > Select Zone < / option >
< / select >
< / div >
< / div >
< div class = "page-header-title" >
< h5 style = "margin: 0;font-weight: bold;" > < span th:text = "${zone}" id = "userzone"
style="display: none;">< / span > Vendors Request List< / h5 > < span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;">< / span >
< hr >
< / div >
< div >
< 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" > S.No< / th >
< th class = "text-center" >
< input type = "checkbox" id = "selectAll" > Select first 20
< / th >
< th class = "text-center" > Request No< / th >
< th class = "text-center" > Zone< / th >
< th class = "text-center" > Ward< / th >
< th class = "text-center" > Name< / th >
< th class = "text-center" > Mobile< / th >
< th class = "text-center" > Address< / th >
< th class = "text-center" > View Details< / th >
< th class = "text-center" > Status< / th >
< th class = "text-center" > Remarks< / th >
< th class = "text-center no-sort" width = "%2" > Action< / th >
< / tr >
< / thead >
< tbody >
< / tbody >
< / table >
< / div >
< / div >
< / div >
< / div >
< div class = "col-md-12" id = "bulksavecontainer" style = "display: none;" >
< div class = "card" >
< div class = "card-block" >
< div class = "row" >
< div class = "col-md-6" >
< label for = "bulkstatus" > Select Status< span class = "text-danger" > *< / span >
< / label >
< select id = "bulkstatus" class = "form-control" >
< option value = "" > Select< / option >
< option value = "Approved" > Approved< / option >
< option value = "Rejected" > Rejected< / option >
< option value = "Postponed" > Postponed< / option >
< / select >
< / div >
< div class = "col-md-6" >
< label for = "bulkremarks" > Remarks< span
class="text-danger">*< / span > < / label > < br >
< textarea rows = "2" id = "bulkremarks" class = "form-control" > < / textarea >
< / div >
< div class = "col-md-12" >
< div class = "text-center mt-4" >
< button type = "button" class = "btn btn-primary"
id="bulksubmitBtn">Submit< / button >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
<!-- Modal -->
<!-- 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-bs-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-bs-dismiss = "modal" > Close< / button >
< / div >
< / 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 >
< / div >
<!-- Modal -->
<!-- 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-bs-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-bs-dismiss = "modal" > Close< / button >
< / 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 >
<!-- 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 >
< footer th:replace = "~{fragments/modules/base/footer :: footer}" > < / footer >
< / 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 >
< 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 src = "https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js" > < / script >
< script src = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js " > < / script >
< div th:replace = "~{fragments/modules/base/app_module_menu_box :: div}" > < / div >
< script type = "text/javascript" >
< 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 src = "https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js" > < / script >
< script src = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" > < / script >
< script type = "text/javascript" >
let userzone = document.getElementById('userzone').textContent;
let userzone = document.getElementById('userzone').textContent;
let userId = document.getElementById('userIdSpan').textContent;
let userId = document.getElementById('userIdSpan').textContent;
//console.log("userId="+userId);
// GLOBAL scope — must be outside any other function
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'" > `;
}
//console.log("userId="+userId);
// GLOBAL scope — must be outside any other function
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');
}
$('#docModal').modal('show');
}
$(document).ready(function() {
$(document).ready(function () {
var table = $('#RequestListDatatable').DataTable({
var table = $('#RequestListDatatable').DataTable({
dom: 'Bftip',
dom: 'Bftip',
columnDefs: [
columnDefs: [
{ width: "150px", targets: 7 },
{width: "150px", targets: 10 }
],
{ width: "150px", targets: 7 },
{ width: "150px", targets: 10 }
],
lengthMenu: [
lengthMenu: [
[200, 400, -1],
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
['200 rows', '400 rows', 'Show all']
],
],
scrollY: '50vh',
scrollY: '50vh',
@ -337,7 +351,7 @@ padding-bottom: 10px;
// Trigger on page load
// Trigger on page load
fetchEventDropdown();
fetchEventDropdown(userId );
let zoneString = userzone; // e.g. "01,02,03,04,05"
let zoneString = userzone; // e.g. "01,02,03,04,05"
@ -354,20 +368,20 @@ padding-bottom: 10px;
$('#dropdownevent').on('change', function () {
$('#dropdownevent').on('change', function () {
$('#zonedropdown').val("");
$('#zonedropdown').val("");
fetchVendingCommitteeList();
fetchVendingCommitteeList();
});
});
$('#zonedropdown').on('change', function () {
let miss_meet= $('#dropdownevent').val();
$('#zonedropdown').on('change', function () {
let miss_meet = $('#dropdownevent').val();
if(!miss_meet) {
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
if (!miss_meet) {
Swal.fire("Warning", "Please select an meeting!", "warning");
return;
}
fetchVendingCommitteeList();
fetchVendingCommitteeList();
});
});
@ -477,7 +491,7 @@ padding-bottom: 10px;
const MAX_SELECTION = 20;
const MAX_SELECTION = 20;
function fetchVendingCommitteeList() {
function fetchVendingCommitteeList() {
const selectedOption = $('#dropdownevent option:selected').text();
const selectedOption = $('#dropdownevent option:selected').text();
// Assuming the format is: "Event Name - yyyy-mm-dd"
// Assuming the format is: "Event Name - yyyy-mm-dd"
const eventDateRaw = selectedOption.split(' - ')[1];
const eventDateRaw = selectedOption.split(' - ')[1];
@ -497,7 +511,7 @@ padding-bottom: 10px;
const formattedDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
const formattedDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
// Read zone dropdown value
// Read zone dropdown value
let selectedZone = $('#zonedropdown').val();
let selectedZone = $('#zonedropdown').val();
// If selected zone is empty → use userzone
// If selected zone is empty → use userzone
@ -510,14 +524,14 @@ padding-bottom: 10px;
$.ajax({
$.ajax({
url: '/gcc/api/streetvendor/getvedingcommitteelist',
url: '/gcc/api/streetvendor/getvedingcommitteelist',
data: { date: formattedDate,zones:finalZone },
data: { date: formattedDate, zones: finalZone },
method: 'GET',
method: 'GET',
contentType: 'application/json',
contentType: 'application/json',
success: function (data) {
success: function (data) {
//console.log("data="+data);
//console.log("data="+data);
$('#pageLoader').hide();
$('#pageLoader').hide();
let tableContainer = $('#RequestListDatatable');
let tableContainer = $('#RequestListDatatable');
// Destroy any existing DataTable instance
// Destroy any existing DataTable instance
@ -610,14 +624,14 @@ padding-bottom: 10px;
{ extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
{ extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
],
],
columnDefs: [
columnDefs: [
{ width: "150px", targets: 7 },
{width: "150px", targets: 10 }
],
{ width: "150px", targets: 7 },
{ width: "150px", targets: 10 }
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
lengthMenu: [
[200, 400, -1],
['200 rows', '400 rows', 'Show all']
],
scrollY: '80vh',
scrollY: '80vh',
scrollX: true,
scrollX: true,
@ -639,7 +653,7 @@ padding-bottom: 10px;
// FIXED: Only check visible rows on the current page
// FIXED: Only check visible rows on the current page
let allVisible = $(pageRows).find('.row-check').length ===
let allVisible = $(pageRows).find('.row-check').length ===
$(pageRows).find('.row-check:checked').length;
$(pageRows).find('.row-check:checked').length;
$('#selectAll').prop('checked', allVisible);
$('#selectAll').prop('checked', allVisible);
@ -650,7 +664,7 @@ padding-bottom: 10px;
$('#selectAll').off('change');
$('#selectAll').off('change');
$('#selectAll').on('change', function () {
$('#selectAll').on('change', function () {
console.log("Select All clicked");
console.log("Select All clicked");
let checked = $(this).is(':checked');
let checked = $(this).is(':checked');
let table = $('#RequestListDatatable').DataTable();
let table = $('#RequestListDatatable').DataTable();
@ -713,7 +727,7 @@ padding-bottom: 10px;
});
});
tableContainer.on('draw.dt', function () {
tableContainer.on('draw.dt', function () {
enforceMaxLimit();
enforceMaxLimit();
toggleBulkSaveContainer();
toggleBulkSaveContainer();
});
});
@ -734,10 +748,10 @@ padding-bottom: 10px;
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-';
const diffAbledDisplay = details.diff_abled ? (details.diff_abled ? 'Yes' : 'No') : '-';
const pmLoanDisplay = details.pm_svanidhi_loan ? (details.pm_svanidhi_loan ? '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 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 idCardDisplay = details.vendor_id_card ? (details.vendor_id_card === '1' ? 'Yes' : 'No') : '-';
const bankPassbookDisplay = details.bank_acc_status === '1' & & details.bank_passbook
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'" > `
: '-';
? `< 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 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 rationCardBtn = details.ration_card_photo ? `< button class = "btn btn-sm btn-light custom-doc-btn" onclick = "openDocModal('${details.ration_card_photo}')" > View< / button > ` : '-';
@ -746,7 +760,7 @@ padding-bottom: 10px;
? `< button class = "btn btn-sm btn-light custom-doc-btn" onclick = "openDocModal('${details.bank_passbook}')" > View< / button > `
? `< 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 spacePhotoBtn = details.vendor_space_photo ? `< button class = "btn btn-sm btn-light custom-doc-btn" onclick = "openDocModal('${details.vendor_space_photo}')" > View< / button > ` : '-';
let postponedHTML = "";
let postponedHTML = "";
@ -771,7 +785,7 @@ padding-bottom: 10px;
});
});
}
}
// Latest postponed entry
// Latest postponed entry
if (details.latestPostponed) {
if (details.latestPostponed) {
postponedHTML += `
postponedHTML += `
< div class = "comment mb-4" >
< div class = "comment mb-4" >
@ -972,7 +986,7 @@ padding-bottom: 10px;
const $submitBtn = $(this); // ONLY this button
const $submitBtn = $(this); // ONLY this button
$submitBtn.prop('disabled', true).text('Submitting...');
$submitBtn.prop('disabled', true).text('Submitting...');
const $row = $(this).closest('tr'); // get the clicked row
const $row = $(this).closest('tr'); // get the clicked row
@ -985,7 +999,7 @@ padding-bottom: 10px;
const remarks = $row.find('textarea').val();
const remarks = $row.find('textarea').val();
const eventReqId = $('#dropdownevent').val();
const eventReqId = $('#dropdownevent').val();
// Event dropdown check
// Event dropdown check
if (!eventReqId) {
if (!eventReqId) {
Swal.fire({
Swal.fire({
icon: 'warning',
icon: 'warning',
@ -997,7 +1011,7 @@ padding-bottom: 10px;
}
}
// Status must be selected
// Status must be selected
if (!status) {
if (!status) {
Swal.fire({
Swal.fire({
icon: 'warning',
icon: 'warning',
@ -1029,57 +1043,57 @@ padding-bottom: 10px;
event_req_id: eventReqId,
event_req_id: eventReqId,
zone: rowData.zone,
zone: rowData.zone,
ward: rowData.ward,
ward: rowData.ward,
cby:userId,
mob_no:rowData.mob_no
cby: userId,
mob_no: rowData.mob_no
};
};
console.log("payload = " + JSON.stringify(payload, null, 2));
console.log("payload = " + JSON.stringify(payload, null, 2));
$('#pageLoader').show();
$('#pageLoader').show();
// 📨 AJAX call
// 📨 AJAX call
$.ajax({
$.ajax({
url: '/gcc/api/streetvendor/savedetailsforvendor',
url: '/gcc/api/streetvendor/savedetailsforvendor',
method: 'POST',
method: 'POST',
contentType: 'application/json',
contentType: 'application/json',
data: JSON.stringify(payload),
data: JSON.stringify(payload),
success: function (response) {
success: function (response) {
$('#pageLoader').hide();
$submitBtn.prop('disabled', false).text('Submit');
if (response.status === "success") {
Swal.fire({
icon: 'success',
title: 'Success',
text: response.message,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showConfirmButton: true,
}).then((result) => {
if (result.isConfirmed) {
console.log("ok button");
fetchVendingCommitteeList();
}
});
}
else if(response.status === "Error") {
Swal.fire({
icon: 'error',
title: 'Error',
text: response.message,
});
}
else {
Swal.fire('Error', 'Failed to submit data.', 'error');
}
$('#pageLoader').hide();
$submitBtn.prop('disabled', false).text('Submit');
if (response.status === "success") {
Swal.fire({
icon: 'success',
title: 'Success',
text: response.message,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showConfirmButton: true,
}).then((result) => {
if (result.isConfirmed) {
console.log("ok button");
fetchVendingCommitteeList();
}
});
}
else if (response.status === "Error") {
Swal.fire({
icon: 'error',
title: 'Error',
text: response.message,
});
}
else {
Swal.fire('Error', 'Failed to submit data.', 'error');
}
},
},
error: function () {
error: function () {
$('#pageLoader').hide();
$submitBtn.prop('disabled', false).text('Submit');
$('#pageLoader').hide();
$submitBtn.prop('disabled', false).text('Submit');
Swal.fire('Error', 'Something went wrong while submitting.', 'error');
Swal.fire('Error', 'Something went wrong while submitting.', 'error');
}
}
});
});
@ -1088,18 +1102,19 @@ padding-bottom: 10px;
},
},
error: function (xhr, status, error) {
error: function (xhr, status, error) {
$('#pageLoader').hide();
$('#pageLoader').hide();
console.error("Error fetching data:", error);
console.error("Error fetching data:", error);
alert("Failed to load vendor list.");
alert("Failed to load vendor list.");
}
}
});
});
}
}
// Call this function on page load
function fetchEventDropdown() {
// Call this function on page load
function fetchEventDropdown(userId ) {
$.ajax({
$.ajax({
url: '/gcc/api/vending/dropdown-Event',
url: '/gcc/api/vending/dropdown-Event',
type: 'GET',
type: 'GET',
data: { userId: userId },
dataType: 'json',
dataType: 'json',
success: function (data) {
success: function (data) {
let eventDropdown = $('#dropdownevent');
let eventDropdown = $('#dropdownevent');
@ -1123,6 +1138,7 @@ padding-bottom: 10px;
});
});
}
}
< / script >
< / body >
< / script >
< / body >
< / html >
< / html >