<?php session_start();  //Developed by ITechScripts
?>
<?
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // ITECHBIDS Configuration File
$locheckuser=$_SESSION[username];
$locheckpass=$_SESSION[checkpass];
if((strlen($locheckuser)==0) || (strlen($locheckpass)==0))
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 
$lochecksql="select * from member_details where user_name='$locheckuser' and password='$locheckpass' and verified='yes' and approved='yes' and payment_status='yes'";
$locheckre=mysql_query($lochecksql);
if(mysql_num_rows($locheckre)==0)
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 
$userid=$_SESSION[userid];
$username=$_SESSION[username];
$query="select * from genaralsettings where set_id = 1";
$table=mysql_query($query);
if($row=mysql_fetch_array($table))
$yoursite = $row['set_value'];
$select_referral_query="select * from member_details  where intro_id=$userid";
$select_referral_result=mysql_query($select_referral_query);
$total_referrals=mysql_num_rows($select_referral_result);
$ref_sql="select SUM(referral_commission) from referral_commission where intro_id=$userid";
$ref_res=mysql_query($ref_sql);
$com_res=mysql_fetch_array($ref_res);
$total_commission=$com_res[0];
?>
<? require 'themes/referral.tpl'; ?>
</table>
</body>
</html>