<?php
//error_reporting(0); 
session_start();
$success=$ccard="";
if(isset($_SESSION['SESS_LOGGEDIN']) == FALSE) {
    header("Location: " . $config_basedir."access-login.php");
}

require("config.php");
require("db.php");
?>
<?php

$seller= $_SESSION['SESS_USERID']; 

$sql = mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");
 
// Place image in the folder 
$numrow=mysqli_fetch_assoc($sql);
$forename = $numrow['firstname'];
$surname = $numrow['lastname'];
$walletid = $numrow['walletid'];
$active_no = $numrow['active_no'];
$cashout_no = $numrow['cashout_no'];
$investors_no = $numrow['investors_no'];
$ver=$numrow['ver_badge'];
//$profile = $numrow['profile'];
//$verifyuser = $numrow['verifyuser'];

$userImage = $numrow['user_image'];
?>

<?php

if(isset($_POST['deposit_button'])){

if (isset($_POST['email']) && isset($_POST['amount']) && isset($_POST['edate'])) {

    //$product_name = mysqli_real_escape_string($_POST['details']);
    $amount = mysqli_real_escape_string($db, $_POST['amount']);
    $email = mysqli_real_escape_string($db, $_POST['email']);
   // $type = mysqli_real_escape_string($_POST['type']);
    //$ctype = mysqli_real_escape_string($_POST['ctype']);
    //$cnumber = mysqli_real_escape_string($_POST['fname']);
    //$fname = mysqli_real_escape_string($_POST['amount']);
    $edate = mysqli_real_escape_string($db, $_POST['edate']);
   // $cvv = mysqli_real_escape_string($_POST['cvv']);
    $seller= $_SESSION['SESS_USERID'];
    $user=$_SESSION['SESS_USERNAME'];
    $ver=1;
    $addresssql = mysqli_query($db, "INSERT INTO `deposit` (`log_id`, `amount`, `email`, `user`, `date`) VALUES ('$seller','$amount','$email','$user', '$edate')");
	
	if($addresssql){
	header('location: deposit.php?success=depositSuccessful');
	exit;
	
	}

}else{
	header('location: deposit.php?error=fieldEmpty');
	exit;
}


}
?>