Commit fa1e374b by Azhan Hannan

Log Pia #141 -> → tambah section untuk TINDAKAN - utk case Kak Syamilah

parent d0053dd4
......@@ -2,6 +2,7 @@
@section('content')
<!-- Staff Timesheet Section Start -->
<div class="ui segment">
<!-- <a class="ui blue left ribbon label">Welcome Back</a>
<br>
......@@ -140,8 +141,8 @@
@else
<th style="width: 17%;">Overhead</th>
<th style="width: 15%;">Verifier</th>
<th style="width: 20%;">Hod Remarks</th>
<th style="width: 20%;">Bod Remarks</th>
<th style="width: 20%;">Verifier Remarks</th>
<th style="width: 20%;">Approver Remarks</th>
@endif
<!-- <th style="width: 5%;" class="center aligned">Total Hours</th>
<th style="width: 5%;" class="center aligned">Total Days</th> -->
......@@ -171,8 +172,8 @@
</td>
@else
<td style="width: 15%;">{{data_get($tpoverhead,'tp_project_name')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</td>
<td style="width: 15%;" class="single line">{{data_get($tpoverhead,'hod.fullname')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'approver_remark')}}</td>
<td style="width: 13%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 1) Draft
......@@ -205,6 +206,203 @@
@endforeach
<!-- <br> -->
</div>
<!-- Staff Timesheet Section End -->
<!-- Verifier Section Start-->
@if(count($profile) > 0)
<div class="ui segment">
<div class="ui blue left ribbon label">
Verifier Section
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff)
@if(data_get($staff,'status') == 2 || data_get($staff,'status') == 3 || data_get($staff,'status') == 6 )
<?php
$detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_type', 3)->whereIn('tp_timesheet_sts', [2,3,6]);
$ts = $checkts->where('tm_staff_id', $staff->staff_id);
?>
@if(count($detail) > 0)
<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,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'tm_month'), 10)) }} - {{ data_get($staff,'tm_year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
$overheadverified = 0;
foreach ($details as $key => $value)
{
if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3)
$overheadverified += 1;
}
?>
@if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 4) <i class="green check icon"></i>Approved by BOD
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD
@elseif($overheadverified > 0 && $overheadverified == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($overheadverified != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 1 || $staff->status == null) In Preparation
@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;">
<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($detail as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25%;">{{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'), 'page'=>$page ]) }}';">Verify | Reject</button>
@else
<a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tm_phase'), 'month' => data_get($staff,'tm_month'), 'year' => data_get($staff,'tm_year') ]) }}" class="center aligned ui blue icon button" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php $n = null; ?>
@foreach($details as $key => $detail)
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
<?php $n = $value; ?>
@endforeach
@endif
@endforeach
@if($n)
<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>
@foreach($details as $key => $detail)
@if(data_get($staff,'tmid') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'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
@foreach ($ts as $key => $value)
@if(data_get($value,'attachement'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>
<a href="{{ asset(data_get($value,'attachement.path'))}}" target="_blank">
<button class="ui active button">
<i class="download icon"></i>
Download
</button>
</a>
</td>
</tr>
</tbody>
</table>
@endif
@endforeach
@if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>{{ data_get($staff,'hodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
</div>
@endif
@endif
@endforeach
@if(count($details) == 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">No pending verification</th>
</tr>
</thead>
</table>
@endif
</div>
</div>
@endif
<!-- Verifier Section End -->
@endsection
......
......@@ -220,6 +220,27 @@ class DashboardController extends Controller
->get();
// dd($projects);
//verifier section
$verifier = Users::find(Auth::id());
$profile = VwReviewProfile::where('hod_id', $verifier->id)
->whereIn('status', [2,3,6])
->with('overheads')
->orderby('tm_year', 'desc')
->orderby('tm_month', 'desc')
->orderby('tm_phase', 'desc')
->get();
// dd($profile);
$details = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1)
->where('tp_pm', $verifier->id)
->with('notes')
->get();
$checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,6])
->with('attachement')
->get();
$user = Users::where('name', 'like', '%'.$keyword.'%')
->orWhere(
function ($query) use ($keyword) {
......@@ -227,7 +248,7 @@ class DashboardController extends Controller
}
)->paginate(15);
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects', 'roleid', 'staffinfo'));
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects', 'roleid', 'staffinfo', 'profile', 'details', 'checkts'));
}if ($roleid == '3') {
......@@ -1005,7 +1026,7 @@ class DashboardController extends Controller
]);
}
// if(data_get($request,'page') == 1){
return redirect()->route('timesheet::dashboard.index')->withErrors('Staff overhead has been rejected');
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff overhead has been rejected');
// }
// return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withErrors('Staff overhead has been rejected');
}
......
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