Team4 : form changes : MONTAIR LC KID 5 - Chemist & Dr Tagging
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
This commit is contained in:
parent
952b314041
commit
02ddfb1b0a
|
|
@ -93,8 +93,19 @@
|
||||||
echo "</pre>"; */
|
echo "</pre>"; */
|
||||||
|
|
||||||
$existingCount = count($submissions);
|
$existingCount = count($submissions);
|
||||||
|
|
||||||
$targetLimit = 20; // नवीन लिमिट २०
|
$targetLimit = 20; // नवीन लिमिट २०
|
||||||
|
|
||||||
|
$historyDoctorIds = [];
|
||||||
|
|
||||||
|
foreach ($submissions as $sub) {
|
||||||
|
if (isset($sub->formdata->cont_id) && $sub->formdata->cont_id != '') {
|
||||||
|
$historyDoctorIds[] = (string) $sub->formdata->cont_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$historyDoctorIds = array_unique($historyDoctorIds);
|
||||||
|
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@if($existingCount<20 || $id)
|
@if($existingCount<20 || $id)
|
||||||
|
|
@ -339,6 +350,8 @@
|
||||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
|
const historyDoctors = @json($historyDoctorIds);
|
||||||
|
console.log("History IDs:", historyDoctors);
|
||||||
// Allow only today's date
|
// Allow only today's date
|
||||||
const today = new Date().toISOString().split('T')[0];
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
|
|
@ -537,7 +550,7 @@ $(document).on(
|
||||||
|
|
||||||
function preventDuplicateDoctors() {
|
function preventDuplicateDoctors() {
|
||||||
|
|
||||||
let selectedValues = [];
|
let selectedValues = [...historyDoctors];
|
||||||
|
|
||||||
// Collect selected values
|
// Collect selected values
|
||||||
$('select[id^="field-contact_id"]').each(function () {
|
$('select[id^="field-contact_id"]').each(function () {
|
||||||
|
|
@ -563,24 +576,28 @@ $(document).on(
|
||||||
if (!optionValue) return;
|
if (!optionValue) return;
|
||||||
|
|
||||||
// remove previous label
|
// remove previous label
|
||||||
let cleanText = option.text().replace(' (Already Added)', '');
|
let cleanText = option.text()
|
||||||
|
.replace(' (Already Added)', '')
|
||||||
|
.replace(' (Already Submitted)', '');
|
||||||
|
|
||||||
// IMPORTANT:
|
if (
|
||||||
// keep currently selected option enabled
|
historyDoctors.includes(optionValue) &&
|
||||||
if (
|
optionValue !== currentValue
|
||||||
selectedValues.includes(optionValue) &&
|
) {
|
||||||
optionValue !== currentValue
|
option.prop('disabled', true);
|
||||||
) {
|
option.text(cleanText + ' (Already Submitted)');
|
||||||
|
}
|
||||||
option.prop('disabled', true);
|
else if (
|
||||||
option.text(cleanText + ' (Already Added)');
|
selectedValues.includes(optionValue) &&
|
||||||
|
optionValue !== currentValue
|
||||||
} else {
|
) {
|
||||||
|
option.prop('disabled', true);
|
||||||
option.prop('disabled', false);
|
option.text(cleanText + ' (Already Added)');
|
||||||
option.text(cleanText);
|
}
|
||||||
|
else {
|
||||||
}
|
option.prop('disabled', false);
|
||||||
|
option.text(cleanText);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue