<?php
if(isset($_POST['btn-submit']))
{
	$price_in_usd = trim($_POST['amount']);
	$invoice_id = USER::AlphaNumeric(15);
	$price_in_btc = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=" . $price_in_usd);
    $date = strtotime("now");
    $datee = date('d/m/Y'); 
    
    if($price_in_usd < 100)
    {
        header("Location: depositfunds?low-funds");
        exit;
    }
    
	if($actionParam->create_invoice($uemail,$invoice_id,$price_in_usd,$price_in_btc,$date))
     {
         $message = "
                     Hello admin,
                     <br /><br />
                     $ufullname wants to deposit $".number_format($price_in_usd)." equivalent to ".number_format($price_in_btc,4)." BTC.<br>
                     Date sent: $datee<br><br>
					 Confirm when received.
                     ";

                     $subject = "New deposit";
                     $email = 'support@sescentigate.com';
                     $actionParam->send_mail_cron3($email,$message,$subject);//send mail to user
                     
       header("Location: deposit");
       exit;
     }
	
}
?>