<?php 
$barcode_columns=3;
?>
<html>
<head>
<style>
	* {
		padding: 0px;
		margin: 0px;
		box-sizing: border-box;
		font-family: Gotham, "Helvetica Neue", Helvetica, Arial, "sans-serif";
	}
	

	
	.container {
		display: flex;
    	flex-wrap: wrap;
		gap: 2mm;
		
		width: 98mm;
	}

	.item {
		/* Add styles for each div item */
		width: calc(33.33% - 10px);
		text-align: center;
		height: 20mm;
	}
	p{
		font-size:7px;
	}
</style>

<script src="dist/JsBarcode.all.js"></script>

<script src="process.js"></script>

</head>
<body onload="window.print();">
	
<div class="container">

<?php
require_once 'dbconfig.php';
include 'barcode128.php';
$product = $_POST['product'];
$stmt = $DB_con->prepare('SELECT * FROM mobileproducts where prid="'.$product.'" ORDER BY prid');
$stmt->execute();
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row);
for($i=1;$i<=$_POST['print_qty'];$i++){
?>
<div class="item" style="width:30mm;margin-left:4px;margin-top:0px;margin-bottom:0px;">
	<div>
		<img id="barcode3"/ width="76%">
		<script>JsBarcode("#barcode3", "<?php echo $row['itemcode']; ?>", {
			format:"CODE128",
			displayValue:false,
			fontSize:15,
			height: 20,
			callback: function() {
                
            }
		});</script>
	</div>
<p style="font-weight:bold;font-size:7px;"><?php echo $row['itemcode']; ?></p>
<p style="font-size:7px;"><?php echo $row['proname']; ?></p>
<p style="font-weight:bold;font-size:7px;">Rs.<?php echo number_format((float)$row['sellprice'], 2); ?></p>

</div>
<?php
}	
}		
}
?>

</div>
	
</body>
</html>
