<!DOCTYPE html>
<html>
<head>
	<?php include('include/head.php'); ?>
</head>
<body>
	<?php include('include/header.php'); ?>
	<?php include('include/sidebar.php'); ?>
	<div class="main-container">
		<div class="pd-ltr-20 xs-pd-20-10">
			<div class="min-height-200px">
				<div class="page-header">
					<div class="row">
						<div class="col-md-6 col-sm-12">
							<div class="title">
								<h4>Voucher Print</h4>
							</div>
							<nav aria-label="breadcrumb" role="navigation">
								<ol class="breadcrumb">
									<li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
									<li class="breadcrumb-item active" aria-current="page">Voucher Print</li>
								</ol>
							</nav>
						</div>
						<!-- <div class="col-md-6 col-sm-12 text-right">
							<div class="dropdown">
								<a class="btn btn-primary dropdown-toggle" href="#" role="button" data-toggle="dropdown">
									January 2018
								</a>
								<div class="dropdown-menu dropdown-menu-right">
									<a class="dropdown-item" href="#">Export List</a>
									<a class="dropdown-item" href="#">Policies</a>
									<a class="dropdown-item" href="#">View Assets</a>
								</div>
							</div>
						</div> -->
					</div>
				</div>
				<div id="div_print">
					<div class="pd-20 bg-white border-radius-4 box-shadow mb-30">
							<?php
							$count=0; 
			                $sel=mysqli_query($connect,"select p.*,vd.* from tbl_voucher_details vd, tbl_payment_mode p where p.fld_payment_mode_id=vd.fld_payment_mode_id and vd.fld_voucher_details_id='".$_GET['fld_voucher_details_id']."'") or die(mysqli_error($connect));
			                $fetch=mysqli_fetch_array($sel);
			                extract($fetch);
			            	?> 	
	            		<div class="row">
		            		<?php
		            		                                       
				              $query=mysqli_query($connect,"select * from tbl_dynamic_header_footer where fld_id='1'") or die (mysqli_error($connect));
				              $fetch1=mysqli_fetch_array($query);
				              extract($fetch1);
				            ?>    
		            		<div class="col-md-6">
		            			<img src="../images/logo/<?php echo $fetch1['fld_logo'];?>" height="100" width="100"><br>
		            			<b><?php echo $fld_company_name; ?></b><br>
										<?php echo $fld_company_address; ?><br>
										<b><?php echo "Mobile:" ?></b> <?php echo $fld_mobile; ?> | <b><?php echo "Tel:" ?></b> <?php echo $fld_phone; ?><br> 
										<b><?php echo "Email:" ?></b> <?php echo $fld_email; ?><br>
										<?php echo $fld_website; ?><br>
		            		</div>
		            		<div class="col-md-6">
		            			<table class="table table-bordered">
		            				<thead>
		            					<tr>
		            						<th colspan="2" style="background-color: darkblue;font-size: 20px; text-align: center;color: white;font-family: Arial">PAYMENT  VOUCHER</th>
		            					</tr>
		            				</thead>
		            				<tbody>
		            				<tr>
		            					<th><?php echo "Date: "; ?></th>
		            					<td><?php echo $fld_voucher_date; ?></td>
		            				</tr>
		            				<tr>
		            					<th><?php echo "Voucher No:"; ?></th>
		            					<td><?php echo $fld_voucher_id; ?></td>
		            				</tr>
		            				<tr>
		            					<th><?php echo "Ledger:"; ?></th>
		            					<td></td>
		            				</tr>
		            				<tr>
		            					<th><?php echo "Accounts:"; ?></th>
		            					<td></td>
		            				</tr>
		            				<tr>
		            					<th><?php echo "Pay To:"; ?></th>
		            					<td></td>
		            				</tr>
		            				<tr>
		            					<th><?php echo "Ringgit:"; ?></th>
		            					<td></td>
		            				</tr>
		            			</tbody>
		            			</table>		
		            		</div>
	            		</div>
		            	<table class="table table-bordered">
		            		<tr>
		            			<th>Serial No.</th>
		            			<th>Payment Method</th>
		            			<th>Reference No.</th>
		            			<th>Description</th>
		            			<th>Amount</th>
		            		</tr>
		            		<tr>
		            			<td><?php echo ++$count; ?></td>
		            			<td><?php echo $fld_payment_mode; ?></td>
		            			<td><?php //echo ++$count; ?></td>
		            			<td><?php echo $fld_description; ?></td>
		            			<td><?php echo $fld_final_amount; ?>/-</td>
		            		</tr>
		            		<tr>
		            			<td colspan="4" align="right"><b><?php echo "Total:" ?></b></td>
		            			<td><?php echo $fld_final_amount; ?>/-</td>
		            		</tr>
		            	</table><br><br>
		            	<div class="row">
		            		<div class="col-md-2"></div>
		            		<div class="col-md-4">Authorized By</div>
		            		<div class="col-md-2"></div>
		            		<div class="col-md-4">Recevied By</div>
		            	</div>
					</div>
				</div>
			<span style="padding-left: 470px"><input name="b_print" type="button" class="ipt btn btn-success"  onClick="printdiv('div_print');" value=" Print " style="margin-top:-40px;"></span>
			<?php include('include/footer.php'); ?>
		</div>
	</div>
	<?php include('include/script.php'); ?>
<script language="javascript">
function printdiv(printpage)
{
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>   
</body>
</html>