<?php
require_once('functions.php');
$user=$_SESSION['user'];
	$level=$_SESSION['admin_level'];



							if (isset($_GET['id']))
							{
			 	  $dbc=mysqli_connect("localhost","juwakaco_231","@@!!jwaki#$%","juwakaco_pot");
						
						$id = $_GET['id'];
						$result = mysqli_query($dbc,("SELECT *,stocking.price as d FROM stocking 
inner join products on products.product_id=stocking.product_id
where stocking.id= '$id'
group by stocking.product_id ORDER BY id desc"));
						
						$row = mysqli_fetch_array($result);
						$id=$row["id"];
					//	$pcode=$row["code"];
						$pname=$row["p_name"];
					//	$pdesc=$row["description"];
						$qty=$row["qty"];
					//	$vat=$row["vat"];
					//		$cat=$row["category"];
					//			$minimum=$row["minimum"];
						$price=$row["d"];
						//	$buying=$row["buying"];
						//	$comp=$row["company"];
					//	$re=$row["reorder"];
						mysqli_close($dbc);
						}
						
						?>




<form action="edit_stocks.php" method="post">
<input name="m" type="hidden" value="<?php echo $id; ?>"/>

<? ECHO"<b>Product name:<br />
<input name='p' type='text' value='{$row['p_name']}' size='60'/><br />";?>
<b>QTY:<br />
<input name="qty" type="text" value="<?php echo $qty; ?>" size="50"/><br />

Price:<br />
<input name="price" type="text" value="<?php echo $price; ?>"size="40" /><br />
<br />





<input name="submit" type="submit" value="save">
</form>
