diff --git a/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php b/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php index fbefe00c..ab920fb6 100644 --- a/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php +++ b/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php @@ -93,7 +93,8 @@ @endphp - @if(count($submissions)===0 || $id) + + {{-- @if(count($submissions)===0 || $id) --}}
@csrf @@ -175,17 +176,17 @@ @endif
+ {!! $question->required == 'yes' ? '*' : '' !!} + @switch($question->type) @case('hidden') @endif - @elseif(!$id) + {{-- @elseif(!$id)

You have already submitted Voltido RCPA data for {{ count($submissions) }} Doctor(s).

- @endif + @endif --}}
@@ -806,7 +807,25 @@ preventDuplicateDoctors(filteredSubmittedDoctors); width: '100%', placeholder: '-- Select Doctor --' }); - preventDuplicateDoctors(); + /* preventDuplicateDoctors(); */ + + // ===== NEW CODE ===== + let activeSelections = []; + + $('select[id^="field-contact_id"]').each(function () { + let val = $(this).val(); + if (val) { + activeSelections.push(val); + } + }); + + let filteredSubmittedDoctors = + window.submittedDoctors.filter( + doctor => !activeSelections.includes(doctor) + ); + + preventDuplicateDoctors(filteredSubmittedDoctors); + // ===== END NEW CODE ===== $('select[id^="execution-"]').select2({ @@ -896,7 +915,7 @@ if ($('.doctor-wrapper').length < MAX_DOCTORS) { $('#report-form').on('submit', function(event) { event.preventDefault(); - @if(!$id) + /* @if(!$id) let totalDoctors = $('.doctor-wrapper').length; if (totalDoctors < MIN_DOCTORS || totalDoctors > MAX_DOCTORS) { @@ -909,7 +928,7 @@ if ($('.doctor-wrapper').length < MAX_DOCTORS) { return; } - @endif + @endif */ $("#pageloader").fadeIn(); $.ajax({