<header>
	<div class="row">
		<div class="col-xs-12">
			<div class="t-corp pull-left">
				<div class="t-corp-logo">
					<img src="<?php echo base_url().'assets/images/logo/salihin-logo.png'; ?>" alt="company logo" />
				</div>
				<div class="t-corp-name"><b>SPS</b> | HR SYSTEM</div>
			</div>
		</div>
	</div>
		<div class="row">
			<div class="col-xs-12">
				<table class="company">
					<tr>
						<td class="divider">
							<span class="line">&nbsp;</span>
						</td>
						<td class="details">
							<span><b>SALIHIN (AF 1426)</b></span>
							<span>555, Jalan Samudra Utara 1, Taman Samudra, Batu Caves,</span>
							<span>68100, Batu Caves, Selangor</span>
							<span>Phone: 03-6185 9970 &nbsp;&nbsp; Fax: 03-6185 9970</span>
							<span>Website: salihin.com.my</span>
						</td>
						<td class="divider">
							<span class="line">&nbsp;</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
</header>
<?php if ($body): ?>
	<div class="col-12 table-responsive mt-4" id="tablePayslip">
		<table class="table table-bordered" width="100%" border="1">
			<thead>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="#: activate to sort column ascending" style="width: 0px;">
					#
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Company Code/ Cost Centre: activate to sort column ascending" style="width: 0px;">
					Company No/ Cost Centre
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Company Name: activate to sort column ascending" style="width: 0px;">
					Company Name
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Salary/ Wage Month: activate to sort column ascending" style="width: 0px;">
					Salary/ Wage Month
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Employee Total Upload: activate to sort column ascending" style="width: 0px;">
					Employee ID
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Name: activate to sort column ascending" style="width: 0px;">
					Name
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Net Pay: activate to sort column ascending" style="width: 0px;">
					Net Pay
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Gross: activate to sort column ascending" style="width: 0px;">
					Gross
				</th>
				<th class="sorting border-top" tabindex="0" aria-controls="table_contact" rowspan="1" colspan="1" aria-label="Total Deduction: activate to sort column ascending" style="width: 0px;">
					Total Deduction
				</th>
							
			</thead>		
			<tbody>
				<?php
					$totalNetPay 	= $totalGrossPay = $totalDeduction = 0;
				?>
				<?php foreach ($body as $key => $content): ?>
					<tr>
						<td><?php echo $key+1; ?></td>
						<td><?php echo $content->roc_no; ?></td>
						<td><?php echo $content->name; ?></td>
						<td><?php echo date('M',mktime(0,0,0,$content->month,10)).''.$content->year; ?></td>
						<td><?php echo $content->employeeID; ?></td>
						<td><?php echo $content->employeeName; ?></td>
						<td class="text-right"><?php echo number_format($content->netPay,2); ?></td>
						<td class="text-right"><?php echo number_format($content->grossPay,2); ?></td>
						<td class="text-right"><?php echo number_format($content->totalDeduction,2); ?></td>
					</tr>
					<?php
						$totalNetPay 	+=  floatval($content->netPay);
						$totalGrossPay 	+=	floatval($content->grossPay);
						$totalDeduction +=	floatval($content->totalDeduction); 
					?>				
				<?php endforeach ?>
					<tr>
						<td colspan="6" class="border-bottom  text-center"><b>TOTAL</b></td>
						<td class="text-right border-bottom"><b><?php echo number_format($totalNetPay,2); ?></b></td>
						<td class="text-right border-bottom"><b><?php echo number_format($totalGrossPay,2); ?></b></td>
						<td class="text-right border-bottom "><b><?php echo number_format($totalDeduction,2); ?></b></td>
					</tr>
			</tbody>
		</table>		
	</div>	
<?php endif ?>
									

