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

	.item {
		flex: 1;
		/* Add styles for each div item */
	}
	.container {
		display: grid;
		grid-template-columns: repeat(<?php echo $barcode_columns; ?>, 1fr );
	}

	.item {
		/* Add styles for each div item */
		text-align: center;
	}
	
</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:400px;margin-left:9px;">
<table>
<tbody>
<tr>
<td style="width: 100%;font-size:12px;text-align:center;" class="barcode">

	<div>
		<img id="barcode3"/>
		<script>JsBarcode("#barcode3", "<?php echo $row['itemcode']; ?>", {
			format:"CODE128",
			displayValue:false,
			fontSize:18,
			height: 40,
			callback: function() {
                
            }
		});</script>
	</div>
<p style="font-weight:700;"><?php echo $row['itemcode']; ?></p>
<p style="font-weight:700;"><?php echo $row['proname']; ?></p>
<p style="font-size:16px;font-weight:bold;">Price : Rs.<?php echo number_format((float)$row['sellprice'], 2); ?></p>
</td>                                      
</tr>
</tbody>
</table>
</div>
<?php
}	
}		
}
?>

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