Commit 15bd9c96 by Azhan Hannan

log en faizal, redundant data.

parent 22dc6c2b
...@@ -243,7 +243,10 @@ ...@@ -243,7 +243,10 @@
</thead> </thead>
<tbody> <tbody>
@foreach($overheadlist as $key => $projectoverhead) @foreach($overheadlist as $key => $projectoverhead)
<?php $totaloverhead = 0; ?> <?php
$totaloverhead = 0;
// dd($overheadlist);
?>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
<td style="width: 23%;">{{ $projectoverhead['pname']}}</td> <td style="width: 23%;">{{ $projectoverhead['pname']}}</td>
...@@ -327,7 +330,7 @@ ...@@ -327,7 +330,7 @@
} }
} }
?> ?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th> <th style="width: 4%">{{ number_format($totaloverheadbyday, 1, '.', '') }}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
...@@ -343,7 +346,7 @@ ...@@ -343,7 +346,7 @@
} }
} }
?> ?>
<th style="width: 4%">{{ $totaloverheadbyday }}</th> <th style="width: 4%">{{ number_format($totaloverheadbyday, '1', '.', '') }}</th>
@endfor @endfor
@endif @endif
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs, 1, '.', '') }} @else 0 @endif</th>
...@@ -356,7 +359,7 @@ ...@@ -356,7 +359,7 @@
<table id="printtable5" class="ui celled structured table unstackable"> <table id="printtable5" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="3" class="center aligned">Notes: BIDS/TENDER/OTHERS</th> <th colspan="3" class="center aligned">Note: BIDS/TENDER/OTHERS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -366,13 +369,13 @@ ...@@ -366,13 +369,13 @@
<td style="width: @if($phase == 1){{(15*4)+10}}@else{{(($daymonth-15)*4)+10}}@endif%;">Description</td> <td style="width: @if($phase == 1){{(15*4)+10}}@else{{(($daymonth-15)*4)+10}}@endif%;">Description</td>
</tr> </tr>
@if($notes) @if($notes)
@foreach($notes as $key => $value) @foreach($notes as $key => $value)
<tr> <tr>
<td>{{ date("d-m-Y", strtotime(data_get($value,'td_date'))) }}</td> <td>{{ date("d-m-Y", strtotime(data_get($value,'td_date'))) }}</td>
<td>{{ data_get($value,'td_overhead_desc') }}</td> <td>{{ data_get($value,'td_overhead_desc') }}</td>
<td>{{ data_get($value,'td_overhead_note') }}</td> <td>{{ data_get($value,'td_overhead_note') }}</td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</tbody> </tbody>
</table> </table>
......
...@@ -51,7 +51,9 @@ ...@@ -51,7 +51,9 @@
</tr> </tr>
<?php <?php
// $chargeproject = $project->where('ptype', 1);
$chargeproject = $project->where('ptype', 1); $chargeproject = $project->where('ptype', 1);
dd($chargeproject);
$chargehours = $chargedays = 0; $chargehours = $chargedays = 0;
?> ?>
......
...@@ -1327,42 +1327,60 @@ class DashboardController extends Controller ...@@ -1327,42 +1327,60 @@ class DashboardController extends Controller
$overheadhour = Ts_detail::where('fk_tm_id',$check->id) $overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->where('td_hours', '!=', 0) ->where('td_hours', '!=', 0)
->get(); // ->groupby('fk_o_id')
->get();
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour[0])) $ovlist = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
->groupby('fk_o_id')
->orderby('fk_o_id', 'asc')
->get();
// dd($ovlist);
foreach ($ovlist as $key => $value)
{ {
// dd('sini ke?'); $overheadlist[] = [
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc; 'pid' => data_get($value,'fk_o_id') ,
$tempOverheadid[0] = $overheadhour[0]->fk_o_id; 'pname' => data_get($value,'td_overhead_desc'),
];
$j = 0; }
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
foreach ($tempOverhead as $key => $value) { // dd($overheadlist);
$overheadlist[] = [ // $tempOverhead[0] = "";
'pid' => $tempOverheadid[$key], // $tempOverheadid[0] = 0;
'pname' => $tempOverhead[$key],
]; // if(isset($overheadhour[0]))
} // {
} // // dd('sini ke?');
else // $tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
{ // $tempOverheadid[0] = $overheadhour[0]->fk_o_id;
// dd('ke sini?');
} // $j = 0;
// for($i = 0; $i < count($overheadhour); $i++)
// {
// if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
// }
// else
// {
// $j++;
// $tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
// $tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
// }
// }
// // dd($tempOverhead);
// foreach ($tempOverhead as $key => $value) {
// $overheadlist[] = [
// 'pid' => $tempOverheadid[$key],
// 'pname' => $tempOverhead[$key],
// ];
// }
// }
// else
// {
// // dd('ke sini?');
// }
$totalchargehrs = $check->tm_chargeable_hrs; $totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs; $totaloverheadhrs = $check->tm_overhead_hrs;
......
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