From 7677ccdb364fe4b0d73074f4d5a0fbeaac14faef Mon Sep 17 00:00:00 2001 From: Ravi Gulhane <> Date: Fri, 14 Aug 2026 15:20:55 +0530 Subject: [PATCH] Preview Changes --- ...43b9-94d0-4dcb-b3f3-4fa11588a0a9.blade.php | 729 ++++++++++-------- 1 file changed, 412 insertions(+), 317 deletions(-) diff --git a/resources/views/form/rapport-team3/preview-1750914801-153443b9-94d0-4dcb-b3f3-4fa11588a0a9.blade.php b/resources/views/form/rapport-team3/preview-1750914801-153443b9-94d0-4dcb-b3f3-4fa11588a0a9.blade.php index 76554301..3bc23855 100644 --- a/resources/views/form/rapport-team3/preview-1750914801-153443b9-94d0-4dcb-b3f3-4fa11588a0a9.blade.php +++ b/resources/views/form/rapport-team3/preview-1750914801-153443b9-94d0-4dcb-b3f3-4fa11588a0a9.blade.php @@ -1,331 +1,426 @@ - - @include('layouts.shared/title-meta', ['title' => 'Form']) + @include('layouts.shared/title-meta', ['title' => $form->title ?? 'Form']) @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? '']) - + -
- processing... -
+ +@php + $record = \DB::table('neblogistic')->where('submission_id', $id)->first(); + $byCode = []; + foreach ($questions as $question) { + if (isset($question->code)) { + $byCode[$question->code] = $question; + } + } + $submitted = $submitted_formdata ?? null; + $val = function ($column, $codes = []) use ($record, $byCode, $submitted) { + if ($record && isset($record->{$column}) && $record->{$column} !== '' && $record->{$column} !== null) { + return $record->{$column}; + } + foreach ((array) $codes as $code) { + if (isset($byCode[$code]->value) && $byCode[$code]->value !== '' && $byCode[$code]->value !== null) { + return $byCode[$code]->value; + } + if (is_object($submitted) && isset($submitted->{$code}) && $submitted->{$code} !== '' && $submitted->{$code} !== null) { + return $submitted->{$code}; + } + if (is_array($submitted) && isset($submitted[$code]) && $submitted[$code] !== '' && $submitted[$code] !== null) { + return $submitted[$code]; + } + } + return ''; + }; + $fileUrl = function ($url) { + $url = (string) $url; + if ($url === '') { + return ''; + } + if (!preg_match('#^https?://#i', $url)) { + return rtrim((string) env('AWS_URL'), '/') . '/' . ltrim($url, '/'); + } + return $url; + }; + $empId = $val('emp_id', ['emp_id']); + $empName = $val('emp_name', ['employee_name', 'emp_name']); + $empPhone = $val('emp_phone', ['employee_phone', 'emp_phone']); + $empEmail = $val('emp_email', ['employee_email', 'emp_email']); + $abmName = $val('abm_name', ['abm_name']); + $rbmName = $val('rbm_name', ['rbm_name']); + $doctorName = $val('doctor_name', ['dr_name', 'doctor_name_for']); + $doctorPhone = $val('doctor_phone', ['doctor_mobile_number']); + $speciality = $val('doctor_speciality', ['speciality']); + $mslCode = $val('msl_code', ['msl_code']); + $nebulizerType = $val('type_of_nebulizer', ['type_of_nebuliser', 'type_of_nebulizer']); + $nebulizerCount = $val('no_of_nebulizer', ['no_of_nebulizer']); + $parcelValue = $val('value_of_parcel', ['value_of_the_parcel']); + $team = $val('team', ['team']); + $clinicName = $val('clinic_hospital_name', ['clinic_hospital_home_name']); + $building = $val('address_building', ['building_name']); + $addressType = $val('address_type', ['address_type']); + $address1 = $val('address_line_1', ['address_line_1']); + $address2 = $val('address_line_2', ['address_line_2']); + $state = $val('address_state', ['state']); + $city = $val('address_city', ['city']); + $pin = $val('address_pin_code', ['pin_code']); + $remarks = $val('remarks', ['remarks']); + $paramedic = $val('paramedic_alternate_contact_number', ['paramedic_alternate_contact_number']); + $status = $val('status', ['status']); + $requestDate = $record->created_at ?? ''; + $letterUrl = $fileUrl($val('request_letter', ['upload_request_letter', 'existing_letter'])); +@endphp - -{{-- @php - echo "
";
-    print_r($questions);
-    exit;
-@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') - @if ($question->code == 'no_of_nebulizer') - - @else - - @endif - @break - - @case('radio') - @foreach ($question->options as $option) -
- - -
- @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) - : []; - @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); @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')) -
- -
- @endif -
- -
-
- - - - -
-
- +
+
+

Review Request

+

Please review the request details and make your decision

+ @if(isset($form->user_info->name) && $form->user_info->name !== '') +

Submitted by: {{ $form->user_info->name }}

+ @endif
- + +
+
Employee Details
+
+ @if($empId !== '') +
+ Emp ID of TM: + {{ $empId }} +
+ @endif + @if($empName !== '') +
+ Name of TM: + {{ $empName }} +
+ @endif + @if($empPhone !== '') +
+ TM Mobile Number: + {{ $empPhone }} +
+ @endif + @if($empEmail !== '') +
+ TM Email ID: + {{ $empEmail }} +
+ @endif + @if($abmName !== '') +
+ ABM Name: + {{ $abmName }} +
+ @endif + @if($rbmName !== '') +
+ RBM Name: + {{ $rbmName }} +
+ @endif +
+
+ +
+
Doctor Details
+
+ @if($doctorName !== '') +
+ Dr Name: + {{ $doctorName }} +
+ @endif + @if($doctorPhone !== '') +
+ Doctor Mobile Number: + {{ $doctorPhone }} +
+ @endif + @if($speciality !== '') +
+ Speciality: + {{ $speciality }} +
+ @endif + @if($mslCode !== '') +
+ MSL CODE of Dr: + {{ $mslCode }} +
+ @endif + @if($nebulizerType !== '') +
+ Type of Nebulizer: + {{ $nebulizerType }} +
+ @endif + @if($nebulizerCount !== '') +
+ No of Nebulizer: + {{ $nebulizerCount }} +
+ @endif + @if($parcelValue !== '') +
+ Value of the Parcel: + {{ $parcelValue }} +
+ @endif + @if($team !== '') +
+ Team: + {{ $team }} +
+ @endif +
+
+ +
+
Drop Details
+
+ @if($clinicName !== '') +
+ Clinic / Hospital / Home Name: + {{ $clinicName }} +
+ @endif + @if($building !== '') +
+ Building Name: + {{ $building }} +
+ @endif + @if($addressType !== '') +
+ Address Type: + {{ $addressType }} +
+ @endif + @if($address1 !== '') +
+ Address line 1: + {{ $address1 }} +
+ @endif + @if($address2 !== '') +
+ Address line 2: + {{ $address2 }} +
+ @endif + @if($state !== '') +
+ State: + {{ $state }} +
+ @endif + @if($city !== '') +
+ City: + {{ $city }} +
+ @endif + @if($pin !== '') +
+ Pin Code: + {{ $pin }} +
+ @endif +
+
+ +
+
Additional Information
+
+
+ Remarks: + {{ $remarks !== '' ? $remarks : 'N/A' }} +
+ @if($paramedic !== '') +
+ Paramedic/Alternate Contact number: + {{ $paramedic }} +
+ @endif + @if($status !== '') +
+ Current Status: + + {{ $status }} + +
+ @endif + @if($requestDate !== '') +
+ Request Date: + {{ \Carbon\Carbon::parse($requestDate)->format('d M Y, h:i A') }} +
+ @endif +
+
+ + @if($letterUrl !== '') +
+
Request Letter
+
+ Request Letter +
+
+ @endif
- - - @include('layouts.shared/footer-script') - - + -