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

$message	= "";
$script		= "";
$product	= isset($_REQUEST['product'])	?	trim($_REQUEST['product'])	:	"0";
$amount		= 0;

if (!$objDB) 
{
	$message	= "Unable to Locate Database Server.";
}//end if 
else
{
	$objU			= new userside($objDB);
        
}//end else
$objM			= new misc($objDB);
include_once ("title.inc.php");
include_once ("tophtml.inc.php");

$flag_to_continue=false;

$transstatus=$_REQUEST['transStatus'];

if(isset($_REQUEST['transStatus']) && $_REQUEST['transStatus']=='Y')
{ 
	$flag_to_continue=true;
}//end if

$sql="select * from ".TABLEPREFIX."payments where vTxn_Id='".addslashes($tx_token)."' and vMethod='WP'";
if($flag_to_continue == true and mysql_num_rows(mysql_query($sql))>0)
{
 	$message=" Transaction Error .Please contact <a href='mailto:".$config['adminMail']."'>".$config['adminMail']."</a>";
}//end if
else if($flag_to_continue == true)
{
      $today = date("Y-m-d");
      $paymentMethod="WP";

      if ($siteSettings["worldpaydemo"] == "YES")  
	  {
			$transactionid='TEST-'.time();
	  }//end if
	  else 
	  {
    		$transactionid=time();
	  }//end if

      
	  $_SESSION['sess_Paymode']='WP';
	  $_SESSION['sess_TransId']=$transactionid;

	  $message=$objU->register_authorize($_SESSION['register_id']);

	  if ($message == "") 
	  {
			header("Location:register_success.php");
			exit();
	  }//end if
}//end else 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>Payment Options - Success</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"><?php echo $ShowMsg;?></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">
                    <tr align="center">
                      <td width="4259875%" colspan="3" class="maintext1 warning"><?php 
													if($flag_to_continue==true)
													{
				                  						echo '<b>'.$message.'</b>';
													}//end if
													else
													{
														echo '<b>There was an error in your payment process.Please contact <a href="mailto:'.$siteSettings['adminmail'].'">'.$siteSettings['adminmail'].'</a> for details.</b>';
													}//end else
							 				?></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');?>
