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/www/zeeroprice.skilladders.com/paynow.php
<? require_once "application_top.php";
	//require "protect.php";
	$id = isset($_REQUEST['id'])? decode($_REQUEST['id']):"";
	//get u's info
	$db->where('id',$id);
	$rowpoints = $db->getOne('pointspackage');
	
	$db->where('userid',$_SESSION['useridsess']);
	$rowu = $db->getOne('register');
	
	$dbwallet = $rowu['points'];
	
	$newwallet = $dbwallet + $rowpoints['points'];
	
	//Assuming payment successfull do following
	$updatedata = array('points'=>$newwallet,
	'isPaid'=>1
	);
	$db->where('userid',$_SESSION['useridsess']);
	$db->update('register',$updatedata);
	
	//insert in transaction table
	$insertdata = array(
	'userid'=>$_SESSION['useridsess'],
	'amount'=>$rowpoints['cost'],
	'credited'=> $rowpoints['points'],
	'remark'=> 'Points purchased',
	'postedon'=> date('Y-m-d H:i:s')
	);
	$db->insert('transactions',$insertdata);
	
	$_SESSION['walletSess'] = $newwallet;
	$_SESSION['msg'] = "Thank you for your payment.";
	
	header('location:wallet.php');exit;
?>