MOON
Server: Apache
System: Linux ip-208-109-13-31.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els4.x86_64 #1 SMP Sat Aug 31 06:58:57 UTC 2024 x86_64
User: durgeshpandey215 (1013)
PHP: 8.1.29
Disabled: NONE
Upload Files
File: /home/durgeshpandey215/public_html/zeeroprice.skilladders.com/buy.php
<?
require "application_top.php";
$pid = isset($_REQUEST['pid'])? $_REQUEST['pid']:"";
if($pid){
	$db->where('id',1);
	$rowu = $db->getOne('wallet_user');	

	$db->where('pid',$pid);
	$rowp = $db->getOne('wallet_products');
	
	if($rowu['points'] < $rowp['cost']){
		$_SESSION['msg'] = "Low wallet balance. Please add sufficient amount in your wallet";
		header("location:products-and-prices.php");exit;
	}
	$walletbalance = $rowu['points'] - $rowp['cost'];
	
	$updatearr = array('points'=>$walletbalance);
	$db->where('id',1);
	$db->update('wallet_user',$updatearr);
	$_SESSION['ViewProductSess'] = 1;
	
	header("location:productdetails.php?pid=".$pid); exit;
}
?>