Commit 6f84d8c8 by Azhan Hannan

Display overhead description bila hod verify

parent b2e67d6b
...@@ -487,7 +487,10 @@ ...@@ -487,7 +487,10 @@
<th class="center aligned">Notes</th> <th class="center aligned">Notes</th>
</tr> </tr>
</thead> </thead>
@foreach($overheads as $key => $overhead) <?php
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
?>
@foreach($pmsoverheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid')) @if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value) @foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours')) @if(data_get($value,'td_hours'))
......
...@@ -193,6 +193,25 @@ ...@@ -193,6 +193,25 @@
</tfoot> --> </tfoot> -->
</table> </table>
<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(data_get($profile,'notes') as $key => $value)
@if(data_get($profile,'fk_o_id') == data_get($value, 'fk_o_id'))
<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
</table>
<form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form"> <form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}"> <input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
......
...@@ -338,6 +338,26 @@ ...@@ -338,6 +338,26 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
@if(count($notes) > 0)
<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($notes as $key => $value)
<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>
@endforeach
</table>
@endif
@endif @endif
<div class="ui segment"> <div class="ui segment">
......
...@@ -340,6 +340,25 @@ ...@@ -340,6 +340,25 @@
</table> </table>
@endif @endif
@if(count($notes) > 0)
<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($notes as $key => $value)
<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>
@endforeach
</table>
@endif
</div> </div>
<div class="ui segment"> <div class="ui segment">
......
...@@ -633,6 +633,7 @@ class DashboardController extends Controller ...@@ -633,6 +633,7 @@ class DashboardController extends Controller
$profile = Tproject::where('id', $request->tpid) $profile = Tproject::where('id', $request->tpid)
->with('team') ->with('team')
->with('hod') ->with('hod')
->with('notes')
->first(); ->first();
// dd($profile); // dd($profile);
...@@ -3358,7 +3359,7 @@ class DashboardController extends Controller ...@@ -3358,7 +3359,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
// dd('sini ke?'); // dd('sini ke?');
...@@ -3386,6 +3387,8 @@ class DashboardController extends Controller ...@@ -3386,6 +3387,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
// dd($overheadlist); // dd($overheadlist);
...@@ -3403,6 +3406,7 @@ class DashboardController extends Controller ...@@ -3403,6 +3406,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -3419,7 +3423,9 @@ class DashboardController extends Controller ...@@ -3419,7 +3423,9 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth')); // dd($notes);
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth', 'notes'));
} }
public function verificationselected(Request $request) public function verificationselected(Request $request)
...@@ -4016,6 +4022,7 @@ class DashboardController extends Controller ...@@ -4016,6 +4022,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
...@@ -4044,6 +4051,8 @@ class DashboardController extends Controller ...@@ -4044,6 +4051,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
} }
...@@ -4060,6 +4069,7 @@ class DashboardController extends Controller ...@@ -4060,6 +4069,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -4076,7 +4086,7 @@ class DashboardController extends Controller ...@@ -4076,7 +4086,7 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.verifyallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'verifier')); return view('timesheet::dashboard.verifyallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'verifier', 'notes'));
} }
public function verificationall(Request $request) public function verificationall(Request $request)
......
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