Commit 2fd63eca by Azhan Hannan

changes

parent f6bec6ed
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<form action="{{ route('timesheet::dashboard.approval') }}" method="POST" class="ui form"> <form action="{{ route('timesheet::dashboard.approval') }}" method="POST" class="ui form">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}"> <input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field"> <div class="six wide field">
<label>Staff Name</label> <label>Staff Name</label>
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?>
@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);
...@@ -32,7 +31,8 @@ ...@@ -32,7 +31,8 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th> <th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">{{ data_get($staff,'year') }} - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - Phase {{ data_get($staff,'phase') }}</th>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation @if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM @elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<th style="width: 10%;" class="center aligned">Action</th> <th style="width: 10%;" class="center aligned">Action</th>
</tr> </tr>
</thead> </thead>
@if($detail->where('tp_project_type', 1)) @if($detail->where('tp_project_type', 1) && data_get($staff,'tmid') == data_get($chargeable,'fk_tm_id'))
@foreach($detail->where('tp_project_type', 1) as $key => $chargeable) @foreach($detail->where('tp_project_type', 1) as $key => $chargeable)
<tr> <tr>
<td style="width: 10%;">{{ data_get($chargeable, 'project.p_project_code') }}</td> <td style="width: 10%;">{{ data_get($chargeable, 'project.p_project_code') }}</td>
...@@ -88,13 +88,14 @@ ...@@ -88,13 +88,14 @@
</td> </td>
<td style="width: 10%;" class="text-center single line"> <td style="width: 10%;" class="text-center single line">
@if(data_get($chargeable, 'tp_timesheet_sts') == 3) @if(data_get($chargeable, 'tp_timesheet_sts') == 3)
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($chargeable, 'id'), 'phase'=>data_get($chargeable, 'tp_phase'), 'month'=>data_get($chargeable, 'tp_month'), 'year'=>data_get($chargeable, 'tp_year') ]) }}';">Approval</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($chargeable, 'id'), 'phase'=>data_get($chargeable, 'tp_phase'), 'month'=>data_get($chargeable, 'tp_month'), 'year'=>data_get($chargeable, 'tp_year'), 'page'=>$page ]) }}';">Approval</button>
@else @else
<button class="center aligned ui green icon button disabled">Approval</button> <button class="center aligned ui green icon button disabled">Approval</button>
@endif @endif
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</table> </table>
@endif @endif
...@@ -114,6 +115,7 @@ ...@@ -114,6 +115,7 @@
</thead> </thead>
@if($detail->where('tp_project_type', 3)) @if($detail->where('tp_project_type', 3))
@foreach($detail->where('tp_project_type', 3) as $key => $overhead) @foreach($detail->where('tp_project_type', 3) as $key => $overhead)
@if(data_get($staff,'tmid') == data_get($overhead,'fk_tm_id'))
<tr> <tr>
<td style="width: 25%;">{{ data_get($overhead, 'tp_project_name') }}</td> <td style="width: 25%;">{{ data_get($overhead, 'tp_project_name') }}</td>
<td style="width: 10%;" class="center aligned">{{ data_get($overhead, 'tp_hours') }}</td> <td style="width: 10%;" class="center aligned">{{ data_get($overhead, 'tp_hours') }}</td>
...@@ -132,12 +134,13 @@ ...@@ -132,12 +134,13 @@
</td> </td>
<td style="width: 10%;" class="text-center single line"> <td style="width: 10%;" class="text-center single line">
@if(data_get($overhead, 'tp_timesheet_sts') == 3) @if(data_get($overhead, 'tp_timesheet_sts') == 3)
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($overhead, 'id'), 'phase'=>data_get($overhead, 'tp_phase'), 'month'=>data_get($overhead, 'tp_month'), 'year'=>data_get($overhead, 'tp_year') ]) }}';">Approval</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($overhead, 'id'), 'phase'=>data_get($overhead, 'tp_phase'), 'month'=>data_get($overhead, 'tp_month'), 'year'=>data_get($overhead, 'tp_year'), 'page'=>$page ]) }}';">Approval</button>
@else @else
<button class="center aligned ui green icon button disabled">Approval</button> <button class="center aligned ui green icon button disabled">Approval</button>
@endif @endif
</td> </td>
</tr> </tr>
@endif
@endforeach @endforeach
@endif @endif
</table> </table>
...@@ -154,7 +157,7 @@ ...@@ -154,7 +157,7 @@
</thead> </thead>
@if($td) @if($td)
@foreach($td as $key => $value) @foreach($td as $key => $value)
@if($value->td_overhead_note) @if($value->td_overhead_note && $value->fk_tm_id == $staff->tmid)
<tr> <tr>
<td style="width: 10%" class="center aligned">{{data_get($value, 'td_date')}}</td> <td style="width: 10%" class="center aligned">{{data_get($value, 'td_date')}}</td>
<td style="width: 25%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td> <td style="width: 25%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<br> <br>
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff) @foreach($profile as $key => $staff)
@if(data_get($staff,'status') == 2) @if(data_get($staff,'status') == 2)
<div class="title"> <div class="title">
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
</td> </td>
<td style="width: 12%;" class="text-center"> <td style="width: 12%;" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 2) @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') ]) }}';">Verify | Reject</button> <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 @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif @endif
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff) @foreach($profile as $key => $staff)
<?php <?php
// dd($staff); // dd($staff);
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
</td> </td>
<td style="width: 12%;" class="text-center"> <td style="width: 12%;" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year')]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif @endif
......
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
<br> <br>
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff) @foreach($profile as $key => $staff)
<?php <?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)); $project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3)); $checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?> ?>
@endforeach
@if($project == $checksts) @if($project == $checksts)
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
...@@ -24,6 +25,15 @@ ...@@ -24,6 +25,15 @@
</tr> </tr>
</thead> </thead>
</table> </table>
@endif
@foreach($profile as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?>
@if($project == $checksts)
@else @else
<div class="title"> <div class="title">
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
...@@ -90,7 +100,7 @@ ...@@ -90,7 +100,7 @@
</td> </td>
<td style="width: 12%;" class="text-center"> <td style="width: 12%;" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year')]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year')]), 'page'=>$page }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif @endif
......
...@@ -18,13 +18,6 @@ ...@@ -18,13 +18,6 @@
?> ?>
@if($project == $checksts) @if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">All timesheet has been verified</th>
</tr>
</thead>
</table>
@else @else
<div class="title"> <div class="title">
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}"> <input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
<input type="hidden" name="tmid" value="{{ data_get($profile,'fk_tm_id') }}"> <input type="hidden" name="tmid" value="{{ data_get($profile,'fk_tm_id') }}">
<input type="hidden" name="pid" value="{{ data_get($profile,'td_project') }}"> <input type="hidden" name="pid" value="{{ data_get($profile,'td_project') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field"> <div class="six wide field">
<label>Staff Name</label> <label>Staff Name</label>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form"> <form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}"> <input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field"> <div class="six wide field">
<label>Staff Name</label> <label>Staff Name</label>
......
...@@ -17,12 +17,6 @@ ...@@ -17,12 +17,6 @@
$detail = $details->where('staffid', $staff->staffid); $detail = $details->where('staffid', $staff->staffid);
$checkchargeable = $detail->where('tp_project_type',1)->first(); $checkchargeable = $detail->where('tp_project_type',1)->first();
$checkoverhead = $detail->where('tp_project_type',3)->first(); $checkoverhead = $detail->where('tp_project_type',3)->first();
// dd($detail);
// dump(count($detail->where('tp_timesheet_sts',4)));
// dump(count($detail));
// dump(count($checkoverhead));
// dd('tengok');
?> ?>
@if(count($detail->where('tp_timesheet_sts',4)) == count($detail)) @if(count($detail->where('tp_timesheet_sts',4)) == count($detail))
...@@ -31,7 +25,8 @@ ...@@ -31,7 +25,8 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th> <th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">{{ data_get($staff,'year') }} - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - Phase {{ data_get($staff,'phase') }}</th>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation @if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM @elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM
...@@ -49,7 +44,6 @@ ...@@ -49,7 +44,6 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
@if($checkchargeable) @if($checkchargeable)
......
...@@ -88,7 +88,10 @@ class DashboardController extends Controller ...@@ -88,7 +88,10 @@ class DashboardController extends Controller
$profiles = VwApprovalProfiles::where('pdid', $approval->id) $profiles = VwApprovalProfiles::where('pdid', $approval->id)
->where('status', 3) ->where('status', 3)
->orderby('tmid') // ->orderby('tmid')
->orderby('year', 'desc')
->orderby('month', 'desc')
->orderby('phase', 'desc')
->with('attachment') ->with('attachment')
->with('team') ->with('team')
->with('tproject') ->with('tproject')
...@@ -120,6 +123,9 @@ class DashboardController extends Controller ...@@ -120,6 +123,9 @@ class DashboardController extends Controller
->where('status', 2) ->where('status', 2)
// ->groupby('staff_id') // ->groupby('staff_id')
->distinct('staff_id') ->distinct('staff_id')
->orderby('year', 'desc')
->orderby('month', 'desc')
->orderby('phase', 'desc')
->orderby('roleid') ->orderby('roleid')
->with('countchargeable') ->with('countchargeable')
->get(); ->get();
...@@ -446,6 +452,7 @@ class DashboardController extends Controller ...@@ -446,6 +452,7 @@ class DashboardController extends Controller
public function revaction(Request $request) public function revaction(Request $request)
{ {
$page = data_get($request,'page');
// dd($request); // dd($request);
$hod = Users::find(Auth::id()); $hod = Users::find(Auth::id());
...@@ -460,11 +467,12 @@ class DashboardController extends Controller ...@@ -460,11 +467,12 @@ class DashboardController extends Controller
// ->first(); // ->first();
return view('timesheet::dashboard.revaction', compact('profile', 'hod')); return view('timesheet::dashboard.revaction', compact('profile', 'hod', 'page'));
} }
public function projectaction(Request $request) public function projectaction(Request $request)
{ {
$page = data_get($request,'page');
$profile = Tproject::where('id', $request->tpid) $profile = Tproject::where('id', $request->tpid)
->with('team') ->with('team')
...@@ -474,7 +482,7 @@ class DashboardController extends Controller ...@@ -474,7 +482,7 @@ class DashboardController extends Controller
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
return view('timesheet::dashboard.projectaction', compact('profile', 'pm')); return view('timesheet::dashboard.projectaction', compact('profile', 'pm', 'page'));
} }
public function verify(Request $request) public function verify(Request $request)
...@@ -497,6 +505,10 @@ class DashboardController extends Controller ...@@ -497,6 +505,10 @@ class DashboardController extends Controller
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index');
}
return redirect()->route('timesheet::dashboard.projectaction', compact('profile', 'pm', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to rejected the project submission. Kindly give remarks for team references. Thank you 😊'); return redirect()->route('timesheet::dashboard.projectaction', compact('profile', 'pm', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to rejected the project submission. Kindly give remarks for team references. Thank you 😊');
} }
// dd($request); // dd($request);
...@@ -542,6 +554,10 @@ class DashboardController extends Controller ...@@ -542,6 +554,10 @@ class DashboardController extends Controller
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff project has been verified.');
}
return redirect()->route('timesheet::dashboard.projectVerify', compact('month', 'phase'))->withSuccess('Staff project has been verified.'); return redirect()->route('timesheet::dashboard.projectVerify', compact('month', 'phase'))->withSuccess('Staff project has been verified.');
} else { } else {
...@@ -572,6 +588,10 @@ class DashboardController extends Controller ...@@ -572,6 +588,10 @@ class DashboardController extends Controller
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff project has been verified.');
}
return redirect()->route('timesheet::dashboard.projectVerify', compact('month', 'phase'))->withErrors('Staff project has been rejected with remarks'); return redirect()->route('timesheet::dashboard.projectVerify', compact('month', 'phase'))->withErrors('Staff project has been rejected with remarks');
} }
} }
...@@ -596,6 +616,10 @@ class DashboardController extends Controller ...@@ -596,6 +616,10 @@ class DashboardController extends Controller
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->with('warning', 'You wanted to rejected the overhead submission. Kindly give remarks for staff references. Thank you 😊');
}
return redirect()->route('timesheet::dashboard.projectaction', compact('profile', 'pm', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to rejected the overhead submission. Kindly give remarks for staff references. Thank you 😊'); return redirect()->route('timesheet::dashboard.projectaction', compact('profile', 'pm', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to rejected the overhead submission. Kindly give remarks for staff references. Thank you 😊');
} }
...@@ -640,6 +664,9 @@ class DashboardController extends Controller ...@@ -640,6 +664,9 @@ class DashboardController extends Controller
'tm_verified_at' => $today 'tm_verified_at' => $today
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff overhead has been verified.');
}
return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withSuccess('Staff overhead has been verified.'); return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withSuccess('Staff overhead has been verified.');
...@@ -670,14 +697,18 @@ class DashboardController extends Controller ...@@ -670,14 +697,18 @@ class DashboardController extends Controller
'hod_rejected_at' => $today, 'hod_rejected_at' => $today,
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->withErrors('Staff overhead has been rejected with remarks');
}
return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withErrors('Staff overhead has been rejected with remarks'); return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withErrors('Staff overhead has been rejected with remarks');
} }
} }
public function approvalaction(Request $request) public function approvalaction(Request $request)
{ {
// dd($request); $page = $request->page;
// dd($page);
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
$profile = Tproject::where('id', $request->tpid) $profile = Tproject::where('id', $request->tpid)
...@@ -685,7 +716,7 @@ class DashboardController extends Controller ...@@ -685,7 +716,7 @@ class DashboardController extends Controller
->first(); ->first();
// dd($profile); // dd($profile);
return view('timesheet::dashboard.approvalaction', compact('profile', 'bod')); return view('timesheet::dashboard.approvalaction', compact('profile', 'bod', 'page'));
} }
public function approval(Request $request) public function approval(Request $request)
...@@ -705,6 +736,10 @@ class DashboardController extends Controller ...@@ -705,6 +736,10 @@ class DashboardController extends Controller
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->with('warning', 'You wanted to reject the submission. Kindly give remarks for staff references. Thank you 😊');
}
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 😊'); 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); // dd($request);
...@@ -757,6 +792,10 @@ class DashboardController extends Controller ...@@ -757,6 +792,10 @@ class DashboardController extends Controller
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff project has been approved.');
}
return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withSuccess('Staff project has been approved.'); return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withSuccess('Staff project has been approved.');
} else { } else {
...@@ -794,6 +833,10 @@ class DashboardController extends Controller ...@@ -794,6 +833,10 @@ class DashboardController extends Controller
]); ]);
} }
if($request->page == 1){
return redirect()->route('timesheet::dashboard.index')->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'); 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