<?php session_start();  //Developed by ITechScripts
require 'include/announcements.php'; // ITECHBIDS Configuration File
	$amount=$_SESSION['amount'];
		$payment_gateway=$_SESSION['payment_gateway'];
		$productid=$_SESSION['productid'];
$userid=$_SESSION['user_id'];
$plan_id=$_SESSION['plan_id'];
$amount=$_SESSION['amount'];
$checkpay = $_SESSION['checkpay'];
$txn_id = $_SESSION['txn_id'];
$trn_id =$_SESSION['trn_id'];
$payment_gateway=$_SESSION['payment_gateway'];
		$trans_date=date('Y-m-d');	
		if($checkpay=="yes")
		{
			$insert_query="insert into usertransaction(trans_amount,itemid,user_id,trans_batchnumber,trans_date, trans_details, txn_id, type, currency, typeofpay, service) values($amount,'$productid','$userid','$trn_id','$trans_date', 'Bid Purchase', '$txn_id', 'Debit', '$pay_currency', '$typeofpay', '$plan_id')";	
			$insert_result=mysql_query($insert_query);
			$sucess_flag=1;
		
        $plan_select_query="select * from plan where plan_id='$plan_id'";
		$plan_select_result=mysql_query($plan_select_query);
		$plan_select_row=mysql_fetch_array($plan_select_result);
		$items=$plan_select_row['items'];

	 $query="update member_details set bid_num=bid_num+$items where user_id='$userid'";
       mysql_query($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();
?>
