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'))
......
...@@ -10,42 +10,42 @@ ...@@ -10,42 +10,42 @@
<br> <br>
<table class="ui unstackable collapsing table" style="width: 100%"> <table class="ui unstackable collapsing table" style="width: 100%">
<tbody> <tbody>
<tr> <tr>
<td rowspan="3"> <td rowspan="3">
<img src="{{ url('img/3f-logo.svg') }}" height="126" width="126" alt="3f-logo"> <img src="{{ url('img/3f-logo.svg') }}" height="126" width="126" alt="3f-logo">
</td> </td>
<td>Name</td> <td>Name</td>
<td>:</td> <td>:</td>
<td>{{ data_get($staff,'STAFF_NAME') }}</td> <td>{{ data_get($staff,'STAFF_NAME') }}</td>
<td rowspan="3"></td> <td rowspan="3"></td>
<td>Department</td> <td>Department</td>
<td>:</td> <td>:</td>
<td>{{ data_get($staff,'DEPARTMENT') }}</td> <td>{{ data_get($staff,'DEPARTMENT') }}</td>
<td rowspan="3"></td> <td rowspan="3"></td>
</tr> </tr>
<tr> <tr>
<td>Staff No</td> <td>Staff No</td>
<td>:</td> <td>:</td>
<td>{{ data_get($staff,'STAFF_ID') }}</td> <td>{{ data_get($staff,'STAFF_ID') }}</td>
<td>Reporting Manager</td> <td>Reporting Manager</td>
<td>:</td> <td>:</td>
<td>{{ data_get($staff,'HOD_NAME') }}</td> <td>{{ data_get($staff,'HOD_NAME') }}</td>
</tr> </tr>
<tr> <tr>
<td>Month</td> <td>Month</td>
<td>:</td> <td>:</td>
<td>{{ $strMonth }}</td> <td>{{ $strMonth }}</td>
<td>Phase</td> <td>Phase</td>
<td>:</td> <td>:</td>
<td> <td>
@if($phase == 1) 1st Half-month @if($phase == 1) 1st Half-month
@else 2nd Half-month @else 2nd Half-month
@endif @endif
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table class="ui celled structured table unstackable"> <table class="ui celled structured table unstackable">
<thead> <thead>
...@@ -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">
......
...@@ -339,6 +339,25 @@ ...@@ -339,6 +339,25 @@
</tfoot> --> </tfoot> -->
</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>
......
...@@ -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);
...@@ -3400,14 +3403,15 @@ class DashboardController extends Controller ...@@ -3400,14 +3403,15 @@ class DashboardController extends Controller
$totaloverheadhrs = $check->tm_overhead_hrs; $totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year) $notes = Ts_detail::where('tm_year', $year)
->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)
->where('tm_staff_id', $tm->tm_staff_id) ->whereIn('fk_o_id', $overheadid)
->where('td_project_type', $overhead) ->where('tm_staff_id', $tm->tm_staff_id)
->whereNotNull('td_hours') ->where('td_project_type', $overhead)
->orderby('td_date') ->whereNotNull('td_hours')
->get(); ->orderby('td_date')
->get();
} }
else else
{ {
...@@ -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,7 +4022,8 @@ class DashboardController extends Controller ...@@ -4016,7 +4022,8 @@ 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?');
...@@ -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