<?php
require_once('functions.php');

$user=$_SESSION['user'];
require_once('mysql.php');


$a=mysqli_real_escape_string($dbc,$_POST['a']);
$c=mysqli_real_escape_string($dbc,$_POST['c']);
$qty=mysqli_real_escape_string($dbc,$_POST['qty']);
$cod=mysqli_real_escape_string($dbc,$_POST['cod']);
$e=mysqli_real_escape_string($dbc,$_POST['ee']);
$m=mysqli_real_escape_string($dbc,$_POST['m']);
$p=mysqli_real_escape_string($dbc,$_POST['p']);
$cat=mysqli_real_escape_string($dbc,$_POST['cat']);
$supplier=mysqli_real_escape_string($dbc,$_POST['supplier']);
$minimum=mysqli_real_escape_string($dbc,$_POST['mini']);
 $cfe=mysqli_query($dbc,("select name from accounts where id='$supplier'"));
	   $mjy=mysqli_fetch_array($cfe);
	      $nge=$mjy['name'];
$pro=$_POST['p'];
$gg=$_POST['gg'];
$vat=$_POST['vat'];
$k=mysqli_real_escape_string($dbc,$_POST['k']);
$re=mysqli_real_escape_string($dbc,$_POST['f']);
$res=mysqli_real_escape_string($dbc,$_POST['x']);
$buying=mysqli_real_escape_string($dbc,$_POST['buying']);

$fr=mysqli_query($dbc,("UPDATE products SET vat='$vat',left_p='$qty',category='$cat', buying='$buying',company='$nge',
 price = '$e',p_name='$p',minimum='$minimum'
WHERE product_id = '$m'"));

  header("location: products_view.php");
		


mysqli_close($dbc)

	
?>