<!DOCTYPE HTML>
<?php
include('config.php');

//checkaccess($flagprint,1);

$pm_autoid = $conn->real_escape_string($_GET['id']);

$query = "select * from mst_product where pm_autoid = '$pm_autoid'";
$dcon 	= $conn->query($query) or die($query);
$rs 	= $dcon->fetch_assoc();

$barcodeno = $rs['pm_barcode'];

if(substr($barcodeno,0,1)=="A"){
	$code = "code128";
	}else{$code = "ean13";}
	
$nama_produk = substr($rs['pm_name'],0,21);

?>
<html>
<head>
    <?php include('../../common/script_css.php');?>
		<script type="text/javascript" src="jquery-barcode.js"></script>
        <script>
        $().ready(function(e) {
			kode = $('#bcno').val();
			kode_bc = $('#kode').val();
            $(".bc").barcode(kode, kode_bc,{barWidth:1, barHeight:21,fontSize:12});
        });
        </script>
<style>
        .div{
			width:121px; /* 1px = 3.77mm, curr setting 33x19mm*/
			font-size:11px;
			display:inline-block;
			margin-right:35px;
			padding:2px;
			height:70px;
			margin-bottom:10px;
			text-align:center;
			margin-left:10px;
			}
		.bc{
			width:180px;display:inline-block;margin-bottom:0px
			}
		.nama-produk{float:left;margin:0px;font-size:10px;margin-bottom:2px}
		.harga{float:right;margin-top:-5px;font-weight:bold}
		body{background-color:#fff}
		p{color:#000000}
        </style>
</head>
<body>


	<input type="hidden" id="bcno" value="<?php echo($barcodeno)?>">
    <div style="width:350px;margin-top:2px">
    <?php 
	for($i=0;$i<10;$i++){
	?>
	<div class="div">
		<p class="nama-produk"><?php echo $nama_produk?></p> 
    	<span class="bc"><?php echo $barcodeno?></span>   
    </div>
	<?php } ?>

</div>
<input type="hidden" id="kode" value="<?php echo($code)?>">
</body>
</html>