Commit 7aaf6e4a by Azhan Hannan

fixing issue pmhod

parent 5975c6b6
......@@ -29,7 +29,7 @@
<h3 class="header link">Timesheet Diluluskan</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="icon calendar check outline"></i>1</span>
</div>
</a>
......@@ -40,8 +40,8 @@
<br>
<br>
@foreach($timesheet as $key => $time)
<!-- <?php
// dd($time->tm_timesheet_master_sts);
<!-- <?php
// dd($time->tm_timesheet_master_sts);
?> -->
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
......@@ -58,7 +58,7 @@
@elseif(data_get($time,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 6) <i class="red attention icon"></i> Rejected by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 6) <i class="red attention icon"></i> Rejected by HOD/HOU/PM
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($time,'tm_submission_at'))) }}</th>
......@@ -70,9 +70,9 @@
</table>
</div>
<?php
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
<?php
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead);
?>
......@@ -100,7 +100,7 @@
@if(count($chargeable) == '0')
<tr>
<td class="text-center" colspan="5">No Project Submitted</td>
</tr>
</tr>
@else
@foreach($chargeable as $key => $tpcharge)
<tr>
......@@ -141,13 +141,13 @@
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 3) Waiting for Approval
@else
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
@endif
</td>
</tr>
</tr>
@endforeach
@endif
</table>
<!-- overhead -->
<table class="ui unstackable celled table">
<thead>
......@@ -171,7 +171,7 @@
@if(count($overhead) == 0)
<tr>
<td class="text-center" colspan="5">No Overhead Submitted</td>
</tr>
</tr>
@else
@foreach($overhead as $key => $tpoverhead)
<tr>
......@@ -220,13 +220,13 @@
</table>
<!-- Overhead Notes Start -->
<?php $n = null; ?>
<?php $n = null; ?>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $tm_detail)
<?php $n = $tm_detail; ?>
@endforeach
@endforeach
@endif
@endforeach
......@@ -249,7 +249,7 @@
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endforeach
@endif
@endforeach
</table>
......@@ -275,16 +275,16 @@
}
?>
<div class="ui segment">
<div class="ui purple left ribbon label">
<div class="ui segment">
<div class="ui purple left ribbon label">
PMS
</div>
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<?php
$page = 1;
<?php
$page = 1;
$project = $checksts = 0;
$pmss = $profile->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
$ovpmss = $ovprofiles->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
......@@ -292,7 +292,7 @@
?>
@if($pms)
@foreach($pmss as $key => $staff)
<?php
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?>
......@@ -310,7 +310,7 @@
@foreach($pmss as $key => $staff)
<?php
<?php
// dump($staff);
// dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
......@@ -318,7 +318,7 @@
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
$checkstsoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
?>
@if(($project+$projectoverhead) == ($checksts+$checkstsoverhead))
@else
<div class="title">
......@@ -330,7 +330,7 @@
@if(data_get($staff,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - {{ data_get($staff,'year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
<?php
// dd($pmss);
$status = $staff->status;
$verified = count(data_get($pmss[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
......@@ -359,7 +359,7 @@
{{csrf_field()}}
<input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<input type="hidden" name="page" value="{{$page}}">
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -405,7 +405,7 @@
</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]) }}';" type="button">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
<!-- <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>
......@@ -420,7 +420,7 @@
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
?>
@if($checkoverhead)
<table class="ui unstackable celled table">
......@@ -435,7 +435,7 @@
</tr>
</thead>
@foreach($overheads as $key => $tp)
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25;">
......@@ -467,7 +467,7 @@
</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') ]) }}';" type="button">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') ]) }}';" 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" 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')]) }}';" type="button" target='_blank'>View</a>
......@@ -478,7 +478,7 @@
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -488,7 +488,7 @@
</tr>
</thead>
<?php
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
?>
@foreach($pmsoverheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
......@@ -500,7 +500,7 @@
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endforeach
@endif
@endforeach
</table>
......@@ -524,7 +524,7 @@
@if(count($ovpmss) > 0)
@foreach($ovpmss as $key => $staff)
<?php
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
?>
......@@ -542,7 +542,7 @@
@foreach($ovpmss as $key => $staff)
<?php
<?php
// dump($staff);
// dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id));
......@@ -550,7 +550,7 @@
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
$checkstsoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
?>
@if(($project+$projectoverhead) == ($checksts+$checkstsoverhead))
@else
<div class="title">
......@@ -562,7 +562,7 @@
@if(data_get($staff,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - {{ data_get($staff,'year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
<?php
// dd($ovpmss);
$status = $staff->status;
$verified = count(data_get($ovpmss[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
......@@ -570,7 +570,7 @@
?>
@if($status == 1 || $status == null) In Preparation
@elseif($status == 2) <i class="red attention icon"></i> Submitted
@elseif($$status == 3) <i class="green check icon"></i> Verified by PM
@elseif($status == 3) <i class="green check icon"></i> Verified by PM
@elseif($status == 4) <i class="green check icon"></i>Verified by PD
@elseif($status == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif($status == 6) <i class="red attention icon"></i>Rejected by PM
......@@ -595,7 +595,7 @@
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
?>
@if($checkoverhead)
<table class="ui unstackable celled table">
......@@ -610,7 +610,7 @@
</tr>
</thead>
@foreach($overheads as $key => $tp)
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25;">
......@@ -642,7 +642,7 @@
</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') ]) }}';" type="button">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') ]) }}';" 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" 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')]) }}';" type="button" target='_blank'>View</a>
......@@ -653,7 +653,7 @@
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -663,7 +663,7 @@
</tr>
</thead>
<?php
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
?>
@foreach($pmsoverheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
......@@ -675,7 +675,7 @@
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endforeach
@endif
@endforeach
</table>
......@@ -689,24 +689,24 @@
@endforeach
@endif
</div>
</div>
</div>
<div class="ui segment">
<div class="ui blue left ribbon label">
<div class="ui segment">
<div class="ui blue left ribbon label">
Other Departments
</div>
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<?php
<?php
$page = 1; $project = $checksts = 0;
$notpms = $profile->where('dept', '<>',4);
?>
@if($others)
@foreach($notpms as $key => $staff)
<?php
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?>
......@@ -722,12 +722,12 @@
@endif -->
@foreach($notpms as $key => $staff)
<?php
<?php
// dd($notpms);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?>
@if($project == $checksts)
@else
<div class="title">
......@@ -739,7 +739,7 @@
@if(data_get($staff,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - {{ data_get($staff,'year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
<?php
// dd($notpms);
$status = $staff->status;
$verified = count(data_get($notpms[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
......@@ -813,7 +813,7 @@
</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>
<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>
......@@ -828,7 +828,7 @@
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
?>
@if($checkoverhead)
<table class="ui unstackable celled table">
......@@ -843,7 +843,7 @@
</tr>
</thead>
@foreach($overheads as $key => $tp)
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25;" class="single line">
......@@ -875,7 +875,7 @@
</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') ]) }}';" type="button">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') ]) }}';" 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,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a>
......@@ -886,7 +886,7 @@
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -905,7 +905,7 @@
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endforeach
@endif
@endforeach
</table>
......@@ -914,7 +914,7 @@
<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>
@endif
@endif
@endforeach
@else
<table class="ui unstackable celled table">
......@@ -934,4 +934,4 @@
<script>
$('.ui.accordion').accordion();
</script>
@endpush
\ No newline at end of file
@endpush
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