@extends('admin.layout') @section('content')

{{ trans('View Task') }}

@php $getUserRoleData = userRoleData(); $task = explode(",",$getUserRoleData->task); @endphp
@if(in_array("View", $task))
@if( count((array) $errors) > 0) @foreach($errors->all() as $error) @endforeach @endif @if(!empty(session('message'))) @endif @if(!empty(session('error'))) @endif
{{ $result['task']->title }}
{{ $result['task']->taskPriority->name }}
{{ $result['task']->assignedToUser->first_name . ' ' . $result['task']->assignedToUser->last_name }}
{{ $result['task']->taskStatus->name }}
{{ $result['task']->taskDepartment->name }}
{{ $result['task']->start_date }}
{{ $result['task']->completion_date }}
@if(in_array("Edit", $task) && $result['task']->comments->isNotEmpty() )
Comments History:
@foreach($result['task']->comments as $v)
{{ $v->createdByUser->first_name . ' ' . $v->createdByUser->last_name . ' | ' . $v->created_at }}
{!! $v->comment !!}
@endforeach
@endif @else

Please contact with SuperAdmin

@endif
@if($result['task']->activities->isNotEmpty())
@php $tds1 = $tds2 = ''; $month = strtotime($result['max_min_date']->min_date); $end = strtotime($result['max_min_date']->max_date); if($result['max_date_extension']->extension > 0) { $extension_days = $result['max_date_extension']->extension * 8; $end = strtotime("+$extension_days days", $end); } $end = strtotime(date('Y-m-t', $end)); while($month < $end) { $tds1 .= ''; for($i = 1; $i <= 4; $i++) { $tds2 .= ''; } $month = strtotime("+1 month", $month); } @endphp {!! $tds1 !!} {!! $tds2 !!} @php $bg_colors = ['violet', 'blue', 'grey', 'purple', 'cyan']; $prev_rand = '' @endphp @foreach($result['task']->activities as $v) status == 2 ? ' class=hidden' : '' }}> status == 1 ? ' style=background:#9ed1ba;' : '' }}> @if(in_array($v->status, [0, 1])) @elseif($v->status == 3) {{ $v->title }} @endif @if($v->status == 0) @endif @php $tds1 = ''; $month = strtotime($result['max_min_date']->min_date); $end = strtotime($result['max_min_date']->max_date); if($result['max_date_extension']->extension > 0) { $extension_days = $result['max_date_extension']->extension * 8; $end = strtotime("+$extension_days days", $end); } $end = strtotime(date('Y-m-t', $end)); $cell = 1; $start_bg = -1; while(true) { $rand = rand(0, 4); if($prev_rand != $rand) { break; } } unset($ext); while($month < $end) { for($i = 1; $i <= 4; $i++) { $bg = ''; if((date('m', $month) == date('m', strtotime($v->start_date)) && date('Y', $month) == date('Y', strtotime($v->start_date)) && $v->start_week_no == $i)) { $start_bg = $cell; } if($start_bg >= $cell) { $bg = 'style="background:' . $bg_colors[$rand] . ';"'; $start_bg++; } if(date('m', $month) == date('m', strtotime($v->end_date)) && date('Y', $month) == date('Y', strtotime($v->end_date)) && $v->end_week_no == $i) { $start_bg = -1; $ext = 1; } if(isset($ext) && $v->extension > 0 && $ext <= $v->extension && empty($bg)) { if($ext == 1) $ext_color = 'yellow'; else if($ext == 2) $ext_color = 'orange'; else $ext_color = 'red'; $bg = 'style="background:' . $ext_color . ';"'; $ext++; } $tds1 .= ""; $cell++; } $month = strtotime("+1 month", $month); } $prev_rand = $rand; @endphp {!! $tds1 !!} @endforeach
Activities Name' . date('F Y', $month) . 'W' . $i . '
assignee_name) ? '' : ' style=display:none;' }}>
assignee_name) ? '' : ' style=display:none;' }}> {{ $v->assignee_name ?? '' }}
@endif
@if(in_array("Edit",$task )) {!! Form::open(array('url' =>'admin/add-task-comment', 'method'=>'post', 'class' => 'form-horizontal', 'id'=>'form1', 'enctype'=>'multipart/form-data')) !!}
{!! Form::textarea('comment', '', array('class'=>'form-control', 'id'=>'comment', 'rows'=>'3', 'required' => 'required')) !!}
{!! Form::close() !!} @endif
@endsection