Commit a50fd5d0 by Azhan Hannan

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

parent a7416a77
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
@foreach($profiles as $key => $staff) @foreach($profiles as $key => $staff)
<?php <?php
$td = $checktd->where('tm_staff_id', $staff->staffid); $td = $checktd->where('tm_staff_id', $staff->staffid);
$detail = $details->where('staffid', $staff->staffid); $detail = $details->where('staffid', $staff->staffid);
...@@ -44,7 +43,7 @@ ...@@ -44,7 +43,7 @@
</th> </th>
<th style="width: 10%" class="text-center"> <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> </th>
</tr> </tr>
</thead> </thead>
......
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
<div class="field"> <div class="field">
<label>Role</label> <label>Role</label>
<select name="role" class="ui fluid dropdown"> <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) @foreach($role as $key => $value)
<option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option> <option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option>
@endforeach @endforeach
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
</div> </div>
<div class="field"> <div class="field">
<label>Project Team Status</label> <label>Status</label>
<select name="status" class="ui fluid dropdown"> <select name="status" class="ui fluid dropdown">
<option value="1">Active</option> <option value="1">Active</option>
<option value="0">Inactive</option> <option value="0">Inactive</option>
......
...@@ -687,6 +687,25 @@ class DashboardController extends Controller ...@@ -687,6 +687,25 @@ class DashboardController extends Controller
public function approval(Request $request) 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()); $bod = Users::find(Auth::id());
$today = Carbon::today()->toDateString(); $today = Carbon::today()->toDateString();
...@@ -731,7 +750,7 @@ class DashboardController extends Controller ...@@ -731,7 +750,7 @@ class DashboardController extends Controller
->update( ->update(
[ [
'tm_timesheet_master_sts' => 4, 'tm_timesheet_master_sts' => 4,
'tm_verified_at' => $today 'tm_approved_at' => $today
]); ]);
} }
...@@ -758,9 +777,12 @@ class DashboardController extends Controller ...@@ -758,9 +777,12 @@ class DashboardController extends Controller
$checkrejected = Tproject::where('fk_tm_id', $tmid) $checkrejected = Tproject::where('fk_tm_id', $tmid)
->where('tp_timesheet_sts', 5) ->where('tp_timesheet_sts', 5)
->first(); ->get();
if($checkrejected){ $allrejected = Tproject::where('fk_tm_id', $tmid)
->get();
if(count($checkrejected) == count($allrejected)){
Ts_master::where('id', $tmid) Ts_master::where('id', $tmid)
->update( ->update(
[ [
...@@ -768,7 +790,6 @@ class DashboardController extends Controller ...@@ -768,7 +790,6 @@ class DashboardController extends Controller
'hod_rejected_at' => $today, 'hod_rejected_at' => $today,
]); ]);
} }
return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withErrors('Staff project has been rejected with remarks'); 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