Commit 6380ef38 by Azhan Hannan

changes for log pia, pmhod tak receive timesheet

parent a05e30bf
......@@ -230,11 +230,12 @@
<?php
$pms = $others = null;
foreach ($profile as $key => $value) {
// dd($value);
// dump(data_get($value,'dept'));
if (data_get($value,'dept') == 4) {
$pms = $value;
} else {
$others = $value;
// dd($others);
}
}
?>
......@@ -251,8 +252,8 @@
$page = 1;
$project = $checksts = 0;
$pmss = $profile->where('dept', 4);
// dd($pmss);
?>
@if($pms)
@foreach($pmss as $key => $staff)
<?php
......@@ -261,7 +262,7 @@
?>
@endforeach
@if($project == $checksts)
<!-- @if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -269,15 +270,20 @@
</tr>
</thead>
</table>
@endif
@endif -->
@foreach($pmss as $key => $staff)
<?php
// dd($staff);
// dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$projectoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id));
$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 == $checksts)
@if(($project+$projectoverhead) == ($checksts+$checkstsoverhead))
@else
<div class="title">
<table class="ui unstackable celled table">
......@@ -435,16 +441,17 @@
</table>
@endif
</div>
@endif
@endif
@endforeach
@else
<table class="ui unstackable celled table">
<!-- <table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">No pending verification</th>
</tr>
</thead>
</table>
</table> -->
@endif
</div>
</div>
......
......@@ -221,6 +221,7 @@ class DashboardController extends Controller
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->with('countoverhead')
// ->with('department')
->get();
// dd($profile);
......
......@@ -28,6 +28,13 @@ class VwChargeableVerification extends Model
return $this->hasMany('Portal\Timesheet\Model\Tproject','fk_tm_id','tmid')->where('tp_project_type', 1);
}
public function countoverhead()
{
return $this->hasMany('Portal\Timesheet\Model\Tproject','fk_tm_id','tmid')->where('tp_project_type', 3);
}
// public function department()
// {
// return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staff_id');
......
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