@extends('layouts.admin') @section('header-content') @endsection @section('content')
Target Detail @if( Auth::user()->can('modify_targets')) @endif
Start Date {{$target->date_start}} End Date {{$target->date_end}}
Sales Target {{$target->sales_target}} Recovery Target {{$target->recovery_target}}
Regional Sales Manager @if(isset($target->rsm->firstname)){{$target->rsm->firstname.' '.$target->rsm->lastname}} @endif
ASM, ASE & SO Target
@foreach($target->target_details as $key2=>$detail) @if($detail['date']==$target->date_start) @endif @endforeach
# Role Name Sales Target Recovery Target
{{$key2+1}} @if(isset($detail->user->role_user)){{$detail->user->role_user}} @endif @if(isset($detail->user->firstname)){{$detail->user->firstname.' '.$detail->user->lastname}} @endif @php // count b/w dates $st=substr($target->date_start, strpos($target->date_start, "-") + 1); $ed=substr($target->date_end, strpos($target->date_end, "-") + 1); $count=1; if(abs($st - $ed)>0){ $count=abs($st - $ed)+1; } @endphp {{$detail['sales_target']*$count}} {{$detail['recovery_target']*$count}}
@endsection