<?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 
{
	$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
$objM			= new Misc($objDB);
include_once ("title.inc.php");
include_once ("tophtml.inc.php");

$txtPaypalEmail = $siteSettings["paypalemail"];
$txtPaypalSandbox = $siteSettings["enablepaypalsandbox"];
$ProductOrderId=rand('100','345');

if ($txtPaypalSandbox == "Y") 
{
	$paypalurl = "https://www.sandbox.paypal.com/cgi-bin/webscr";
   	$paypalbuttonurl = "https://www.sandbox.paypal.com/en_US/i/btn/x-click-but23.gif";
}//end if
else 
{
    $paypalurl = "https://www.paypal.com/cgi-bin/webscr";
    $paypalbuttonurl = "https://www.paypal.com/en_US/i/btn/x-click-but23.gif";
}//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 ?> day(s) 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 PayPal <img src="./images/pp.jpg" title="Make payments with PayPal - it's fast, free and secure! " border="0"></b></td>
                      </tr>
                    <tr align="center">
                      <td colspan="3" class="maintext1"><form action="<?php echo $paypalurl;?>" method="post" name="frmPayment">
															<input type="hidden" name="cmd" value="_xclick">
															<input type="hidden" name="business" value="<?php echo $txtPaypalEmail?>">
															<input type="hidden" name="item_name" value="<?php echo $siteSettings['sitename'];?> : Registration Payment">
															<input type="hidden" name="item_number" value="<?php echo $ProductOrderId;?>">
															<input type="hidden" name="amount" value="<?php echo round($objS->membership_amount,2);?>">
															<input type="hidden" name="no_shipping" value="1">
															<input type="hidden" name="custom" value="<?php echo $_SESSION['register_id'];?>">
															<input type="hidden" name="return" value="<?php echo $siteSettings['site_normal_url'] ."/register_ppsuccess.php"; ?>">
															<input type="hidden" name="cancel_return" value="<?php echo $siteSettings['site_normal_url'] ."/ppfailure.php"; ?>">
															<input type="hidden" name="no_note" value="1">
															<input type="hidden" name="currency_code" value="USD">
															<input type="hidden" name="bn" value="armiasystems_shoppingcart_wps_us">
															<div align="center"><input type="image" src="<?php echo $paypalbuttonurl;?>" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"></div>
															</form></td>
                      </tr>
                  </table>
                    </td>
                </tr>
              </table>
              <div id="hide"><?php echo $script?></div>
			</td>
          </tr>
        </table></div></td>
        <td width="28%" valign="top"><?php //include_once ("left.inc.php");?></td>
      </tr>
    </table>      
      </td>
  </tr>
</table>
<?php include_once('bottomhtml.inc.php');?>
