@include('layouts.shared/title-meta', ['title' => "Report"]) @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])

Loading

{{$graph->name}}

@php $showUserAttrs = ($graph->show_user_attributes ?? 'no') === 'yes'; $userAttrs = ($showUserAttrs && isset($graph->user_attributes) && is_array($graph->user_attributes)) ? $graph->user_attributes : []; $userAttrLabels = $user_attribute_labels ?? []; @endphp

{!!$graph->agg_type == 'team' ? '' : '' !!} {{ucwords($graph->agg_type)}} Report

{{ucwords($graph->type)}} Metric

Date Range Selected: {{$graph->first_day}} to {{$graph->last_day}}

@if((in_array($post['type'], ['trend','leaderboard']) && !in_array($post['chart'], ['line', 'bar']) ) || ($post['type'] == 'graphical' && $graph->type == 'grouped') || ($post['type'] == 'details' && $graph->chart == 'tabular') || ($post['type'] == 'contacts' && $graph->chart == 'contacts') || ($post['type'] == 'scoreboard' && $graph->chart == 'leaderboard') ) @endif
@foreach($charts as $chart) @if(sizeof($chart->charts)>0) @endif @endforeach

Select Period

@foreach($charts as $chart) @if($chart->type == $post['type'] && sizeof($chart->charts) > 1) @foreach($chart->charts as $ch) @endforeach @endif @endforeach
@switch(true) @case($graph->chart == 'leaderboard')
@if($graph->agg_type == 'team') @if(sizeof($breadcrumbs) == 0)
@else @endif @endif
@if($graph->agg_type != 'team' || $post['type'] != 'leaderboard')@endif @foreach($userAttrs as $attr) @endforeach @foreach($graph->metrics as $val) @if(isset($val->is_visible) && $val->is_visible) @endif @endforeach @php $leader_id = ''; @endphp @foreach($graph->values as $i => $val) @if($leader_id != $val->user->id) @if($graph->agg_type != 'team' || $post['type'] != 'leaderboard') @endif @foreach($userAttrs as $attr) @endforeach @if($graph->type == 'verses') @foreach($graph->metrics as $m) @if(isset($m->is_visible) && $m->is_visible) @php $statVal = isset($val->stats->{$m->metric}) ? $val->stats->{$m->metric} : (isset($val->stats->{$m->display}) ? $val->stats->{$m->display} : null); @endphp @endif @endforeach @else @foreach($graph->metrics as $m) @if(isset($m->is_visible) && $m->is_visible) @php $statVal = isset($val->stats->{$m->metric}) ? $val->stats->{$m->metric} : (isset($val->stats->{$m->display}) ? $val->stats->{$m->display} : null); @endphp @endif @endforeach @endif @endif @php $leader_id = $val->user->id; @endphp @endforeach
RankUser{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}{{$val->display}}
{{ isset($val->user->name) ? $val->user->name : '' }}
{{ isset($val->user->designation) ? $val->user->designation : '' }}
{{ $val->user->{$attr} ?? '-' }}{{ $statVal !== null ? $statVal : '-' }}{{ $statVal !== null ? $statVal : '-' }}
@break @case($graph->type == 'simple' && $post['type'] == 'trend' && $graph->chart == 'tabular')
@foreach($graph->values as $i => $val) @endforeach
Periods {{$graph->label}}
{{$val->x}} {{$val->y}}
@break @case($graph->type == 'grouped' && $post['type'] == 'trend' && $graph->chart == 'tabular')
@foreach($graph->values as $met) @endforeach @foreach($graph->values[0]->stats as $i => $stat) @foreach($graph->values as $met) @endforeach @endforeach
Periods{{$met->metric}}
{{$stat->x}}{{isset($met->stats[$i])?$met->stats[$i]->y:0}}
@break @case($post['type'] == 'details' && $graph->chart == 'tabular')
@if(isset($graph->values->metrics)) @foreach($userAttrs as $attr) @endforeach @foreach($graph->values->metrics as $metric) @if(!isset($metric->is_visible) || $metric->is_visible) @endif @endforeach @foreach($graph->values->users as $user) @foreach($userAttrs as $attr) @endforeach @foreach($graph->values->metrics as $metric) @if(!isset($metric->is_visible) || $metric->is_visible) @php $cellVal = isset($metric->stats->{$user->id}) ? $metric->stats->{$user->id} : null; @endphp @endif @endforeach @endforeach
User Employee Code{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}Zone Region Area Territory{{ $metric->metric ?? $metric->display ?? '' }}
{{ $user->name }}
{{$user->designation}}
{{ isset($user->employee_code) ? $user->employee_code:''}}{{ $user->{$attr} ?? '-' }}{{ isset($user->positions->Zone) ? $user->positions->Zone : '-' }} {{ isset($user->positions->Region) ? $user->positions->Region : '-' }} {{ isset($user->positions->Area) ? $user->positions->Area : '-' }} {{ isset($user->positions->Territory) ? $user->positions->Territory : '-' }}{{ $cellVal !== null ? $cellVal : '-' }}
@endif
@break @case($post['type'] == 'contacts' && $graph->chart == 'contacts')
@if(isset($graph->values->metrics)) @foreach($graph->values->metrics as $metric) @if(isset($metric->is_visible) && $metric->is_visible) @endif @endforeach @foreach($graph->values->contacts as $contact) @php if(!isset($graph->values->users->{$contact->id})) { continue; } $user = $graph->values->users->{$contact->id}; @endphp @foreach($graph->values->metrics as $metric) @if(isset($metric->is_visible) && $metric->is_visible) @php $cellVal = isset($metric->stats->{$contact->id}) ? $metric->stats->{$contact->id} : null; @endphp @endif @endforeach @endforeach
Doctor MSL Code User Employee Code Zone Region Area Territory{{ $metric->metric ?? $metric->display ?? '' }}
{{ $contact->name }} {{ $contact->msl_code }}{{ $user->name }}
{{$user->designation}}
{{ isset($user->employee_code) ? $user->employee_code:''}} {{ isset($user->positions->Zone) ? $user->positions->Zone : '-' }} {{ isset($user->positions->Region) ? $user->positions->Region : '-' }} {{ isset($user->positions->Area) ? $user->positions->Area : '-' }} {{ isset($user->positions->Territory) ? $user->positions->Territory : '-' }}{{ $cellVal !== null ? $cellVal : '-' }}
@endif
@break @default
@if($post['type'] == 'value' || ($post['type'] == 'graphical' && $graph->chart = 'percentile' && $graph->type == 'simple' ))
{{ $graph->type == 'simple' ? $graph->label : 'Total ' . $graph->name }}

{{$graph->value}}

@endif @break @endswitch
@include('layouts.shared/footer-script')