Commit 2fd63eca by Azhan Hannan

changes

parent f6bec6ed
......@@ -9,6 +9,7 @@
<form action="{{ route('timesheet::dashboard.approval') }}" method="POST" class="ui form">
{{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field">
<label>Staff Name</label>
......
......@@ -10,9 +10,8 @@
<br>
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profiles as $key => $staff)
<?php
$td = $checktd->where('tm_staff_id', $staff->staffid);
$detail = $details->where('staffid', $staff->staffid);
......@@ -32,7 +31,8 @@
<table class="ui unstackable celled table">
<thead>
<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">
@if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM
......@@ -67,7 +67,7 @@
<th style="width: 10%;" class="center aligned">Action</th>
</tr>
</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)
<tr>
<td style="width: 10%;">{{ data_get($chargeable, 'project.p_project_code') }}</td>
......@@ -88,13 +88,14 @@
</td>
<td style="width: 10%;" class="text-center single line">
@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
<button class="center aligned ui green icon button disabled">Approval</button>
@endif
</td>
</tr>
@endforeach
@endif
</table>
@endif
......@@ -114,30 +115,32 @@
</thead>
@if($detail->where('tp_project_type', 3))
@foreach($detail->where('tp_project_type', 3) as $key => $overhead)
<tr>
<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">{{ number_format(data_get($overhead, 'tp_hours')/8, 1, '.', '') }}</td>
<td style="width: 15%;">{{data_get($overhead, 'verifier_remark')}}</td>
<td style="width: 15%;">{{data_get($overhead, 'approver_remark')}}</td>
<td style="width: 15%;" class="center aligned">
@if(data_get($overhead, 'tp_timesheet_sts') == 1 || data_get($overhead, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($overhead, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($overhead, 'tp_timesheet_sts') == 3) <i class="red attention icon"></i> Verified by HOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 10%;" class="text-center single line">
@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>
@else
<button class="center aligned ui green icon button disabled">Approval</button>
@endif
</td>
</tr>
@if(data_get($staff,'tmid') == data_get($overhead,'fk_tm_id'))
<tr>
<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">{{ number_format(data_get($overhead, 'tp_hours')/8, 1, '.', '') }}</td>
<td style="width: 15%;">{{data_get($overhead, 'verifier_remark')}}</td>
<td style="width: 15%;">{{data_get($overhead, 'approver_remark')}}</td>
<td style="width: 15%;" class="center aligned">
@if(data_get($overhead, 'tp_timesheet_sts') == 1 || data_get($overhead, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($overhead, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($overhead, 'tp_timesheet_sts') == 3) <i class="red attention icon"></i> Verified by HOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD
@elseif(data_get($overhead, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 10%;" class="text-center single line">
@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'), 'page'=>$page ]) }}';">Approval</button>
@else
<button class="center aligned ui green icon button disabled">Approval</button>
@endif
</td>
</tr>
@endif
@endforeach
@endif
</table>
......@@ -154,7 +157,7 @@
</thead>
@if($td)
@foreach($td as $key => $value)
@if($value->td_overhead_note)
@if($value->td_overhead_note && $value->fk_tm_id == $staff->tmid)
<tr>
<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>
......
......@@ -8,6 +8,7 @@
<br>
<br>
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff)
@if(data_get($staff,'status') == 2)
<div class="title">
......@@ -82,7 +83,7 @@
</td>
<td style="width: 12%;" class="text-center">
@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
<button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif
......
......@@ -10,6 +10,7 @@
<br>
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
@foreach($profile as $key => $staff)
<?php
// dd($staff);
......@@ -82,7 +83,7 @@
</td>
<td style="width: 12%;" class="text-center">
@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
<button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif
......
......@@ -10,6 +10,23 @@
<br>
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
@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));
?>
@endforeach
@if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">All timesheet has been verified</th>
</tr>
</thead>
</table>
@endif
@foreach($profile as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
......@@ -17,13 +34,6 @@
?>
@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
<div class="title">
<table class="ui unstackable celled table">
......@@ -90,7 +100,7 @@
</td>
<td style="width: 12%;" class="text-center">
@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
<button class="center aligned ui green icon button disabled">Verify | Reject</button>
@endif
......
......@@ -10,7 +10,7 @@
<br>
<div class="ui styled fluid accordion">
@foreach($profile as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
......@@ -18,13 +18,6 @@
?>
@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
<div class="title">
<table class="ui unstackable celled table">
......
......@@ -11,6 +11,7 @@
<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="pid" value="{{ data_get($profile,'td_project') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field">
<label>Staff Name</label>
......
......@@ -9,6 +9,7 @@
<form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form">
{{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
<input type="hidden" name="page" value="{{$page}}">
<div class="six wide field">
<label>Staff Name</label>
......
......@@ -17,12 +17,6 @@
$detail = $details->where('staffid', $staff->staffid);
$checkchargeable = $detail->where('tp_project_type',1)->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))
......@@ -31,7 +25,8 @@
<table class="ui unstackable celled table">
<thead>
<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">
@if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD/HOU/PM
......@@ -49,7 +44,6 @@
</thead>
</table>
</div>
<div class="content" style="padding-top: 0px;">
@if($checkchargeable)
......
......@@ -88,7 +88,10 @@ class DashboardController extends Controller
$profiles = VwApprovalProfiles::where('pdid', $approval->id)
->where('status', 3)
->orderby('tmid')
// ->orderby('tmid')
->orderby('year', 'desc')
->orderby('month', 'desc')
->orderby('phase', 'desc')
->with('attachment')
->with('team')
->with('tproject')
......@@ -120,6 +123,9 @@ class DashboardController extends Controller
->where('status', 2)
// ->groupby('staff_id')
->distinct('staff_id')
->orderby('year', 'desc')
->orderby('month', 'desc')
->orderby('phase', 'desc')
->orderby('roleid')
->with('countchargeable')
->get();
......@@ -446,6 +452,7 @@ class DashboardController extends Controller
public function revaction(Request $request)
{
$page = data_get($request,'page');
// dd($request);
$hod = Users::find(Auth::id());
......@@ -460,11 +467,12 @@ class DashboardController extends Controller
// ->first();
return view('timesheet::dashboard.revaction', compact('profile', 'hod'));
return view('timesheet::dashboard.revaction', compact('profile', 'hod', 'page'));
}
public function projectaction(Request $request)
{
$page = data_get($request,'page');
$profile = Tproject::where('id', $request->tpid)
->with('team')
......@@ -474,7 +482,7 @@ class DashboardController extends Controller
$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)
......@@ -497,6 +505,10 @@ class DashboardController extends Controller
$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 😊');
}
// dd($request);
......@@ -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.');
} else {
......@@ -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');
}
}
......@@ -596,6 +616,10 @@ class DashboardController extends Controller
$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 😊');
}
......@@ -640,6 +664,9 @@ class DashboardController extends Controller
'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.');
......@@ -670,14 +697,18 @@ class DashboardController extends Controller
'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');
}
}
public function approvalaction(Request $request)
{
// dd($request);
$page = $request->page;
// dd($page);
$bod = Users::find(Auth::id());
$profile = Tproject::where('id', $request->tpid)
......@@ -685,7 +716,7 @@ class DashboardController extends Controller
->first();
// dd($profile);
return view('timesheet::dashboard.approvalaction', compact('profile', 'bod'));
return view('timesheet::dashboard.approvalaction', compact('profile', 'bod', 'page'));
}
public function approval(Request $request)
......@@ -705,6 +736,10 @@ class DashboardController extends Controller
$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 😊');
}
// dd($request);
......@@ -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.');
} else {
......@@ -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');
}
}
......
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