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

$user=$_SESSION['user'];
 $dbc=mysqli_connect("localhost","dhdogzbe_rots","@@67YHeqSUYz4@YIKU@@Lo@@@","dhdogzbe_store");
 //$conn=mysqli_connect("localhost","vosmcyqy_tow","@@frtHY78V432SWz4@YIKU@@Lo@@@","vosmcyqy_town");
  //$com=mysqli_connect("localhost","vosmcyqy_af","2@RhUH7JY78@@@9823@KLULasd","vosmcyqy_afri");
    //$coo=mysqli_connect("localhost","vosmcyqy_fas","J78RhHUY765@@23@PLasd","vosmcyqy_safe");

$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']);
$sup=mysqli_real_escape_string($dbc,$_POST['sup']);
$minimum=mysqli_real_escape_string($dbc,$_POST['mini']);
$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']);
$t=mysqli_query($dbc,("select p_name from products where product_id='$m'"));
  $lo=mysqli_fetch_array($t);
     $pp=$lo['p_name'];
       
$fr=mysqli_query($dbc,("UPDATE products SET left_p='$qty',category='$cat', buying='$buying',
 price = '$e',p_name='$p',minimum='$minimum'
WHERE product_id = '$m'"));


  header("location: products_view.php");
		


mysqli_close($dbc);
mysqli_close($conn);
mysqli_close($coo);
mysqli_close($com);

	
?>