<?php
	session_start();
	require 'include/announcements.php'; // ITECHBIDS Configuration File
	if(strlen($_POST)> 0 || $_SESSION['amount']!='')
	 {
	 	 $amount=$_SESSION['totalprice']; 
         $user_id= $_SESSION['user_id']; 
		 $account= $_SESSION['account']; 
		 $productid=$_SESSION['productid']; 
	     $up_sql="update site_bids set payment_status='paid' where productid=$productid and user_id=$user_id";
		 $res=mysql_query($up_sql);
		 $mode="won";
		 if($res)
		 {
		  $getdate=date("Y:m:d");
          $up_sql="insert into admin_earnings(user_id,productid,payment_date,amount,type) values('$_SESSION[userid]','$productid','$getdate','$amount','buyitem')";
          mysql_query($up_sql); 
		  echo '<meta http-equiv="refresh" content="0;url=detailstatics.php?user_id='.$user_id.'&mode='.$mode.'">';
          echo "$lang_675 <a href=detailstatics.php?user_id=$user_id&mode=$mode>$lang_117</a>";
		 }
          // exit(); 
		$_SESSION['amount']='';
		$_SESSION['payment']='';
    }
	else
    {
		$err_message="Sorry, Your Payment was not Made Sucessfully";
	}
	exit();
	
?>

