From 426a525f7ab7ebc1291055af7d000b21608660eb Mon Sep 17 00:00:00 2001 From: zeeshan Date: Wed, 3 Jun 2026 18:05:03 +0530 Subject: [PATCH] Team 4 (Preview) --- ...e0eb-680e-4855-b4fd-4472099dfcd9.blade.php | 10 +- ...e0eb-680e-4855-b4fd-4472099dfcd9.blade.php | 135 ++++++++++-------- 2 files changed, 80 insertions(+), 65 deletions(-) diff --git a/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php b/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php index eb54f190..6a93ea9c 100644 --- a/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php +++ b/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php @@ -342,14 +342,18 @@ foreach ($brands as $brand) { title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }) - $('#report-form').trigger("reset"); + }).then(() => { + location.reload(); // page reload + }); + //$('#report-form').trigger("reset"); } else { Swal.fire({ icon: 'error', title: 'Data not submitted', text: 'Something went wrong, please try again after some time!' - }) + }).then(() => { + location.reload(); // page reload + }); } }, }); diff --git a/resources/views/form/rapport-team4/preview-1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php b/resources/views/form/rapport-team4/preview-1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php index 34d421ed..5ccf65ee 100644 --- a/resources/views/form/rapport-team4/preview-1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php +++ b/resources/views/form/rapport-team4/preview-1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php @@ -38,6 +38,24 @@
Submitted By: {{$form->user_info->name}}
@endif + + @php + /* echo "
";
+                            print_r($submitted_formdata);
+                            echo "
"; */ + $skuData = []; + + foreach($questions as $q){ + if($q->code === 'sku'){ + foreach($q->options as $opt){ + $skuData[$opt->value] = $opt->submitted_value ?? 0; + } + } + } + + @endphp + +
@@ -61,6 +79,9 @@ @foreach($questions as $question) + @if (in_array($question->code, ['execution_date','executed_as_per_plan' ,'revised_start_time','patient_screened','patients_diagnosed','rxn_of_montair_lc_adult','rxn_of_montair_lc_kid_tab','rxn_of_montair_lc_kid_syrup','rxn_of_furamist','rxn_of_furamist_az','total_rxns'])) + @continue + @endif
@switch($question->type) @@ -82,19 +103,33 @@ @case('dropdown') @break @case('checkbox') @@ -113,7 +148,7 @@ @endif @break - @case('multitextbox') + {{-- @case('multitextbox')
@foreach($question->options as $option)
{{$option->display}}
@@ -122,17 +157,23 @@
@endforeach
- @break - - @case('time') - required == 'yes' ? 'required' : ''}} - value="{{isset($question->value) ? $question->value : ''}}"> - @break - + @break --}} + + @case('multitextbox') +
+ @foreach($question->options as $option) +
{{ $option->display }}
+
+ +
+ @endforeach +
+ @break @endswitch @endforeach @@ -182,7 +223,6 @@ let hierarchy = $('option:selected', this).attr('hierarchy'); $('#field-hierarchy_id').val(hierarchy) event.preventDefault(); - $("#pageloader").fadeIn(); $.ajax({ type: "GET", url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy, @@ -193,16 +233,12 @@ $('#field-contact_id').html('') $('#field-contact_id').append($("").attr("value",'').text('-- Select --')); for (let itm of data) { - $('#field-contact_id').append($("").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality)); + $('#field-contact_id').append($("").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code)); } $('#field-contact_id').change(function() { $('#field-msl_code').val($('option:selected', this).attr('msl_code')) - }) - - $('#field-contact_id').change(function() { - $('#field-speciality').val($('option:selected', this).attr('speciality')) - }) + }) }, }); @@ -217,52 +253,29 @@ $('#field-msl_code').val($('option:selected', this).attr('msl_code')) }) - $('#field-msl_code,#field-speciality').attr('readonly',true); - - $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false}); $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide(); - $('#field-contact_id').on('change',function(){ - let dropDown=$('#field-contact_id').val(); - if(dropDown==='others'){ - $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().show(); - $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":true}); - $('#field-speciality,#field-msl_code').parent().hide(); - $('#field-speciality,#field-msl_code').prop({"required":false}); - } - else{ - $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide(); - $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false}); - $('#field-speciality,#field-msl_code').parent().show(); - $('#field-speciality,#field-msl_code').prop({"required":true}); + - } - }) - - $('#field-contact_id').append(''); - $('#field-sitazit_d_rx,#field-sitazit_dm_rx,#field-ziten_m_rx').on('input', function() { - var total=( - (parseInt($('#execution-sitazit_d_rx').val())*15 ||0)+ - (parseInt($('#execution-sitazit_dm_rx').val())*25 ||0)+ - (parseInt($('#execution-ziten_m_rx').val())*35 ||0) - ); - - $('#execution-total_camp_rx').val(total) - }) + $('#report-form').on('submit', function(event){ event.preventDefault(); + const formData = new FormData($('#report-form')[0]); + // Log form data to console for (let [key, value] of formData.entries()) { console.log(key, value); } + + $("#pageloader").fadeIn(); $.ajax({ type: "POST", @@ -277,9 +290,7 @@ title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }).then(() => { - location.reload(); // 🔥 page refresh here - }); + }) $('#report-form').trigger("reset"); } else { Swal.fire({