<?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;">
<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:20,
			height: 50,
			callback: function() {
                
            }
		});</script>
	</div>
<p>Product Code : <?php echo $row['prcode']; ?></p>
<p><?php echo $row['proname']; ?></p>
<p>Barcode : <?php echo $row['itemcode']; ?></p>
</td>
</tr>
</tbody>
</table>
</div>
<?php
}	
}		
}
?>

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