<?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/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");

$objU=new userside($objDB);
if (!isset($_SESSION['register_id']) OR $_SESSION['register_id'] == "") {
	header("Locaation: register.php");
	exit();
}
    $objM                   = new misc($objDB);
    $objS		    = new settings($objDB);        
    $objS->set_variables();
    $objS->membership_amount;
$method		= isset($_POST['method'])	?	trim($_POST['method'])	:	"";
$message	= "";
$script		= "";

if (isset($_POST['CONS'])) {
	if ($method == "") {
		$message	= "Please select any one method.<br>";
	} else {
		if ($method == "FC") {
			header("Location: freecode_register.php");
			exit();
		}if ($method == "CouponC") {
			header("Location: couponcode_register.php");
			exit();
		} else if ($method == "CC") {
			header("Location:".$objU->SecureUrl()."/authorize_register.php?stype=".$method);
			exit();
		} else if ($method == "UP") {
			header("Location:".$objU->SecureUrl()."/authorize_register.php?stype=".$method);
			exit();
		}else if ($method == "WP") {
			header("Location:".$objU->SecureUrl()."/worldpay_register.php?stype=".$method);
			exit();
		}
		 else if ($method == "ECHECK") {
			header("Location:".$objU->SecureUrl()."/authorize_register.php?stype=".$method);
			exit();
		}
		else if ($method == "GOOGLE") {
			header("Location:".$objU->SecureUrl()."/google_register.php?stype=".$method);
			exit();
		}
		else if ($method == "PAYPAL") {
			header("Location:".$objU->SecureUrl()."/paypal_register.php?stype=".$method);
			exit();
		}
	}
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
$chkPaypal = $siteSettings["enablepaypal"];
$ddlPaymentMethod = $siteSettings["paymentmethod"];
$chkGoogle = $siteSettings["enablegoogle"];

//checking payment mode
if($siteSettings['regmode']!=REGISTRATION_PAID_MODE)
{
    $objU->free_registration($_SESSION['register_id']);
    header("Location:register_success.php");
    exit();
}//end if
?>


<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Payment Selection</h2></div></div>
			<div class="row">
				<h2 class="headings2">Just pay $<?php  echo $objS->membership_amount;?> for <?php echo $objS->ValidityDayMembership ?> days subscription</h2>
			</div>
			<div class="row">
				<h2 class="headings2">Select Payment Method</h2>
			</div>		
			<div class="row">
			
				<form name="frmMethod" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
					<div class="newdesignforinput maintext1">
					  	<?php
							if (isset($message) && trim($message) != '') {
						?>
						<div class="full_row">
							<div class="maintext1 warning"><?php echo $message; ?></div>
						</div>
						<?php }//end if?>
						
						<div class="full_row">
							<div class="twelve columns padding_B_10"><input name="method" type="radio" value="FC">Free Code</div>
						</div>
						
						 <?php
						if ($ddlPaymentMethod == "CC" || $ddlPaymentMethod == "PRO") {
							?>
							<div class="full_row">
								<div class="twelve columns padding_B_10"><input name="method" type="radio" value="CC" checked> Credit Card</div>
							</div>
							<?php
						}//end if
						if ($ddlPaymentMethod == "UP") {
							?>
							<div class="full_row">
								<div class="twelve columns padding_B_10"><input name="method" type="radio" value="UP" checked> Yourpay</div>
							</div>
								<?php
							}//end if
							if ($ddlPaymentMethod == "WP") {
								?>
							<div class="full_row">
								<div class="twelve columns padding_B_10"><input name="method" type="radio" value="WP" checked> Worldpay</div>
							</div>
							<?php
							}//end if
							if ($chkPaypal == "Y") {
								?>
							<div class="full_row">
								<div class="twelve columns padding_B_10"><input name="method" type="radio" value="PAYPAL">PayPal</div>
							</div>
						<?php
						}//end if
						if ($chkGoogle == "Y") {
							?>
							<div class="full_row">
								<div class="twelve columns padding_B_10"><input name="method" type="radio" value="GOOGLE">Google Checkout</div>
							</div>
						<?php }//end if ?>
						<div class="full_row">
							<div class="twelve columns padding_B_10"><input name="CONS" type="submit" class="signupbutton" value="Continue"></div>
						</div>
						
					</div>
				</form>
				<div id="hide"><?php echo $script ?></div>
			</div>
		</div>
	</div>
</div>


<?php include_once('bottomhtml.inc.php');?>
