diff --git a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php index 7b544e0c..92016b8b 100644 --- a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php +++ b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php @@ -116,7 +116,7 @@ @endif @foreach ($questions as $question) - @if (in_array($question->code, ['record_date', 'name_of_the_speaker', 'msl_code', 'attendence','speciality','honorarium_amount','other_expenses','total_eas','no_of_patients_on_duolin','no_of_units_duolin_respules','other_msl_code','other_speciality','other_speaker_name'])) + @if (in_array($question->code, ['record_date', 'attendence','honorarium_amount','other_expenses','total_eas','no_of_patients_on_duolin','no_of_units_duolin_respules'])) @continue @endif
@@ -155,14 +155,40 @@ @break @case('dropdown') - required == 'yes' ? 'required' : '' }}> - @foreach ($question->options as $option) - - @endforeach + @if ($question->code == 'name_of_the_speaker') + @foreach ($question->options as $option) + @if( isset($option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors) && $option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors == 'Yes' ) + + @endif + @endforeach + + + @elseif ($question->code == 'other_speaker_name') + @foreach ($question->options as $option) + @if(!isset($option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors) || + $option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors === null + ) + + @endif + @endforeach + + @else + @foreach ($question->options as $option) + + @endforeach + @endif @break @@ -235,41 +261,40 @@ @case('dropdown') + {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}> + {{ $option->display }} + + @endif + @endforeach + + @else + @foreach ($question->options as $option) + + @endforeach + @endif + @break @case('checkbox') @@ -393,6 +418,47 @@ $('#execution-form-wrapper').hide() }) + + $('#field-msl_code,#field-speciality,#field-other_msl_code,#field-other_speciality').attr('readonly',true); + + $('#field-name_of_the_speaker').change(function() { + let value=$(this).val(); + if(value==='other'){ + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').parent().show(); + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').attr('required',true); + + $('#field-msl_code,#field-speciality').parent().hide(); + $('#field-msl_code,#field-speciality').attr('required',false); + } + else{ + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').parent().hide(); + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').attr('required',false); + $('#field-msl_code,#field-speciality').parent().show(); + $('#field-msl_code,#field-speciality').attr('required',true); + } + }) + + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').parent().hide(); + $('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name').attr('required',false); + + $('#field-name_of_the_speaker').change(function() { + $('#field-msl_code').val($('option:selected', this).attr('msl_code')) + }) + + $('#field-name_of_the_speaker').change(function() { + $('#field-speciality').val($('option:selected', this).attr('speciality')) + }) + + $('#field-other_speaker_name').change(function() { + $('#field-other_msl_code').val($('option:selected', this).attr('msl_code')) + }) + + $('#field-other_speaker_name').change(function() { + $('#field-other_speciality').val($('option:selected', this).attr('speciality')) + }) + + + $('.edit-btn').click(function() { let selected = JSON.parse($(this).attr('plan_details')) /*for (let k of Object.keys(selected)) { @@ -450,7 +516,7 @@ let type_of_meet=$('#execution-type_of_meeting').val(); console.log("Type of Meet without change",type_of_meet); - if(type_of_meet==='Asthma camp'){ + if(type_of_meet==='GNP Camp'){ $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); @@ -463,26 +529,11 @@ } - $('#execution-name_of_the_speaker').change(function() { - $('#execution-msl_code').val($('option:selected', this).attr('msl_code')) - }) - $('#execution-name_of_the_speaker').change(function() { - $('#execution-speciality').val($('option:selected', this).attr('speciality')) - }) - - $('#execution-other_speaker_name').change(function() { - $('#execution-other_msl_code').val($('option:selected', this).attr('msl_code')) - }) - - $('#execution-other_speaker_name').change(function() { - $('#execution-other_speciality').val($('option:selected', this).attr('speciality')) - }) - }) - $('#execution-msl_code,#execution-speciality,#execution-other_msl_code,#execution-other_speciality').attr('readonly',true); + $('#execution-msl_code,#execution-speciality,#execution-other_msl_code,#execution-other_speciality').attr('readonly',true); - $('#execution-name_of_the_speaker').change(function() { + $('#execution-name_of_the_speaker').change(function() { let value=$(this).val(); if(value==='other'){ $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().show(); @@ -497,7 +548,7 @@ $('#execution-msl_code,#execution-speciality').parent().show(); $('#execution-msl_code,#execution-speciality').attr('required',true); } - }) + }) jQuery(document).ready(function($) { $('#field-user_id').change(function(){ diff --git a/resources/views/form/rapport-team3/preview-1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php b/resources/views/form/rapport-team3/preview-1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php new file mode 100644 index 00000000..7b22617a --- /dev/null +++ b/resources/views/form/rapport-team3/preview-1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php @@ -0,0 +1,450 @@ + + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ + + +@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 + + + + +
+
+
+
+
+
+ + @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 + + @endswitch +
+ @endforeach + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != + 'yes' ) ) +
+ +
+ @endif +
+ +
+
+ + + + +
+
+ +
+ +
+ + + @include('layouts.shared/footer-script') + + + + + + \ No newline at end of file