<?php require_once('header.php'); 
if(isset($_GET['id'])){
    
$id=$_GET['id'];
$statement = $pdo->prepare("SELECT * FROM tbl_barcode where id=$id");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);

?>

<section class="content">
	<div class="row">
		<div class="col-md-12">
			<center><div class="box box-info" style="width: 50%;">
			    <br><br><center><input type="button" class="btn btn-info" onclick="printDiv('printableArea')" value="Print Or Pdf" />&ensp;</center><br><br>
				<div class="box-body" id="printableArea">
					<center><img src="../assets/uploads/logo.png" style="width: 70%;"></center><br><br>
					<center><img src="vehicle-api/barcode/generate.php?code=https://dashboard.completescsolutions.com/admin/vehicle-api/index.php?id=<?= $result['0']['barcode_number']; ?>" alt="" style="width: 70%;"></center>
				    <center>
				        <h3>Branch Location : <b><?= $result['0']['location']; ?> </b> </h3>
				        <p style="font-size:18px;">
				            Notes:<br>
				               1.Scan barcode & fill given details after start trip.<br>
				               2.Trip has been complted again scan & fill given details to end your trip.
				        </p>
				    </center>
				</div>
			</div></center>
		</div>
	</div>


</section>
<?php } else { echo "<center>invalid page Access</center>"; } ?>
<script>
    function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = printContents;

     window.print();

     document.body.innerHTML = originalContents;
}
</script>
<?php require_once('footer.php'); ?>