<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/
require_once ("../config.inc.php");
require_once ("../includes/userlogincheck.mobile.inc.php");
require_once ("../includes/mysql_mobile.inc.php");
require_once ("../includes/arrays.inc.php");
require_once ("../classes/settings.class.php");
require_once ("../classes/userside.class.php");

$message	= "";
$script		= "";
$product	= isset($_REQUEST['product'])	?	trim($_REQUEST['product'])	:	"0";
$amount		= 0;
$arrCard	= "";
if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objU			= new userside($objDB);
	$objS			= new settings($objDB);
	$objS->set_variables();
	
	$arrCard	= $objU->get_creditcard($_SESSION['user_id']);
	if (empty($arrCard)) {
		$message	.= "You haven't stored your credit card details yet. You have to do so for renewing your account with mobile version.";
	} else {
		$objU->set_creditcard($_SESSION['user_id']);
		
		if (isset($_POST['PYN'])) {
			$objU->set_BCIDV($_SESSION['idverify']);
			$message	= $objU->buy_product($_SESSION['user_id'], $product);
			if ($message == "") {
				header("Location: purchase_success.php?product=$product");
				exit();
			}
		}
	}
	$amount		= $objU->get_amount($product);;

	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>Cybermatch</title>
<link href="images/mobile.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div xmlns="http://www.w3.org/1999/xhtml">
<?php include_once('title.inc.php');?>
<div>&nbsp;</div>
    <div>
        <div><i>+</i> <a href="index.php">Home</a></div>
        <div><i>+</i> <a href="search.php">Search</a></div>
       <div> <i>+</i> <a href="dashbox.php">Dashbox</a></div>
        <div><i>+</i> <a href="logout.php">Logout</a></div>
    </div>
<div>&nbsp;</div>
<div class="message"> <?php echo $message?></div>
<div>&nbsp;</div>
<div class="message"><strong>Renew your profile now</strong>
<div>&nbsp;</div>
<form name="frmPayment" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" >
<div>Amount to Pay: $ <?php echo $amount?>. </div>
<div>&nbsp;</div>
<input name="PYN" type="submit" class="inputb" value="  Pay Now " <?php echo empty($arrCard) ? "disabled" : ""?>>
<input type="hidden" name="step" value="3">
<input type="hidden" name="product" value="<?php echo $product?>">
</form>
</div>
<?php include_once('footer.inc.php');?>