<?
//*********************************************************************************
// Original Website By : Niadesain.com Di Jual melalui http://niadesain.com
// Please Call / SMS : 081384745483 (support@niadesain.com)
// Niadesain.com - Jasa Pembuatan Website Paling Murah dan Paling Lengkap
//*********************************************************************************
?>
<?
switch($page) {
	default :
?>
<style type="text/css">
<!--
.style2 {font-size: 12px}
-->
</style>


<h4 align="center">REWARD POIN JARINGAN <?
		$lv=1;
		for($i=0;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>
</h4>
<div style="width: 98%; padding: 2px; margin: 0;">
              <div class="newsItem"><strong> </strong>
                <div style="display:yes;">
                      <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung1=$pengunjung->kunjung;
		?>
                  <br />
                  <?
		$lv=2;
		for($i=1;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung2=$pengunjung->kunjung;
		?>

	  <?
		}
		}
	?>
	          <?
		$lv=3;
		for($i=2;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung3=$pengunjung->kunjung;
		?>

	  <?
		}
		}
	?>
<?
		}
		}
	?>
              <?
		$lv=4;
		for($i=3;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>
              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung4=$pengunjung->kunjung;
		?>
      <?
		}
		}
	?>
              <?
		$lv=5;
		for($i=4;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>
              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung5=$pengunjung->kunjung;

		?>
      <?
		}
		}
	?>
              <?
		$lv=6;
		for($i=5;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung6=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=7;
		for($i=6;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung7=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=8;
		for($i=7;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung8=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=9;
		for($i=8;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung9=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=10;
		for($i=9;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung10=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=11;
		for($i=10;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung11=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=12;
		for($i=11;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung12=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=13;
		for($i=12;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung13=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=14;
		for($i=13;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung14=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=15;
		for($i=14;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung15=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=16;
		for($i=15;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung16=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=17;
		for($i=16;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung17=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=18;
		for($i=17;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung18=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=19;
		for($i=18;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung19=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=20;
		for($i=19;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung20=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=21;
		for($i=20;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung21=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=22;
		for($i=21;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung22=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=23;
		for($i=22;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung23=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=24;
		for($i=23;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung24=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=25;
		for($i=24;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung25=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=26;
		for($i=25;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung26=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=27;
		for($i=26;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung27=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=28;
		for($i=27;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung28=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=29;
		for($i=28;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung29=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=30;
		for($i=29;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung30=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=31;
		for($i=30;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung31=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=32;
		for($i=31;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung32=$pengunjung->kunjung;

		?>


      <?
		}
		}
	?>

              <?
		$lv=33;
		for($i=32;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung33=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=34;
		for($i=33;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung34=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=35;
		for($i=34;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung35=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>


              <?
		$lv=36;
		for($i=35;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung36=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=37;
		for($i=36;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung37=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=38;
		for($i=37;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung38=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=39;
		for($i=38;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung39=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=40;
		for($i=39;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung40=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=41;
		for($i=40;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung41=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=42;
		for($i=41;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung42=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=43;
		for($i=42;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung43=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=44;
		for($i=43;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung44=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=45;
		for($i=44;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung45=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=46;
		for($i=45;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung46=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=47;
		for($i=46;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung47=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=48;
		for($i=47;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung48=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=49;
		for($i=48;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung49=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>

              <?
		$lv=50;
		for($i=49;$i<$lv;$i++) {
			$j = $i + 1;
			$ja = $db->jmlmember($mid, "a.status=1 and b.upline$i='$user_session'"); //jml mbr aktif per level
			$jf = $db->jmlmember($mid, "a.status=0 and blokir=0 and b.upline$i='$user_session'"); //jml mbr free per level
			$jb = $db->jmlmember($mid, "a.blokir=1 and b.upline$i='$user_session'"); //jml mbr blokir per level
			
			if($ja > 0 or $jf > 0) {
?>

              <?
$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, a.poin, a.tglaktif, a.upline, b.sponsor", "banner_kanan as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'");
	$sqlpengunjung="SELECT count(*), sum(poin) kunjung from banner_kanan as a inner join upline as b on a.username=b.username and b.upline$i='$user_session'"; 
    $resultpengunjung = mysql_query($sqlpengunjung);
    $pengunjung=mysql_fetch_object($resultpengunjung);
    $totalpengunjung50=$pengunjung->kunjung;

		?>

      <?
		}
		}
	?>
<p>&nbsp;</p>
</div>
	  

</p>
<?
	break;
	
	case tree :
		echo "<div id='module'><h3><center>NETWORK TREE & DATA DOWNLINE</center></h3><p>&nbsp;</p>";
		?>
        
         <P><strong><a href="?m=tree">Data Downline</a> | </strong></P>
        
         <?
		include ("tree2.php");
		echo "</div>";
		break;
	}	
?>
         <table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
           <tr>
             <td width="41%" height="35" bgcolor="#66FF66"><div align="center">Username</div></td>
             <td width="25%" bgcolor="#66FF66"><div align="center">Total Poin Jaringan</div></td>
           </tr>
           <tr>
             <td height="33"><div align="center"><? echo $user_session; ?></div></td>
             <td><div align="center">
               <?
$totpoin = $totalpengunjung1 + $totalpengunjung2 + $totalpengunjung3 + $totalpengunjung4 + $totalpengunjung5 + $totalpengunjung6 + $totalpengunjung7 + $totalpengunjung8 + $totalpengunjung9 + $totalpengunjung10 + $totalpengunjung11 + $totalpengunjung12 + $totalpengunjung13 + $totalpengunjung14 + $totalpengunjung15 + $totalpengunjung16 + $totalpengunjung17 + $totalpengunjung18 + $totalpengunjung19 + $totalpengunjung20 + $totalpengunjung21 + $totalpengunjung22 + $totalpengunjung23 + $totalpengunjung24 + $totalpengunjung25 + $totalpengunjung26 + $totalpengunjung27 + $totalpengunjung28 + $totalpengunjung29 + $totalpengunjung30 + $totalpengunjung31 + $totalpengunjung32 + $totalpengunjung33 + $totalpengunjung34 + $totalpengunjung35 + $totalpengunjung36 + $totalpengunjung37 + $totalpengunjung38 + $totalpengunjung39 + $totalpengunjung40 + $totalpengunjung41 + $totalpengunjung42 + $totalpengunjung43 + $totalpengunjung44 + $totalpengunjung45 + $totalpengunjung46 + $totalpengunjung47 + $totalpengunjung48 + $totalpengunjung49 + $totalpengunjung50;
?>
                 <?= $totpoin; ?>
                 <?
$kiri=$totpoin;
$kp1=$db->config("kp1");

$kp2=$db->config("kp2");

$kp3=$db->config("kp3");

$kp4=$db->config("kp4");

$kp5=$db->config("kp5");

$kp6=$db->config("kp6");

$kp7=$db->config("kp7");

$kp8=$db->config("kp8");


$myrwd1=$db->dataku("rpoin1", $user_session);
if($myrwd1<1) {
$status1="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status1="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd2=$db->dataku("rpoin2", $user_session);
if($myrwd2<1) {
$status2="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status2="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd3=$db->dataku("rpoin3", $user_session);
if($myrwd3<1) {
$status3="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status3="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd4=$db->dataku("rpoin4", $user_session);
if($myrwd4<1) {
$status4="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status4="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd5=$db->dataku("rpoin5", $user_session);
if($myrwd5<1) {
$status5="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status5="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd6=$db->dataku("rpoin6", $user_session);
if($myrwd6<1) {
$status6="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status6="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd7=$db->dataku("rpoin7", $user_session);
if($myrwd7<1) {
$status7="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status7="<img src='images/tick.png' width='16' height='16' />";
}

$myrwd8=$db->dataku("rpoin8", $user_session);
if($myrwd8<1) {
$status8="<img src='images/publish_x.png' width='16' height='16' />";
} else {
$status8="<img src='images/tick.png' width='16' height='16' />";
}

if($kiri>=$kp1) {
$rpoin1="Qualified";
$ambil1= "<span style='font-size: 12px;'><a href='?m=ambilrpoin1''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin1="Belum Qualified";
$ambil1= "<strong>CAIRKAN</strong>";
}


if($kiri>=$kp2) {
$rpoin2="Qualified";
$ambil2= "<span style='font-size: 12px;'><a href='?m=ambilrpoin2''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin2="Belum Qualified";
$ambil2= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp3) {
$rpoin3="Qualified";
$ambil3= "<span style='font-size: 12px;'><a href='?m=ambilrpoin3''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin3="Belum Qualified";
$ambil3= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp4) {

$rpoin4="Qualified";
$ambil4= "<span style='font-size: 12px;'><a href='?m=ambilrpoin4''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin4="Belum Qualified";
$ambil4= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp5) {
$rpoin5="Qualified";
$ambil5= "<span style='font-size: 12px;'><a href='?m=ambilrpoin5''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin5="Belum Qualified";
$ambil5= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp6) {
$rpoin6="Qualified";
$ambil6= "<span style='font-size: 12px;'><a href='?m=ambilrpoin6''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin6="Belum Qualified";
$ambil6= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp7) {
$rpoin7="Qualified";
$ambil7= "<span style='font-size: 12px;'><a href='?m=ambilrpoin7''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin7="Belum Qualified";
$ambil7= "<strong>CAIRKAN</strong>";
}

if($kiri>=$kp8) {
$rpoin8="Qualified";
$ambil8= "<span style='font-size: 12px;'><a href='?m=ambilrpoin8''><strong>CAIRKAN</strong></a></span>";
} else {
$rpoin8="Belum Qualified";
$ambil8= "<strong>CAIRKAN</strong>";
}

?>
             </div></td>
           </tr>
         </table>
         <table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
           <tr>
             <td width="88" height="37" bgcolor="#FFCC99"><div align="center"><strong>Reward</strong></div></td>
             <td width="55" bgcolor="#FFCC99"><div align="center"><strong>Poin</strong></div></td>
             <td width="112" bgcolor="#FFCC99"><div align="center"><strong>Pencapaian</strong></div></td>
             <td width="125" bgcolor="#FFCC99"><div align="center"><strong>Bonus Reward </strong></div></td>
             <td width="84" bgcolor="#FFCC99"><div align="center"><strong>Ambil Reward </strong></div></td>
             <td width="88" bgcolor="#FFCC99"><div align="center"><strong>Status Withdrawl </strong></div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-1</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp1"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin1; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin1"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil1; ?>
             </div></td>
             <td><div align="center">
                 <?= $status1; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-2</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp2"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin2; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin2"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil2; ?>
             </div></td>
             <td><div align="center">
                 <?= $status2; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-3</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp3"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin3; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin3"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil3; ?>
             </div></td>
             <td><div align="center">
                 <?= $status3; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-4</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp4"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin4; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin4"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil4; ?>
             </div></td>
             <td><div align="center">
                 <?= $status4; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-5</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp5"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin5; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin5"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil5; ?>
             </div></td>
             <td><div align="center">
                 <?= $status5; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-6</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp6"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin6; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin6"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil6; ?>
             </div></td>
             <td><div align="center">
                 <?= $status6; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-7</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp7"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin7; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin7"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil7; ?>
             </div></td>
             <td><div align="center">
                 <?= $status7; ?>
             </div></td>
           </tr>
           <tr>
             <td height="35"><div align="center">Reward-8</div></td>
             <td><div align="center"><span class="style2">
                 <?= $db->config("kp8"); ?>
             </span></div></td>
             <td><div align="center"><span class="style2">
                 <?= $rpoin8; ?>
             </span></div></td>
             <td><div align="center">
                 <?= $db->config("rpoin8"); ?>
             </div></td>
             <td><div align="center">
                 <?= $ambil8; ?>
             </div></td>
             <td><div align="center">
                 <?= $status8; ?>
             </div></td>
           </tr>
         </table>
         <p>&nbsp;</p>
         <p align="center">&nbsp;         </p>
