diff --git a/resources/views/form/rapport-copd/1780297253-4b6e680c-f3a0-47f3-9375-04f5bdf52dd4.blade.php b/resources/views/form/rapport-copd/1780297253-4b6e680c-f3a0-47f3-9375-04f5bdf52dd4.blade.php index 3c94a4b8..8755c3ff 100644 --- a/resources/views/form/rapport-copd/1780297253-4b6e680c-f3a0-47f3-9375-04f5bdf52dd4.blade.php +++ b/resources/views/form/rapport-copd/1780297253-4b6e680c-f3a0-47f3-9375-04f5bdf52dd4.blade.php @@ -209,8 +209,12 @@ @endif
+ class="form-label">{{$question->question}} @if($question->code=='contact_id') + {{ $i + 1 }} + @endif{!!$question->required == 'yes' ? + '*':''!!} + + @switch($question->type) @case('hidden') + + + @include('layouts.shared/title-meta', ['title' => "History"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+
+ + +
+
+

{{$formname}}

+
+ +
+ + @if(session()->has('message')) +
+ {{ session()->get('message') }} +
+ @endif + @if(session()->has('error')) +
+ {{ session()->get('error') }} +
+ @endif +
+
+
+
+
+
+
+ + + + + @foreach($questions as $code => $question) + @if($question->type == 'hidden') + @continue; + @endif + @if($question->type == 'multitextbox') + @foreach($question->options as $k => $v) + + @endforeach + @else + + @endif + @endforeach + + + + + @foreach($submissions as $submission) + + + @foreach($questions as $code => $question) + @if($question->type == 'hidden') + @continue; + @endif + @if($question->type == 'file') + + + @elseif($question->type == 'radiometrix' && isset($submission->formdata->{$code}) && is_object($submission->formdata->{$code})) + + + @elseif($question->type == 'multitextbox') + @foreach($question->options as $k => $v) + @php + $optKey = is_object($v) ? ($v->value ?? $k) : $k; + $optVal = ''; + if (isset($submission->formdata->{$optKey})) { + $raw = $submission->formdata->{$optKey}; + $optVal = is_array($raw) ? implode(', ', $raw) : (is_object($raw) ? json_encode($raw) : $raw); + } elseif (isset($submission->formdata->{$code}) && (is_object($submission->formdata->{$code}) || is_array($submission->formdata->{$code}))) { + $box = (array) $submission->formdata->{$code}; + if (array_key_exists($optKey, $box)) { + $raw = $box[$optKey]; + $optVal = is_array($raw) ? implode(', ', $raw) : (is_object($raw) ? json_encode($raw) : $raw); + } + } + @endphp + + @endforeach + + @elseif(count((array)$question->options) > 0 && 1==2 ) + + @else + + @endif + @endforeach + + + @endforeach + +
Submission Date{{ is_object($v) ? ($v->display ?? $v->label ?? $k) : $v }} ({{$question->label}}){{$question->label}}Action
{{date("d M Y", strtotime($submission->updatedAt))}} Download + {{ collect((array)$submission->formdata->{$code})->map(function($val, $key){ return "$key: $val"; })->implode(', ') }} + {{ $optVal }}{{ $question->options->{ $submission->formdata->{$code} } }}{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) : (is_object($submission->formdata->{$code}) ? collect((array)$submission->formdata->{$code})->map(function($val, $key){ return "$key: $val"; })->implode(', ') : $submission->formdata->{$code}) : '' }} + @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 ) + @if($submission->workflow == 'yes' && $submission->workflow_status == 'approved' ) +

Approved

+ @else + {{-- Edit --}} + @if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') + Delete + @endif + @endif + @endif +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ + @include('layouts.shared/footer-script') + + \ No newline at end of file diff --git a/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php b/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php new file mode 100644 index 00000000..ab920fb6 --- /dev/null +++ b/resources/views/form/rapport-copd/1785317381-d72b4330-0fad-49a3-913c-98d978cf22f1.blade.php @@ -0,0 +1,966 @@ + + + + + @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 + + @php + $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); + $submissions = $submissions->data->submissions; + $submittedDoctors = collect($submissions)->map(function ($item) { + return $item->formdata->cont_id ?? null; + })->filter()->unique()->values()->toArray(); + + + @endphp + + {{-- @if(count($submissions)===0 || $id) --}} +
+ + @csrf + @if($id) + + @endif + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) +
+ + + +
+ @endif + @foreach($questions as $question) + @if( !in_array($question->code, + ["record_date"] ) ) + @continue; + @endif +
+ + @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 + @endswitch +
+ @endforeach +
+

+ Doctor 1 +

+ + + + @foreach($questions as $question) + @if( in_array($question->code, + ["record_date","select_rxber_type"] ) ) + @continue; + @endif +
+ + @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') + @if ($question->code == 'contact_id') + + @else + + @endif + @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 + @endswitch +
+ {{-- Added this Heading/label for brands --}} + @if($question->code == 'speciality') +
Enter Monthly Rx of Competition Brand
+ @endif + @endforeach +
+
+ +
+ @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != + 'yes' ) ) +
+ @if(!$id) + + @endif + +
+ @endif +
+ {{-- @elseif(!$id) +

+ You have already submitted Voltido RCPA data for {{ count($submissions) }} Doctor(s). + +

+ @endif --}} +
+
+ + + + +
+
+ +
+ +
+ + + @include('layouts.shared/footer-script') + + + + + + diff --git a/resources/views/form/rapport-copd/1786536014-1de0e688-9b34-483f-9b79-871a5a9641b6.blade.php b/resources/views/form/rapport-copd/1786536014-1de0e688-9b34-483f-9b79-871a5a9641b6.blade.php new file mode 100644 index 00000000..4043ec0b --- /dev/null +++ b/resources/views/form/rapport-copd/1786536014-1de0e688-9b34-483f-9b79-871a5a9641b6.blade.php @@ -0,0 +1,385 @@ + + + + @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') + + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-iva/1714829109-b695430a-48aa-424e-9e50-6704e933380c.blade.php b/resources/views/form/rapport-iva/1714829109-b695430a-48aa-424e-9e50-6704e933380c.blade.php index d98edd08..e2141df7 100644 --- a/resources/views/form/rapport-iva/1714829109-b695430a-48aa-424e-9e50-6704e933380c.blade.php +++ b/resources/views/form/rapport-iva/1714829109-b695430a-48aa-424e-9e50-6704e933380c.blade.php @@ -453,7 +453,7 @@ // console.log("day = ",day) // console.log("month = ",month) // console.log("year = ",year) - let minDateStr = year + '/' + month + '/' + day; + /* let minDateStr = year + '/' + month + '/' + day; let maxDateStr = year + '/' + month + '/' + day; // console.log("minDateStr = ",minDateStr) @@ -461,12 +461,22 @@ // let minDate = new Date(new Date(minDate).getTime()+(9*24*60*60*1000)) let minDate = new Date (today - (30*24*60*60*1000)); - minDateStr = minDate.getFullYear() + '/' + String(minDate.getMonth() + 1).padStart(2, '0') + '/' + String(minDate.getDate()).padStart(2, '0'); + minDateStr = minDate.getFullYear() + '/' + String(minDate.getMonth() + 1).padStart(2, '0') + '/' + String(minDate.getDate()).padStart(2, '0'); */ // console.log("minDate = ",minDate) // console.log("minDateStr = ",minDateStr) //Setting min, max dates and value to Datepicker... + + // Minimum date = 1 April of current year +let minDateStr = year + '/04/01'; + +// Maximum date = Today +let maxDateStr = year + '/' + month + '/' + day; + +console.log("minDateStr =", minDateStr); +console.log("maxDateStr =", maxDateStr); + $('#field-record_date').flatpickr({ minDate: minDateStr, maxDate: maxDateStr, diff --git a/resources/views/form/rapport-pulmocare/1784533027-3b12705e-bcd1-4910-b7aa-1c54b4b64135.blade.php b/resources/views/form/rapport-pulmocare/1784533027-3b12705e-bcd1-4910-b7aa-1c54b4b64135.blade.php index bffa3418..54ecbd50 100644 --- a/resources/views/form/rapport-pulmocare/1784533027-3b12705e-bcd1-4910-b7aa-1c54b4b64135.blade.php +++ b/resources/views/form/rapport-pulmocare/1784533027-3b12705e-bcd1-4910-b7aa-1c54b4b64135.blade.php @@ -242,7 +242,7 @@ $('#field-pob_units').on('input', function() { var total=( (parseInt($('#field-pob_units').val())*11.4 ||0) - ); + ).toFixed(2); $('#field-pob_value').val(total) }) diff --git a/resources/views/form/rapport-pulmocare/1784711349-38c6aeb9-1a07-403e-b893-8a5c1868da6d.blade.php b/resources/views/form/rapport-pulmocare/1784711349-38c6aeb9-1a07-403e-b893-8a5c1868da6d.blade.php new file mode 100644 index 00000000..72c5df26 --- /dev/null +++ b/resources/views/form/rapport-pulmocare/1784711349-38c6aeb9-1a07-403e-b893-8a5c1868da6d.blade.php @@ -0,0 +1,544 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ +@php +$brandData = [ + +//['brand'=>'Pulmosmart G', 'slug'=>'pulmosmart_g_units','pseudoId'=>'pulmosmart_g_value'], +['brand'=>"200 PULMICAPS (30'S)", 'slug'=>'200_pulmicaps_30s_units','pseudoId'=>'200_pulmicaps_30s_value'], +['brand'=>"400 PULMICAPS (30'S)", 'slug'=>'400_pulmicaps_30s_units','pseudoId'=>'400_pulmicaps_30s_value'], +['brand'=>'DOSE COUNTER MDI 200 INHALER', 'slug'=>'dose_counter_mdi_200_inhaler_units','pseudoId'=>'dose_counter_mdi_200_inhaler_value'], +['brand'=>'DOSE COUNTER MDI 400 INHALER', 'slug'=>'dose_counter_mdi_400_inhaler_units','pseudoId'=>'dose_counter_mdi_400_inhaler_value'], +['brand'=>'PULMULES (2 ML)', 'slug'=>'pulmules_2_ml_units','pseudoId'=>'pulmules_2_ml_value'], +['brand'=>'1MG PULMULES (2 ML)', 'slug'=>'1mg_pulmules_2_ml_units','pseudoId'=>'1mg_pulmules_2_ml_value'] + + + +]; + +@endphp + +@php + $submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id); + + + $formdata = null; + +if (!empty($submissions->data->submissions)) { + foreach ($submissions->data->submissions as $submission) { + if ($submission->id == $id) { + $formdata = $submission->formdata ?? null; + break; + } + } +} + +@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 + + @php + $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); + $submissions = $submissions->data->submissions; + + + + @endphp + +
+ + + + @csrf + @if($id) + + @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($brandData as $brand) + + + + + + + + @endforeach + +
BrandUnits
{{ $brand['brand'] }} + +
+
+ + +
+ @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') + + + + + + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-pulmocare/1784801601-237d9454-d2c1-4de6-8880-ebc68bac9231.blade.php b/resources/views/form/rapport-pulmocare/1784801601-237d9454-d2c1-4de6-8880-ebc68bac9231.blade.php new file mode 100644 index 00000000..8e8c18bc --- /dev/null +++ b/resources/views/form/rapport-pulmocare/1784801601-237d9454-d2c1-4de6-8880-ebc68bac9231.blade.php @@ -0,0 +1,399 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ +@php +$brandData = [ + +//['brand'=>'Pulmosmart G', 'slug'=>'pulmosmart_g_units','pseudoId'=>'pulmosmart_g_value'], +['brand'=>"200 PULMICAPS (30'S)", 'slug'=>'200_pulmicaps_30s_units','pseudoId'=>'200_pulmicaps_30s_value'], +['brand'=>"400 PULMICAPS (30'S)", 'slug'=>'400_pulmicaps_30s_units','pseudoId'=>'400_pulmicaps_30s_value'], +['brand'=>'DOSE COUNTER MDI 200 INHALER', 'slug'=>'dose_counter_mdi_200_inhaler_units','pseudoId'=>'dose_counter_mdi_200_inhaler_value'], +['brand'=>'DOSE COUNTER MDI 400 INHALER', 'slug'=>'dose_counter_mdi_400_inhaler_units','pseudoId'=>'dose_counter_mdi_400_inhaler_value'], +['brand'=>'PULMULES (2 ML)', 'slug'=>'pulmules_2_ml_units','pseudoId'=>'pulmules_2_ml_value'], +['brand'=>'1MG PULMULES (2 ML)', 'slug'=>'1mg_pulmules_2_ml_units','pseudoId'=>'1mg_pulmules_2_ml_value'] + + + +]; + +@endphp + +@php + $submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id); + + + $formdata = null; + +if (!empty($submissions->data->submissions)) { + foreach ($submissions->data->submissions as $submission) { + if ($submission->id == $id) { + $formdata = $submission->formdata ?? null; + break; + } + } +} + +@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 + + @php + $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); + $submissions = $submissions->data->submissions; + + + + @endphp + +
+ + + + @csrf + @if($id) + + @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($brandData as $brand) + + + + + + + + @endforeach + +
BrandUnits
{{ $brand['brand'] }} + +
+
+ + +
+ @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') + + + + + + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-pulmocare/1785478799-c8848bee-0fdd-4af1-8b21-450ee6fc0cc6.blade.php b/resources/views/form/rapport-pulmocare/1785478799-c8848bee-0fdd-4af1-8b21-450ee6fc0cc6.blade.php new file mode 100644 index 00000000..2f92a2f1 --- /dev/null +++ b/resources/views/form/rapport-pulmocare/1785478799-c8848bee-0fdd-4af1-8b21-450ee6fc0cc6.blade.php @@ -0,0 +1,544 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ +@php +$brandData = [ + +//['brand'=>'Pulmosmart G', 'slug'=>'pulmosmart_g_units','pseudoId'=>'pulmosmart_g_value'], +['brand'=>"200 PULMICAPS (30'S)", 'slug'=>'200_pulmicaps_30s_units','pseudoId'=>'200_pulmicaps_30s_value'], +['brand'=>"400 PULMICAPS (30'S)", 'slug'=>'400_pulmicaps_30s_units','pseudoId'=>'400_pulmicaps_30s_value'], +['brand'=>'DOSE COUNTER MDI 200 INHALER', 'slug'=>'dose_counter_mdi_200_inhaler_units','pseudoId'=>'dose_counter_mdi_200_inhaler_value'], +['brand'=>'DOSE COUNTER MDI 400 INHALER', 'slug'=>'dose_counter_mdi_400_inhaler_units','pseudoId'=>'dose_counter_mdi_400_inhaler_value'], +['brand'=>'PULMULES (2 ML)', 'slug'=>'pulmules_2_ml_units','pseudoId'=>'pulmules_2_ml_value'], +['brand'=>'1MG PULMULES (2 ML)', 'slug'=>'1mg_pulmules_2_ml_units','pseudoId'=>'1mg_pulmules_2_ml_value'] + + + +]; + +@endphp + +@php + $submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id); + + + $formdata = null; + +if (!empty($submissions->data->submissions)) { + foreach ($submissions->data->submissions as $submission) { + if ($submission->id == $id) { + $formdata = $submission->formdata ?? null; + break; + } + } +} + +@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 + + @php + $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); + $submissions = $submissions->data->submissions; + + + + @endphp + +
+ + + + @csrf + @if($id) + + @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($brandData as $brand) + + + + + + + + @endforeach + +
BrandUnits
{{ $brand['brand'] }} + +
+
+ + +
+ @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') + + + + + + + + + + \ No newline at end of file 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 46697a33..8c40024e 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 @@ -77,8 +77,8 @@ - + class="mdi mdi-pencil"> Execute + {{ isset($sub->formdata->record_date) && $sub->formdata->record_date > 0 ? 'Yes' : 'No' }} @@ -104,7 +104,7 @@ @csrf @foreach ($questions as $question) - @if (in_array($question->code, ['record_date', 'name_of_the_speaker', 'msl_code', 'attendence','speciality'])) + @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'])) @continue @endif
@@ -364,6 +364,40 @@ $('#form-wrapper').hide() $('#execution-form-wrapper').show() $('#table-wrapper').hide() + $('#execution-no_of_patients_on_duolin').attr('max',10); + + $('#execution-type_of_meeting').on('change',function(){ + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("Type of Meet",type_of_meet); + + if(type_of_meet==='Asthma 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) '); + + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + } + }) + + 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'){ + $('#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) '); + + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + + } }) jQuery(document).ready(function($) { @@ -438,20 +472,20 @@ var recordDateField = document.getElementById('field-plan_date'); recordDateField.setAttribute('min', today); - var executionDateField = document.getElementById('execution-plan_date'); - // executionDateField.setAttribute('min', today); + /* var executionDateField = document.getElementById('execution-plan_date'); + executionDateField.setAttribute('min', today); */ $('.edit-btn').click(function() { var executionexeField = document.getElementById('execution-record_date'); - executionexeField.setAttribute('min', executionDateField.value); + executionexeField.setAttribute('max', today); }); - executionDateField.addEventListener('change', function() { + /* executionDateField.addEventListener('change', function() { console.log('gg'); var executionexeField = document.getElementById('execution-record_date'); executionexeField.setAttribute('min', executionDateField.value); }); - + */ diff --git a/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php b/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php index c1b1446b..0c60dbff 100644 --- a/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php +++ b/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php @@ -187,7 +187,7 @@ @csrf @foreach ($questions as $question) - @if (in_array($question->code, ['record_date','attendence','new_continue','lta_regional','physical_virtual','yearly_honorarium','venue_av_food_etc_cost','total_eas_required'])) + @if (in_array($question->code, ['record_date','attendence','new_continue','lta_regional','physical_virtual','yearly_honorarium','venue_av_food_etc_cost','total_eas_required','no_of_patients_on_duolin','no_of_units_duolin_respules'])) @continue @endif
@@ -411,6 +411,35 @@ $('#execution-form-wrapper').show() $('#table-wrapper').hide() $('#execution-attendence').attr({min:"1"}); + $('#execution-no_of_patients_on_duolin').attr('max',10); + + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("type of meet",type_of_meet); + + if(type_of_meet==='Asthma 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) '); + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + + } + + $('#execution-type_of_meeting').on('change',function(){ + let type_of_meet=$('##execution-type_of_meeting').val(); + if(type_of_meet==='Asthma 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); + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + } + }) + }) @@ -529,18 +558,18 @@ // recordDateField.setAttribute('max', today); var executionDateField = document.getElementById('execution-plan_date'); - // executionDateField.setAttribute('min', today); + executionDateField.setAttribute('min', today); $('.edit-btn').click(function() { var executionexeField = document.getElementById('execution-record_date'); - executionexeField.setAttribute('min', executionDateField.value); + executionexeField.setAttribute('max', today); }); - executionDateField.addEventListener('change', function() { + /* executionDateField.addEventListener('change', function() { console.log('gg'); var executionexeField = document.getElementById('execution-record_date'); executionexeField.setAttribute('min', executionDateField.value); - }); + }); */ diff --git a/resources/views/form/rapport-team3/1655458548-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac8.blade.php b/resources/views/form/rapport-team3/1655458548-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac8.blade.php index 1f0e6527..b86d1877 100644 --- a/resources/views/form/rapport-team3/1655458548-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac8.blade.php +++ b/resources/views/form/rapport-team3/1655458548-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac8.blade.php @@ -55,7 +55,7 @@ Execution Date Name of speaker MSL Code - No. og Doctors/Paramedics attended + No of Attendees @@ -65,7 +65,15 @@ @endphp - + @if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes') Executed + + @else + + @endif + {{(isset($sub->formdata->record_date) && $sub->formdata->record_date > 0) ?'Yes':'No' }} {{$sub->formdata->plan_date}} @@ -143,6 +151,7 @@ @csrf + @foreach($questions as $question)
@@ -245,6 +254,11 @@ }) $('.edit-btn').click(function(){ + $('#execution-plan_date').attr('readonly',true); + let contacts = document.getElementById('execution-type_of_meeting'); + contacts.addEventListener('mousedown', function(e) { + e.preventDefault(); + }) let selected = JSON.parse($(this).attr('plan_details')) for(let k of Object.keys(selected)) { if(selected[k] != '') @@ -333,14 +347,14 @@ $('.edit-btn').click(function() { var executionexeField = document.getElementById('execution-record_date'); - executionexeField.setAttribute('min', executionDateField.value); + executionexeField.setAttribute('max', today); }); - executionDateField.addEventListener('change', function() { + /* executionDateField.addEventListener('change', function() { console.log('gg'); var executionexeField = document.getElementById('execution-record_date'); executionexeField.setAttribute('min', executionDateField.value); - }); + }); */ }); diff --git a/resources/views/form/rapport-team3/1786346682-7ed41cf4-f562-4eb7-8d53-efedd0133f41.blade.php b/resources/views/form/rapport-team3/1786346682-7ed41cf4-f562-4eb7-8d53-efedd0133f41.blade.php new file mode 100644 index 00000000..0dd4ec7b --- /dev/null +++ b/resources/views/form/rapport-team3/1786346682-7ed41cf4-f562-4eb7-8d53-efedd0133f41.blade.php @@ -0,0 +1,321 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ + + + +@include('layouts.shared/footer-script') + + + + + + \ No newline at end of file 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..9e9652da 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,130 +73,130 @@ } @endphp - @if(count($submissions) < 1) + @if(count($submissions) < 3 ) -
- - - - @csrf - @if($id) - - @endif - @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) -
- - - -
- @endif - - - @foreach($questions as $question) + + + + + @csrf + @if($id) + + @endif + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
- - @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') - @if ($question->code == 'contact_id') - - @else - - @endif - @break - @case('checkbox') - @foreach($question->options as $option) -
- value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}> - -
+ + required == 'yes'?'required':'' }}> - @elseif(isset($question->value)) - - @endif - - @break - @case('multitextbox') -
+ + +
+ @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') + @if ($question->code == 'contact_id') + + @else + + @endif + @break + @case('checkbox') @foreach($question->options as $option) -
{{$option->display}}
-
- +
+ value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}> +
@endforeach -
- @break + @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 - + @case('time') + required == 'yes' ? 'required' : ''}} + value="{{isset($question->value) ? $question->value : ''}}"> + @break + @endswitch +
+ @endforeach + - @if(!$alreadySubmitted && (!isset($form->is_approval) || $form->is_approval != 'yes')) -
- -
- {{-- @else -
- You have already submitted this form for this month. -
--}} - @endif -
+ @if((!isset($form->is_approval) || $form->is_approval != 'yes')) +
+ +
+ {{-- @else +
+ You have already submitted this form for this month. +
--}} + @endif + @elseif($submissions[0]->workflow_status=='rejected') @if(!request()->has('edit')) @@ -212,125 +212,125 @@ @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
- You have already submitted this form + You have already submitted this forms
@endif @@ -431,6 +431,10 @@ } }) + $('#field-month').val('August'); + + + $('#field-month').css({'pointer-events': 'none','background-color': '#e9ecef'}).attr('tabindex', '-1'); // $('#field-contact_id').append(''); @@ -455,19 +459,19 @@ $('#field-expecteed_value_total').val(total) }) - $('#field-tm_contact').on('input', function () { - let mobile = $(this).val(); + $('#field-tm_contact').on('input', function () { + let mobile = $(this).val(); - // Allow only digits - mobile = mobile.replace(/\D/g, ''); + // Allow only digits + mobile = mobile.replace(/\D/g, ''); - // Limit to 10 digits - if (mobile.length > 10) { - mobile = mobile.slice(0, 10); - } + // Limit to 10 digits + if (mobile.length > 10) { + mobile = mobile.slice(0, 10); + } - $(this).val(mobile); - }); + $(this).val(mobile); + }); $('#report-form').on('submit', function(event){ event.preventDefault(); @@ -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 @@ -667,7 +676,7 @@ $(document).on('input', '[id^=field-expected_value_kid_tab], [id^=field-expected }); - --}} + + + + + @endif @if($id) @@ -885,6 +971,10 @@ $(document).on('change', '[id^=field-contact_id]', function () { $wrapper.find('[id^=field-legacy_code]').val(''); } }); + + + + @endif diff --git a/resources/views/form/rapport-team4/1785473498-ead8cd2d-1aa9-4585-af07-69dd3a2f692c.blade.php b/resources/views/form/rapport-team4/1785473498-ead8cd2d-1aa9-4585-af07-69dd3a2f692c.blade.php new file mode 100644 index 00000000..716c5639 --- /dev/null +++ b/resources/views/form/rapport-team4/1785473498-ead8cd2d-1aa9-4585-af07-69dd3a2f692c.blade.php @@ -0,0 +1,314 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + +
+ processing... +
+ + + + +@include('layouts.shared/footer-script') + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-titans/1781584303-cf62bee0-3c63-4070-9781-113989593655.blade.php b/resources/views/form/rapport-titans/1781584303-cf62bee0-3c63-4070-9781-113989593655.blade.php index facaa13d..1d14659e 100644 --- a/resources/views/form/rapport-titans/1781584303-cf62bee0-3c63-4070-9781-113989593655.blade.php +++ b/resources/views/form/rapport-titans/1781584303-cf62bee0-3c63-4070-9781-113989593655.blade.php @@ -54,7 +54,7 @@ } } - $isTaggingComplete = ($taggedDoctorCount == 20); + $isTaggingComplete = ($taggedDoctorCount > 0); @endphp @if($isTaggingComplete)
diff --git a/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php b/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php index 8bffa037..9f4db43f 100644 --- a/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php +++ b/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php @@ -54,7 +54,7 @@ } } - $isTaggingComplete = ($taggedDoctorCount == 20); + $isTaggingComplete = ($taggedDoctorCount > 0); @endphp @if($isTaggingComplete) diff --git a/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php b/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php index 7f5f89b5..d8fdf8db 100644 --- a/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php +++ b/resources/views/form/rapport-titans/1781589472-85f7118d-3199-483f-bbae-1b8f5d0f24e8.blade.php @@ -117,6 +117,19 @@ @if ($id) @endif + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) +
+ + + +
+ @endif + @foreach ($questions as $question) @if (in_array($question->code, ['execution_date','actual_no_of_attendees' ,'hcp_name','pcode_of_wrapper_doctor','speaker_name','venue','time','eas_id'])) @continue @@ -401,6 +414,53 @@ $('#field-eas_amt').on('input', function () { this.value = this.value.replace(/\D/g, ''); }); + $('#field-user_id').change(function(){ + 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, + processData: false, + contentType: false, + success: function( data ) { + $("#pageloader").fadeOut(); + $('#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)); + } + + /* New Code */ + let $doctorSelects = $('[id^="field-hcp_name"]'); + $doctorSelects.each(function() { + let $select = $(this); + $select.empty().append($("").attr("value", "").text("-- Select --")); + for (let itm of data) { + $select.append( + $("") + .attr("value", itm.value) + .text(itm.display) + .attr("msl_code", itm.contact ? itm.contact.msl_code : "") + .attr("speciality", itm.contact ? itm.contact.speciality : "") + ); + } + }); + /* End of New 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')) + }) + }, + }); + + console.log(hierarchy) + }) $('#form-wrapper').hide() $('#execution-form-wrapper').hide() var count = 1 @@ -648,6 +708,9 @@ }); + + + $('.edit-btn').click(function() { $('#execution-form-wrapper').show(100, () => { $('#add-camp-btn').hide(0); @@ -720,10 +783,109 @@ el.readOnly = true; }); + let hierarchy = selected['hierarchy_id'] || $('#field-hierarchy_id').val(); + + console.log("Execution Hierarchy:", hierarchy); + console.log("Selected Doctor:", selected['contact_id']); + + if (hierarchy) { + + $("#pageloader").fadeIn(); + + $.ajax({ + type: "GET", + url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy, + + success: function(data) { + + $("#pageloader").fadeOut(); + + let $executionContact = $('#execution-contact_id'); + + $executionContact.empty(); + + $executionContact.append( + $("") + .attr("value", "") + .text("-- Select --") + ); + + for (let itm of data) { + + $executionContact.append( + $("") + .attr("value", itm.value) + .text(itm.display) + .attr("msl_code", itm.contact ? itm.contact.msl_code : "") + .attr("speciality", itm.contact ? itm.contact.speciality : "") + ); + + } + + // ========================================================= + // NEW CODE START: Populate Add Attendee / Speaker dropdowns for Manager Execution + // ========================================================= + let $doctorSelects = $('[id^="field-hcp_name"]'); + $doctorSelects.each(function() { + let $select = $(this); + let currentVal = $select.val(); + $select.empty().append($("").attr("value", "").text("-- Select --")); + for (let itm of data) { + $select.append( + $("") + .attr("value", itm.value) + .text(itm.display) + .attr("msl_code", itm.contact ? itm.contact.msl_code : "") + .attr("speciality", itm.contact ? itm.contact.speciality : "") + ); + } + if (currentVal) { + $select.val(currentVal); + } + }); + // ========================================================= + // NEW CODE END + // ========================================================= + + + + // Selected doctor select เค•เคฐเคพ + if (selected['contact_id']) { + + let contactId = selected['contact_id'].trim(); + + let $option = $executionContact.find('option').filter(function() { + return $(this).text().trim() === contactId || + $(this).val() === contactId; + }).first(); + + if ($option.length) { + $executionContact.val($option.val()).trigger('change'); + } + } + + }, + + error: function(xhr) { + + $("#pageloader").fadeOut(); + + console.error( + "Doctor loading failed:", + xhr.responseText + ); + + } + + + }); + } }) + + $('#report-form').on('submit', function(event) { event.preventDefault(); diff --git a/resources/views/form/rapport-titans/1786097403-53d864f1-cf0f-4faf-aaf6-93c24321caae.blade.php b/resources/views/form/rapport-titans/1786097403-53d864f1-cf0f-4faf-aaf6-93c24321caae.blade.php new file mode 100644 index 00000000..8c2e895b --- /dev/null +++ b/resources/views/form/rapport-titans/1786097403-53d864f1-cf0f-4faf-aaf6-93c24321caae.blade.php @@ -0,0 +1,550 @@ + + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+@php +$brandData = [ + +['brand'=>"Foracort G 400 Ciphaler 60 Blisters", 'slug'=>'foracort_g_400_ciphaler_60_blisters_units','pseudoId'=>'foracort_g_400_ciphaler_60_blisters_value'], +['brand'=>"Foracort G 400 Rotacaps", 'slug'=>'foracort_g_400_rotacaps_units','pseudoId'=>'foracort_g_400_rotacaps_value'], +['brand'=>"Foracort G Inhaler", 'slug'=>'foracort_g_inhaler_units','pseudoId'=>'foracort_g_inhaler_value'], +['brand'=>"Foracort G Synchrobreathe", 'slug'=>'foracort_g_synchrobreathe_units','pseudoId'=>'foracort_g_synchrobreathe_value'], +['brand'=>"Glycohale F", 'slug'=>'glycohale_f_units','pseudoId'=>'glycohale_f_value'], +['brand'=>"Glycohale F Inhaler", 'slug'=>'glycohale_f_inhaler_units','pseudoId'=>'glycohale_f_inhaler_value'], +['brand'=>"Glycohale F Synchrobreathe", 'slug'=>'glycohale_f_synchrobreathe_units','pseudoId'=>'glycohale_f_synchrobreathe_value'], +['brand'=>"Glycohale FB", 'slug'=>'glycohale_fb_units','pseudoId'=>'glycohale_fb_value'], +['brand'=>'Glycohale FB Ciphaler', 'slug'=>'glycohale_fb_ciphaler_units','pseudoId'=>'glycohale_fb_ciphaler_value'], +['brand'=>'Glycohale FB Inhaler', 'slug'=>'glycohale_fb_inhaler_units','pseudoId'=>'glycohale_fb_inhaler_value'], +['brand'=>'Glycohale FB Synchrobreathe', 'slug'=>'glycohale_fb_synchrobreathe_units','pseudoId'=>'glycohale_fb_synchrobreathe_value'], + + + +]; + +@endphp + +@php + $submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id); + // $submission = null; + // if(isset($submissions->data->submissions) && count($submissions->data->submissions) > 0) { + // $submission = $submissions->data->submissions[0]; + // $formdata = $submission->formdata ?? (object)[]; + // } else { + // $formdata = []; + // } + + $formdata = null; + +if (!empty($submissions->data->submissions)) { + foreach ($submissions->data->submissions as $submission) { + if ($submission->id == $id) { + $formdata = $submission->formdata ?? null; + break; + } + } +} + + + +@endphp + + + +
+ + + @include('layouts.shared/footer-script') + + + + + + \ No newline at end of file