Commit 5dab96b4 by Azhan Hannan

Log Pia #118 -> ISU: -lepas htr: tiada display message berjaya submit -lepas htr…

Log Pia #118 -> ISU: -lepas htr: tiada display message berjaya submit -lepas htr : tiada rekod timesheet yg dihantar
parent 6c3b26d1
......@@ -2,6 +2,189 @@
@section('content')
<div class="ui segment">
<!-- <a class="ui blue left ribbon label">Welcome Back</a>
<br>
<br> -->
<!-- <div class="column sixteen wide">
<div class="ui cards four doubling">
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Baru Hantar</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="american sign language interpreting icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Belum Hantar </h3>
</div>
<div class="extra content">
<span class="right floated"><i class="retweet icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Diluluskan</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="icon calendar check outline"></i>1</span>
</div>
</a>
</div>
</div>
<br> -->
<a class="ui teal left ribbon label">Timesheet Status</a>
<br>
<br>
@foreach($timesheet as $key => $value)
<!-- <?php
// dd($value->tm_timesheet_master_sts);
?> -->
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 60%" class="text-center">
@if(data_get($value,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($value,'tm_month'), 10)) }} - {{ data_get($value,'tm_year') }}
</th>
<th style="width: 15%;" class="center aligned">
@if(data_get($value,'tm_timesheet_master_sts') == 1) Draft
@elseif(data_get($value,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($value,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($value,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($value,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($value,'tm_timesheet_master_sts') == 6) <i class="red attention icon"></i> Rejected by HOD/HOU/PM
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($value,'tm_submission_at'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Project</button>
</th>
</tr>
</thead>
</table>
</div>
<?php
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($value,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($value,'id'));
// dd($overhead);
?>
<div class="content" style="padding-top: 0px;">
<!-- chargeable -->
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 7%;" class="text-center">Project Code</th>
<th style="width: 13;">Project Name</th>
<th style="width: 15;">Project Manager</th>
<!-- <th style="width: 5%;" class="center aligned">Total Hours</th>
<th style="width: 5%;" class="center aligned">Total Days</th> -->
<th style="width: 20%">PM Remarks</th>
<th style="width: 20%">PD Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@if(count($chargeable) == '0')
<tr>
<td class="text-center" colspan="5">No Project Submitted</td>
</tr>
@else
@foreach($chargeable as $key => $tpcharge)
<tr>
<td style="width: 7%;" class="text-center">{{data_get($tpcharge,'project.p_project_code')}}</td>
<td style="width: 13;">{{data_get($tpcharge,'tp_project_name')}}</td>
<td style="width: 15;">{{data_get($tpcharge,'project.projectManager.fullname')}}</td>
<!-- <td style="width: 5%;" class="center aligned">{{data_get($tpcharge,'tp_hours')}}</td>
<td style="width: 5%;" class="center aligned">{{data_get($tpcharge,'tp_hours')/8}}</td> -->
<td style="width: 20%">{{data_get($tpcharge,'verifier_remark')}}</td>
<td style="width: 20%">{{data_get($tpcharge,'approver_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tpcharge,'tp_timesheet_sts') == 1) Draft
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 2) Submitted
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 3) Verified by PM
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 4) Approved by PD
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 5) Rejected by PD
@elseif(data_get($tpcharge,'tp_timesheet_sts') == 6) Rejected by PM
@endif
</td>
<td style="width: 12%;" class="text-center">
@if(data_get($tpcharge,'tp_timesheet_sts') == 5|| data_get($tpcharge,'tp_timesheet_sts') == 6)
<button class="center aligned ui red icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpcharge,'id')]) }}';">Resubmit</button>
@elseif(data_get($value,'tm_timesheet_master_sts') == 1)
<!-- <button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['year' => data_get($tpcharge,'tp_year'), 'month' => data_get($tpcharge,'tp_month'), 'phase' => data_get($tpcharge,'tp_phase')]) }}';">Edit Draft</button> -->
@else
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
</td>
</tr>
@endforeach
@endif
</table>
<!-- overhead -->
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 20%;">Overhead</th>
<th style="width: 20%;">Approver</th>
<!-- <th style="width: 5%;" class="center aligned">Total Hours</th>
<th style="width: 5%;" class="center aligned">Total Days</th> -->
<!-- <th style="width: 15%;">Hod Remarks</th> -->
<th style="width: 35%;">Bod Remarks</th>
<th style="width: 13%;" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@if(count($overhead) == 0)
<tr>
<td class="text-center" colspan="5">No Overhead Submitted</td>
</tr>
@else
@foreach($overhead as $key => $tpoverhead)
<tr>
<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: 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: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</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) Verified by HOD
@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>
<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
@else
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
</td>
</tr>
@endforeach
@endif
</table>
</div>
</div>
<br>
@endforeach
<!-- <br> -->
</div>
<div class="ui segment">
<div class="ui blue left ribbon label">
Head of Department/Unit Dashboard
</div>
......@@ -192,6 +375,7 @@
@endif
</div>
</div>
@endsection
@push('script')
......
......@@ -185,8 +185,6 @@
<!-- <br> -->
</div>
@endsection
@push('script')
......
......@@ -35,7 +35,6 @@ use Auth;
class DashboardController extends Controller
{
public function index()
{
......@@ -79,7 +78,27 @@ class DashboardController extends Controller
->with('attachement')
->get();
return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier'));
//timesheet status
$staffid = Users::find(Auth::id())
->u_staffID;
$timesheet = Ts_master::where('tm_staff_id', $staffid)
->where('tm_timesheet_master_sts', '<>', 1)
->orderby('tm_year')
->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC')
->get();
$projects = Tproject::where('staffid', $staffid)
->where('tp_year', date('Y'))
->where('tp_timesheet_sts', '<>', 1)
->with('project')
->with('overhead')
->with('hod')
->with('bod')
->get();
return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier', 'timesheet', 'projects'));
}
......
......@@ -42,6 +42,11 @@ class Tproject extends Model
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','tp_pm');
}
public function bod()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','tp_pd');
}
public function team()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staffid');
......
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