Commit 82b6db53 by Azhan Hannan

Log Pia #32 - CADANGAN: tambah senarai yang berstatus draft dekat bawah, Klik…

Log Pia #32 - CADANGAN: tambah senarai yang berstatus draft dekat bawah, Klik edit , pergi ke page timesheet
parent 99707ac9
...@@ -3,3 +3,49 @@ ...@@ -3,3 +3,49 @@
@section('action') @section('action')
<form class="ui form" action="{{ route('timesheet::form.chargeableselectmonthphase') }}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.chargeableselectmonthphase') }}" method="POST">
@endsection @endsection
@section('draft')
@if(count($checkdraft) > 0)
<div class="ui segment">
<a class="ui purple left ribbon label">Edit Timesheet</a>
<br>
<table class="ui unstackable celled striped table">
<thead>
<tr>
<th class="text-center">No</th>
<th class="text-center">Phase</th>
<th class="text-center">Month</th>
<th class="text-center">Year</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach($checkdraft as $key => $draft)
<tr>
<td class="text-center" style="width: 5%;">{{$key+1}}</td>
<td class="text-center" style="width: 25%;">
@if(data_get($draft,'tm_phase') == 1) 1st Half-month
@else 2nd Half-month
@endif
</td>
<td class="text-center" style="width: 20%;">
{{ date("F", strtotime(data_get($draft,'tm_month'))) }}
</td>
<td class="text-center" style="width: 20%;">{{data_get($draft,'tm_year')}}</td>
<td class="text-center" style="width: 15%;">
@if(data_get($draft,'tm_timesheet_master_sts') == 1) Draft @endif
</td>
<td class="text-center" style="width: 15%;">
<button class="ui purple compact icon button" type="button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => data_get($draft,'tm_phase'), 'month' =>data_get($draft,'tm_month')] ) }}';">
<i class="edit outline icon"></i>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@endsection
\ No newline at end of file
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
</form> </form>
</div> </div>
@yield('draft')
@endsection @endsection
\ No newline at end of file
...@@ -31,8 +31,11 @@ class FormController extends Controller ...@@ -31,8 +31,11 @@ class FormController extends Controller
{ {
public function filterChargeable() public function filterChargeable()
{ {
$user = Staff_info::where('id', Auth::id())->first();
// dd($user);
$currmonth = date('n'); $currmonth = date('n');
$currmonth = 1; // $currmonth = 1;
$curryear = date('Y'); $curryear = date('Y');
...@@ -42,7 +45,12 @@ class FormController extends Controller ...@@ -42,7 +45,12 @@ class FormController extends Controller
$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::form.filterChargeable', compact('month', 'currmonth', 'curryear')); $checkdraft = Ts_master::where('tm_staff_id', $user->staff_id)
->where('tm_timesheet_master_sts', 1)
->get();
// dd($checkdraft);
return view('timesheet::form.filterChargeable', compact('month', 'currmonth', 'curryear', 'checkdraft'));
} }
public function filterOverhead() public function filterOverhead()
......
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