Commit 5ae502ad by Azhan Hannan

Display overhead description for Staff dashboard, Project Manager & HOD dashboard.

parent fba11573
......@@ -38,7 +38,7 @@
<a class="ui teal left ribbon label">Timesheet Status</a>
<br>
<br>
@foreach($timesheet as $key => $value)
@foreach($timesheet as $key => $time)
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
<div class="title">
......@@ -46,18 +46,18 @@
<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') }}
@if(data_get($time,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($time,'tm_month'), 10)) }} - {{ data_get($time,'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
@if(data_get($time,'tm_timesheet_master_sts') == 1) Draft
@elseif(data_get($time,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($time,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($time,'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: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($time,'tm_submission_at'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Project</button>
</th>
......@@ -67,8 +67,8 @@
</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'));
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead);
?>
......@@ -174,6 +174,44 @@
@endforeach
@endif
</table>
<!-- Overhead Notes Start -->
<?php $n = null; ?>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $tm_detail)
<?php $n = $tm_detail; ?>
@endforeach
@endif
@endforeach
@if($n)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<!-- Overhead Notes End -->
</div>
</div>
<br>
......
......@@ -41,7 +41,7 @@
<br>
@if(count($timesheet) > 0)
<br>
@foreach($timesheet as $key => $value)
@foreach($timesheet as $key => $time)
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
<div class="title">
......@@ -49,18 +49,18 @@
<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') }}
@if(data_get($time,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($time,'tm_month'), 10)) }} - {{ data_get($time,'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
@if(data_get($time,'tm_timesheet_master_sts') == 1) Draft
@elseif(data_get($time,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($time,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($time,'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: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($time,'tm_submission_at'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Project</button>
</th>
......@@ -70,8 +70,8 @@
</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'));
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead);
?>
......@@ -197,6 +197,44 @@
</tr>
@endforeach
@endif
<!-- Overhead Notes Start -->
<?php $n = null; ?>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $tm_detail)
<?php $n = $tm_detail; ?>
@endforeach
@endif
@endforeach
@if($n)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<!-- Overhead Notes End -->
</table>
</div>
</div>
......
......@@ -40,9 +40,9 @@
<a class="ui teal left ribbon label">Timesheet Status</a>
<br>
<br>
@foreach($timesheet as $key => $value)
@foreach($timesheet as $key => $time)
<!-- <?php
// dd($value->tm_timesheet_master_sts);
// dd($time->tm_timesheet_master_sts);
?> -->
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
......@@ -51,18 +51,18 @@
<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') }}
@if(data_get($time,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($time,'tm_month'), 10)) }} - {{ data_get($time,'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
@if(data_get($time,'tm_timesheet_master_sts') == 1) Draft
@elseif(data_get($time,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($time,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($time,'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: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($time,'tm_submission_at'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Project</button>
</th>
......@@ -72,8 +72,8 @@
</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'));
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead);
?>
......@@ -219,6 +219,44 @@
@endforeach
@endif
</table>
<!-- Overhead Notes Start -->
<?php $n = null; ?>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $tm_detail)
<?php $n = $tm_detail; ?>
@endforeach
@endif
@endforeach
@if($n)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<!-- Overhead Notes End -->
</div>
</div>
<br>
......
......@@ -40,9 +40,9 @@
<a class="ui teal left ribbon label">Timesheet Status</a>
<br>
<br>
@foreach($timesheet as $key => $value)
@foreach($timesheet as $key => $time)
<!-- <?php
// dd($value->tm_timesheet_master_sts);
// dd($time->tm_timesheet_master_sts);
?> -->
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
......@@ -51,18 +51,18 @@
<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') }}
@if(data_get($time,'tm_phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($time,'tm_month'), 10)) }} - {{ data_get($time,'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
@if(data_get($time,'tm_timesheet_master_sts') == 1) Draft
@elseif(data_get($time,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($time,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU/PM
@elseif(data_get($time,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($time,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($time,'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: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($time,'tm_submission_at'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Project</button>
</th>
......@@ -72,8 +72,8 @@
</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'));
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead);
?>
......@@ -200,6 +200,46 @@
@endforeach
@endif
</table>
<!-- Overhead Notes Start -->
<?php $n = null; ?>
@foreach($staffnotes as $key => $detail)
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $tm_detail)
<?php $n = $tm_detail; ?>
@endforeach
@endif
@endforeach
@if($n)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($staffnotes as $key => $detail)
<?php
// dump('value : '.data_get($time,'id')); dump('detail : '.data_get($detail,'fk_tm_id'));
?>
@if(data_get($time,'id') == data_get($detail, 'fk_tm_id'))
@foreach(data_get($detail,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<!-- Overhead Notes End -->
</div>
</div>
<br>
......
......@@ -69,6 +69,13 @@ class DashboardController extends Controller
->orderby('tm_phase', 'desc')
->get();
$staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1)
->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y'))
->with('notes')
->get();
$details = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1)
->where('tp_pm', $verifier->id)
......@@ -99,7 +106,7 @@ class DashboardController extends Controller
->with('bod')
->get();
return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier', 'timesheet', 'projects'));
return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier', 'timesheet', 'projects', 'staffnotes'));
}
......@@ -161,7 +168,6 @@ class DashboardController extends Controller
if ( $roleid == '8') {
$verifier = Users::find(Auth::id());
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid')
......@@ -176,6 +182,12 @@ class DashboardController extends Controller
->with('countchargeable')
->get();
// dd($profile);
$staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1)
->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y'))
->with('notes')
->get();
$details = Tproject::where('tp_pm', $verifier->u_staffID)
// ->where('tp_timesheet_sts', 2)
......@@ -207,7 +219,7 @@ class DashboardController extends Controller
->with('bod')
->get();
return view('timesheet::dashboard.dashboardpm', compact('profile', 'details', 'verifier', 'timesheet', 'projects', 'staffinfo'));
return view('timesheet::dashboard.dashboardpm', compact('profile', 'details', 'verifier', 'timesheet', 'projects', 'staffinfo', 'staffnotes'));
}
if ( $roleid == '9') {
......@@ -225,6 +237,13 @@ class DashboardController extends Controller
// ->with('department')
->get();
// dd($profile);
$staffnotes = Tproject::where('tp_project_type', 3)
// ->where('tp_timesheet_sts','<>', 1)
->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y'))
->with('notes')
->get();
// dd($staffnotes);
$details = Tproject::where('tp_pm', $verifier->u_staffID)
// ->whereIn('tp_timesheet_sts', [2,6])
......@@ -263,7 +282,7 @@ class DashboardController extends Controller
->with('bod')
->get();
return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid'));
return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid', 'staffnotes'));
}
if (($roleid == ('5'||'6'))) {
......@@ -295,6 +314,14 @@ class DashboardController extends Controller
->get();
// dd($projects);
$staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1)
->where('staffid', $staffid)
->where('tp_year', date('Y'))
->with('notes')
->get();
// dd($staffnotes);
//verifier section
$verifier = Users::find(Auth::id());
......@@ -323,7 +350,7 @@ class DashboardController extends Controller
}
)->paginate(15);
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects', 'roleid', 'staffinfo', 'profile', 'details', 'checkts'));
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects', 'roleid', 'staffinfo', 'profile', 'details', 'checkts', 'staffnotes'));
}if ($roleid == '3') {
......
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