Commit 25c682c3 by Azhan Hannan

Project manager / HOD → checkbox function for project manager & HOD verification.

parent 46ded914
...@@ -235,7 +235,6 @@ ...@@ -235,7 +235,6 @@
</table> </table>
@endif @endif
@if(data_get($staff,'hodremarks')) @if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
......
...@@ -275,125 +275,143 @@ ...@@ -275,125 +275,143 @@
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
<table class="ui unstackable celled table"> <form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
<thead> {{csrf_field()}}
<tr> <input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<th style="width: 25%;">Overhead</th> <input type="hidden" name="page" value="{{$page}}">
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@foreach($detail as $key => $tp) <table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 25%;">Overhead</th>
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id')) @foreach($detail as $key => $tp)
<tr>
<td style="width: 25%;">{{data_get($tp, 'tp_project_name')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp,'tp_phase'), 'month'=>data_get($tp,'tp_month'), 'year'=>data_get($tp,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button>
@else
<a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tm_phase'), 'month' => data_get($staff,'tm_month'), 'year' => data_get($staff,'tm_year') ]) }}" class="center aligned ui blue icon button" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php $n = null; ?> @if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
@foreach($details as $key => $detail) <tr>
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id')) <td style="width: 25%;">
@foreach(data_get($detail,'notes') as $key => $value) @if(data_get($tp,'tp_timesheet_sts') == 2)
<?php $n = $value; ?> <div class="ui toggle checkbox">
@endforeach <input type="checkbox" name="pid[{{data_get($tp,'id')}}]" value="{{data_get($tp,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($tp, 'tp_project_name')}}
</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp,'tp_phase'), 'month'=>data_get($tp,'tp_month'), 'year'=>data_get($tp,'tp_year'), 'page'=>$page ]) }}';" type="button">Verify | Reject</button>
@else
<a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tm_phase'), 'month' => data_get($staff,'tm_month'), 'year' => data_get($staff,'tm_year') ]) }}" class="center aligned ui blue icon button" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php $n = null; ?>
@foreach($details as $key => $detail)
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
<?php $n = $value; ?>
@endforeach
@endif
@endforeach
@if($n)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($details as $key => $detail)
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif @endif
@endforeach
@if($n) @foreach ($ts as $key => $value)
<table class="ui unstackable celled table"> @if(data_get($value,'attachement'))
<thead> <table class="ui unstackable celled table">
<tr> <thead>
<th style="width: 10%" class="center aligned">Date</th> <tr>
<th style="width: 15%" class="single line"> Overhead Description</th> <th colspan="2" class="center aligned">Notes Attachment</th>
<th class="center aligned">Notes</th> </tr>
</tr> </thead>
</thead> <tbody>
@foreach($details as $key => $detail) <tr>
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id')) <td style="width: 4%;"></td>
@foreach(data_get($detail,'notes') as $key => $value) <td>
@if(data_get($value,'td_hours')) <a href="{{ asset(data_get($value,'attachement.path'))}}" target="_blank">
<tr> <button class="ui active button">
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td> <i class="download icon"></i>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td> Download
<td>{{data_get($value, 'td_overhead_note')}}</td> </button>
</tr> </a>
@endif </td>
@endforeach </tr>
@endif </tbody>
@endforeach </table>
</table> @endif
@endif @endforeach
@foreach ($ts as $key => $value) @if(data_get($staff,'hodremarks'))
@if(data_get($value,'attachement'))
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th colspan="2" class="center aligned">Notes Attachment</th> <th colspan="2" class="center aligned">Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
<td> <td>{{ data_get($staff,'hodremarks') }}</td>
<a href="{{ asset(data_get($value,'attachement.path'))}}" target="_blank">
<button class="ui active button">
<i class="download icon"></i>
Download
</button>
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@endif @endif
@endforeach <button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'tm_phase'), 'month'=>data_get($staff, 'tm_month'), 'year'=>data_get($staff, 'tm_year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
@if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>{{ data_get($staff,'hodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
</div> </div>
@endif @endif
......
...@@ -234,7 +234,6 @@ ...@@ -234,7 +234,6 @@
</table> </table>
@endif @endif
<!-- Overhead Notes End --> <!-- Overhead Notes End -->
</table> </table>
</div> </div>
</div> </div>
...@@ -305,50 +304,68 @@ ...@@ -305,50 +304,68 @@
</table> </table>
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
<table class="ui unstackable celled table"> <form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
<thead> {{csrf_field()}}
<tr> <input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<th style="width: 10%;">Project Code</th> <input type="hidden" name="page" value="{{$page}}">
<th style="width: 15;">Project Name</th> <table class="ui unstackable celled table">
<th style="width: 10%;" class="center aligned">Total Hours</th> <thead>
<th style="width: 10%;" class="center aligned">Total Days</th> <tr>
<th style="width: 30%">Remarks</th> <th style="width: 10%;">Project Code</th>
<th style="width: 13%" class="text-center">Status</th> <th style="width: 15;">Project Name</th>
<th style="width: 12%;" class="text-center">Action</th> <th style="width: 10%;" class="center aligned">Total Hours</th>
</tr> <th style="width: 10%;" class="center aligned">Total Days</th>
</thead> <th style="width: 30%">Remarks</th>
@foreach($details as $key => $detail) <th style="width: 13%" class="text-center">Status</th>
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid')) <th style="width: 12%;" class="text-center">Action</th>
<tr> </tr>
<td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td> </thead>
<td style="width: 15;">{{data_get($detail, 'tp_project_name')}}</td> @foreach($details as $key => $detail)
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td> @if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<td style="width: 10%;" class="center aligned"> <tr>
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }} <td style="width: 10%;" class="single line">
</td> @if(data_get($detail,'tp_timesheet_sts') == 2)
<td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td> <div class="ui toggle checkbox">
<td style="width: 13%" class="text-center"> <input type="checkbox" name="pid[{{data_get($detail,'id')}}]" value="{{data_get($detail,'id')}}">
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation </div>
@elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted @else
@elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM <div class="ui toggle checkbox">
@elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD <input type="checkbox" disabled="disabled">
@elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD </div>
@elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM @endif
@elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR {{data_get($detail, 'project.p_project_code')}}
@endif </td>
</td> <td style="width: 15;">{{data_get($detail, 'tp_project_name')}}</td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
@if(data_get($detail, 'tp_timesheet_sts') == 2) <td style="width: 10%;" class="center aligned">
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button> {{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
@else </td>
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target="_blank">View</a> <td style="width: 13%" class="text-center">
@endif @if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
</td> @elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
</tr> @elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@endif @elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@endforeach @elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
</table> @elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year'), 'page'=>$page ]) }}';" type="button">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target="_blank">View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'phase'), 'month'=>data_get($staff, 'month'), 'year'=>data_get($staff, 'year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
</div> </div>
@endif @endif
@endforeach @endforeach
......
...@@ -355,63 +355,16 @@ ...@@ -355,63 +355,16 @@
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
<form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
<table class="ui unstackable celled table"> {{csrf_field()}}
<thead> <input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<tr> <input type="hidden" name="page" value="{{$page}}">
<th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</th>
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@foreach($details as $key => $detail)
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year'), 'page' => $page]) }}';">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
@if($checkoverhead)
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 25%;">Overhead</th> <th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</th>
<th style="width: 10%;" class="center aligned">Total Hours</th> <th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th> <th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th> <th style="width: 30%">Remarks</th>
...@@ -419,32 +372,43 @@ ...@@ -419,32 +372,43 @@
<th style="width: 12%;" class="text-center">Action</th> <th style="width: 12%;" class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
@foreach($details as $key => $detail)
@foreach($overheads as $key => $tp) @if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr> <tr>
<td style="width: 25;">{{data_get($tp, 'tp_project_name')}}</td> <td style="width: 10%;" class="single line">
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td> @if(data_get($detail,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($detail,'id')}}]" value="{{data_get($detail,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($detail, 'project.p_project_code')}}
</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned"> <td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }} {{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td> </td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td> <td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center"> <td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation @if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted @elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU @elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD @elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD @elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU @elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR @elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif @endif
</td> </td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year'), 'page' => $page]) }}';" type="button">Verify | Reject</button>
@else @else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</a> <a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif @endif
</td> </td>
...@@ -452,30 +416,96 @@ ...@@ -452,30 +416,96 @@
@endif @endif
@endforeach @endforeach
</table> </table>
<table class="ui unstackable celled table"> <?php
<thead> $overhead = $overheads->where('staffid', $staff->staff_id);
<tr> $checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
<th style="width: 10%" class="center aligned">Date</th> ?>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th> @if($checkoverhead)
</tr> <table class="ui unstackable celled table">
</thead> <thead>
@foreach($overheads as $key => $overhead) <tr>
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid')) <th style="width: 25%;">Overhead</th>
@foreach(data_get($overhead,'notes') as $key => $value) <th style="width: 10%;" class="center aligned">Total Hours</th>
@if(data_get($value,'td_hours')) <th style="width: 10%;" class="center aligned">Total Days</th>
<tr> <th style="width: 30%">Remarks</th>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td> <th style="width: 13%" class="text-center">Status</th>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td> <th style="width: 12%;" class="text-center">Action</th>
<td>{{data_get($value, 'td_overhead_note')}}</td> </tr>
</tr> </thead>
@endif
@endforeach @foreach($overheads as $key => $tp)
@endif @if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
@endforeach <tr>
</table> <td style="width: 25;">
@endif @if(data_get($tp,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($tp,'id')}}]" value="{{data_get($tp,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($tp, 'tp_project_name')}}
</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($overheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'tm_phase'), 'month'=>data_get($staff, 'tm_month'), 'year'=>data_get($staff, 'tm_year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
</div> </div>
@endif @endif
@endforeach @endforeach
...@@ -563,63 +593,15 @@ ...@@ -563,63 +593,15 @@
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
<form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
<table class="ui unstackable celled table"> {{csrf_field()}}
<thead> <input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<tr> <input type="hidden" name="page" value="{{$page}}">
<th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</th>
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@foreach($details as $key => $detail)
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
@if($checkoverhead)
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 25%;">Overhead</th> <th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</th>
<th style="width: 10%;" class="center aligned">Total Hours</th> <th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th> <th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th> <th style="width: 30%">Remarks</th>
...@@ -627,32 +609,43 @@ ...@@ -627,32 +609,43 @@
<th style="width: 12%;" class="text-center">Action</th> <th style="width: 12%;" class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
@foreach($details as $key => $detail)
@foreach($overheads as $key => $tp) @if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr> <tr>
<td style="width: 25;">{{data_get($tp, 'tp_project_name')}}</td> <td style="width: 10%;" class="single line">
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td> @if(data_get($detail,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($detail,'id')}}]" value="{{data_get($detail,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($detail, 'project.p_project_code')}}
</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned"> <td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }} {{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td> </td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td> <td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center"> <td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation @if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted @elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU @elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD @elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD @elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU @elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR @elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif @endif
</td> </td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';">Verify | Reject</button>
@else @else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a> <a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif @endif
</td> </td>
...@@ -660,30 +653,95 @@ ...@@ -660,30 +653,95 @@
@endif @endif
@endforeach @endforeach
</table> </table>
<table class="ui unstackable celled table"> <?php
<thead> $overhead = $overheads->where('staffid', $staff->staff_id);
<tr> $checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
<th style="width: 10%" class="center aligned">Date</th> ?>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th> @if($checkoverhead)
</tr> <table class="ui unstackable celled table">
</thead> <thead>
@foreach($overheads as $key => $overhead) <tr>
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid')) <th style="width: 25%;">Overhead</th>
@foreach(data_get($overhead,'notes') as $key => $value) <th style="width: 10%;" class="center aligned">Total Hours</th>
@if(data_get($value,'td_hours')) <th style="width: 10%;" class="center aligned">Total Days</th>
<tr> <th style="width: 30%">Remarks</th>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td> <th style="width: 13%" class="text-center">Status</th>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td> <th style="width: 12%;" class="text-center">Action</th>
<td>{{data_get($value, 'td_overhead_note')}}</td> </tr>
</tr> </thead>
@endif
@endforeach @foreach($overheads as $key => $tp)
@endif @if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
@endforeach <tr>
</table> <td style="width: 25;" class="single line">
@endif @if(data_get($tp,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($tp,'id')}}]" value="{{data_get($tp,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($tp, 'tp_project_name')}}
</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($overheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'tm_phase'), 'month'=>data_get($staff, 'tm_month'), 'year'=>data_get($staff, 'tm_year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
</div> </div>
@endif @endif
@endforeach @endforeach
......
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui green left ribbon label">Timesheet Verification</a>
<a class="ui right floated center aligned teal compact button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'STAFF_ID') ,'phase' => $phase, 'month' => $month , 'year' => $year ]) }}" target="_blank">View Timesheet</a>
<br>
<table class="ui unstackable collapsing table" style="width: 100%">
<tbody>
<tr>
<td rowspan="3">
<img src="{{ url('img/3f-logo.svg') }}" height="126" width="126" alt="3f-logo">
</td>
<td>Name</td>
<td>:</td>
<td>{{ data_get($staff,'STAFF_NAME') }}</td>
<td rowspan="3"></td>
<td>Department</td>
<td>:</td>
<td>{{ data_get($staff,'DEPARTMENT') }}</td>
<td rowspan="3"></td>
</tr>
<tr>
<td>Staff No</td>
<td>:</td>
<td>{{ data_get($staff,'STAFF_ID') }}</td>
<td>Reporting Manager</td>
<td>:</td>
<td>{{ data_get($staff,'HOD_NAME') }}</td>
</tr>
<tr>
<td>Month</td>
<td>:</td>
<td>{{ $strMonth }}</td>
<td>Phase</td>
<td>:</td>
<td>
@if($phase == 1) 1st Half-month
@else 2nd Half-month
@endif
</td>
</tr>
</tbody>
</table>
@if(count($chargeablelist) > 0)
<table class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="3" rowspan="2" class="center aligned">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 10%;">Project Code</th>
<th style="width: 13%;">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($chargeablelist as $key => $projectchargeable)
<?php $totalcharge = 0; ?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 10%;">{{ $projectchargeable['pcode']}}</td>
<td style="width: 13%;">{{ $projectchargeable['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
// dd('masuk');
// dd($chargehour);
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->where('td_hours','<>',0)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
// dump($totalcharge);
}
// dump($valchargehour);
?>
@if($valchargehour)
<td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->where('td_hours','<>',0)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour)
<td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totalcharge)
<td style="width: 5%">{{ number_format($totalcharge, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totalcharge/8, 1, '.', '') }}</td>
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="3">Total (A)</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour)
{
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value)
{
$totalcbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalcbyday }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour)
{
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value)
{
$totalcbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalcbyday }}</th>
@endfor
@endif
<th>@if($totalchargehrs){{ $totalchargehrs }}@else 0 @endif</th>
<th>@if($totalchargehrs){{ number_format($totalchargehrs/8, 1, '.', '') }}@else 0 @endif</th>
</tfoot> -->
</table>
@endif
@if(count($overheadlist) > 0)
<table class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" rowspan="3" class="center aligned" style="width: 27%;">Overhead</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($overheadlist as $key => $projectoverhead)
<?php $totaloverhead = 0; ?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">{{ $projectoverhead['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
// dd('masuk');
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totaloverhead)
<td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td>
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="2">Total (B)</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th>
@endfor
@endif
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs, 1, '.', '') }} @else 0 @endif</th>
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> -->
</table>
@endif
<div class="ui segment">
<form action="{{ route('timesheet::dashboard.verificationselected') }}" method="POST" class="ui form">
{{csrf_field()}}
<input type="hidden" name="page" value="{{$page}}">
<input type="hidden" name="tmid" value="{{data_get($tm,'id')}}">
@foreach($profile as $key => $value)
<input type="hidden" name="pid[{{$key}}]" value="{{ data_get($value,'id') }}">
@endforeach
<div class="two fields">
<div class="field">
<input type="hidden" name="approval" value="{{ data_get($pm,'id') }}">
<label>Verifier</label>
<input type="text" readonly="readonly" value="{{ data_get($pm,'name') }}">
</div>
<div class="field">
<label>Action</label>
<select class="ui fluid dropdown" name="action">
<option value="1">Verify</option>
<option value="2">Reject</option>
</select>
</div>
</div>
<div class="field">
<label>Remarks</label>
<textarea rows="3" name="remarks"></textarea>
</div>
<button class="ui green button" type="submit">Submit</button>
</form>
</div>
</div>
@endsection
\ No newline at end of file
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui green left ribbon label">Project Verification</a>
<a class="ui right floated center aligned teal compact button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'STAFF_ID') ,'phase' => $phase, 'month' => $month , 'year' => $year ]) }}" target="_blank">View Timesheet</a>
<br>
<table class="ui unstackable collapsing table" style="width: 100%">
<tbody>
<tr>
<td rowspan="3">
<img src="{{ url('img/3f-logo.svg') }}" height="126" width="126" alt="3f-logo">
</td>
<td>Name</td>
<td>:</td>
<td>{{ data_get($staff,'STAFF_NAME') }}</td>
<td rowspan="3"></td>
<td>Department</td>
<td>:</td>
<td>{{ data_get($staff,'DEPARTMENT') }}</td>
<td rowspan="3"></td>
</tr>
<tr>
<td>Staff No</td>
<td>:</td>
<td>{{ data_get($staff,'STAFF_ID') }}</td>
<td>Reporting Manager</td>
<td>:</td>
<td>{{ data_get($staff,'HOD_NAME') }}</td>
</tr>
<tr>
<td>Month</td>
<td>:</td>
<td>{{ $strMonth }}</td>
<td>Phase</td>
<td>:</td>
<td>
@if($phase == 1) 1st Half-month
@else 2nd Half-month
@endif
</td>
</tr>
</tbody>
</table>
@if(count($chargeablelist) > 0)
<table class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="3" rowspan="2" class="center aligned">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 10%;">Project Code</th>
<th style="width: 13%;">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($chargeablelist as $key => $projectchargeable)
<?php $totalcharge = 0; ?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 10%;">{{ $projectchargeable['pcode']}}</td>
<td style="width: 13%;">{{ $projectchargeable['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
// dd('masuk');
// dd($chargehour);
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->where('td_hours','<>',0)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
// dump($totalcharge);
}
// dump($valchargehour);
?>
@if($valchargehour)
<td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->where('td_hours','<>',0)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour)
<td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totalcharge)
<td style="width: 5%">{{ number_format($totalcharge, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totalcharge/8, 1, '.', '') }}</td>
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="3">Total (A)</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour)
{
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value)
{
$totalcbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalcbyday }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour)
{
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value)
{
$totalcbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalcbyday }}</th>
@endfor
@endif
<th>@if($totalchargehrs){{ $totalchargehrs }}@else 0 @endif</th>
<th>@if($totalchargehrs){{ number_format($totalchargehrs/8, 1, '.', '') }}@else 0 @endif</th>
</tfoot> -->
</table>
@endif
@if(count($overheadlist) > 0)
<table class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" rowspan="3" class="center aligned" style="width: 27%;">Overhead</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($overheadlist as $key => $projectoverhead)
<?php $totaloverhead = 0; ?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">{{ $projectoverhead['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
// dd('masuk');
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totaloverhead)
<td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td>
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="2">Total (B)</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th>
@endfor
@endif
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs, 1, '.', '') }} @else 0 @endif</th>
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> -->
</table>
@endif
</div>
<div class="ui segment">
<form action="{{ route('timesheet::dashboard.verificationall') }}" method="POST" class="ui form">
{{csrf_field()}}
<input type="hidden" name="page" value="{{$page}}">
<input type="hidden" name="tmid" value="{{data_get($tm,'id')}}">
@foreach($chargeableproject as $key => $value)
<input type="hidden" name="cid[{{$key}}]" value="{{ data_get($value,'id') }}">
@endforeach
@foreach($overheadproject as $key => $value)
<input type="hidden" name="oid[{{$key}}]" value="{{ data_get($value,'id') }}">
@endforeach
<div class="two fields">
<div class="field">
<input type="hidden" name="approval" value="{{ data_get($verifier,'id') }}">
<label>Approver</label>
<input type="text" readonly="readonly" value="{{ data_get($verifier,'name') }}">
</div>
<div class="field">
<label>Action</label>
<select class="ui fluid dropdown" name="action">
<option value="1">Verify</option>
<option value="2">Reject</option>
</select>
</div>
</div>
<div class="field">
<label>Remarks</label>
<textarea rows="3" name="remarks"></textarea>
</div>
<button class="ui green button" type="submit">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
...@@ -49,6 +49,11 @@ Route::group( ...@@ -49,6 +49,11 @@ Route::group(
Route::post('approvalselected', ['uses' => 'DashboardController@approvalselected', 'as' => 'dashboard.approvalselected']); Route::post('approvalselected', ['uses' => 'DashboardController@approvalselected', 'as' => 'dashboard.approvalselected']);
Route::get('approveallaction', ['uses' => 'DashboardController@approveallaction', 'as' => 'dashboard.approveallaction']); Route::get('approveallaction', ['uses' => 'DashboardController@approveallaction', 'as' => 'dashboard.approveallaction']);
Route::post('approvalall', ['uses' => 'DashboardController@approvalall', 'as' => 'dashboard.approvalall']); Route::post('approvalall', ['uses' => 'DashboardController@approvalall', 'as' => 'dashboard.approvalall']);
Route::post('selectverification', ['uses' => 'DashboardController@selectverification', 'as' => 'dashboard.selectverification']);
Route::post('verificationselected', ['uses' => 'DashboardController@verificationselected', 'as' => 'dashboard.verificationselected']);
Route::get('selectverificationpage', ['uses' => 'DashboardController@selectverificationpage', 'as' => 'dashboard.selectverificationpage']);
Route::get('verifyallaction', ['uses' => 'DashboardController@verifyallaction', 'as' => 'dashboard.verifyallaction']);
Route::post('verificationall', ['uses' => 'DashboardController@verificationall', 'as' => 'dashboard.verificationall']);
//laporan //laporan
Route::get('ringkasanLaporan', ['uses' => 'ReportController@ringkasanLaporan', 'as' => 'report.ringkasanLaporan']); Route::get('ringkasanLaporan', ['uses' => 'ReportController@ringkasanLaporan', 'as' => 'report.ringkasanLaporan']);
......
...@@ -2380,7 +2380,7 @@ class DashboardController extends Controller ...@@ -2380,7 +2380,7 @@ class DashboardController extends Controller
} }
return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth')); return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth'));
} }
public function approvalselected(Request $request) public function approvalselected(Request $request)
{ {
...@@ -2788,6 +2788,888 @@ class DashboardController extends Controller ...@@ -2788,6 +2788,888 @@ class DashboardController extends Controller
} }
} }
public function selectverification(Request $request)
{
if($request->pid)
{
}
else
{
return redirect()->route('timesheet::dashboard.index')->withErrors('Please choose at lease one project for verification action');
}
// dd($request);
$pid = [];
foreach ($request->pid as $key => $value) {
$pid[] = $value;
}
$page = data_get($request,'page');
// dd($page);
$user = Staff_info::where('id', Auth::id())->first();
$pm = Users::find(Auth::id());
$tm = Ts_master::where('id', $request->tmid)->first();
// dd($tm);
$staffid = data_get($tm,'tm_staff_id');
$profile = Tproject::whereIn('id', $pid)
->with('team')
->get();
// dd($profile);
$phase = $tm->tm_phase;
$month = $tm->tm_month;
$year = $tm->tm_year;
$staff = VwViewer::where('STAFF_ID', $tm->tm_staff_id)
->first();
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.'1'.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strMonth = $date->format('F');
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$chargeable = 1;
$overhead = 3;
$check = Ts_master::where('tm_staff_id', $tm->tm_staff_id)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->with('attachement')
->first();
$chargeableproject = Tproject::whereIn('id', $pid)
->where('tp_project_type', 1)
->with('project')
->get();
$chargeablelist = [];
$overheadlist = [];
foreach($chargeableproject as $key => $value) {
// dd($value);
$chargeablelist[] = [
'pid' => $value->td_project,
'pcode' => data_get($value,'project.p_project_code'),
'pname' => data_get($value,'tp_project_name'),
];
}
// dd($chargeablelist);
if($check)
{
$chargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $chargeable)
// ->where('td_hours', '!=', 0)
->get();
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
->get();
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour[0]))
{
// dd('sini ke?');
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0;
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
if (count($profile) > 0) {
foreach ($profile as $key => $value) {
if($value->tp_project_type == 3){
$overheadlist[] = [
'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name,
];
}
}
// dd($overheadlist);
}
}
else
{
// dd('ke sini?');
}
$totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_hours')
->orderby('td_date')
->get();
}
else
{
$chargehour = null;
$overheadhour = null;
$totalchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
$check = null;
}
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth'));
}
public function verificationselected(Request $request)
{
$user = Staff_info::where('id', Auth::id())->first();
$pid = [];
foreach ($request->pid as $key => $value) {
$pid[] = $value;
}
$tmid = $request->tmid;
$page = data_get($request,'page');
$tmaster = Ts_master::where('id', data_get($request,'tmid'))->first();
$year = data_get($tmaster,'tp_year');
$month = data_get($tmaster,'tp_month');
$phase = data_get($tmaster,'tp_phase');
if($request->action == 2 && $request->remarks == null)
{
return redirect()->route('timesheet::dashboard.selectverificationpage', compact('tmid','page','pid'))->with('warning','You wanted to reject the submission. Kindly give remarks for staff references. Thank you.');
}
// dd('wait a minute');
if ($request->action == 1) {
$projects = Tproject::whereIn('id',$pid)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => data_get($request,'remarks'),
'tp_verified_at' => today()->toDateString(),
'tp_verified_by' => data_get($user,'fk_users'),
]);
$checkprojectsapproved = Tproject::where('fk_tm_id', $tmid)
->where('tp_timesheet_sts', 3)
->get();
$totalprojects = Tproject::where('fk_tm_id', $tmid)->get();
if(count($checkprojectsapproved) == count($totalprojects))
{
Ts_master::where('id', $tmid)
->update([
'tm_timesheet_master_sts' => 3,
]);
}
if (count($pid) == 1)
{
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been verified successfully');
}
else
{
return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been verified successfully');
}
}
if ($request->action == 2) {
$projects = Tproject::whereIn('id',$pid)
->update([
'tp_timesheet_sts' => 6,
'verifier_remark' => data_get($request,'remarks'),
]);
$checkprojectsrejected = Tproject::where('fk_tm_id', $tmid)
->where('tp_timesheet_sts', 6)
->get();
$totalprojects = Tproject::where('fk_tm_id', $tmid)->get();
if(count($checkprojectsrejected) == count($totalprojects))
{
Ts_master::where('id', $tmid)
->update([
'tm_timesheet_master_sts' => 6,
]);
}
if (count($pid) == 1)
{
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected');
}
else
{
return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been rejected');
}
}
}
public function selectverificationpage(Request $request)
{
$pid = [];
foreach ($request->pid as $key => $value) {
$pid[] = $value;
}
$page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first();
// dd($user);
$pm = Users::find(Auth::id());
$tm = Ts_master::where('id', $request->tmid)->first();
$staffid = data_get($tm,'tm_staff_id');
$profile = Tproject::whereIn('id', $pid)
->with('team')
->get();
// dd($profile);
$phase = $tm->tm_phase;
$month = $tm->tm_month;
$year = $tm->tm_year;
$staff = VwViewer::where('STAFF_ID', $tm->tm_staff_id)
->first();
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.'1'.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strMonth = $date->format('F');
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$chargeable = 1;
$overhead = 3;
$check = Ts_master::where('tm_staff_id', $tm->tm_staff_id)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->with('attachement')
->first();
$chargeableproject = Tproject::whereIn('id', $pid)
->where('tp_project_type', 1)
->with('project')
->get();
$chargeablelist = [];
$overheadlist = [];
foreach($chargeableproject as $key => $value) {
// dd($value);
$chargeablelist[] = [
'pid' => $value->td_project,
'pcode' => data_get($value,'project.p_project_code'),
'pname' => data_get($value,'tp_project_name'),
];
}
// dd($chargeablelist);
if($check)
{
$chargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $chargeable)
// ->where('td_hours', '!=', 0)
->get();
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
->get();
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour[0]))
{
// dd('sini ke?');
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0;
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
if (count($profile) > 0) {
foreach ($profile as $key => $value) {
if($value->tp_project_type == 3){
$overheadlist[] = [
'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name,
];
}
}
// dd($overheadlist);
}
}
else
{
// dd('ke sini?');
}
$totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_hours')
->orderby('td_date')
->get();
}
else
{
$chargehour = null;
$overheadhour = null;
$totalchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
$check = null;
}
$page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first();
// dd($user);
$bod = Users::find(Auth::id());
$tm = Ts_master::where('id', $request->tmid)->first();
$staffid = data_get($tm,'tm_staff_id');
$profile = Tproject::whereIn('id', $pid)
->with('team')
->get();
// dd($profile);
$phase = $tm->tm_phase;
$month = $tm->tm_month;
$year = $tm->tm_year;
$staff = VwViewer::where('STAFF_ID', $tm->tm_staff_id)
->first();
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.'1'.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strMonth = $date->format('F');
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$chargeable = 1;
$overhead = 3;
$check = Ts_master::where('tm_staff_id', $tm->tm_staff_id)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->with('attachement')
->first();
$chargeableproject = Tproject::whereIn('id', $pid)
->where('tp_project_type', 1)
->with('project')
->get();
$chargeablelist = [];
$overheadlist = [];
foreach($chargeableproject as $key => $value) {
// dd($value);
$chargeablelist[] = [
'pid' => $value->td_project,
'pcode' => data_get($value,'project.p_project_code'),
'pname' => data_get($value,'tp_project_name'),
];
}
// dd($chargeablelist);
if($check)
{
$chargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $chargeable)
// ->where('td_hours', '!=', 0)
->get();
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
->get();
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour[0]))
{
// dd('sini ke?');
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0;
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
if (count($profile) > 0) {
foreach ($profile as $key => $value) {
if($value->tp_project_type == 3){
$overheadlist[] = [
'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name,
];
}
}
// dd($overheadlist);
}
}
else
{
// dd('ke sini?');
}
$totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_hours')
->orderby('td_date')
->get();
}
else
{
$chargehour = null;
$overheadhour = null;
$totalchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
$check = null;
}
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth'));
}
public function verifyallaction(Request $request)
{
$user = Staff_info::where('id', Auth::id())->first();
$chargeableproject = Tproject::where('tp_project_type', 1)
->where('fk_tm_id', $request->tmid)
->where('tp_timesheet_sts', 2)
->where('tp_pm', $user->staff_id)
->with('project')
->get();
$overheadproject = Tproject::where('tp_project_type', 3)
->where('fk_tm_id', $request->tmid)
->where('tp_timesheet_sts', 2)
->where('tp_pm', $user->id)
->with('overhead')
->get();
$checktp = Tproject::where('fk_tm_id', $request->tmid)
->where('tp_timesheet_sts', 2)
->where('tp_project_type', 1)
->where('tp_pm', $user->staff_id)
->with('overhead')
->get();
$checkoverhead = Tproject::where('fk_tm_id', $request->tmid)
->where('tp_timesheet_sts', 2)
->where('tp_project_type', 3)
->where('tp_pm', $user->id)
->with('overhead')
->get();
if (count($checktp)+count($checkoverhead) == 0) {
return redirect()->route('timesheet::dashboard.index')->withWarning('No pending verification for the staff');
}
$tm = Ts_master::where('id', data_get($request,'tmid'))->first();
$page = data_get($request,'page');
$verifier = Users::find(Auth::id());
$staffid = data_get($tm,'tm_staff_id');
// dd($staffid);
// $profile = Tproject::whereIn('id', $pid)
// ->with('team')
// ->get();
// dd($profile);
$phase = $tm->tm_phase;
$month = $tm->tm_month;
$year = $tm->tm_year;
// dd($tm);
$staff = VwViewer::where('STAFF_ID', data_get($tm,'tm_staff_id'))
->first();
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.'1'.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strMonth = $date->format('F');
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
// $profiles = Tproject::where('fk_tm_id', $request->tmid)
// ->where('tp_timesheet_sts', 3)
// ->with('team')
// ->get();
// dd($profiles);
$chargeable = 1;
$overhead = 3;
$check = Ts_master::where('id', $request->tmid)
->with('attachement')
->first();
$chargeablelist = [];
$overheadlist = [];
foreach($chargeableproject as $key => $value)
{
$chargeablelist[] = [
'pid' => $value->td_project,
'pcode' => data_get($value,'project.p_project_code'),
'pname' => data_get($value,'tp_project_name'),
];
}
// dd($check);
if($check)
{
$chargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $chargeable)
->get();
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
->get();
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour[0]))
{
// dd('sini ke?');
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0;
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
if (count($overheadproject) > 0) {
foreach ($overheadproject as $key => $value) {
if($value->tp_project_type == 3){
$overheadlist[] = [
'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name,
];
}
}
}
}
else
{
// dd('ke sini?');
}
$totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_hours')
->orderby('td_date')
->get();
}
else
{
$chargehour = null;
$overheadhour = null;
$totalchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
$check = null;
}
return view('timesheet::dashboard.verifyallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'verifier'));
}
public function verificationall(Request $request)
{
// dd($request);
$user = Staff_info::where('id', Auth::id())->first();
if (data_get($request,'action') == 2 && data_get($request,'remarks') == null) {
// dd('sini');
$tmid = data_get($request,'tmid');
$page = data_get($request,'page');
return redirect()->route('timesheet::dashboard.verifyallaction', compact('tmid', 'page'))->with('warning','Please enter remarks for the timesheet rejection');
}
// dd($request);
if (data_get($request,'cid')) {
$cid = [];
$cpid = [];
foreach (data_get($request,'cid') as $key => $value) {
$cid[] = $value;
$data = Tproject::where('id', $value)->first();
$cpid[] = data_get($data,'td_project');
}
}
if (data_get($request,'oid')) {
$oid = [];
$opid = [];
foreach (data_get($request,'oid') as $key => $value) {
$oid[] = $value;
$odata = Tproject::where('id', $value)->first();
$opid[] = data_get($odata,'fk_o_id');
}
}
if (data_get($request,'action') == 1)
{
if (data_get($request,'cid')) {
Tproject::whereIn('id', $cid)
->where('tp_pm', $user->staff_id)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => data_get($request,'remarks'),
'tp_verified_by' => data_get($user,'fk_users'),
'tp_verified_at' => today()->toDateString(),
]);
Ts_detail::where('fk_tm_id', $request->tmid)
->whereIn('td_project', $cpid)
->update([
'td_timesheet_sts' => 3,
]);
}
if (data_get($request,'oid')) {
Tproject::whereIn('id', $oid)
->where('tp_pm', $user->id)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => data_get($request,'remarks'),
]);
Ts_detail::where('fk_tm_id', $request->tmid)
->whereIn('fk_o_id', $opid)
->update([
'td_timesheet_sts' => 3,
]);
}
$verifiedprojects = Tproject::where('fk_tm_id', data_get($request,'tmid'))
->where('tp_timesheet_sts', 3)
->get();
$allprojects = Tproject::where('fk_tm_id', data_get($request,'tmid'))
->get();
// dump(count($verifiedprojects));
// dd(count($allprojects));
if(count($verifiedprojects) == count($allprojects))
{
Ts_master::where('id', data_get($request,'tmid'))
->update([
'tm_timesheet_master_sts' => 3,
]);
}
return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been approved successfully');
}
if (data_get($request,'action') == 2)
{
if (data_get($request,'cid')) {
$rejectedallchargeables = Tproject::whereIn('id', $cid)->get();
foreach ($rejectedallchargeables as $key => $value) {
$value->tp_timesheet_sts = 6;
$value->verifier_remark = data_get($request,'remarks');
$value->save();
}
Ts_detail::where('fk_tm_id', $request->tmid)
->whereIn('td_project', $cpid)
->update([
'td_timesheet_sts' => 6,
]);
}
if (data_get($request,'oid')) {
$rejectedalloverheads = Tproject::whereIn('id', $oid)->get();
foreach ($rejectedalloverheads as $key => $value) {
$value->tp_timesheet_sts = 6;
$value->verifier_remark = data_get($request,'remarks');
$value->save();
}
Ts_detail::where('fk_tm_id', $request->tmid)
->whereIn('fk_o_id', $opid)
->update([
'td_timesheet_sts' => 6,
]);
}
$rejectedprojects = Tproject::where('fk_tm_id', data_get($request,'tmid'))
->where('tp_timesheet_sts', 6)
->get();
$allprojects = Tproject::where('fk_tm_id', data_get($request,'tmid'))
->get();
// dump(count($rejectedprojects));
// dd(count($allprojects));
if(count($rejectedprojects) == count($allprojects))
{
Ts_master::where('id', data_get($request,'tmid'))
->update([
'tm_timesheet_master_sts' => 6,
]);
}
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully');
}
}
public function filterHrStaffsTimesheet() public function filterHrStaffsTimesheet()
{ {
$currmonth = date('n'); $currmonth = date('n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment