@extends('user::layouts.master') @section('content')

Manage Timesheet

Timesheet

@php $total_hour = 0; $tmj = 0; $detailTimesheets = $timesheet->project->staffTimesheets() ->where('role', 'detail') ->where('sub_activity_id', $timesheet->sub_activity_id) ->groupBy('activity_id') ->get(); @endphp @if($detailTimesheets->isNotEmpty()) @foreach($detailTimesheets as $detailTimesheet) @php $detailTimesheets1 = $timesheet->project->staffTimesheets() ->where('role', 'detail') ->where('main_activity_id', $timesheet->main_activity_id) ->where('sub_activity_id', $timesheet->sub_activity_id) ->where('activity_id', $detailTimesheet->activity_id) ->get(); @endphp @if($detailTimesheets1->isNotEmpty()) @foreach($detailTimesheets1 as $detailTimesheet1) @php $tt = $detailTimesheet1->total_hours; $a = ''; $a = $detailTimesheet1->total_hours; if (strpos($a, ':') !== false) { }else{ $tt = str_pad($tt, 2, '0', STR_PAD_LEFT).':00'; } $dtm = new DateTime('2019-11-09 '.$tt.''); $time = $dtm->format('H:i'); $ph = $dtm->format('H'); $pm = $dtm->format('i'); $tmin = ($ph*60)+$pm; $user = \App\User::where('email', $detailTimesheet1->supervisor_email)->first(); @endphp @php $tmj=$tmj+$pm; @$total_hour=$total_hour+$ph; @endphp @endforeach @endif @php if($tmj > 60){ $total_hour = $total_hour + floor($tmj/60); $tmj = floor($tmj%60); } @endphp @endforeach @endif
Project: {{ $timesheet->project->display_project_title }} Area: {{ $timesheet->mainActivity->area }} Level: {{ $timesheet->mainActivity->level }}
Activity Code Sub Code Date Start Time End Time Hours People Total Hours
{{ $detailTimesheet1->activity }} {{ $detailTimesheet1->subActivity->activity }} / {{ $user ? $user->meuser_name : '' }} {{ $detailTimesheet1->timesheet_date }} {{ $detailTimesheet1->start_time }} {{ $detailTimesheet1->end_time }} {{ $tt }} {{ $detailTimesheet1->peoples }} {{ $tt }}
Total Hours : {{ $total_hour }}:{{ $tmj }}
@stop @push('scripts') @endpush