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



							if (isset($_GET['id']))
							{
					 $con=mysqli_connect("localhost","gurudumu_rad3","@@rad#@@@2023!!","gurudumu_dar");
						
						$id = $_GET['id'];
						$result = mysqli_query($con,("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($con);
						}
						
						?>




<form action="edd.php" method="post">
<input name="m" type="hidden" value="<?php echo $id; ?>"/>
<input name="gg" type="hidden" value="<?php echo $pleft; ?>"/><br />
<b>Product name:<br />
<input name="p" type="text" value="<?php echo $pname; ?>" size="50"/><br />
<b>Barcode:<br />
<input name="bar" type="text" value="<?php echo $pcode; ?>" size="50"/><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 />


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