<?php

if(isset($_GET['confirm']) && isset($_GET['pay']))
{
	$uid = base64_decode($_GET['pay']);
	
	$stmt = $actionParam->runQuery("SELECT * FROM invoices WHERE userID=:id");
$stmt->execute(array(":id"=>$uid));
$inrow=$stmt->fetch(PDO::FETCH_ASSOC);

$stmt = $actionParam->runQuery("SELECT * FROM tbl_user WHERE email=:id");
$stmt->execute(array(":id"=>$inrow['email']));
$inr=$stmt->fetch(PDO::FETCH_ASSOC);
$email = $inr['email'];
$amount = $inrow['price_in_usd'];
$refamount = $inrow['price_in_usd']* 0.05;
$fullname = $inr['fullname'];
$refemail = $inr['ref_email'];

$stmt = $actionParam->runQuery("SELECT * FROM tbl_user WHERE email=:email");
$stmt->execute(array(":email"=>$refemail));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$refname= $row['fullname'];
    if($actionParam->confirm($uid))
     {
         
         $message = "
                 <img src= http://bitxprofits.com/pip.png alt= BitXprofits><br><br>
   
                 Hello $fullname,
                 <br><br>
                 Your Deposit of $".$amount." has been successfully approved and is available on your profile.<br>
                 Transaction Batch is Paid.<br>
                 Thank You.<br>
                 BitXprofits Team.
                 
                 ";

                 $subject = "Deposit Confirmation";

                 $actionParam->send_maill($email,$message,$subject);
      $actionParam->redirect('confirm?confirmed');
     }
      
    
}
?>