<?

ob_start();session_start();

		include("include/db.inc.php");

		include("include/bit_functions.inc.php");

 		$db1=new db;

        $db1->open();

       mysql_query("SET NAMES 'utf8'");  $currency_symbol_new=symbol_currency();

		$uid=$_SESSION['uid'];



	    $oid="";

	    $sold_price=0;



	    if(is_array($_POST['productIdArr']))

	    {

			 foreach($_POST['productIdArr'] as $key=>$payid) {



				$oid.=$payid."_";

			 }



			 $oid = substr($oid,0,-1);

        }



        $sold_price = $_POST['pay_value'];



	    $paypal_pay = mysql_fetch_array(mysql_query("select paypal_pay_id from admin"));

  		$paypal_pay_id = $paypal_pay['paypal_pay_id'];





?>

<html>

<head>

<base href="<?=_BASEURL_?>/" />

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>

<body>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form1">

     <input type="hidden" name="cmd" value="_xclick">

     <input type="hidden" name="business" value="<?=$paypal_pay_id;?>">

     <input type="hidden" name="item_name" value="Product Payment">

     <input type="hidden" name="item_number" value="Product Payment">

     <input type="hidden" name="notify_return" value="<?=_BASEURL_?>/notify.php?orderid=<?=$oid?>">

     <input type="hidden" name="return" value="<?=_BASEURL_?>/success_pay.php?order_id=<?=$oid?>">

     <input type="hidden" name="cancel_return" value="<?=_BASEURL_?>/cancel.php?orderid=<?=$oid?>">

     <input type="hidden" name="amount" value="<?=$sold_price;?>">

     <input type="hidden" name="no_note" value="1">

     <input type="hidden" name="rm" value="2">

<input type="hidden" name="lc" value="FR">

     <input type="hidden" name="currency_code" value="<?=get_currency_code();?>">

</form>

<script language="JavaScript">document.form1.submit()</script>

</body>

</html>