<?php
ob_start();
session_start();
    $fro=$_POST['fro'];
	    if($fro=='homestore'){
        $dbc=mysqli_connect("localhost","dhdogzbe_rots","@@67YHeqSUYz4@YIKU@@Lo@@@","dhdogzbe_store");
         
    }
      
   
      
   //    $con=mysqli_connect("localhost","vosmcyqy_af","2@RhUH7JY78@@@9823@KLULasd","vosmcyqy_afri");
     //   $con=mysqli_connect("localhost","vosmcyqy_fas","J78RhHUY765@@23@PLasd","vosmcyqy_safe");
           
$r=mysqli_query($dbc,("select * from invo"));
$row=mysqli_fetch_array($r);
$code=$row['cod'];
$r=mysqli_query($dbc,("update invo set cod=cod+1"));
$client=$_POST['sup'];
$to=$_POST['to'];
$fro=$_POST['fro'];
//$expected=$_POST['expected'];
$date=$_POST['date'];
//$invoice=$_POST['invoice'];
//$_SESSION['project']=$project;
$_SESSION['date']=$date;
if(strcmp($to,$fro) !==0){
$_SESSION['sup']=$client;
$_SESSION['invc']=$code;
$_SESSION['to']=$to;
$_SESSION['fro']=$fro;
$url='invii.php';


ob_end_clean();
header("Location: $url");
//echo $_SESSION['fro'];
}else{
$url='invo.php';


ob_end_clean();
header("Location: $url");
}
mysqli_close($dbc);
  