Commit b96e2a42 by Azhan Hannan

update dashboard approval

parent 2fd63eca
......@@ -67,35 +67,36 @@
<th style="width: 10%;" class="center aligned">Action</th>
</tr>
</thead>
@if($detail->where('tp_project_type', 1) && data_get($staff,'tmid') == data_get($chargeable,'fk_tm_id'))
@if($detail->where('tp_project_type', 1))
@foreach($detail->where('tp_project_type', 1) as $key => $chargeable)
<tr>
<td style="width: 10%;">{{ data_get($chargeable, 'project.p_project_code') }}</td>
<td style="width: 15%;">{{ data_get($chargeable, 'tp_project_name') }}</td>
<td style="width: 10%;" class="center aligned">{{ data_get($chargeable, 'tp_hours') }}</td>
<td style="width: 10%;" class="center aligned">{{ number_format(data_get($chargeable, 'tp_hours')/8, 1, '.', '') }}</td>
<td style="width: 15%;">{{data_get($chargeable, 'verifier_remark')}}</td>
<td style="width: 15%;">{{data_get($chargeable, 'approver_remark')}}</td>
<td style="width: 15%;" class="center aligned">
@if(data_get($chargeable, 'tp_timesheet_sts') == 1 || data_get($chargeable, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 3) <i class="red attention icon"></i> Verified by PM
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($chargeable, '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($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'), 'page'=>$page ]) }}';">Approval</button>
@else
<button class="center aligned ui green icon button disabled">Approval</button>
@endif
</td>
</tr>
@endforeach
@if(data_get($staff,'tmid') == data_get($chargeable,'fk_tm_id'))
<tr>
<td style="width: 10%;">{{ data_get($chargeable, 'project.p_project_code') }}</td>
<td style="width: 15%;">{{ data_get($chargeable, 'tp_project_name') }}</td>
<td style="width: 10%;" class="center aligned">{{ data_get($chargeable, 'tp_hours') }}</td>
<td style="width: 10%;" class="center aligned">{{ number_format(data_get($chargeable, 'tp_hours')/8, 1, '.', '') }}</td>
<td style="width: 15%;">{{data_get($chargeable, 'verifier_remark')}}</td>
<td style="width: 15%;">{{data_get($chargeable, 'approver_remark')}}</td>
<td style="width: 15%;" class="center aligned">
@if(data_get($chargeable, 'tp_timesheet_sts') == 1 || data_get($chargeable, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 3) <i class="red attention icon"></i> Verified by PM
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($chargeable, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($chargeable, '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($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'), 'page'=>$page ]) }}';">Approval</button>
@else
<button class="center aligned ui green icon button disabled">Approval</button>
@endif
</td>
</tr>
@endif
@endforeach
@endif
</table>
@endif
......
......@@ -811,7 +811,6 @@ class DashboardController extends Controller
->where('td_project', $pid)
->update([ 'td_timesheet_sts' => 5 ]);
} else {
dd('sini');
Ts_detail::where('fk_tm_id', $tmid)
->where('fk_o_id', $oid)
->update([ 'td_timesheet_sts' => 5 ]);
......@@ -829,7 +828,7 @@ class DashboardController extends Controller
->update(
[
'tm_timesheet_master_sts' => 5,
'hod_rejected_at' => $today,
'bod_rejected_at' => $today,
]);
}
......
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