Commit 918bd551 by Azhan Hannan

Ubah project under en fairuz ke verifier baru. (alter data dalam table)

parent 28f1e463
......@@ -287,6 +287,171 @@
</div>
<!-- Staff Timesheet Section End -->
<!-- Project Verification Section Start -->
<?php
$others = null;
foreach ($chargeprofile as $key => $value) {
$others = $value;
}
// dd($others);
?>
<div class="ui segment">
<div class="ui blue left ribbon label">
Project Verification
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<?php
$page = 1; $project = $checksts = 0;
$notpms = $chargeprofile->where('dept', '<>',4);
?>
@if($others)
@foreach($notpms as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID)->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($notpms as $key => $staff)
<?php
// dd($notpms);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID)->where('tp_timesheet_sts', 3));
?>
@if($project == $checksts)
@else
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'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($notpms);
$status = $staff->status;
$verified = count(data_get($notpms[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
$allproject = count(data_get($notpms[$key], 'countchargeable'));
?>
@if($status == 1 || $status == null) In Preparation
@elseif($verified == $allproject) <i class="green check icon"></i> Verified by PM
@elseif($status == 2) <i class="red attention icon"></i> Submitted
@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}}">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</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>
@php
$details = $chargedetails->where('tp_project_type', 1);
// dd($details);
@endphp
@foreach($details as $key => $detail)
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td style="width: 10%;" class="single line">
@if(data_get($detail,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($detail,'id')}}]" value="{{data_get($detail,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($detail, 'project.p_project_code')}}
</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($detail, '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($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>
@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>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<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
@else
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">No pending verification</th>
</tr>
</thead>
</table>
@endif
</div>
</div>
<!-- Project Verification Section End -->
<!-- Verification Section Start -->
@if(count($profile) > 0)
<div class="ui segment">
......
......@@ -38,7 +38,6 @@ use Auth;
class DashboardController extends Controller
{
public function index()
{
......@@ -169,7 +168,24 @@ class DashboardController extends Controller
->with('attachement')
->get();
return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'checkts', 'details'));
$chargeprofile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->u_staffID)
// ->where('status', '<>', 1)
->whereIn('status', [2,3,5,6])
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->with('countoverhead')
// ->with('department')
->get();
$chargedetails = Tproject::where('tp_pm', $verifier->u_staffID)
// ->where('tp_timesheet_sts', 2)
->with('project')
->with('pm')
->get();
return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'chargeprofile', 'chargedetails', 'checkts', 'details'));
}
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