@extends('layouts.tab') @section('planner_content')
@if (auth()->user()->user_type == 1)

Company Targets

@endif @if (session('success')) @endif
{{-- Province --}}
{{-- Area --}}
{{-- Location / Place --}}
@foreach ($planners as $planner) @php $assignedUsers = explode(',', $planner->assigned_to); @endphp
@php $planPeriod = str_replace(' - ', ' to ', $planner->plan_period); $dates = explode(' to ', $planPeriod); @endphp
{{ $planner->planner_type }} - {{ \Carbon\Carbon::parse(trim($dates[0]))->format('d-m-Y') }} to {{ \Carbon\Carbon::parse(trim($dates[1]))->format('d-m-Y') }}

₹{{ number_format($planner->target_amount, 2) }}

Target for this period

@if ($planner->location) {{ $planner->places->location }} @if ($planner->area_id) , {{ $planner->area->name }} @endif @if ($planner->province_id) , {{ $planner->province->name }} @endif @elseif($planner->area_id) {{ $planner->area->name }} @if ($planner->province_id) , {{ $planner->province->name }} @endif @elseif($planner->province_id) {{ $planner->province->name }} @else N/A @endif
    @foreach ($planner->targets as $target)
  • {{ $target->status->name }}
    {{ $target->status->name }}
    {{ $target->target_count }}
  • @endforeach
    @foreach ($planner->assignedUsers as $user)
  • {{ $user->name }}
  • @endforeach View Details
{{ $planner->title ?? $planner->plan_period }}
@if ($planner->planner_type == 'year')

Yearly Plan Bifurcation

@foreach ($planner->breakdowns as $breakdown)
{{ ucfirst($breakdown->breakdown_type) }} Target

Target: ₹{{ number_format($breakdown->target_amount, 2) }}

Achieved: ₹{{ number_format($breakdown->achieved_amount, 2) }}

@php $divisor = match (strtolower($breakdown->breakdown_type)) { 'monthly' => 12, 'quarterly' => 4, 'half_yearly' => 2, 'weekly' => 52, 'daily' => 365, default => 1, }; @endphp
    @foreach ($planner->targets as $target)
  • {{ $target->status->name }}
    {{ number_format($target->target_count / $divisor) }}
  • @endforeach
@endforeach
Session Target

Morning Session: 4 hrs (9 AM – 1 PM)

Afternoon Session: 4 hrs (2 PM – 6 PM)

@php $sessionDivisor = 730; @endphp
    @foreach ($planner->targets as $target)
  • {{ $target->status->name }}
    {{ number_format($target->target_count / $sessionDivisor) }}
  • @endforeach
@endif
@endforeach
Create Planner
@csrf {{-- Planner Type --}}
{{-- Plan Period --}}
{{-- Target Amount --}}
{{-- Industries --}}
@foreach ($industries as $industry)
@endforeach
{{-- Solutions --}}
@foreach ($solutions as $solution)
@endforeach
{{-- Channels --}}
@foreach ($channel_categories as $category) {{ $category->name }}
@foreach ($category->channels as $channel)
@endforeach
@endforeach
{{-- =============================== LOCATION HIERARCHY =============================== --}} {{-- =============================== LOCATION HIERARCHY =============================== --}} {{-- Province --}}
{{-- Area --}}
{{-- Location --}}
{{-- Target Per Status --}}
Target Per Status
@foreach ($statuses as $status)
@endforeach
Edit Planner
@csrf @method('PUT')
{{-- Province --}}
{{-- Area --}}
{{-- Location --}}
@foreach ($industries as $industry)
@endforeach
@foreach ($solutions as $solution)
@endforeach
@foreach ($channel_categories as $category) {{ $category->name }}
@foreach ($category->channels as $channel)
id, old('channel'))) checked @endif>
@endforeach
@endforeach
@endsection