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



							if (isset($_GET['id']))
							{
			 	 $dbc= mysqli_connect("localhost","vosmcyqy_af","2@RhUH7JY78@@@9823@KLULasd","vosmcyqy_afri");
						
						$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 />
Wholesale:<br />
<input name="mini" type="text" value="<?php echo $minimum; ?>" size="40"/><br />

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