<?php
if(isset($_GET['mark']) && isset($_GET['id']))
{
    $id = base64_decode($_GET['id']);
	$stat = 1;
	//update withdrawal list
    $stmt = $actionParam->runQuery("UPDATE tbl_withdrawal SET status=:stats WHERE userID=:id");
    $stmt->bindparam(":id",$id);
    $stmt->bindparam(":stats",$stat);
    $stmt->execute();
      
    $stmt = $actionParam->runQuery("SELECT * FROM tbl_withdrawal WHERE userID=:id");
$stmt->execute(array(":id"=>$id));
$inrow=$stmt->fetch(PDO::FETCH_ASSOC);
$email = $inrow['email'];
$amount = $inrow['amount'];
$desc = $inrow['description'];
$stmt = $actionParam->runQuery("SELECT * FROM tbl_user WHERE email=:id");
$stmt->execute(array(":id"=>$inrow['email']));
$inr=$stmt->fetch(PDO::FETCH_ASSOC);
$fullname = $inr['fullname'];

$message = "
                 <img src=  http://bitxprofits.com/pip.png alt= BitXprofits><br><br>
                 Hello $fullname,
                     <br /><br />
                 Your withdrawal of $".$amount." has been successfully sent to your wallet.<br><br>
                 Receiver Wallet: $desc<br><br>
                 Best Regards,<br>
                 BitXprofits Team.
                 ";

                 $subject = "Withdrawal Sent";

                 $actionParam->send_mail($email,$message,$subject);

    
    header("Location: withdrawal?marked");
    exit;
}
?>