<style>
	table.datatables{ order: 2px solid #444 !important; }
	table.datatables th, .datatables td { border: 1px solid #444 !important; }
	table.datatables th { background-color: #F9F9F9 !important; }
	table.datatables th.header { background-color: #F4F4F4 !important; }
	table.datatables tr.total td,
	table.datatables tr.total th { font-weight: bold !important; }
</style>
<script>
$(document).ready(function() {
	$('td.blk5').prepend('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
	$('td.blk10').prepend('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
});
</script>


<section class="container">
	<div class="row">
		<div class="col-xs-12 table-responsive">
			<h3>Penyata Prestasi Kewangan</h3>
			<table width="100%" class="datatables">
				<thead>
					<tr>
						<th rowspan="2" class="col-md-8">Perkara</th>
					</tr>
					<tr>
						<th class="col-md-2 text-center">
							Tahun Semasa<br />Berakhir Pada 31/12/<span class="year_curr"><?php echo ($years && $years[0]) ? $years[0] : NULL; ?></span>
						</th>
						<th class="col-md-2 text-center">
							Tahun Sebelum<br />Berakhir Pada 31/12/<span class="year_prev"><?php echo ($years && $years[1]) ? $years[1] : NULL; ?></span>
						</th>
					</tr>
				</thead>
				
				<tbody>
				<?php
				if($perf) {
					$k = 0;
					foreach($perf as $key=>$value) {
						?>
						<tr>
						<td class="blk5"><?php echo $this->lang->line(strtolower(str_replace(" ","",$key))); ?></td>
						<td class="text-center" id="<?php echo "perf_".$k; ?>_0">
							<?php echo ($years && $years[0]) ? number_format($value[$years[0]],2) : NULL; ?>
						</td>
						<td class="text-center" id="<?php echo "perf_".$k; ?>_1">
							<?php echo ($years && $years[1]) ? number_format($value[$years[1]],2) : NULL; ?>
						</td>
						</tr>
						<?php
						$k++;
					}
				}				
				?>
				</tbody>
				
			</table>
		</div>
	</div>
	
	<div class="row">
		<div class="col-xs-12 table-responsive">
			<h3>Nisbah Prestasi Kewangan</h3>
			<table width="100%" class="datatables">
				<thead>
					<tr>
						<th rowspan="2" class="col-md-8"><?php echo $this->lang->line('ratio'); ?></th>
					</tr>
					<tr>
						<th class="col-md-2 text-center">
							Tahun Semasa<br />Sehingga 31/12/<span class="year_curr"><?php echo ($years && $years[0]) ? $years[0] : NULL; ?></span>
						</th>
						<th class="col-md-2 text-center">
							Tahun Sebelum<br />Sehingga 31/12/<span class="year_prev"><?php echo ($years && $years[1]) ? $years[1] : NULL; ?></span>
						</th>
					</tr>
				</thead>
				
				<tbody>
				<?php
				if($ratios) {	
					foreach($ratios as $key=>$value) {
						if($value['details']) {
							foreach($value['details'] as $index=>$item) {
								?>
								<tr>
								<td class="blk5"><?php echo $this->lang->line(strtolower($item['name'])); ?></td>
								<td class="text-center" id="<?php echo "fp_ratio_".$key."_".$index; ?>_0">
									<?php echo ($years && $years[0]) ? $item['data'][$years[0]] : NULL; echo ($value['name'] == "Income Ratio") ? "%" : NULL; ?>
								</td>
								<td class="text-center" id="<?php echo "fp_ratio_".$key."_".$index; ?>_1">
									<?php echo ($years && $years[1]) ? $item['data'][$years[1]] : NULL; echo ($value['name'] == "Income Ratio") ? "%" : NULL; ?>
								</td>
								</tr>
								<?php
							}
						}		
					}
				}				
				?>
				</tbody>
				
			</table>
		</div>
	</div>
	
	
	<br><br>
	<div class="row" style="page-break-after: auto;">
		<div class="col-xs-12">
			<div class="tableTitle">
					PENGESAHAN
			</div>
			<table class="datatables" width = "100%">
					<tr>
							<th class="subheader" width="25%" colspan="2">JURUAUDIT I</th>
							<th class="subheader" width="25%" colspan="2">JURUAUDIT II</th>
							<th class="subheader" width="25%" colspan="2">DISEMAK</th>
							<th class="subheader" width="25%" colspan="2">DIPERAKUI</th>
					</tr>
					<tr>
							<td class="text-center">TANDATANGAN</td>
							<td class="text-center">TARIKH</td>
							<td class="text-center">TANDATANGAN</td>
							<td class="text-center">TARIKH</td>
							<td class="text-center">TANDATANGAN</td>
							<td class="text-center">TARIKH</td>
							<td class="text-center">TANDATANGAN</td>
							<td class="text-center">TARIKH</td>
					</tr>
					<tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
					</tr>
			</table>
		</div>
   </div>
		
</section>
