<?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-23-2009                       #
##################################################################
#               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/settings.class.php");
require_once ("classes/misc.class.php");
require_once ("classes/userside.class.php");

if (!isset($_SESSION['register_id']) OR $_SESSION['register_id'] == "") {
	header("Location: register.php");
	exit();
}

$arrSettings	= array();
$script		= "";
$message	= "";

if (!$objDB) 
{
	$message	= "Unable to Locate Database Server.";
}//end if
else 
{
        $objM			= new Misc($objDB);
	$objS			= new settings($objDB);
	$objS->set_variables();
}//end else
$checktypemode=($_GET['stype']!='')?$_GET['stype']:$_POST['stype'];
if($checktypemode!='')
{
	$_SESSION['sess_register_stype']=$checktypemode;
}//end if
else
{
	$checktypemode=$_SESSION['sess_register_stype'];
}//end else
include_once ("title.inc.php");
include_once ("tophtml.inc.php");

$txtWorldInstId = $siteSettings["worldpayid"];
$txtWorldEmailId = $siteSettings["worldpayemail"];
$txtWorldTransMode = $siteSettings["worldpaytransmode"];
$txtWorldpaySandbox = $siteSettings["worldpaydemo"];
$ProductOrderId=rand('100','345');

if ($txtWorldpaySandbox == "YES") 
{
	$worldpayserver="https://select-test.worldpay.com/wcc/purchase";
	$txtWorldpaySandbox2='100';
}//end if
else 
{
    $worldpayserver="https://select.worldpay.com/wcc/purchase";
	$txtWorldpaySandbox2='0';
}//end if
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="72%" valign="top"><div class="search-rslts"><table width="100%"  border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td>              <table width="100%"  border="0" cellspacing="0" cellpadding="5">
              <tr>
                  <td class="inenr-hd"><h2>Pay Now</h2></td>
            
              </tr>
            </table>
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="headings2">Click below to complete the purchase of your <?php echo $objS->ValidityDayMembership ?> subscription</td>
                    </tr>
                  </table>
                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><img src="images/spacer.gif" width="1" height="10"></td>
                      </tr>
                    </table>
                    <table width="100%"  border="0" cellspacing="0" cellpadding="5">
					<?php if(isset($message) && trim($message)!='')
					      {
					?>
                    <tr align="center">
                      <td colspan="3" class="maintext1 warning"><?php echo $message;?></td>
                      </tr>
					<?php }//end if?>
                    <tr>
                      <td width="54%" class="maintext1">Amount Pay</td>
                      <td width="46%" colspan="2" class="maintext1">$ <?php echo $objS->membership_amount?></td>
                    </tr>
                    <tr align="center">
                      <td colspan="3" class="maintext1"><b>Make payments with Worldpay <img src="./images/worldpay.gif" width="139" height="33" title="Make payments with Worldpay - it's fast, free and secure! " border="0"></b></td>
                      </tr>
                    <tr align="center">
                      <td colspan="3" class="maintext1"><form action="<?php echo $worldpayserver;?>" name="BuyForm" method="POST">
					<input type="hidden" name="instId"  value="<?php echo $txtWorldInstId;?>">
					<input type="hidden" name="cartId" value="<?php echo $ProductOrderId;?>">
					<input type="hidden" name="currency" value="USD">
					<input type="hidden" NAME="email" VALUE="<?php echo $txtWorldEmailId;?>">
					<input type="hidden" name="amount"  value="<?php echo round($objS->membership_amount,2);?>">
					<input type="hidden" name="testMode" value="<?php echo $txtWorldpaySandbox2;?>">
					<input type="hidden" NAME="MC_ORDERID" VALUE="<?php echo $ProductOrderId;?>">
					<input type='hidden' name='authMode' value="<?php echo $txtWorldTransMode;?>">
					<input type="hidden" name="MC_callback" value="<?php echo $siteSettings['site_normal_url']."/register_wpsuccess.php";?>">
					<input name="imageField" type="image" src="./images/worldpay.gif" width="139" height="33" border="0"  title="Make payments with Worldpay - it's fast, free and secure!" alt="Make payments with Worldpay - it's fast, free and secure!">
					</form></td>
                      </tr>
                  </table>
                    </td>
                </tr>
              </table>
              <div id="hide"><?php echo $script?></div>
			</td>
          </tr>
        </table></div></td></td>
        <td width="28%" valign="top"><?php include_once ("left.inc.php");?></td>
      </tr>
    </table>     
      </td>
  </tr>
</table>
<?php include_once('bottomhtml.inc.php');?>
