@include('layouts.shared/title-meta', ['title' => 'Form']) @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
";
// print_r($history);
@endphp
@php
$plannedBrandData = [
[
'brand' => 'ENCICARB 1K',
'slug' => 'planned_encicarb_1k_units',
'pseudoId' => 'planned_encicarb_1k_values',
'total_slug' => 'planned_encicarb_1k_total_units',
'total_slug_value' => 'planned_encicarb_1k_total_values',
],
[
'brand' => 'EMBREMMA',
'slug' => 'planned_embremma_units',
'pseudoId' => 'planned_embremma_values',
'total_slug' => 'planned_embremma_total_units',
'total_slug_value' => 'planned_embremma_total_values',
],
[
'brand' => 'SOMALINX-LAR',
'slug' => 'planned_somalinx_lar_units',
'pseudoId' => 'planned_somalinx_lar_values',
'total_slug' => 'planned_somalinx_lar_total_units',
'total_slug_value' => 'planned_somalinx_lar_total_values',
],
[
'brand' => 'PEGEX',
'slug' => 'planned_pegex_units',
'pseudoId' => 'planned_pegex_values',
'total_slug' => 'planned_pegex_total_units',
'total_slug_value' => 'planned_pegex_total_values',
],
];
$executionBrandData = [
[
'brand' => 'ENCICARB 1K',
'slug' => 'execution_encicarb_1k_units',
'pseudoId' => 'execution_encicarb_1k_values',
'total_slug' => 'execution_encicarb_1k_total_units',
'total_slug_value' => 'execution_encicarb_1k_total_values',
],
[
'brand' => 'EMBREMMA',
'slug' => 'execution_embremma_units',
'pseudoId' => 'execution_embremma_values',
'total_slug' => 'execution_embremma_total_units',
'total_slug_value' => 'execution_embremma_total_values',
],
[
'brand' => 'SOMALINX-LAR',
'slug' => 'execution_somalinx_lar_units',
'pseudoId' => 'execution_somalinx_lar_values',
'total_slug' => 'execution_somalinx_lar_total_units',
'total_slug_value' => 'execution_somalinx_lar_total_values',
],
[
'brand' => 'PEGEX',
'slug' => 'execution_pegex_units',
'pseudoId' => 'execution_pegex_values',
'total_slug' => 'execution_pegex_total_units',
'total_slug_value' => 'execution_pegex_total_values',
],
];
$weeks = [1, 2, 3, 4];
@endphp
@php
usort($history->data->submissions, function ($a, $b) {
$dateA = isset($a->formdata->plan_date)
? \Carbon\Carbon::createFromFormat('Y-m-d', $a->formdata->plan_date)->timestamp
: 0;
$dateB = isset($b->formdata->plan_date)
? \Carbon\Carbon::createFromFormat('Y-m-d', $b->formdata->plan_date)->timestamp
: 0;
return $dateB <=> $dateA; // descending
});
@endphp
Status
Action
Execution Done
Plan Date
Execution Date
Institute Name
City
{{-- Planned Values for the week selected
Actual Values for the week selected --}}
@foreach ($history->data->submissions as $sub)
@php
$sub->formdata->id = $sub->id;
@endphp
{{ $sub->workflow_status }}
@if ($sub->workflow_status == 'approved')
{{-- @elseif (
$sub->workflow_status == 'approved' ||
$sub->workflow_status == 'unapproved' ||
!empty($sub->formdata->execution_date)) --}}
@elseif ($sub->workflow_status == 'rejected')
@endif
{{ isset($sub->formdata->execution_date) && $sub->formdata->execution_date > 0 ? 'Yes' : 'No' }}
{{ $sub->formdata->plan_date }}
{{ isset($sub->formdata->execution_date) ? $sub->formdata->execution_date : '' }}
{{ isset($sub->formdata->contact_id) ? $sub->formdata->contact_id : '' }}
{{ isset($sub->formdata->city) ? $sub->formdata->city : '' }}
@endforeach