From 46d2d566b8e79c0c58c62dbbe461740f1aa00325 Mon Sep 17 00:00:00 2001 From: zeeshan Date: Mon, 10 Aug 2026 11:17:24 +0530 Subject: [PATCH] Team4 (Mother Forum Final Change) --- ...8ad9-1e71-4afa-9138-7787c06a7c7b.blade.php | 239 +++++++++--------- 1 file changed, 126 insertions(+), 113 deletions(-) diff --git a/resources/views/form/rapport-team4/1774621694-60538ad9-1e71-4afa-9138-7787c06a7c7b.blade.php b/resources/views/form/rapport-team4/1774621694-60538ad9-1e71-4afa-9138-7787c06a7c7b.blade.php index da22e849..f015d704 100644 --- a/resources/views/form/rapport-team4/1774621694-60538ad9-1e71-4afa-9138-7787c06a7c7b.blade.php +++ b/resources/views/form/rapport-team4/1774621694-60538ad9-1e71-4afa-9138-7787c06a7c7b.blade.php @@ -73,7 +73,7 @@ } @endphp - @if(count($submissions) < 1) + @if(count($submissions) < 2)
@@ -211,122 +211,122 @@ @endif - - - - @csrf - @if($id) - - @endif + + + + @csrf + @if($id) + + @endif - {{-- TM Contact: common field, outside doctor wrappers --}} -
- - -
+ {{-- TM Contact: common field, outside doctor wrappers --}} +
+ + +
- {{-- Manager select if applicable --}} - @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) -
- - - -
- @endif + {{-- Manager select if applicable --}} + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) +
+ + + +
+ @endif - {{-- Doctor Wrappers --}} - @for($i = 1; $i <= 3; $i++) -
-
Doctor {{$i}}
+ {{-- Doctor Wrappers --}} + @for($i = 1; $i <= 3; $i++) +
+
Doctor {{$i}}
- @foreach($questions as $question) + @foreach($questions as $question) - @php - $fieldName = $question->code; - if($i > 1){ - $fieldName = $question->code . '_' . $i; - } + @php + $fieldName = $question->code; + if($i > 1){ + $fieldName = $question->code . '_' . $i; + } - // Special case: first wrapper contact_id is stored as cont_id in formdata - $lookupName = $fieldName; - if($i == 1 && $question->code == 'contact_id'){ - $lookupName = 'cont_id'; - } + // Special case: first wrapper contact_id is stored as cont_id in formdata + $lookupName = $fieldName; + if($i == 1 && $question->code == 'contact_id'){ + $lookupName = 'cont_id'; + } - // Skip tm_contact because it's outside - if($question->code == 'tm_contact') continue; + // Skip tm_contact because it's outside + if($question->code == 'tm_contact') continue; - $value = isset($submissions[0]->formdata->{$lookupName}) - ? $submissions[0]->formdata->{$lookupName} - : ''; - @endphp + $value = isset($submissions[0]->formdata->{$lookupName}) + ? $submissions[0]->formdata->{$lookupName} + : ''; + @endphp -
- +
+ - @switch($question->type) - @case('text') - @case('email') - @case('tel') - @case('date') - @case('time') - @case('number') - - @break + @switch($question->type) + @case('text') + @case('email') + @case('tel') + @case('date') + @case('time') + @case('number') + + @break - @case('textarea') - - @break + @case('textarea') + + @break - @case('dropdown') - + + @foreach ($question->options as $option) + @php + $optionValue = $option->value; // default ID + if($i > 1 && $question->code == 'contact_id') { + $optionValue = $option->display; // use name for wrapper 2 & 3 + } + @endphp - -@endforeach - - @break - @endswitch -
+ + @endforeach + + @break + @endswitch +
- @endforeach -
- @endfor + @endforeach +
+ @endfor - {{-- Submit button --}} - {{-- @if(!$alreadySubmitted && (!isset($form->is_approval) || $form->is_approval != 'yes')) --}} -
- -
- {{-- @endif --}} -
+ {{-- Submit button --}} + {{-- @if(!$alreadySubmitted && (!isset($form->is_approval) || $form->is_approval != 'yes')) --}} +
+ +
+ {{-- @endif --}} + @else
@@ -431,6 +431,10 @@ } }) + $('#field-month').val('August'); + + + $('#field-month').css({'pointer-events': 'none','background-color': '#e9ecef'}).attr('tabindex', '-1'); // $('#field-contact_id').append(''); @@ -483,19 +487,19 @@ return; } - let totalWrappers = $('.doctor-wrapper').length; + let totalWrappers = $('.doctor-wrapper').length; - if (totalWrappers < 3) { - event.preventDefault(); + if (totalWrappers < 3) { + event.preventDefault(); - Swal.fire({ - icon: 'error', - title: 'Incomplete Form', - text: 'Please add all 3 doctors before submitting.' - }); + Swal.fire({ + icon: 'error', + title: 'Incomplete Form', + text: 'Please add all 3 doctors before submitting.' + }); - return false; - } + return false; + } const formData = new FormData($('#report-form')[0]); // Log form data to console @@ -539,7 +543,7 @@ var plandateField = document.getElementById('field-record_date'); - plandateField.setAttribute('max', today); + //plandateField.setAttribute('max', today); }); @if(!$id) @@ -629,6 +633,11 @@ for (let i = 2; i <= 3; i++) { // numbering starts at 2 // 👉 Append clone $clone.insertAfter($('.doctor-wrapper').last()); + + $('#field-month_2').val('August'); +$('#field-month_3').val('August'); + +$('#field-month_2, #field-month_3').css({'pointer-events': 'none','background-color': '#e9ecef'}).attr('tabindex', '-1'); } // 👉 Remove add button completely @@ -885,6 +894,10 @@ $(document).on('change', '[id^=field-contact_id]', function () { $wrapper.find('[id^=field-legacy_code]').val(''); } }); + + + + @endif