<!DOCTYPE html>
<html>
<head>
	<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
	<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
	<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="assets/css/main.css" rel="stylesheet" type="text/css">
	<link href="assets/css/my-custom-styles.css" rel="stylesheet" type="text/css">
	<link href="css/jquery.toast.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/jquery-confirm.min.css">
	<meta charset="utf-8">
	<!------ Include the above in your HEAD tag ---------->
	<style>
	.invoice-title h2, .invoice-title h3 {
		display: inline-block;
	}

	.table > tbody > tr > .no-line {
		border-top: none;
	}

	.table > thead > tr > .no-line {
		border-bottom: none;
	}

	.table > tbody > tr > .thick-line {
		border-top: 2px solid;
	}
	</style>
	<meta charset="utf-8">
</head>
<body onafterprint="afterprint()">
	<div class="container">
		<div class="row">
			<div class="col-xs-12">
				<div class="invoice-title">
						<center><img src="img/printlogo.png"></center>
					<hr>
					<center><b style="font-size: x-large;"> {{ __('mylanguage.jamath_list') }} - {{ $data['rectype'] }}</b></center>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">

<table id="mydatatable" class="table table-sorting table-striped table-hover table-bordered datatable">
	<thead>
		<tr>
			<th>{{ __('mylanguage.slno') }}</th>
			<th>{{ __('mylanguage.member_id') }}</th>
			<th>{{ __('mylanguage.name') }}</th>
			<th style="text-align: right;">{{ __('mylanguage.Total_amount') }}</th>
			@foreach($data['fundtype'] as $fundtype)
				<th>{{ $fundtype->ftyp_fundtype }}</th>
			@endforeach		
			<th style="text-align: right;">{{ __('mylanguage.Paid_amount') }}</th>
			<th style="text-align: right;">{{ __('mylanguage.balance_amount') }}</th>
		</tr>
	</thead>
	<tbody>
		<?php  $i=1;
		?>
		@foreach($data['LoadJamathRecords'] as $LoadJamathRec)
		<?php
		$resaddr = unserialize($LoadJamathRec->cst_resaddress);
		$permaddr = unserialize($LoadJamathRec->cst_permaddress);
		?>
		<tr>
			<td><?php echo $i; ?></td>
			<td>{{$LoadJamathRec->grd_prefix}}{{$LoadJamathRec->cst_code}}</a></td>
			<td>{{$LoadJamathRec->cst_name}} </td>	
			<td style="text-align: right;">{{$LoadJamathRec->totalamt}}</td>
			@foreach($data['fundtype'] as $fundtype)
				<td style="text-align: right;" ><?php 
				$val = "rec".$fundtype->ftyp_id;
				echo $LoadJamathRec->$val;
				?></td>
			@endforeach		
			<td style="text-align: right;" id="paid_{{$LoadJamathRec->cst_id}}">{{$LoadJamathRec->paidamt + $LoadJamathRec->advamt + $LoadJamathRec->prepayamt}}</td>
			<td style="text-align: right;" id="bal_{{$LoadJamathRec->cst_id}}">{{ ($LoadJamathRec->totalamt) - ($LoadJamathRec->paidamt  + $LoadJamathRec->advamt + $LoadJamathRec->prepayamt) }}</td>
		</tr>
		<?php
		$i= $i+1;
		?>
		@endforeach	
	</tbody>
	<?php
	/*
	<tfoot>
		<tr>
			<th></th>
			<th></th>
			<th>Total</th>
			<th style="text-align: right;" id="tbltotalamt"><?php echo $totalamt; ?></th>		
			<th style="text-align: right;" id="tblpaidamt"><?php echo $paidamt; ?></th>	
			<th style="text-align: right;" id="tblbalamt"><?php echo $totalamt - $paidamt; ?></th>		
			<th></th>					
		</tr>
	</tfoot>
	*/
	?>
</table>
			</div>
		</div>
	</div>
</body>
<script>
$(document).ready(function()
{
	window.print();
});
function afterprint()
{
	window.close();
}
</script>
</html>