From b56c9a542353fcf83bbe22dc4a2b02bb683085ad Mon Sep 17 00:00:00 2001 From: Ravi Gulhane Date: Tue, 27 Oct 2026 12:30:07 +0530 Subject: [PATCH] =Changes --- .../partials/survey-preview-helpers.blade.php | 39 +++++ .../partials/survey-preview-styles.blade.php | 65 ++++++++ ...97b6-61f7-4eda-901a-2cb4ff6f293d.blade.php | 153 ++++++++++++++++++ ...58a6-d509-4ac0-9b18-6d366a74965e.blade.php | 142 ++++++++++++++++ 4 files changed, 399 insertions(+) create mode 100644 resources/views/form/rapport-team3/partials/survey-preview-helpers.blade.php create mode 100644 resources/views/form/rapport-team3/partials/survey-preview-styles.blade.php create mode 100644 resources/views/form/rapport-team3/preview-1790230856-704c97b6-61f7-4eda-901a-2cb4ff6f293d.blade.php create mode 100644 resources/views/form/rapport-team3/preview-1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php diff --git a/resources/views/form/rapport-team3/partials/survey-preview-helpers.blade.php b/resources/views/form/rapport-team3/partials/survey-preview-helpers.blade.php new file mode 100644 index 00000000..5249a75b --- /dev/null +++ b/resources/views/form/rapport-team3/partials/survey-preview-helpers.blade.php @@ -0,0 +1,39 @@ +@php + $byCode = []; + foreach ($questions ?? [] as $question) { + if (isset($question->code)) { + $byCode[$question->code] = $question; + } + } + $submitted = $submitted_formdata ?? null; + $val = function ($code) use ($byCode, $submitted) { + 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]; + } + if (isset($byCode[$code]->value) && $byCode[$code]->value !== '' && $byCode[$code]->value !== null) { + return $byCode[$code]->value; + } + return ''; + }; + $show = function ($code) use ($val) { + $value = $val($code); + return $value !== '' && $value !== null ? $value : '—'; + }; + $fileUrl = function ($url) { + $url = trim((string) $url); + if ($url === '') { + return ''; + } + if (!preg_match('#^https?://#i', $url)) { + return rtrim((string) env('AWS_URL'), '/') . '/' . ltrim($url, '/'); + } + return $url; + }; + $isImageUrl = function ($url) { + $ext = strtolower(pathinfo((string) parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION)); + return in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'webp'], true); + }; +@endphp diff --git a/resources/views/form/rapport-team3/partials/survey-preview-styles.blade.php b/resources/views/form/rapport-team3/partials/survey-preview-styles.blade.php new file mode 100644 index 00000000..f8c0c73f --- /dev/null +++ b/resources/views/form/rapport-team3/partials/survey-preview-styles.blade.php @@ -0,0 +1,65 @@ +
+
+ × + Uploaded photo +
+
+ + diff --git a/resources/views/form/rapport-team3/preview-1790230856-704c97b6-61f7-4eda-901a-2cb4ff6f293d.blade.php b/resources/views/form/rapport-team3/preview-1790230856-704c97b6-61f7-4eda-901a-2cb4ff6f293d.blade.php new file mode 100644 index 00000000..7a099a68 --- /dev/null +++ b/resources/views/form/rapport-team3/preview-1790230856-704c97b6-61f7-4eda-901a-2cb4ff6f293d.blade.php @@ -0,0 +1,153 @@ + + + + @include('layouts.shared/title-meta', ['title' => $form->title ?? 'Chemist Survey']) + @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? '']) + + + +@include('form.rapport-team3.partials.survey-preview-helpers') +@php + $products = [ + 'Asthalin Inhaler' => 'asthalin_inhaler', + 'Asthalin Rotacap' => 'asthalin_rotacap', + 'Aerocort Inhaler' => 'aerocort_inhaler', + 'Aerocort Rotacap' => 'aerocort_rotacap', + 'Aerocort Forte Rotacap' => 'aerocort_forte_rotacap', + ]; + $therapies = [ + 'Nebulization Respules / Month' => 'neb_respules', + 'Foracort Inhaler Units / Month' => 'foracort_inhaler_units', + 'Foracort Rotacaps Units / Month' => 'foracort_rotacaps_units', + 'Asthalin Syrup Units / Month' => 'asthalin_syrup_units', + 'Levolin Syrup Units / Month' => 'levolin_syrup_units', + 'Deriphyllin Units / Month' => 'deriphyllin_units', + 'Betnesol Tablet Units / Month' => 'beclomethasone_units', + 'Methylprednisolone Units / Month' => 'methylprednisolone_units', + 'Prednisolone Units / Month' => 'prednisolone_units', + 'Cough Syrups Units / Month' => 'cough_syrups_units', + ]; + $services = [ + 'BP Monitoring' => 'chemist_bp_monitoring', + 'Weighing Machine' => 'chemist_weighing_machine', + 'Nebulization' => 'chemist_nebulization', + ]; + $boardUrl = $fileUrl($val('chemist_board')); +@endphp + +
+
+

Chemist Survey Review

+

Review the submitted chemist survey before you approve or reject

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

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

+ @endif +
+ +
+
+ Chemist details +
+
Date{{ $show('record_date') }}
+
Chemist Name{{ $show('chemist_name') }}
+
MSL Code{{ $show('msl_code') }}
+
Mobile Number{{ $show('mobile_number') }}
+
Chemist Address{{ $show('chemist_location') }}
+
Chemist Pincode{{ $show('chemist_pincode') }}
+
Chemist Type{{ $show('chemist_type') }}
+
Manager Joint Visit{{ $show('manager_joint_visit') }}
+
+
+ +
+ Chemist Board +
+ @if($boardUrl === '') +

No chemist board uploaded.

+ @else + @if($isImageUrl($boardUrl)) +
+ Chemist board +
+ @endif +

Open chemist board

+ @endif +
+
+ +
+ RCPA details +
+ @foreach($products as $label => $code) +
+
{{ $label }}
+
+ Units / Month + {{ $show($code.'_units') }} +
+ @for($doctor = 1; $doctor <= 3; $doctor++) + @php + $docName = $val($code.'_doctor_'.$doctor.'_name'); + $docCode = $val($code.'_doctor_'.$doctor.'_code'); + @endphp + @if($docName !== '' || $docCode !== '') +
+ Doctor {{ $doctor }} + {{ trim(($docName !== '' ? $docName : '—').' / '.($docCode !== '' ? $docCode : '—')) }} +
+ @endif + @endfor +
+ @endforeach +
+
+ +
+ Stockist +
+ @foreach([1, 2] as $n) +
+
Stockist {{ $n }}
+
Name{{ $show('stockist_'.$n.'_name') }}
+
Location{{ $show('stockist_'.$n.'_location') }}
+
ID{{ $show('stockist_'.$n.'_id') }}
+
Supply Frequency{{ $show('stockist_'.$n.'_frequency') }}
+
+ @endforeach +
+
+ +
+ Other therapies +
+ @foreach($therapies as $label => $code) +
+ {{ $label }} + {{ $show($code) }} +
+ @endforeach +
+
+ +
+ Services +
+ @foreach($services as $label => $code) +
+ {{ $label }} + + {{ $show($code) }} + @if($val($code) === 'Yes' && $val($code.'_charge') !== '') + ({{ $val($code.'_charge') }}) + @endif + +
+ @endforeach +
+
+
+
+ +@include('form.rapport-team3.partials.survey-preview-styles') + + diff --git a/resources/views/form/rapport-team3/preview-1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php b/resources/views/form/rapport-team3/preview-1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php new file mode 100644 index 00000000..59f1bad4 --- /dev/null +++ b/resources/views/form/rapport-team3/preview-1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php @@ -0,0 +1,142 @@ + + + + @include('layouts.shared/title-meta', ['title' => $form->title ?? 'Doctor Survey']) + @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? '']) + + + +@include('form.rapport-team3.partials.survey-preview-helpers') +@php + $products = [ + 'Asthalin Inhaler' => 'asthalin_inhaler', + 'Asthalin Rotacap' => 'asthalin_rotacap', + 'Aerocort Inhaler' => 'aerocort_inhaler', + 'Aerocort Rotacap' => 'aerocort_rotacap', + 'Aerocort Forte Rotacap' => 'aerocort_forte_rotacap', + ]; + $therapies = [ + 'Nebulization Respules / Month' => 'neb_respules', + 'Foracort Inhaler Units / Month' => 'foracort_inhaler_units', + 'Foracort Rotacaps Units / Month' => 'foracort_rotacaps_units', + 'Asthalin Syrup Units / Month' => 'asthalin_syrup_units', + 'Levolin Syrup Units / Month' => 'levolin_syrup_units', + 'Deriphyllin Units / Month' => 'deriphyllin_units', + 'Betnesol Tablet Units / Month' => 'beclomethasone_units', + 'Methylprednisolone Units / Month' => 'methylprednisolone_units', + 'Prednisolone Units / Month' => 'prednisolone_units', + 'Cough Syrups Units / Month' => 'cough_syrups_units', + ]; + $photos = [ + 'Visiting Card' => 'visiting_card', + 'Rx Pad' => 'rx_pad', + 'Doctor Board' => 'doctor_board', + ]; + $degree = (string) $val('degree'); + if (strcasecmp($degree, 'Other') === 0 && $val('doctor_other_degree') !== '') { + $degree = $val('doctor_other_degree'); + } + $specialty = (string) $val('specialty'); + if (strcasecmp($specialty, 'Other') === 0 && $val('doctor_other_speciality') !== '') { + $specialty = $val('doctor_other_speciality'); + } +@endphp + +
+
+

Doctor Survey Review

+

Review the submitted doctor survey before you approve or reject

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

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

+ @endif +
+ +
+
+ Doctor details +
+
Date{{ $show('record_date') }}
+
Doctor Name{{ $show('doctor_name') }}
+
MSL Code{{ $show('msl_code') }}
+
Registration Number{{ $show('doctor_registration_number') }}
+
Mobile Number{{ $show('mobile_number') }}
+
Legacy Code{{ $show('legacy_code') }}
+
Degree{{ $degree !== '' ? $degree : '—' }}
+
Specialty{{ $specialty !== '' ? $specialty : '—' }}
+
Doctor Address{{ $show('doctor_location') }}
+
Doctor Pincode{{ $show('doctor_pincode') }}
+
Doctor Type{{ $show('doctor_type') }}
+
Total Patients / Day{{ $show('total_patients') }}
+
Respiratory Patients / Day{{ $show('respiratory_patients') }}
+
Manager Joint Visit{{ $show('manager_joint_visit') }}
+
Attached Chemist{{ $show('attached_chemist_name') }}
+
No. of Staff{{ $show('no_of_staff') }}
+
+
+ +
+ Doctor Prescription +
+ + + + + + + + + + @foreach($products as $label => $code) + + + + + + @endforeach + +
ProductPrescribedUnits / Month
{{ $label }}{{ $show($code) }}{{ $val($code.'_units') !== '' ? $val($code.'_units') : '—' }}
+
+
+ +
+ Other therapies +
+ @foreach($therapies as $label => $code) +
+ {{ $label }} + {{ $show($code) }} +
+ @endforeach +
+
+ +
+ Photos +
+ @php $anyPhoto = false; @endphp + @foreach($photos as $label => $code) + @php $url = $fileUrl($val($code)); @endphp + @if($url !== '') + @php $anyPhoto = true; @endphp +
+
{{ $label }}
+ @if($isImageUrl($url)) +
+ {{ $label }} +
+ @endif +

Open {{ strtolower($label) }}

+
+ @endif + @endforeach + @if(!$anyPhoto) +

No photos uploaded.

+ @endif +
+
+
+
+ +@include('form.rapport-team3.partials.survey-preview-styles') + +