<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
include('../include/session.php');
$today = date("Y-m-d");

$product_store_line_id = $_GET['product_store_line_id_text'];
if (isset($_GET['stock_quantity_checkbox'])) { 
$print_stock = 'yes'; 
}
else {
$print_stock = 'no';
}

$table_name = $_SESSION['db_prefix']."_product_store";
$table_name2 = $_SESSION['db_prefix']."_product_store_lines";
$batch_no_query = "SELECT $table_name.product_item_id,  $table_name.item_name, $table_name2.batch_code, ($table_name2.quantity_in - $table_name2.quantity_out) AS stock_quantity FROM $table_name, $table_name2 WHERE $table_name.product_item_id=$table_name2.product_item_id AND $table_name2.product_store_line_id = '".$product_store_line_id."' ";
$batch_no_result = $con->query($batch_no_query);
$row = mysqli_fetch_assoc($batch_no_result);
$item_name = $row['item_name'];
$batch_code = $row['batch_code'];
$stock_quantity = $row['stock_quantity'];

?>
<style>
.rotate {

/* Safari */
-webkit-transform: rotate(-90deg);

/* Firefox */
-moz-transform: rotate(-90deg);

/* IE */
-ms-transform: rotate(-90deg);

/* Opera */
-o-transform: rotate(-90deg);

float: left;

}
</style>

<!--style sheets-->
<link href="../css/print.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">
<title>Store label</title>

</head>

<body  onload="window.print(); window.close();" >

<div class="rotate" style="height:auto; width:1200px;; margin-left:-300px; margin-top:350px;; text-align:center; ">
<br>
<br>
<label style="font-size:36px; font-weight:bold"><?php echo $item_name ?></label><br />
<br />
<br />


<label style="font-size:72px; font-weight:bold"><?php echo $batch_code ?></label>
<br />
<br />
<br />
<br />
<?php if ($print_stock=='yes') { ?>
<label style="font-size:24px; font-weight:bold">Stock quantity: <?php echo $stock_quantity ?>&nbsp;&nbsp;&nbsp;(<?php echo date("d-m-Y", strtotime($today)) ?>)</label>
<?php } ?>


</div>
<br>


</body>


