Commit d04f1c6d by Azhan Hannan

changes

parent 19511ea7
...@@ -192,179 +192,179 @@ ...@@ -192,179 +192,179 @@
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?> <?php $page = 1; ?>
@foreach($profile as $key => $staff) @if(count($profile) > 0)
@if(data_get($staff,'status') == 2 || data_get($staff,'status') == 3 || data_get($staff,'status') == 6 ) @foreach($profile as $key => $staff)
<?php @if(data_get($staff,'status') == 2 || data_get($staff,'status') == 3 || data_get($staff,'status') == 6 )
$detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_type', 3)->whereIn('tp_timesheet_sts', [2,3,6]); <?php
$ts = $checkts->where('tm_staff_id', $staff->staff_id); $detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_type', 3)->whereIn('tp_timesheet_sts', [2,3,6]);
?> $ts = $checkts->where('tm_staff_id', $staff->staff_id);
?>
@if(count($detail) > 0) @if(count($detail) > 0)
<div class="title"> <div class="title">
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th> <th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center"> <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') }} @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>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
<?php <?php
$overheadverified = 0; $overheadverified = 0;
foreach ($details as $key => $value) foreach ($details as $key => $value)
{ {
if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3) if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3)
$overheadverified += 1; $overheadverified += 1;
} }
?> ?>
@if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR @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 == 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 == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 4) <i class="green check icon"></i>Approved by BOD @elseif($staff->status == 4) <i class="green check icon"></i>Approved by BOD
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD @elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD
@elseif($overheadverified > 0 && $overheadverified == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU @elseif($overheadverified > 0 && $overheadverified == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($overheadverified != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted @elseif($overheadverified != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 1 || $staff->status == null) In Preparation @elseif($staff->status == 1 || $staff->status == null) In Preparation
@endif @endif
</th> </th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($staff,'submission'))) }}</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"> <th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Details</button> <button class="center aligned ui blue icon button">View Details</button>
</th> </th>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
<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: 25%;">Overhead</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>
<th style="width: 13%" class="text-center">Status</th> <th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th> <th style="width: 12%;" class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
@foreach($detail as $key => $tp) @foreach($detail as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id')) @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: 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">{{data_get($tp, '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($tp, 'tp_hours')/8, 1, '.', '') }}
</td> </td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td> <td style="width: 30%">{{data_get($tp, '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($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') == 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') == 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') == 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') == 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') == 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 @elseif(data_get($tp, '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($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> <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 @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> <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 @endif
</td> </td>
</tr> </tr>
@endif @endif
@endforeach @endforeach
</table> </table>
<?php $n = null; ?> <?php $n = null; ?>
@foreach($details as $key => $detail) @foreach($details as $key => $detail)
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id')) @if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value) @foreach(data_get($detail,'notes') as $key => $value)
<?php $n = $value; ?> <?php $n = $value; ?>
@endforeach @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 </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
@endif
@endforeach
@if(count($details) == 0) @endif
@endforeach
@else
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
......
...@@ -155,7 +155,7 @@ class DashboardController extends Controller ...@@ -155,7 +155,7 @@ class DashboardController extends Controller
->with('attachement') ->with('attachement')
->get(); ->get();
return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'details', 'checkts')); return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'checkts', 'details'));
} }
if ( $roleid == '8') { if ( $roleid == '8') {
......
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