@if(!request()->has('view'))
@foreach($users as $user)
{{ $user->firstname }} {{ $user->lastname }}
@php $i = 1; $next_class = ''; $sequence = 1; @endphp
@foreach($dates as $date)
@php $planning = PlanningController::getUserPlannings($user->id, $date) @endphp
@php
$resizable = 'resizable';
$class = "";
if(isset($dates[$i])){
$planning_next = PlanningController::getUserPlannings($user->id, $dates[$i]);
if($planning_next && isset($planning->project_id)){
if($planning_next->project_id==$planning->project_id){
$class = "next-same";
}elseif($planning_next->project_id!=$planning->project_id){
$resizable = '';
}
}
}
@endphp
@php $dayName = date('l', strtotime($date)); @endphp
@if($planning)
@if($planning->confirmed==0)
@php $style = 'background:#ddd;border:2px solid grey'; @endphp
@else
@php $style = 'background:'.$planning->background.'.;border:2px solid '.$planning->border.';'; @endphp
@endif
@if($planning->confirmed==0)
@endif
{{ $planning->company_name }}
WG-{{str_pad($planning->project_id, 4, '0', STR_PAD_LEFT)}}
@php $staffs = PlanningController::getProjectUsers($planning->project_id, $date) @endphp
@foreach($staffs as $staff)
@endforeach
@endif
@php
$i++; if($class=='next-same'){ $next_class = 'prev-same'; }else{ $next_class=''; $sequence++; }
@endphp
@endforeach
@endforeach
@else
@foreach($users as $user)
{{ $user->firstname }} {{ $user->lastname }}
@php $i = 1; $next_class = ''; @endphp
@foreach($dates as $date)
@php $planning = PlanningController::getUserPlannings($user->id, $date) @endphp
@php
$resizable = 'resizable';
$class = "";
if(isset($dates[$i])){
$planning_next = PlanningController::getUserPlannings($user->id, $dates[$i]);
if($planning_next && isset($planning->project_id)){
if($planning_next->project_id==$planning->project_id){
$class = "next-same";
$resizable = '';
}elseif($planning_next->project_id!=$planning->project_id){
$resizable = '';
}
}
}
@endphp
@if($planning)
@php
$staffs = PlanningController::getProjectUsers($planning->project_id, $date);
$names = [];
foreach ($staffs as $staff) {
$names[] = $staff->firstname . ' ' . $staff->lastname;
}
$tooltip = '
Project: '.$planning->company_name.' (WG-'.str_pad($planning->project_id, 4, '0', STR_PAD_LEFT).')
Date: '.date('jS M Y', strtotime($date)).'
People working: '.implode(', ', $names);
@endphp
{{ $planning->company_name }}
WG-{{str_pad($planning->project_id, 4, '0', STR_PAD_LEFT)}}
@endif
@php
$i++; if($class=='next-same'){ $next_class = 'prev-same'; }else{ $next_class=''; }
@endphp
@endforeach
@endforeach
@endif