Commit 9c65203d by Azhan Hannan

Dept PMS, staff yg hantar timesheet tanpa project, tak appear untuk verification.

parent a4ed7c3f
......@@ -267,14 +267,12 @@
<?php
$pms = $others = null;
foreach ($profile as $key => $value) {
// dump(data_get($value,'dept'));
if (data_get($value,'dept') == 4) {
$pms = $value;
$pms = $value;
} else {
$others = $value;
// dd($others);
}
}
}
?>
<div class="ui segment">
......@@ -289,7 +287,8 @@
$page = 1;
$project = $checksts = 0;
$pmss = $profile->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
// dd($pmss);
$ovpmss = $ovprofiles->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
// dd($ovpmss);
?>
@if($pms)
@foreach($pmss as $key => $staff)
......@@ -522,6 +521,173 @@
</thead>
</table> -->
@endif
@if(count($ovpmss) > 0)
@foreach($ovpmss as $key => $staff)
<?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));
?>
@endforeach
<!-- @if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">All timesheet has been verified</th>
</tr>
</thead>
</table>
@endif -->
@foreach($ovpmss as $key => $staff)
<?php
// dump($staff);
// dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id));
$projectoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id));
$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">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'sname.fullname') }}</th>
<th style="width: 20%" class="text-center">
@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
// dd($ovpmss);
$status = $staff->status;
$verified = count(data_get($ovpmss[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
$allproject = count(data_get($ovpmss[$key], 'countchargeable'));
?>
@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 == 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
@elseif($status == 7) <i class="red attention icon"></i>Rejected by HR
@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>
<div class="content" style="padding-top: 0px;">
<form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
{{csrf_field()}}
<input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<input type="hidden" name="page" value="{{$page}}">
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
@if($checkoverhead)
<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>
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25;">
@if(data_get($tp,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($tp,'id')}}]" value="{{data_get($tp,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{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') ]) }}';" 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>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<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>
<?php
$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'))
@foreach(data_get($overhead,'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
<button type="submit" class="center aligned ui green icon button">Verify</button>
<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
@endforeach
@endif
</div>
</div>
......
......@@ -241,8 +241,28 @@ class DashboardController extends Controller
->with('countchargeable')
->with('countoverhead')
// ->with('department')
->get();
$staffpms = [];
foreach ($profile as $key => $value) {
if (data_get($value,'dept') == 4) {
$staffpms[] = $value->staff_id;
}
}
$ovprofiles = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->id)
// ->where('status', '<>', 1)
->whereIn('status', [2,3,5,6])
->whereNotIn('staff_id', $staffpms)
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->with('countoverhead')
->with('sname')
// ->with('department')
->get();
// dd($profile);
// dd($ovprofiles);
$staffnotes = Tproject::where('tp_project_type', 3)
->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('staffid', $verifier->u_staffID)
......@@ -288,7 +308,7 @@ class DashboardController extends Controller
->with('bod')
->get();
return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid', 'staffnotes'));
return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid', 'staffnotes', 'ovprofiles'));
}
if (($roleid == ('5'||'6'))) {
......
......@@ -33,7 +33,10 @@ class VwChargeableVerification extends Model
return $this->hasMany('Portal\Timesheet\Model\Tproject','fk_tm_id','tmid')->where('tp_project_type', 3);
}
public function sname()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staff_id');
}
// public function department()
// {
......
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