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



							if (isset($_GET['id']))
							{
					 $dbc=mysqli_connect("localhost","u486354202_kgit","GH@@Y98it%9a#@!*&&","u486354202_kone");
						
						$id = $_GET['id'];
						$result = mysqli_query($dbc,("SELECT * FROM products WHERE product_id = $id"));
						
						$row = mysqli_fetch_array($result);
						$id=$row["product_id"];
						$pcode=$row["code"];
						$pname=$row["p_name"];
						$pdesc=$row["description"];
						$pleft=$row["left_p"];
						$vat=$row["vat"];
							$cat=$row["category"];
								$minimum=$row["minimum"];
						$pprice=$row["price"];
							$buying=$row["buying"];
							$comp=$row["company"];
						$re=$row["reorder"];
						mysqli_close($dbc);
						}
						
						?>




<form action="edit.php" method="post">
<input name="m" type="hidden" value="<?php echo $id; ?>"/>
<input name="gg" type="hidden" value="<?php echo $pleft; ?>"/><br />
<? 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 $pleft; ?>" size="50"/><br />
category:<br />
<input name="cat" type="text" value="<?php echo $cat; ?>" size="50" />
<br />
Buying price:<br />
<input name="buying" type="text" value="<?php echo $buying; ?>"size="40" /><br />
<br />

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


vat:<br />
<input name="vat" type="text" value="<?php echo $vat; ?>"size="40" /><br />
Re-Order Level:<br />
<input name="f" type="text" value="<?php echo $re; ?>" size="40"/><br />
Reason:<br />
<input name="x" type="text" value="" size="50"/><br />
<input name="submit" type="submit" value="save">
</form>
