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

Manage Timesheet

@include('layouts.flash.alert')
{{ Form::model($timesheet, ['route' => ['timesheets.labour.update', $timesheet->id], 'method' => 'patch', 'enctype'=> 'multipart/form-data']) }}

Edit Timesheet

@php $total_spent_hour = $timesheet->total_spent_hour; $remaining_hour = $timesheet->remaining_hour; $spent_hour = $timesheet->spent_hour; $ts = $total_spent_hour; $as = ''; $as = $total_spent_hour; if (strpos($as, '.') !== false) { $h=strtok($as, '.'); $m=substr(strstr($as, '.'), 1); $ts=str_pad($h, 2, '0', STR_PAD_LEFT).':'.str_pad($m, 2, '0', STR_PAD_LEFT); $as=$ts; }else{ } if (strpos($as, ':') !== false) { }else{ $ts=str_pad($ts, 2, '0', STR_PAD_LEFT).':00'; } $rth=strtok($ts, ':'); $rtm=substr(strstr($ts, ':'), 1); $sth=strtok($spent_hour, ':'); $stm=substr(strstr($spent_hour, ':'), 1); if($rth != 00){ $real_total_spent_hour = abs($rth-$sth).':'.abs($rtm-$stm); }else{ $real_total_spent_hour = '00:00'; } $tt = $remaining_hour; $a = ''; $a = $remaining_hour; if (strpos($a, '.') !== false) { $h = strtok($a, '.'); $m = substr(strstr($a, '.'), 1); $tt = str_pad($h, 2, '0', STR_PAD_LEFT).':'.str_pad($m, 2, '0', STR_PAD_LEFT); $a = $tt; }else{ } if (strpos($a, ':') !== false) { }else{ $tt=str_pad($tt, 2, '0', STR_PAD_LEFT).':00'; } $remaining_hour = $tt; $allocated_hour = $timesheet->allocated_hour; $aa = $allocated_hour; $al = ''; $al = $allocated_hour; if (strpos($al, '.') !== false) { $h=strtok($al, '.'); $m=substr(strstr($al, '.'), 1); $aa=str_pad($h, 2, '0', STR_PAD_LEFT).':'.str_pad($m, 2, '0', STR_PAD_LEFT); $al=$aa; }else{ } if (strpos($al, ':') !== false) { }else{ $aa=str_pad($aa, 2, '0', STR_PAD_LEFT).':00'; } $allocated_hour = $aa; @endphp
Activity Code Activity Site Operative Allocated/hr Spent/hr Total Spent/hr Remaining/hr
{{ $timesheet->activityOfTimesheet->item_code }} {{ $timesheet->activity }} {{ $timesheet->peoples }} {{ $allocated_hour }} {{ $timesheet->spent_hour }} {{ $timesheet->total_spent_hour }} {{ $timesheet->remaining_hour }}
{{ Form::label('notes', 'Notes') }} {{ Form::textarea('notes', $timesheet->notes, [ 'class' => "form-control", 'id' => "notes", 'rows'=> 3 ]) }} @if($errors->has('notes')) {{ $errors->first('notes') }} @endif
{{ Form::file('files[]', [ 'class' => "custom-file-input", 'id' => "files", 'multiple'=> 'multiple' ]) }} @if($errors->has('files.*')) {{ $errors->first('files.*') }} @endif
{{ Form::close() }}
@stop @push('scripts') @endpush