Commit a50fd5d0 by Azhan Hannan

Dashboard (staff), PD/ BOD dah approved tapi tak appear approval date.

parent a7416a77
......@@ -10,7 +10,6 @@
<br>
<div class="ui styled fluid accordion">
@foreach($profiles as $key => $staff)
<?php
......@@ -44,7 +43,7 @@
</th>
<th style="width: 10%" class="text-center">
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => $phase, 'month' => $month, 'year' => $year]) }}';" target='_blank'>View</button>
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staffid') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</button>
</th>
</tr>
</thead>
......
......@@ -48,7 +48,8 @@
<div class="field">
<label>Role</label>
<select name="role" class="ui fluid dropdown">
<option value="{{data_get($team,'role_id')}}">{{data_get($teamRole,'role')}}</option>
<option value="">{{data_get($teamRole,'role')}}</option>
<!-- <option value="{{data_get($team,'role_id')}}">{{data_get($teamRole,'role')}}</option> -->
@foreach($role as $key => $value)
<option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option>
@endforeach
......@@ -56,7 +57,7 @@
</div>
<div class="field">
<label>Project Team Status</label>
<label>Status</label>
<select name="status" class="ui fluid dropdown">
<option value="1">Active</option>
<option value="0">Inactive</option>
......
......@@ -687,6 +687,25 @@ class DashboardController extends Controller
public function approval(Request $request)
{
if($request->action == 2 && $request->remarks == null)
{
// dd('reject & tak komen');
$profile = Tproject::where('id', $request->tpid)
->with('team')
->first();
// dd($profile);
$tpid = $profile->id;
$year = $profile->tp_year;
$month = $profile->tp_month;
$phase = $profile->tp_phase;
$bod = Users::find(Auth::id());
return redirect()->route('timesheet::dashboard.approvalaction', compact('profile', 'bod', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to reject the submission. Kindly give remarks for staff references. Thank you 😊');
}
// dd($request);
$bod = Users::find(Auth::id());
$today = Carbon::today()->toDateString();
......@@ -731,7 +750,7 @@ class DashboardController extends Controller
->update(
[
'tm_timesheet_master_sts' => 4,
'tm_verified_at' => $today
'tm_approved_at' => $today
]);
}
......@@ -758,9 +777,12 @@ class DashboardController extends Controller
$checkrejected = Tproject::where('fk_tm_id', $tmid)
->where('tp_timesheet_sts', 5)
->first();
->get();
$allrejected = Tproject::where('fk_tm_id', $tmid)
->get();
if($checkrejected){
if(count($checkrejected) == count($allrejected)){
Ts_master::where('id', $tmid)
->update(
[
......@@ -769,7 +791,6 @@ class DashboardController extends Controller
]);
}
return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withErrors('Staff project has been rejected with remarks');
}
}
......
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