<?php
$user = auth()->user();
?>
<script src="assets/js/king-table.js"></script>
<div class="content">
	<div class="main-content">
		<!-- DATA EXPORT -->
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> {{ __('matrimonial.marriage_certificate') }}</h3>
			</div>
			<div class="widget-content">
				<table id="mydatatable" class="table table-sorting table-striped table-hover table-bordered datatable">
					<thead>
						<tr>
							<th>{{ __('mylanguage.slno') }}</th>
							<th>{{ __('matrimonial.mrg_membercode') }}</th>
							<th>{{ __('matrimonial.mrg_name') }}</th>
							<th>{{ __('matrimonial.mrg_printdate') }}</th>
							<th>{{ __('matrimonial.mrg_dob') }}</th>		
							<th>{{ __('matrimonial.mrg_marriagedate') }}</th>		
							<th>{{ __('matrimonial.mrg_marriagetime') }}</th>		
							<th>{{ __('matrimonial.mrg_cost') }}</th>		
							<th>{{ __('mylanguage.action') }}</th>					
						</tr>
					</thead>
<tbody>
	<?php  $i=1;
	$totalamt=0;
	$paidamt=0;
	?>
	@foreach($data['LoadmatriRecords'] as $LoadmatriRec)
	<tr>
		<td>{{$LoadmatriRec->mrg_no}}</td>
		<td>{{$LoadmatriRec->mrg_membercode}}</td>
		<td>{{$LoadmatriRec->mrg_name}} </td>
		<td>{{$LoadmatriRec->mrg_certificatedate}}</td>
		<td>{{date("d-m-Y",strtotime($LoadmatriRec->mrg_dob))}}</td>
		<td>{{date("d-m-Y",strtotime($LoadmatriRec->mrg_marriagedate))}}</td>
		<td>{{date("h:i A",strtotime($LoadmatriRec->mrg_marriagetime))}}</td>
		<th style="text-align: right;">{{$LoadmatriRec->mrg_cost}}</th>
		<th>
			<button class="btn btn-default btn-xs" onclick="editmatrirecord({{$LoadmatriRec->mrg_id}})"  ><i class="fa fa-pencil-square-o" aria-hidden="true"></i></button>
			<button class="btn btn-default btn-xs" onclick="printrecord({{$LoadmatriRec->mrg_id}})" title="Print" ><i class="fa fa-print" aria-hidden="true" target="_blank"></i></button>
		</th>
	</tr>
	<?php
	$totalamt = $totalamt + $LoadmatriRec->mrg_cost;
	$i= $i+1;
	?>
	@endforeach	
</tbody>
					<tfoot>
						<tr>
							<th></th>
							<th></th>
							<th></th>
							<th></th>
							<th></th>
							<th></th>
							<th>Total</th>
							<th style="text-align: right;"><?php echo $totalamt; ?></th>		
							<th></th>					
						</tr>
					</tfoot>
				</table>
			</div>
		</div>
		<!-- END DATA EXPORT -->
	</div>
</div>
<!-- /main -->
<style>
.modal-dialog.modal-100 {
    width: 90%;
    /*margin: 30px auto;*/
}
</style>

<script>
	$('.createMod').click(function(e)
	{   
		e.preventDefault();
		$('#sideMenu').load($(this).attr('href'));
	});
	function editmatrirecord(mrg_id)
	{
		$('#sideMenu').load('editMatriCertificate?mrg_id=' + mrg_id);
	}
	function printrecord(id)
	{
		window.open('printmarriagecertificate?id=' + id  ,'_blank');
	}
$(document).ready( function () {
    $('#mydatatable').DataTable({
		"sDom": '<"H"lfrp>t<"F"ip>',
	});
} );
</script>		