Commit 95f49f85 by Azhan Hannan

changes in export report

parent 527ffcba
......@@ -27,23 +27,36 @@
@foreach($staffs as $key => $staff)
<tbody>
<?php
$countchargeable = $countoverhead = 0;
$countproject = $projecttitle->where('staffid', data_get($staff,'staffid'));
$chargeproject = $projecttitle->where('ptype', 1);
foreach ($chargeproject as $key => $chargeable) {
if (data_get($chargeable,'staffid') == data_get($staff,'staffid')) {
$countchargeable += 1;
}
}
foreach ($overheadtitle as $key => $value) {
if (data_get($value,'staffid') == data_get($staff,'staffid')) {
$countoverhead += 1;
}
}
$countrow = $countoverhead+$countchargeable;
?>
<tr>
<td colspan="6">{{data_get($staff,'name')}}</td>
<td rowspan="{{$countrow+2}}" style="border-right: 1px solid rgba(34,36,38,.15);">{{data_get($staff,'name')}}</td>
</tr>
<?php
// $chargeproject = $project->where('ptype', 1);
$chargeproject = $projecttitle->where('ptype', 1);
// dump($chargeproject);
$chargehours = $chargedays = 0;
// dump($countrow);
?>
@foreach($chargeproject as $key => $chargeable)
@if(data_get($chargeable,'staffid') == data_get($staff,'staffid'))
<tr>
<td style="width: 35%"></td>
<td style="width: 5%" class="center aligned">C</td>
<td style="width: 15%" class="center aligned">{{data_get($chargeable,'pcode')}}</td>
<td style="width: 25%">{{data_get($chargeable,'pname')}}</td>
......@@ -76,7 +89,6 @@
@foreach($overheadtitle as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid'))
<tr>
<td style="width: 35%"></td>
<td style="width: 5%" class="center aligned">NC</td>
<td style="width: 15%" class="center aligned"></td>
<td style="width: 25%">{{data_get($value,'pname')}}</td>
......@@ -107,8 +119,7 @@
$staffdays = $chargedays+$overheaddays;
?>
<tr>
<td colspan="3"></td>
<td style="width: 25%" class="center aligned">Total</td>
<td style="width: 25%" colspan="3" class="center aligned">Total</td>
<td style="width: 10%" class="center aligned">{{ number_format($staffhours, '1', '.', '') }}</td>
<td style="width: 10%" class="center aligned">{{ number_format($staffdays, '1', '.', '') }}</td>
</tr>
......@@ -121,8 +132,7 @@
@endforeach
<tfoot class="full-width">
<tr>
<th colspan="3"><strong>Total</strong></th>
<th style="width: 25%" class="center aligned"></th>
<th style="width: 25%" colspan="4" class="left aligned">Total</th>
<th style="width: 10%" class="center aligned"><strong>{{ number_format($totalhours, '1', '.', '') }}</strong></th>
<th style="width: 10%" class="center aligned"><strong>{{ number_format($totaldays, '1', '.', '') }}</strong></th>
</tr>
......
......@@ -44,23 +44,36 @@
@foreach($staffs as $key => $staff)
<tbody>
<?php
$countchargeable = $countoverhead = 0;
$countproject = $projecttitle->where('staffid', data_get($staff,'staffid'));
$chargeproject = $projecttitle->where('ptype', 1);
foreach ($chargeproject as $key => $chargeable) {
if (data_get($chargeable,'staffid') == data_get($staff,'staffid')) {
$countchargeable += 1;
}
}
foreach ($overheadtitle as $key => $value) {
if (data_get($value,'staffid') == data_get($staff,'staffid')) {
$countoverhead += 1;
}
}
$countrow = $countoverhead+$countchargeable;
?>
<tr>
<td colspan="6">{{data_get($staff,'name')}}</td>
<td rowspan="{{$countrow+2}}" style="border-right: 1px solid rgba(34,36,38,.15);">{{data_get($staff,'name')}}</td>
</tr>
<?php
// $chargeproject = $project->where('ptype', 1);
$chargeproject = $projecttitle->where('ptype', 1);
// dump($chargeproject);
$chargehours = $chargedays = 0;
// dump($countrow);
?>
@foreach($chargeproject as $key => $chargeable)
@if(data_get($chargeable,'staffid') == data_get($staff,'staffid'))
<tr>
<td style="width: 35%"></td>
<td style="width: 5%" class="center aligned">C</td>
<td style="width: 15%" class="center aligned">{{data_get($chargeable,'pcode')}}</td>
<td style="width: 25%">{{data_get($chargeable,'pname')}}</td>
......@@ -93,7 +106,6 @@
@foreach($overheadtitle as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid'))
<tr>
<td style="width: 35%"></td>
<td style="width: 5%" class="center aligned">NC</td>
<td style="width: 15%" class="center aligned"></td>
<td style="width: 25%">{{data_get($value,'pname')}}</td>
......@@ -124,8 +136,7 @@
$staffdays = $chargedays+$overheaddays;
?>
<tr>
<td colspan="3"></td>
<td style="width: 25%" class="center aligned">Total</td>
<td style="width: 25%" colspan="3" class="center aligned">Total</td>
<td style="width: 10%" class="center aligned">{{ number_format($staffhours, '1', '.', '') }}</td>
<td style="width: 10%" class="center aligned">{{ number_format($staffdays, '1', '.', '') }}</td>
</tr>
......@@ -138,8 +149,7 @@
@endforeach
<tfoot class="full-width">
<tr>
<th colspan="3"><strong>Total</strong></th>
<th style="width: 25%" class="center aligned"></th>
<th style="width: 25%" colspan="4" class="left aligned">Total</th>
<th style="width: 10%" class="center aligned"><strong>{{ number_format($totalhours, '1', '.', '') }}</strong></th>
<th style="width: 10%" class="center aligned"><strong>{{ number_format($totaldays, '1', '.', '') }}</strong></th>
</tr>
......
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