<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com © 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | 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.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "../includes/config.php";
include "../includes/session.php";
include "../includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE); 
} 

if (isset($_GET["rid"]) and $_GET["rid"] != "") {
    $rid = $_GET["rid"];
} else if (isset($_POST["rid"]) and $_POST["rid"] != "") {
    $rid = $_POST["rid"];
} 
$sql=" SELECT ar.*,ap.payment_date FROM ".$tableprefix."affiliate_registrations ar LEFT JOIN  ".$tableprefix."affiliate_payments ap ON ar.affiliate_payment_id = ap.affiliate_payment_id
		WHERE ar.registration_id = '".addslashes($rid)."'
	";
	
//echo $sql;
$rs = mysql_query($sql);
if(mysql_num_rows($rs)!= 0){
	$row = mysql_fetch_array($rs);
	$txtUserName= $row["user_name"];
	$txtRegistrationDate = (isNotNull($row["registration_date"] and ($row["registration_date"]!= "0000-00-00")) ? dateFormat($row["registration_date"],"Y-m-d","m/d/Y") : "");
	$txtUserFullName = $row["user_first_name"];
	$txtUserFullName.= $row["user_last_name"]!=""? " ".$row["user_last_name"]:"";
	$txtReferralCharge = $row["referral_charge"];
	$txtUserEmail  = $row["user_email"];
	$txtPaid = $row["affiliate_payment_id"]!=""? "Y":"N";
	$txtPaymentDate = (isNotNull($row["payment_date"] and ($row["payment_date"]!= "0000-00-00")) ? dateFormat($row["payment_date"],"Y-m-d","m/d/Y") : "");
}else{
	header("Location:registrations.php");
	exit;
}

include "../includes/htmltop.php";
?>


<body>
<center>
		
		<div align="left" id="layout">
		
		
				
				
				<!--header area start -->
<?php

	include_once("../includes/topheader_admin.php")

?>
				
				<!--header area end -->
				
				
				
				
				<div align="left" class="main_body">
				<!--main body start -->
				
				
				
<?php
		include_once("../includes/admintopmenu.php")
?>		
																					
								
					<div align="left" class="content_area">
					
					<!--content area start -->
                                        <?php /*
					<div align="left"><?php include("../includes/subtab.php");?></div>
                                         */
                                        ?>
					<div align="left" class="page_title"><?php echo REG_DETAILS;?></div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
                    <br>
					
		
					<form name="frmProfile" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
					<input type="hidden" name="userid" value="<?php echo htmlentities($affiliateid);?>">
					
					
					<div align="left">
						
					<table width="80%" border="0" cellpadding="0" cellspacing="0" class="manage_table">
					<tr><td width="20%" align="left"><?php echo USER_NAME;?></td><td width="3%">&nbsp;</td><td width="77%" class="" align="left"><?php echo ($txtUserName);?></td></tr>
					<tr><td width="20%" align="left"><?php echo USER_FULL_NAME;?></td><td width="3%">&nbsp;</td><td class="" align="left"><?php echo ($txtUserFullName);?></td></tr>
					<tr><td width="20%" align="left"><?php echo USER_EMAIL;?></td><td width="3%">&nbsp;</td><td class="" align="left"><?php echo htmlentities($txtUserEmail);?></td></tr>
					<tr><td width="20%" align="left"><?php echo REFERRAL_CHARGE;?></td><td width="3%">&nbsp;</td><td class="" align="left"><?php echo htmlentities($txtReferralCharge);?></td></tr>
					<tr><td width="20%" align="left"><?php echo PAID1;?></td><td width="3%">&nbsp;</td><td class="" align="left"><?php echo htmlentities($txtPaid);?></td></tr>
<?php
					if($txtPaid == "Y")
					{
 ?>
					<tr><td width="20%" align="left"><?php echo PAYMENT_DATE;?></td><td width="3%">&nbsp;</td><td class="innertextCopy2" align="left"><?php echo htmlentities($txtPaymentDate);?></td></tr>
<?php
					}
?>
					<tr><td colspan="3">&nbsp;</td></tr>
					<tr><td colspan="3" align="center"><input type="button" value="<?php echo BACK;?>" class="button" name="btnBack" onClick="history.go(-1);" ></td></tr>
				</table>
				</form>
					</div>
						
						
				<!--content area end-->
								
				</div>
				
				
				
					<div align="left" class="clear_float"><img src="<?php echo $imagefolder;?>/clear.gif" alt="" width="1" height="1" /></div>
				<!--main body end -->
				</div>
				
				
<?php
	include "../includes/footer.php";
?>																						



