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

$user=$_SESSION['user'];
 $dbc=mysqli_connect("localhost","vosmcyqy_tow","@@frtHY78V432SWz4@YIKU@@Lo@@@","vosmcyqy_town");


//$a=mysqli_real_escape_string($dbc,$_POST['a']);
//$c=mysqli_real_escape_string($dbc,$_POST['c']);
$qty=mysqli_real_escape_string($dbc,($_POST['qty']));
//$bar=mysqli_real_escape_string($dbc,$_POST['bar']);
$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']));
//$sup=mysqli_real_escape_string($dbc,$_POST['sup']);
$minimum=mysqli_real_escape_string($dbc,($_POST['min']));
$pro=mysqli_real_escape_string($dbc,($_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']);

$ft=mysqli_query($dbc,("UPDATE products SET left_p='$qty',category='$cat', buying='$buying',
 price = '$e',p_name='$p',minimum='$minimum'
WHERE product_id = '$m'"));
$r="insert into audit(product,stock,qty,reason,date,value,user)value('$m','$d','0','$res',NOW(),'Product Edit ','$user')";
$sql=mysqli_query($dbc,$r);
  header("location: pro_view.php");
		


mysqli_close($dbc);

	
?>