From f224b18fd19650774ee8c89542adb73ab787a4ad Mon Sep 17 00:00:00 2001 From: zeeshan Date: Thu, 17 Sep 2026 09:34:45 +0530 Subject: [PATCH] Team 4 (2 Form Changes) --- ...a95a-2dd2-42ce-8686-72dfe2cd37f7.blade.php | 397 ++++++++++++++---- ...f5ac-f7a7-477b-926f-62a066a6c718.blade.php | 120 +++--- 2 files changed, 375 insertions(+), 142 deletions(-) diff --git a/resources/views/form/rapport-team4/1788175239-76b9a95a-2dd2-42ce-8686-72dfe2cd37f7.blade.php b/resources/views/form/rapport-team4/1788175239-76b9a95a-2dd2-42ce-8686-72dfe2cd37f7.blade.php index 7108d89d..bb7f21ca 100644 --- a/resources/views/form/rapport-team4/1788175239-76b9a95a-2dd2-42ce-8686-72dfe2cd37f7.blade.php +++ b/resources/views/form/rapport-team4/1788175239-76b9a95a-2dd2-42ce-8686-72dfe2cd37f7.blade.php @@ -1,100 +1,333 @@ - @include('layouts.shared/title-meta', ['title' => "History"]) + @include('layouts.shared/title-meta', ['title' => "Form"]) @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + - +
+ processing... +
+
+
+
+
+ + @if(Session::has('error'))
{{Session::get('error')}}
+
@endif + @if(session('success'))
{{ session('success') }} +
+
@endif +
+

{{$form->title}}

+
+ @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) +
+ @if($form->link_type == 'form') + View History + @else + Back + @endif +
+ @endif + @if(isset($form->user_info)) +
+
Submitted By: {{$form->user_info->name}}
+
+ @endif +
+ + + + @csrf + @if($id) + + @endif + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) +
+ + + +
+ @endif + + + @foreach($questions as $question) +
+ + @switch($question->type) + @case('hidden') + + @break + @case('text') + @case('email') + @case('tel') + @case('date') + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}"> + @break + @case('number') + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}"> + @break + @case('textarea') + + @break + @case('dropdown') + + @break + @case('checkbox') + @foreach($question->options as $option) +
+ value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}> + +
+ @endforeach + @break + @case('file') + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) + required == 'yes'?'required':'' }}> + @elseif(isset($question->value)) + + @endif + + @break + @case('multitextbox') +
+ @foreach($question->options as $option) +
{{$option->display}}
+
+ +
+ @endforeach +
+ @break + + @case('time') + required == 'yes' ? 'required' : ''}} + value="{{isset($question->value) ? $question->value : ''}}"> + @break + + @endswitch +
+ @endforeach + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) +
+ +
+ @endif +
-
-
+
+
+ -
-
- + + + + + - - - - + + - @include('layouts.shared/footer-script') + +@include('layouts.shared/footer-script') + + + + \ No newline at end of file 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 56375302..a0166d65 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,45 @@ @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 +251,9 @@
@endif
- {{-- @else + @else

You have submitted 20 Doctors

- @endif --}} + @endif @@ -298,43 +299,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 +374,7 @@ } // 🔥 NEW - Disable doctors already submitted by this user - /* preventDuplicateDoctors(); */ + preventDuplicateDoctors(); }, }); @@ -440,7 +441,6 @@ var yyyy = today.getFullYear(); today = yyyy + '-' + mm + '-' + dd; - //date field min and max var conversionDateField = document.getElementById('field-record_date');