Commit 15bd9c96 by Azhan Hannan

log en faizal, redundant data.

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