Commit d0053dd4 by Azhan Hannan

changes kat dashboard staff bila -> penyokong kat staff_info =0. filter tsubmit…

changes kat dashboard staff bila -> penyokong kat staff_info =0. filter tsubmit dgn resubmit utk overhead bila timesheet takde project
parent c6629de3
......@@ -133,7 +133,7 @@
<table class="ui unstackable celled table">
<thead>
<tr>
@if( data_get($staffinfo,'fk_lkp_department') == '7' && data_get($staffinfo,'penyokong') == '0' )
@if( data_get($staffinfo,'penyokong') == '0' )
<th style="width: 20%;">Overhead</th>
<th style="width: 20%;">Approver</th>
<th style="width: 35%;">Bod Remarks</th>
......@@ -156,18 +156,24 @@
@else
@foreach($overhead as $key => $tpoverhead)
<tr>
@if( data_get($staffinfo,'fk_lkp_department') == '7' && data_get($staffinfo,'penyokong') == '0' )
@if( data_get($staffinfo,'penyokong') == '0' )
<td style="width: 20%;">{{data_get($tpoverhead,'tp_project_name')}}</td>
<td style="width: 20%;" class="single line">{{data_get($tpoverhead,'bod.fullname')}}</td>
<td style="width: 35%;">{{data_get($tpoverhead,'approver_remark')}}</td>
<td style="width: 13%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 1) Draft
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 2) Submitted
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 3) Auto-verified
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 4) Approved by BOD
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 5) Rejected by BOD
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 6) Rejected by HOD
@endif
</td>
@else
<td style="width: 15%;">{{data_get($tpoverhead,'tp_project_name')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</td>
<td style="width: 15%;" class="single line">{{data_get($tpoverhead,'hod.fullname')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'approver_remark')}}</td>
@endif
<!-- <td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')}}</td>
<td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')/8}}</td> -->
<td style="width: 13%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 1) Draft
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 2) Submitted
......@@ -177,11 +183,14 @@
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 6) Rejected by HOD
@endif
</td>
@endif
<!-- <td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')}}</td>
<td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')/8}}</td> -->
<td style="width: 12%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 5 || data_get($tpoverhead,'tp_timesheet_sts') == 6)
<button class="center aligned ui red icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpoverhead,'id')]) }}';">Resubmit</button>
@elseif(data_get($value,'tm_timesheet_master_sts') == 1)
return ke edit overhead
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 2) Waiting for Verification
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 3) Waiting for Approval
@else
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
......
......@@ -1639,9 +1639,11 @@ class DashboardController extends Controller
if ($checkpmhod)
{
Ts_detail::where('fk_tm_id', $request->tid)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => 'Verified',
......@@ -1653,9 +1655,11 @@ class DashboardController extends Controller
->update([ 'tm_timesheet_master_sts' => 3 ]);
Ts_detail::where('fk_tm_id', $request->tid)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => 'Verified',
......@@ -1669,13 +1673,15 @@ class DashboardController extends Controller
->update([ 'tm_timesheet_master_sts' => 3 ]);
Ts_detail::where('fk_tm_id', $request->tid)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->where('tp_project_type', 3)
->update([ 'tp_timesheet_sts' => 3] );
}
if ( (data_get($user,'penyokong') == '0') && (data_get($user,'fk_lkp_department') == '7'))
if ( data_get($user,'penyokong') == '0' )
{
// dd('bdd & takde penyokong')
$checkbdd = Tproject::where('tp_project_type', 1)
......@@ -1685,9 +1691,11 @@ class DashboardController extends Controller
if ($checkbdd)
{
Ts_detail::where('fk_tm_id', $request->tid)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
......@@ -1703,9 +1711,11 @@ class DashboardController extends Controller
]);
Ts_detail::where('fk_tm_id', $request->tid)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
......
......@@ -2728,7 +2728,7 @@ class FormController extends Controller
return redirect()->route('timesheet::dashboard.index')->withSuccess('Rejected overhead has been resubmit');
}
if ( (data_get($user,'penyokong') == '0') && (data_get($user,'fk_lkp_department') == '7'))
if ( data_get($user,'penyokong') == '0' )
{
$checkbdd = Tproject::where('tp_project_type', 1)
->where('fk_tm_id',$request->fk_tm_id)
......@@ -2736,9 +2736,11 @@ class FormController extends Controller
if ($checkbdd) {
Ts_detail::where('fk_tm_id', $request->fk_tm_id)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->fk_tm_id)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
......@@ -2753,9 +2755,11 @@ class FormController extends Controller
'tm_verified_at' => today()->toDateString(),
]);
Ts_detail::where('fk_tm_id', $request->fk_tm_id)
->where('td_project_type', 3)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->fk_tm_id)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
......
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