<?php

if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( '../init.php' );
}

include ( 'sessioninc.php' );

define( 'PAGE_ID', 'affiliate_stats' );

if ( !checkAdminPermission( PAGE_ID ) ) {

	header( 'location: not_authorize.php' );
	exit;
}

$affid = $_REQUEST['affid'];

$rs =& $osDB->getAll( 'SELECT a. userid, b.invoice_no, b.to_membership, b.txn_date, b.amount_paid, b.payment_mod FROM  !  AS a, ! AS b where a.affid=? and a.userid = b.userid order by b.txn_date desc', array( AFFILIATE_REFERALS_TABLE, TRANSACTIONS_TABLE  ) );



?>