Commit 5e2ce6b4 by Azhan Hannan

Dashboard Hod → kalau takde tproject yg pending, tak perlu display

parent d456d697
......@@ -11,173 +11,187 @@
<?php $page = 1; ?>
@foreach($profile as $key => $staff)
@if(data_get($staff,'status') == 2)
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">
@if(data_get($staff,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'tm_month'), 10)) }} - {{ data_get($staff,'tm_year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
$over = 0;
// dd($details);
foreach ($details as $key => $value) {
if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3)
$over += 1;
}
// dump($over);
// dump(data_get($staff,'status'));
?>
@if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 4) <i class="green check icon"></i>Verified by BOD
@elseif($over > 0 && $over == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($over != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 1 || $staff->status == null) In Preparation
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($staff,'submission'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Details</button>
</th>
</tr>
</thead>
</table>
</div>
<?php
$detail = $details->where('staffid', $staff->staff_id);
$detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_sts', 2);
$ts = $checkts->where('tm_staff_id', $staff->staff_id);
// dump($detail);
?>
<div class="content" style="padding-top: 0px;">
<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(count($detail) > 0)
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">
@if(data_get($staff,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'tm_month'), 10)) }} - {{ data_get($staff,'tm_year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
$over = 0;
// dd($details);
foreach ($details as $key => $value) {
@foreach($detail as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<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
if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3)
$over += 1;
}
// dump($over);
// dump(data_get($staff,'status'));
?>
@if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 4) <i class="green check icon"></i>Verified by BOD
@elseif($over > 0 && $over == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($over != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 1 || $staff->status == null) In Preparation
@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
<button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif
<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>
</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
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($staff,'submission'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Details</button>
</th>
</tr>
</thead>
</table>
</div>
@if($n)
<div class="content" style="padding-top: 0px;">
<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">{{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
<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>
@foreach($detail as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<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
<button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif
<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>
</td>
</tr>
@endif
@endforeach
</table>
@endif
@foreach ($ts as $key => $value)
@if(data_get($value,'attachement'))
<?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">{{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
@foreach ($ts as $key => $value)
@if(data_get($value,'attachement'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<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>
</tbody>
</table>
@endif
@endforeach
@if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
<th colspan="2" class="center aligned">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<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>
<td>{{ data_get($staff,'hodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
@endforeach
@endif
</div>
@endif
@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>
@endif
@endforeach
@if(count($detail) == 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">No pending verification</th>
</tr>
</thead>
</table>
@endif
</div>
</div>
@endsection
......
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