Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/admin/
Upload File :
Current File : /home2/wtmwscom/public_html/admin/process_payout_old.php

<?php session_start();
include "../connection.php";
if(!isset($_SESSION['adminid'])) die ('Unauthorized');
$uid = $_GET['uid'];
$wallet = mysqli_fetch_object(mysqli_query($connection, "SELECT wallet FROM user WHERE uid = '$uid' "))->wallet;
$isupdate=0;
//$isupdate = mysqli_query($connection, "UPDATE user SET wallet = 0 WHERE uid = '$uid'");
if($wallet >= 100){
        $tds = $wallet * 0.05;
        $service = $wallet * 0.05;
        //$service = 0;
        $net = $wallet - ($tds + $service);
         mysqli_query($connection, "INSERT INTO withdraw (uid, amount, tds, service, net_amount, datetime, status) VALUES('$uid', '$wallet', '$tds', '$service', '$net', '" . date('Y-m-d H:i:s') . "',1)");
         $isupdate = mysqli_query($connection, "update user set wallet = 0 where uid ='$uid'");
    
}
$msg = $isupdate ? "Transcation done successfully" : "Failed, Some error occured,Try again";
echo $msg;
?>