<?php

session_start();
if ($_SESSION['dbName'] == "") {
	header("location:../index.php");
}


include("config.inc.php");
include("Functions_Purchase.php");


$connection = mysql_connect($config['dbServer'], $config['dbUser'], $config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'], $connection) or die("Could not find DB");


//Read From Setup Table							
$querysetup = " select DecimalBase, DecimalBase1, DecimalBase2, base1 as Base1, base2 as Base2 from setup ";
$resultsetup = mysql_query($querysetup, $connection) or die(mysql_error());
while ($rowsetup = mysql_fetch_array($resultsetup)) {
	extract($rowsetup);
}


$pid            = $_POST['pid'];
if ($pid == "") {
	$pid = $_GET["pid"];
}


print <<<HERE
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script type="text/javascript" language="javascript">
function Print(){
	var pid = document.productionbarcode.pid.value;
	var qty = document.productionbarcode.txtQty.value;
	var weight = document.productionbarcode.txtWeight.value;
	var str = 'Form_ProdBarcodePreview.php?pid='+pid+'&qty='+qty+'&weight='+weight;
		window.open(str);
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Print Item Barcode</title>


<script type="text/javascript" src="dropdown.js"></script>
<link rel="stylesheet" href="default.css" type="text/css" />
<link rel="stylesheet" href="short.css" type="text/css" />
<link rel="stylesheet" href="dropdown.css" type="text/css" />
<style type="text/css">

body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
}
body {
	margin-top: 2px;
	margin-left: 1px;
}
a:link {
	text-decoration: none;
	color: #0000FF;
}
a:visited {
	text-decoration: none;
	color: #0000FF;
}
a:hover {
	text-decoration: none;
	color: #0000FF;
}
a:active {
	text-decoration: none;
	color: #0000FF;
}
.style11 {color: #999999; font-weight: bold; }
.style12 {
	font-size: 10px;
	color: #999999;
	font-weight: bold;
}
.style15 {color: #5151FF; font-size: 10px;}
.style16 {
	font-size: 16px;
	color: #FF0000;
	font-weight: bold;
	font-family: "Times New Roman", Times, serif;
}
.style17 {font-size: 9px}
.style25 {color: #999999; font-weight: bold; font-size: 10px; }
.style26 {color: #FF0000}
.style27 {color: #999999 ;font-size: 10px;}
.style28 {color: #FFFFFF ;font-size: 10px;}

</style>

</head>
<body  >
<form name='productionbarcode' method='post'>
<input type='hidden' name='pid' value='$pid'>

HERE;


//Edit Purchase Detail Mode




$style = "style=' background-color:#4069A7; color:#FFFFFF;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;'";

echo "   <table border='0' style='table-layout:fixed' align='center' valign='top'>
			<col width=120>
			<col width=100>
            <col width=100>
			<tr bgcolor='#F7F7F7' height='25'>
				<th colspan='3'><span class='style1'>Quantity </span></th>
                </tr>
			<tr bgcolor='#F7F7F7' height='25'>	
				<td colspan='2' align='center'><font size='1' color='#FF0000' face='Verdana'><b></b></font></td>		 
			 <td></td></tr>
			<tr bgcolor='#F7F7F7' height='25'>
				<td valign='center' align='left' ><span class='style12'>Quantity</span></td>
				<td colspan='3'><input type='text' name='txtQty' value='$txtQty' maxlength='20' style='text-align:right; font-size:12px; width:90px;'/></td>
			 
                </tr> ";
echo "	<tr bgcolor='#F7F7F7' height='25'>
				<td valign='center' align='left' ><span class='style12'>Weight</span></td>
				<td colspan='3'><input type='text' name='txtWeight' value='$txtWeight' maxlength='20' style='text-align:right; font-size:12px; width:90px;'/></td>
			 
                </tr> ";
echo "   	<tr bgcolor='#F7F7F7' height='35'>
				<td colspan='3' align='center' bgcolor=#D8D8D8>
				 <button type='button' id='btnPrint' name='btnPrint' onclick='Print(); return false;' title='Print'><span><span>Print</span></span></button>
			</td>
            
			</tr>
        </table>";



print <<<HERE
</form>
</body>

HERE;
