diff --git a/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php b/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php index 845ce6e5..19492ffe 100644 --- a/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php +++ b/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php @@ -62,7 +62,7 @@ @endphp - @if(count($submissions)<20) + {{-- @if(count($submissions)<20) --}}
@csrf @@ -118,44 +118,44 @@ @break @case('dropdown') - required == 'yes'?'required':'' }}> - + - @foreach($question->options as $option) + @foreach($question->options as $option) - {{-- 🔥 NEW: Check whether this doctor was already submitted --}} - @php - $alreadySubmitted = in_array( - (string) $option->value, - $historyDoctorIds - ); - @endphp + {{-- 🔥 NEW: Check whether this doctor was already submitted --}} + @php + $alreadySubmitted = in_array( + (string) $option->value, + $historyDoctorIds + ); + @endphp - + - @endforeach - - @break + @endforeach + + @break @case('radio') @foreach($question->options as $option)
@@ -250,9 +250,9 @@
@endif
- @else + {{-- @else

You have submitted 20 Doctors

- @endif + @endif --}} @@ -298,43 +298,43 @@ // 🔥 NEW - Disable doctors that were already submitted // NEW - DEBUG duplicate doctor check // 🔥 NEW - Disable previously submitted doctors -function preventDuplicateDoctors() { + /* function preventDuplicateDoctors() { - $('#field-contact_id option').each(function () { + $('#field-contact_id option').each(function () { - let option = $(this); - let doctorId = String(option.val()); + let option = $(this); + let doctorId = String(option.val()); - if (!doctorId) { - return; - } + if (!doctorId) { + return; + } - // Remove old label first - let cleanText = option.text() - .replace(' (Already Submitted)', ''); + // Remove old label first + let cleanText = option.text() + .replace(' (Already Submitted)', ''); - console.log( - "Doctor ID:", - doctorId, - "History IDs:", - historyDoctorIds - ); + console.log( + "Doctor ID:", + doctorId, + "History IDs:", + historyDoctorIds + ); - if (historyDoctorIds.includes(doctorId)) { + if (historyDoctorIds.includes(doctorId)) { - // 🔥 Disable doctor - option.prop('disabled', true); + // 🔥 Disable doctor + option.prop('disabled', true); - // 🔥 Show label - option.text(cleanText + ' (Already Submitted)'); + // 🔥 Show label + option.text(cleanText + ' (Already Submitted)'); - } else { + } else { - option.prop('disabled', false); - option.text(cleanText); - } - }); -} + option.prop('disabled', false); + option.text(cleanText); + } + }); + } */ $('#field-user_id').change(function(){ let hierarchy = $('option:selected', this).attr('hierarchy'); @@ -373,7 +373,7 @@ function preventDuplicateDoctors() { } // 🔥 NEW - Disable doctors already submitted by this user - preventDuplicateDoctors(); + /* preventDuplicateDoctors(); */ }, });