diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index fab9a407..b63e2133 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -5465,6 +5465,7 @@ class FormController extends Controller $request->session()->put('formdata', $formdata); Log::debug(print_r($formdata, true)); + //return response()->json(['status' => 'error', 'data' => $formdata]); $files = $request->file(); foreach($files as $fname => $file) { $post[$fname] = $this->_uploadMedia($request, $fname, 'form/'.$post['form_id'].'/'.$fname); diff --git a/resources/views/form/rapport-arise/1779187275-848fd8f3-6ea2-4521-9d85-85ec424fa8d5.blade.php b/resources/views/form/rapport-arise/1779187275-848fd8f3-6ea2-4521-9d85-85ec424fa8d5.blade.php index dd274a93..637f9e5e 100644 --- a/resources/views/form/rapport-arise/1779187275-848fd8f3-6ea2-4521-9d85-85ec424fa8d5.blade.php +++ b/resources/views/form/rapport-arise/1779187275-848fd8f3-6ea2-4521-9d85-85ec424fa8d5.blade.php @@ -305,6 +305,7 @@ $categoryDoctorSubmissions = []; $doctorRxCounts = []; $doctorMonthData = []; + $categoryAttributes = [ 'foracort-ciphaler' => 'foracort_ciphaler', diff --git a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php index 5244c990..97325b73 100644 --- a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php +++ b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php @@ -1,57 +1,18 @@ + + @include('layouts.shared/title-meta', ['title' => "Form"]) @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) - - + -
- processing... -
+
+ processing... +
@@ -68,11 +29,10 @@

{{$form->title}}

- @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' - ) ) + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
@if($form->link_type == 'form') - View History + @else Back @endif @@ -83,38 +43,15 @@
Submitted By: {{$form->user_info->name}}
@endif - - @php - $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); - $submissions = $submissions->data->submissions; - $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","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') - - @break - @endswitch -
- @endforeach -
- - @foreach($questions as $question) - @if( in_array($question->code, - ["record_date","select_rxber_type"] ) ) - @continue; + @foreach($questions as $question) + @php + + $hideFields = [ + + 'contact_id', + 'month_1', + 'month_2', + 'month_3', + 'converted', + 'rx_support', + 'other_molecule_use' + ]; + + @endphp + + @if(in_array($question->code, $hideFields)) + @continue @endif -
- - @switch($question->type) +
+ + @switch($question->type) @case('hidden') - - @break + + @break @case('text') @case('email') @case('tel') @case('date') - required == 'yes'?'required':'' }} - value="{{isset($question->value)?$question->value:''}}"> - @break + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}"> + @break @case('number') - required == 'yes'?'required':'' }} - value="{{isset($question->value)?$question->value:0}}"> - @break + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}"> + @break @case('textarea') - - @break + + @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') -
+ + @break + @case('radio') @foreach($question->options as $option) -
{{$option->display}}
-
- +
+ +
@endforeach -
- @break - @endswitch -
- @endforeach -
-
+ @break + @case('radiometrix') + @php + // Decode the first option's value to use as heading labels + $headings = + count($question->options) > 0 + ? json_decode($question->options[0]->value, true) + : []; -
- @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != - 'yes' ) ) -
- @if(!$id) - - @endif + if(!is_array($headings)){ + $headings = []; + } + @endphp + + {{-- Matrix Wrapper with Horizontal Scroll on Small Screens --}} +
+
+ {{-- Table Headers --}} +
+
+ {{-- Placeholder for row labels --}} + @foreach ($headings as $head) +
{{ $head }} +
+ @endforeach +
+ + {{-- Table Rows --}} + @foreach ($question->options as $option) + @php + $nn = json_decode($option->value, true); + + // fallback if invalid json + if(!is_array($nn)){ + $nn = []; + } + @endphp +
+
+ {{ $option->display }} +
+ + @foreach ($nn as $value) +
+ display) && $option->display != $option->display ? 'checked' : '' }}> + +
+ @endforeach +
+ @endforeach +
+
+ @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 +
+ @endforeach + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) +
+
+
+ {{--
+
Tagged Doctors
+
--}} +
+
+ @php +$doctors = []; + +foreach($questions as $question){ + if($question->code == 'contact_id'){ + $doctors = $question->options ?? []; + break; + } +} +@endphp + + + + + + + + + + + + +@for($i=1; $i<=5; $i++) + + + + + + + + + + + +@endfor + + +
Doctor NameRxn/Week SupportOther Molecule Use
+ + + + + + + + +
+
+
+
+
+ -
+
@endif - {{-- @elseif(!$id) -

You have submitted 10 doctors

- @endif --}} +
- -
@@ -312,535 +345,1033 @@ - - @include('layouts.shared/footer-script') - - - + + + - + \ No newline at end of file