File: /home/durgeshpandey215/public_html/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;
?>