Commit e2afcfa5 by Azhan Hannan

timesheet viewer -> filter null data & filter column penyokong

parent a9c41025
...@@ -89,84 +89,88 @@ ...@@ -89,84 +89,88 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($chargeablelist as $key => $projectchargeable) @if(count($chargeablelist) > 0)
<?php $totalcharge = 0; ?> @foreach($chargeablelist as $key => $projectchargeable)
<tr> <?php $totalcharge = 0; ?>
<td style="width: 4%;"></td> <tr>
<td style="width: 10%;">{{ $projectchargeable['pcode']}}</td> <td style="width: 4%;"></td>
<td style="width: 13%;">{{ $projectchargeable['pname']}}</td> <td style="width: 10%;">{{ $projectchargeable['pcode']}}</td>
@if($phase == 1) <td style="width: 13%;">{{ $projectchargeable['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php @for($i = 0; $i < 15 ; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{ if($chargehour)
$valchargehour = $chargehour->where('td_date','=',$date) {
->where('td_project',$projectchargeable['pid']) $valchargehour = $chargehour->where('td_date','=',$date)
->where('tm_phase',$phase) ->where('td_project',$projectchargeable['pid'])
->first(); ->where('tm_phase',$phase)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
} $totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour) ?>
<td style="width: 4%;"> @if($valchargehour)
@if(data_get($valchargehour,'td_hours') == 0) <td style="width: 4%;">
@else {{ data_get($valchargehour,'td_hours') }} @if(data_get($valchargehour,'td_hours') == 0)
@endif @else {{ data_get($valchargehour,'td_hours') }}
</td> @endif
@else </td>
<td style="width: 4%;"></td> @else
@endif <td style="width: 4%;"></td>
@endif
@endfor
@else @endfor
@for($i = 15; $i < $daymonth; $i++) @else
<?php @for($i = 15; $i < $daymonth; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{ if($chargehour)
$valchargehour = $chargehour->where('td_date','=',$date) {
->where('td_project',$projectchargeable['pid']) $valchargehour = $chargehour->where('td_date','=',$date)
->where('tm_phase',$phase) ->where('td_project',$projectchargeable['pid'])
->first(); ->where('tm_phase',$phase)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
} $totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour) ?>
<td style="width: 4%;"> @if($valchargehour)
@if(data_get($valchargehour,'td_hours') == 0) <td style="width: 4%;">
@else {{ data_get($valchargehour,'td_hours') }} @if(data_get($valchargehour,'td_hours') == 0)
@endif @else {{ data_get($valchargehour,'td_hours') }}
</td> @endif
</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totalcharge)
<td style="width: 5%">{{ number_format($totalcharge, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totalcharge/8, 1, '.', '') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif @endif
</tr>
@endfor @endforeach
@endif @else
<tr>
@if($totalcharge) <td class="text-center" colspan="@if($phase==1){{5+15}} @else {{5+($daymonth-15)}} @endif">No Data Overhead</td>
<td style="width: 5%">{{ number_format($totalcharge, 1, '.', '') }}</td> </tr>
<td style="width: 5%">{{ number_format($totalcharge/8, 1, '.', '') }}</td> @endif
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
@endif
</tr>
@endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<th colspan="3">Total (A)</th> <th colspan="3">Total (A)</th>
...@@ -248,77 +252,81 @@ ...@@ -248,77 +252,81 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($overheadlist as $key => $projectoverhead) @if(count($overheadlist) > 0)
<?php @foreach($overheadlist as $key => $projectoverhead)
$totaloverhead = 0; <?php
// dd($overheadlist); $totaloverhead = 0;
?> ?>
<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>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<?php <?php
$valoverheadhour = ''; $valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour) if($overheadhour)
{ {
$valoverheadhour = $overheadhour->where('td_date','=',$date) $valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid']) ->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase) ->where('tm_phase',$phase)
->first(); ->first();
$totaloverhead += data_get($valoverheadhour,'td_hours'); $totaloverhead += data_get($valoverheadhour,'td_hours');
} }
?> ?>
@if($valoverheadhour) @if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td> <td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth ; $i++) @for($i = 15; $i < $daymonth ; $i++)
<?php <?php
$valoverheadhour = ''; $valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour) if($overheadhour)
{ {
$valoverheadhour = $overheadhour->where('td_date','=',$date) $valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid']) ->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase) ->where('tm_phase',$phase)
->first(); ->first();
$totaloverhead += data_get($valoverheadhour,'td_hours'); $totaloverhead += data_get($valoverheadhour,'td_hours');
} }
?> ?>
@if($valoverheadhour) @if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td> <td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
@endfor
@endif
@endfor @if($totaloverhead)
@endif <td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td>
@if($totaloverhead) @else
<td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td> <td style="width: 5%">0</td>
<td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td> <td style="width: 5%">0</td>
@else @endif
<td style="width: 5%">0</td> </tr>
<td style="width: 5%">0</td> @endforeach
@endif @else
<tr>
</tr> <td class="text-center" colspan="@if($phase==1){{4+15}} @else {{4+($daymonth-15)}} @endif">No Data Overhead</td>
@endforeach </tr>
@endif
</tbody> </tbody>
<tfoot> <tfoot>
<th colspan="2">Total (B)</th> <th colspan="2">Total (B)</th>
...@@ -374,7 +382,7 @@ ...@@ -374,7 +382,7 @@
<td style="width: 17%;">Task</td> <td style="width: 17%;">Task</td>
<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>
...@@ -382,11 +390,18 @@ ...@@ -382,11 +390,18 @@
<td>{{ data_get($value,'td_overhead_note') }}</td> <td>{{ data_get($value,'td_overhead_note') }}</td>
</tr> </tr>
@endforeach @endforeach
@endif @else
<tr>
<td colspan="3" class="text-center">No Data Overhead</td>
</tr>
@endif
</tbody> </tbody>
</table> </table>
@if(data_get($check,'attachement')) </div>
<table id="printtable5" class="ui celled structured table unstackable">
@if(data_get($check,'attachement'))
<div class="ui segment">
<table id="printtable8" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th class="center aligned">Title</th> <th class="center aligned">Title</th>
...@@ -408,15 +423,14 @@ ...@@ -408,15 +423,14 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
@endif
</div> </div>
@endif
<div class="ui segment"> <div class="ui segment">
<table id="printtabl6" class="ui celled structured table unstackable"> <table id="printtable6" class="ui celled structured table unstackable">
<tbody> <tbody>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%"></td>
<td style="width: 23%;">Total (A) + (B) Working Hours</td> <td style="width: 23%;">Total (A) + (B) Working Hours</td>
@if( $phase == 1 ) @if( $phase == 1 )
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
...@@ -481,12 +495,12 @@ ...@@ -481,12 +495,12 @@
<td style="width: 4%;">{{ number_format($ac, '1', '.', '') }}</td> <td style="width: 4%;">{{ number_format($ac, '1', '.', '') }}</td>
@endfor @endfor
@endif @endif
<td> @if($check) {{ number_format(($totalchargehrs + $totaloverheadhrs), 1, '.', '') }} @else 0 @endif </td> <td style="width: 5%;"> @if($check) {{ number_format(($totalchargehrs + $totaloverheadhrs), 1, '.', '') }} @else 0 @endif </td>
<td> {{ number_format(($totalchargehrs + $totaloverheadhrs)/8, 1, '.', '') }} </td> <td style="width: 5%;"> {{ number_format(($totalchargehrs + $totaloverheadhrs)/8, 1, '.', '') }} </td>
</tr> </tr>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%"></td>
<td style="width: 23%;">Total (A+B) - 8 Overtime</td> <td style="width: 23%;">Total (A+B) - 8 Overtime</td>
<?php $totalot = 0; ?> <?php $totalot = 0; ?>
@if( $phase == 1 ) @if( $phase == 1 )
...@@ -583,6 +597,7 @@ ...@@ -583,6 +597,7 @@
</table> </table>
</div> </div>
@if(data_get($profile,'HOD_NAME'))
<div class="ui segment"> <div class="ui segment">
<table id="printtable7" class="ui celled structured table unstackable"> <table id="printtable7" class="ui celled structured table unstackable">
<thead> <thead>
...@@ -606,6 +621,28 @@ ...@@ -606,6 +621,28 @@
</tbody> </tbody>
</table> </table>
</div> </div>
@else
<div class="ui segment">
<table id="printtable7" class="ui celled structured table unstackable">
<thead>
<tr>
<th style="width: 50%;" class="center aligned">Staff Signature</th>
<th style="width: 50%;" class="center aligned">Approved by</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 50%;" class="center aligned"><br><br></td>
<td style="width: 50%;" class="center aligned"><br><br></td>
</tr>
<tr>
<td style="width: 50%;" class="center aligned">@if($profile){{ data_get($profile,'STAFF_NAME') }}@endif</td>
<td style="width: 50%;" class="center aligned">@if($profile){{ data_get($profile,'BOD_NAME') }}@endif</td>
</tr>
</tbody>
</table>
</div>
@endif
</div> </div>
<br> <br>
......
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