Commit 6bda12c8 by Azhan Hannan

add new section in filter viewer page -> list timesheet

parent e2afcfa5
...@@ -3,3 +3,45 @@ ...@@ -3,3 +3,45 @@
@section('action') @section('action')
<form class="ui form" action="{{ route('timesheet::dashboard.viewerselectmonthphase') }}" method="POST"> <form class="ui form" action="{{ route('timesheet::dashboard.viewerselectmonthphase') }}" method="POST">
@endsection @endsection
@section('listts')
<div class="ui segment">
<a class="ui purple left ribbon label">List Timesheet</a>
<br>
<table class="ui unstackable celled table">
<thead>
<th class="text-center" style="width: 4%;">No</th>
<th class="text-center">Phase</th>
<th class="text-center">Month</th>
<th class="text-center">Year</th>
<th class="text-center">Date Submit</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</thead>
<tbody>
@foreach($timesheets as $key => $timesheet)
<tr>
<td>{{$key+1}}</td>
<td class="text-center">@if(data_get($timesheet,'tm_phase') == 1)1st Halfmonth @else 2nd Halfmonth @endif</td>
<td class="text-center">{{ date('F', mktime(0, 0, 0, data_get($timesheet,'tm_month'), 10)) }}</td>
<td class="text-center">{{ data_get($timesheet,'tm_year') }}</td>
<td class="text-center">{{ date("d/m/Y", strtotime(data_get($timesheet,'tm_submission_at'))) }}</td>
<td class="text-center">
@if(data_get($timesheet,'tm_timesheet_master_sts') == 2) Submitted
@elseif(data_get($timesheet,'tm_timesheet_master_sts') == 3) Verified by HOD/PM
@elseif(data_get($timesheet,'tm_timesheet_master_sts') == 4) Verified by BOD/PD
@elseif(data_get($timesheet,'tm_timesheet_master_sts') == 5) Rejected by BOD/PD
@elseif(data_get($timesheet,'tm_timesheet_master_sts') == 6) Rejected by HOD/PM
@endif
</td>
<td class="text-center">
<a class="ui purple compact icon button" href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => data_get($timesheet,'tm_phase'), 'month' =>data_get($timesheet,'tm_month')] ) }}" target="_blank">
<i class="eye icon"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
\ No newline at end of file
...@@ -49,4 +49,5 @@ ...@@ -49,4 +49,5 @@
</div> </div>
@yield('draft') @yield('draft')
@yield('listts')
@endsection @endsection
\ No newline at end of file
...@@ -222,14 +222,21 @@ class DashboardController extends Controller ...@@ -222,14 +222,21 @@ class DashboardController extends Controller
{ {
$currmonth = date('n'); $currmonth = date('n');
$curryear = date('Y'); $curryear = date('Y');
$month = []; $month = [];
for ($m=1; $m<=12; $m++) { for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y'))); $month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
} }
return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth')); $user = Staff_info::where('id', Auth::id())->first();
$timesheets = Ts_master::where('tm_staff_id', data_get($user,'staff_id'))
->where('tm_timesheet_master_sts','<>',1)
->orderby('tm_year','desc')
->orderby('tm_phase','desc')
->orderby('tm_year','desc')
->get();
return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth', 'timesheets'));
} }
public function filterProjectVerify() public function filterProjectVerify()
......
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