Commit 6380ef38 by Azhan Hannan

changes for log pia, pmhod tak receive timesheet

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