From 7374343cd977b5cf074e0df9314d52df3140558b Mon Sep 17 00:00:00 2001 From: zeeshan Date: Thu, 18 Jun 2026 13:17:38 +0530 Subject: [PATCH] Titans (Novel meet) --- ...118d-3199-483f-bbae-1b8f5d0f24e8.blade.php | 71 +++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php b/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php index 86c0163f..e71ffbdd 100644 --- a/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php +++ b/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php @@ -28,7 +28,7 @@
@endif
-

Report Novel Meet

+

Novel Meet

@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes')) @@ -170,7 +170,7 @@ @endforeach - + @break @@ -288,7 +288,7 @@
-

Add Doctors

+

Add Attendee

{{--
--}}
@@ -475,7 +475,7 @@ $('.doctor-group-wrapper').show(); - // आधीचे सर्व जनरेट झालेले ग्रुप्स साफ करा + $('.execution-doctor-group-wrapper').empty(); if (attendees <= 0) { @@ -502,6 +502,8 @@ '
' + doctor_html + '
' ); + updateDoctorOptions(); + (function(c) { $('#field-hcp_name_' + c).change(function() { @@ -510,7 +512,7 @@ $('#field-pcode_of_wrapper_doctor_' + c).val(selectedOption.attr('msl_code')); - // २. सर्वात महत्त्वाचे: या ड्रॉपडाउनची 'value' बदलून थेट डॉक्टरांचे 'नाव' सेट करा + let doctorName = selectedOption.text().trim(); if(doctorName !== "" && doctorName !== "-- Select --") { selectedOption.val(doctorName); @@ -521,6 +523,60 @@ }); + function updateDoctorOptions() { + + let selectedDoctors = []; + + $('[id^="field-hcp_name"]').each(function () { + let val = $(this).val(); + if (val) { + selectedDoctors.push(val); + } + }); + + $('[id^="field-hcp_name"]').each(function () { + + let currentValue = $(this).val(); + + $(this).find('option').each(function () { + + let optionValue = $(this).val(); + + if ( + optionValue && + optionValue !== currentValue && + selectedDoctors.includes(optionValue) + ) { + $(this).prop('disabled', true); + } else { + $(this).prop('disabled', false); + } + + }); + + }); + } + + $(document).on('change', '[id^="field-hcp_name"]', function () { + + let currentVal = $(this).val(); + + let duplicate = false; + + $('[id^="field-hcp_name"]').not(this).each(function () { + if ($(this).val() === currentVal && currentVal !== '') { + duplicate = true; + } + }); + + if (duplicate) { + alert('This doctor is already selected.'); + $(this).val(''); + } + + updateDoctorOptions(); + }); + $('#field-hcp_name').change(function() { $('#field-pcode_of_wrapper_doctor').val($('option:selected', this).attr('msl_code')) }) @@ -562,6 +618,7 @@ $('#execution-plan_date').prop('readonly', true); $('#execution-msl_code').prop('readonly',true); $('#execution-expected_no_of_attendees').prop('readonly',true); + $('#execution-name_of_additional_speaker').prop('readonly',true); let contacts = document.getElementById('execution-contact_id'); @@ -615,6 +672,10 @@ $('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').parent().hide(); $('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').attr('required',false); + document.querySelectorAll('[id^="field-pcode_of_wrapper_doctor"]') + .forEach(function(el) { + el.readOnly = true; + }); })