<?php session_start();  //Developed by ITechScripts
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch
	if( $_SESSION['amount']!='') 
	{
		$amount=$_SESSION['amount'];
		$payment_gateway=$_SESSION['payment_gateway'];
		$productid=$_SESSION['plan_id'];
		$userid=$_SESSION['user_id'];

$recycle=$_SESSION['recycle'];
if($recycle!="yes"){
$recycle="no"
}

$checkpay = $_SESSION['checkpay'];
$txn_id = $_SESSION['txn_id'];
$trn_id =$_SESSION['trn_id'];
		$trans_date=date('Y-m-d');	
		if($checkpay=="yes")
		{
		
		 
		     $up_sql="update auction_details set status='Sold' where productid=$productid";	
			mysql_query($up_sql);
		  
			$insert_query="insert into usertransaction(trans_amount,itemid,user_id,trans_batchnumber,trans_date, trans_details, seller_id, txn_id, type, currency, typeofpay, service,purchase) values($amount,'$productid','$userid','$trn_id','$trans_date', 'Payment','$seller_id', '$txn_id', 'Debit', '$pay_currency', '$typeofpay', 'OTHER', '$recycle')";	
			$insert_result=mysql_query($insert_query);
			$sucess_flag=1;
		}
		else
		{
	echo '<meta http-equiv="refresh" content="0;url=myauction.php">';
	echo "<center><font size=+1 color=#003366>$lang_582....</font></center>";
	exit();
		}
		$_SESSION['amount']='';
		$_SESSION['productid']='';
		$_SESSION['payment_gateway']='';
	}
	echo '<meta http-equiv="refresh" content="0;url=myauction.php">';
	echo "<center><font size=+1 color=#003366>$lang_581....</font></center>";
	exit();
?>

