<?

//*********************************************************************************

// 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

//*********************************************************************************

?>

 <script type="text/javascript" src="../javascript/prototype.js"></script> 

		<script type="text/javascript" src="../javascript/effects.js"></script> 

		<script type="text/javascript" src="../javascript/newsbox.js"></script>

<style type="text/css">

<!--

.free{

	font-family:Tahoma;

	font-size:11px;

	color:#FF0000;

	text-align:center;

	line-height: 12px;

	font-weight:bold;

}

.aktif{

	font-family:Tahoma;

	font-size:11px;

	color:#003300;

	text-align:center;

	line-height: 12px;

	font-weight:bold;

}

-->

</style>

<?

if(!$awal) $awal = $user_session;

?>





<?

switch($page) {

	default :

	

	if(!$mid) {

		$mid = $user_session;

	

	} else {

		if($cari == 1) {

	//---levelku--

			$mylev = $db->dataupline("level", $user_session);

			$lev_uid = $db->dataupline("level", $mid);

			for($i=0;$i<$lev_uid;$i++) {

				$jd = $db->count_records("upline", "username='$mid' and upline$i='$user_session'");

				$ad = $ad + $jd;

			}	

				if($lev_uid > $mylev and $ad > 0) {

				//$sql="SELECT a.username, a.kiri, a.kanan, b.nama, b.status, b.sponsor FROM upline as a inner join member as b on a.username=b.username WHERE a.username='$mid'";

			//$awal=$uid;

				$mid = $mid;

			}

			

		} else {

			$mid = $mid;

		}		

	}

?>

<style type="text/css">

<!--

img {

	padding-top:2px;

}

-->

</style>



<div align="center">

										<table style="border-collapse: collapse;" border="0" cellpadding="0" width="100%">

											<tbody><tr>

												<td align="center" background="../network/bg01.gif" height="25">

												<span><strong style="color:#FFFFFF">DIAGRAM JARINGAN</strong></span></td>

											</tr>

										</tbody></table>

									</div>

<table style="border-collapse: collapse;" border="0" cellpadding="0" width="100%">

											<tbody><tr>

												<td class="tbl_content" style="background-position: center bottom; background-repeat: repeat-x;" align="center" background="../network/bg_colfoot.jpg">

												<div align="center">												  </div>

												<div align="center">

													<table style="border-collapse: collapse;" border="0" bordercolor="#111111" cellpadding="0" width="100%">

														<tbody><tr>

															<td align="center" width="15">&nbsp;</td>

															<td align="center">&nbsp;</td>

															<td align="center" width="15">&nbsp;</td>

														</tr>

														<tr>

															<td align="center" width="15">&nbsp;</td>

															<td align="center">

															<strong>Jaringan (<span style="color: rgb(255, 0, 0);"><?= $mid; ?></span>)<br>

															(<span style="color: rgb(255, 0, 0);"><?= $db->dataku("nama", $mid); ?></span>)<br>

															Sponsor (<span style="color: rgb(255, 0, 0);"><?= $db->dataku("sponsor", $mid); ?></span>)<br>

															<br></strong></td>

															<td align="center" width="15">&nbsp;</td>

														</tr>

														<tr>

															<td align="center" width="15">&nbsp;</td>

															<td align="center">&nbsp;</td>

															<td align="center" width="15">&nbsp;</td>

														</tr>

													</tbody></table>

												</div>

												<div align="center">

													<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="666">

														<tbody><tr>

															<td align="center"><strong>upline<br>(<span style="color: rgb(255, 0, 0);"><?= $db->dataupline("upline0", $mid); ?></span>)</strong><br></td>

														</tr>

														<tr>

															<td height="20">&nbsp;</td>

														</tr>

														<tr>

															<td>

																<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%">

																	<tbody><tr>

																		<td align="center" width="301">

																			<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="103%">

																				<tbody><tr>

																					<td align="right">&nbsp;</td>

																				  <td align="center" width="10"></td>

																				</tr>

																		  </tbody></table>

																		</td>

																		<td align="center" width="81">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

	

 <?

 if(!$db->dataku("foto", $mid)) {

 	$foto = "../network/noimage.jpg";

} else {

	$foto =	"../member/images/".$db->dataku("foto", $mid);

}	

 ?>   

    																				<td align="center" bgcolor="#f1f1f1" height="125" width="90">

   																				  <table class="tbl03" cellpadding="0" cellspacing="0"><tbody><tr><td align="center" height="75" width="75"><img src="<?= $foto; ?>" border="0" height="75" width="75"></td></tr></tbody></table></a><br><span style="font-size: 10px;"><?= memberkiri($mid, "and b.status=1"); ?> | <?= memberkanan($mid, "and b.status=1"); ?></span><br><span style="font-size: 12px;"><a href="#"><strong><?= $mid; ?></strong></a><br>
   																				  <?= $db->dataku("nama", $mid); ?></span></td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center">

																			<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="94%">

																				<tbody><tr>

																					<td align="center" width="22"></td>

																					<td width="269" align="left">&nbsp;</td>

																				</tr>

																		  </tbody></table>

																		</td>

																	</tr>

																</tbody></table>

															</td>

														</tr>

														<tr>

															<td align="center" background="../network/tree01.gif" height="50"></td>

														</tr>

														<tr>

															<td>

																<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%">

																	<tbody><tr>

																		<td align="center" width="129"></td>

																		<td align="center" width="81">

																			<table width="100%" height="116" border="1" cellpadding="2" cellspacing="0" bordercolor="<? $statuski; ?>" bgcolor="<? $statuski; ?>" class="tbl03" style="border-collapse: collapse;">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

                                                                                    

   <?

   $db->select("kiri, kanan", "upline", "username='$mid'");

   		$idki = $db->result(0, "kiri");

		$naki = $db->dataku("nama", $idki);

		$kotaki = $db->dataku("kota", $idki);
		
 

		 if(!$db->dataku("foto", $idki)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki);

		}

		if($db->dataku("status", $idki)>0) {

		$statuski="<div class='aktif'>Aktif</div>";

		} else {

		$statuski="<div class='free'>Free</div>";

		}	

		

   if($idki) {

   		

   		$kiri = "<a href='?m=genealogi&mid=$idki'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto'  border='0' height='75' width='75' style='padding-top:2px'></td></tr></tbody></table></a>".$statuski."<span style='font-size: 10px;'>".memberkiri($idki, "and b.status=1")." | ".memberkanan($idki, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki'><strong>$idki</strong></a><br>$naki<br> </span>";

   } else {

   		$kiri = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$mid&pos=KIRI''><strong>DAFTAR</strong></a></span>";

		

   }

   echo $kiri;

   $kosong = "";

   ?>                                                                             </td>

																				</tr>

																		  </tbody></table>

																		</td>

																		<td align="center" width="263"></td>

																		<td align="center" width="81">

                                                                        <table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125">

																		 <?

   $db->select("kiri, kanan", "upline", "username='$mid'");

   	$idka = $db->result(0, "kanan");

		$naka = $db->dataku("nama", $idka);

		$kotaka = $db->dataku("kota", $idka);
		
  

		 if(!$db->dataku("foto", $idka)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idka);

		}

		if($db->dataku("status", $idka)>0) {

		$statuska="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuska="<div class='free'>Free</div>";

		}	

		

   if($idka) {

   		

   		$kanan = "<a href='?m=genealogi&mid=$idka'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuska."<span style='font-size: 10px;'>".memberkiri($idka, "and b.status=1")." | ".memberkanan($idka, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idka'><strong>$idka</strong></a><br>$naka<br> </span>";

   } else {

   		$kanan = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$mid&pos=KANAN''><strong>DAFTAR</strong></a></span>";

		

   }

   echo $kanan;

   ?>																		</td>

																				</tr></tbody></table></td>

																		<td align="center" width="129"></td>

																	</tr>

																</tbody></table>

															</td>

														</tr>

														<tr>

															<td align="center" background="../network/tree02.gif" height="50"></td>

														</tr>

														<tr>

															<td>

																<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%">

																	<tbody><tr>

																		<td align="center" width="43"></td>

																		<td align="center" width="81">

                                                                        <table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

					

   <?

   //----level 2 kiri---

   if(!$idki) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki'");

		$idki2a = $db->result(0, "kiri");

			$naki2a = $db->dataku("nama", $idki2a);

			$kotaki2a = $db->dataku("kota", $idki2a);
			
 

			 if(!$db->dataku("foto", $idki2a)) {

				$foto = "../network/noimage.jpg";

			} else {

				$foto =	"../member/images/".$db->dataku("foto", $idki2a);

			}

		if($db->dataku("status", $idki2a)>0) {

		$statuski2a="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski2a="<div class='free'>Free</div>";

		}	

	   if($idki2a) {

			

			$kiri2a = "<a href='?m=genealogi&mid=$idki2a'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski2a."<span style='font-size: 10px;'>".memberkiri($idki2a, "and b.status=1")." | ".memberkanan($idki2a, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki2a'><strong>$idki2a</strong></a><br>$naki2a<br> </span>";

	   } else {

			$kiri2a = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri2a;	

   }

   ?>                 

                    

                    														

																			</td>

																				</tr>

																			</tbody></table>

                                                                        </td>

																		<td align="center" width="91"></td>

																		<td align="center" width="81">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

        <?

   //----level 2b kiri---

   if(!$idki) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki'");

		$idki2b = $db->result(0, "kanan");

			$naki2b = $db->dataku("nama", $idki2b);

			$kotaki2b = $db->dataku("kota", $idki2b);
			
  

		 if(!$db->dataku("foto", $idki2b)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki2b);

		}	

		if($db->dataku("status", $idki2b)>0) {

		$statuski2b="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski2b="<div class='free'>Free</div>";

		}	



	   if($idki2b) {

			

			$kiri2b = "<a href='?m=genealogi&mid=$idki2b'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski2b."<span style='font-size: 10px;'>".memberkiri($idki2b, "and b.status=1")." | ".memberkanan($idki2b, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki2b'><strong>$idki2b</strong></a><br>$naki2b<br> </span>";

	   } else {

			$kiri2b = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri2b;	

   }

   ?>                                                                                

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="91"></td>

																		<td align="center" width="81">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

       <?

   //----level 2 kanan---

   if(!$idka) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka'");

		$idka2a = $db->result(0, "kiri");

			$naka2a = $db->dataku("nama", $idka2a);

			$kotaka2a = $db->dataku("kota", $idka2a);
			
 

		 if(!$db->dataku("foto", $idka2a)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idka2a);

		}

		if($db->dataku("status", $idka2a)>0) {

		$statuska2a="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuska2a="<div class='free'>Free</div>";

		}

			



	   if($idka2a) {

			

			$kanan2a = "<a href='?m=genealogi&mid=$idka2a'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuska2a."<span style='font-size: 10px;'>".memberkiri($idka2a, "and b.status=1")." | ".memberkanan($idka2a, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idka2a'><strong>$idka2a</strong></a><br>$naka2a<br> </span>";

	   } else {

			$kanan2a = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kanan2a;	

   }

   ?>                                                                                       

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>	

																		</td>

																		<td align="center" width="91"></td>

																		<td align="center" width="81">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

                                                                                    

                <?

   //----level 2b kanan---

   if(!$idka) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka'");

		$idka2b = $db->result(0, "kanan");

			$naka2b = $db->dataku("nama", $idka2b);

			$kotaka2b = $db->dataku("kota", $idka2b);
			
 

		 if(!$db->dataku("foto", $idka2b)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idka2b);

		}	

		if($db->dataku("status", $idka2b)>0) {

		$statuska2b="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuska2b="<div class='free'>Free</div>";

		}



	   if($idka2b) {

			

			$kanan2b = "<a href='?m=genealogi&mid=$idka2b'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuska2b."<span style='font-size: 10px;'>".memberkiri($idka2b, "and b.status=1")." | ".memberkanan($idka2b, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idka2b'><strong>$idka2b</strong></a><br>$naka2b<br> </span>";

	   } else {

			$kanan2b = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kanan2b;	

   }

   ?>                                                                                  

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="23"></td>

																	</tr>

																</tbody></table>

															</td>

														</tr>

														<tr>

															<td align="center" background="../network/tree03.gif" height="50">

                                                                                                 

                                                            </td>

														</tr>

														<tr>

															<td>

																<table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%">

																	<tbody><tr>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                                    

                                  <?

   //----level 3 A kiri---

   if(!$idki2a) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki2a'");

		$idki3a = $db->result(0, "kiri");

			$naki3a = $db->dataku("nama", $idki3a);

			$kotaki3a = $db->dataku("kota", $idki3a);
			
 

		 if(!$db->dataku("foto", $idki3a)) {

			$foto = "../network/noimage.jpg";

		} else {

		$foto =	"../member/images/".$db->dataku("foto", $idki3a);

		}	

		if($db->dataku("status", $idki3a)>0) {

		$statuski3a="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3a="<div class='free'>Free</div>";

		}



	   if($idki3a) {

			

			$kiri3a = "<a href='?m=genealogi&mid=$idki3a'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3a."<span style='font-size: 10px;'>".memberkiri($idki3a, "and b.status=1")." | ".memberkanan($idki3a, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3a'><strong>$idki3a</strong></a><br>$naki3a<br> </span>";

	   } else {

			$kiri3a = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki2a&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3a;	

   }

   ?>                                                                           

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                            

                           <?

   //----level 3 B kiri---

   if(!$idki2a) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki2a'");

		$idki3b = $db->result(0, "kanan");

			$naki3b = $db->dataku("nama", $idki3b);

			$kotaki3b = $db->dataku("kota", $idki3b);
			
 

		 if(!$db->dataku("foto", $idki3b)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki3b);

		}	

		if($db->dataku("status", $idki3b)>0) {

		$statuski3b="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3b="<div class='free'>Free</div>";

		}



	   if($idki3b) {

			

			$kiri3b = "<a href='?m=genealogi&mid=$idki3b'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3b."<span style='font-size: 10px;'>".memberkiri($idki3b, "and b.status=1")." | ".memberkanan($idki3b, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3b'><strong>$idki3b</strong></a><br>$naki3b<br> </span>";

	   } else {

			$kiri3b = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki2a&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3b;	

   }

   ?>                                                                                                            

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                                    

                           <?

   //----level 3 C kiri---

   if(!$idki2b) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki2b'");

		$idki3c = $db->result(0, "kiri");

			$naki3c = $db->dataku("nama", $idki3c);

			$kotaki3c = $db->dataku("kota", $idki3c);
			
 

		 if(!$db->dataku("foto", $idki3c)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki3c);

		}	

		if($db->dataku("status", $idki3c)>0) {

		$statuski3c="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3c="<div class='free'>Free</div>";

		}



	   if($idki3c) {

			

			$kiri3c = "<a href='?m=genealogi&mid=$idki3c'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3c."<span style='font-size: 10px;'>".memberkiri($idki3c, "and b.status=1")." | ".memberkanan($idki3c, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3c'><strong>$idki3c</strong></a><br>$naki3c<br> </span>";

	   } else {

			$kiri3c = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki2b&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3c;	

   }

   ?>                                                                                  

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>	

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                                    

                                                                                    

                               <?

   //----level 3 D kiri---

   if(!$idki2b) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idki2b'");

		$idki3d = $db->result(0, "kanan");

			$naki3d = $db->dataku("nama", $idki3d);

			$kotaki3d = $db->dataku("kota", $idki3d);
			
 

		 if(!$db->dataku("foto", $idki3d)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki3d);

		}	

		if($db->dataku("status", $idki3d)>0) {

		$statuski3d="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3d="<div class='free'>Free</div>";

		}



	   if($idki3d) {

			

			$kiri3d = "<a href='?m=genealogi&mid=$idki3d'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3d."<span style='font-size: 10px;'>".memberkiri($idki3d, "and b.status=1")." | ".memberkanan($idki3d, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3d'><strong>$idki3d</strong></a><br>$naki3d<br> </span>";

	   } else {

			$kiri3d = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idki2b&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3d;	

   }

   //---end lev 3d

   ?>                                                                                  

                                                                                             

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="81">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="81">

                          <?

   //----level 3 E kiri---

   if(!$idka2a) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka2a'");

		$idki3e = $db->result(0, "kiri");

			$naki3e = $db->dataku("nama", $idki3e);

			$kotaki3e = $db->dataku("kota", $idki3e);
			
 

		 if(!$db->dataku("foto", $idki3e)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki3e);

		}	

		if($db->dataku("status", $idki3e)>0) {

		$statuski3e="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3e="<div class='free'>Free</div>";

		}



	   if($idki3e) {

			

			$kiri3e = "<a href='?m=genealogi&mid=$idki3e'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3e."<span style='font-size: 10px;'>".memberkiri($idki3e, "and b.status=1")." | ".memberkanan($idki3e, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3e'><strong>$idki3e</strong></a><br>$naki3e<br> </span>";

	   } else {

			$kiri3e = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka2a&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3e;	

   }

   ?>                                                                                  

                                                                                                  

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                            <?

   //----level 3 F kiri---

   if(!$idka2a) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka2a'");

		$idki3f = $db->result(0, "kanan");

			$naki3f = $db->dataku("nama", $idki3f);

			$kotaki3f = $db->dataku("kota", $idki3f);
			
 

		 if(!$db->dataku("foto", $idki3f)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idki3f);

		}	

		if($db->dataku("status", $idki3f)>0) {

		$statuski3f="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuski3f="<div class='free'>Free</div>";

		}



	   if($idki3f) {

			$kiri3f = "<a href='?m=genealogi&mid=$idki3f'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuski3f."<span style='font-size: 10px;'>".memberkiri($idki3f, "and b.status=1")." | ".memberkanan($idki3f, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idki3f'><strong>$idki3f</strong></a><br>$naki3f<br> </span>";

	   } else {

			$kiri3f = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka2a&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kiri3f;	

   }

   ?>                                                                                                    

                                                                                    

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																		<td align="center" width="5"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                                    

                              <?

   //----level 3 G kiri---

   if(!$idka2b) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka2b'");

		$idka3g = $db->result(0, "kiri");

			$naka3g = $db->dataku("nama", $idka3g);

			$kotaka3g = $db->dataku("kota", $idka3g);
			
 

		 if(!$db->dataku("foto", $idka3g)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idka3g);

		}	

		if($db->dataku("status", $idka3g)>0) {

		$statuska3g="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuska3g="<div class='free'>Free</div>";

		}



	   if($idka3g) {

			

			$kanan3g = "<a href='?m=genealogi&mid=$idka3g'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuska3g."<span style='font-size: 10px;'>".memberkiri($idka3g, "and b.status=1")." | ".memberkanan($idka3g, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idka3g'><strong>$idka3g</strong></a><br>$naka3g<br> </span>";

	   } else {

			$kanan3g = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka2b&pos=KIRI''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kanan3g;	

   }

   ?>                                                                                                  

                                                                                    </td>

																				</tr>

																			</tbody></table>	

																		</td>

																		<td align="center" style="width: 5px"></td>

																		<td align="center" width="76">

																			<table class="tbl03" style="border-collapse: collapse;" border="1" cellpadding="2" cellspacing="0" height="116" width="100%">

																				<tbody><tr>

																					<td align="center" bgcolor="#f1f1f1" height="125" width="76">

                                                                                    

                                     <?

   //----level 3 H kiri---

   if(!$idka2b) {

   	echo $kosong;

	} else {

		$db->select("kiri, kanan", "upline", "username='$idka2b'");

		$idka3h = $db->result(0, "kanan");

			$naka3h = $db->dataku("nama", $idka3h);

			$kotaka3h = $db->dataku("kota", $idka3h);
			
 

		 if(!$db->dataku("foto", $idka3h)) {

			$foto = "../network/noimage.jpg";

		} else {

			$foto =	"../member/images/".$db->dataku("foto", $idka3h);

		}	

		if($db->dataku("status", $idka3h)>0) {

		$statuska3h="<div class='aktif'>Aktif</div>"; 

		} else {

		$statuska3h="<div class='free'>Free</div>";

		}



	   if($idka3h) {

			

			$kanan3h = "<a href='?m=genealogi&mid=$idka3h'><table class='tbl03' cellpadding='0' cellspacing='0'><tbody><tr><td align='center' height='75' width='75'><img src='$foto' border='0' height='75' width='75'></td></tr></tbody></table></a>".$statuska3h."<span style='font-size: 10px;'>".memberkiri($idka3h, "and b.status=1")." | ".memberkanan($idka3h, "and b.status=1")."</span><br><span style='font-size: 12px;'><a href='?m=genealogi&mid=$idka3h'><strong>$idka3h</strong></a><br>$naka3h<br> </span>";

	   } else {

			$kanan3h = "<span style='font-size: 10px;'><a href='?m=join&sp=$awal&up=$idka2b&pos=KANAN''><strong>DAFTAR</strong></a></span>";

			

	   }

	   echo $kanan3h;	

   }

   ?>                                                                                           

                                                                                    </td>

																				</tr>

																			</tbody></table>

																		</td>

																	</tr>

																</tbody></table>

															</td>

														</tr>

												  </tbody></table>

												</div>

												<div align="center">

													<table style="border-collapse: collapse;" border="0" bordercolor="#111111" cellpadding="0" width="100%">

														<tbody><tr>

															<td align="center" width="15">&nbsp;</td>

															<td align="center"><br><br>

															<span style="color: rgb(128, 128, 128);"><br>

															<br>

														    <br>

														    <br></span></td>

															<td align="center" width="15">&nbsp;</td>

														</tr>

													</tbody></table>

												</div>

												</td>

											</tr>

										</tbody></table>



<?	

	break;

	

	case tree :

		

		$idtree = $db->tree($mid);

			include("../classes/class.tree.php");



		$tree=new Tree($idtree);    // or $_POST["id"] numeric value of the root folder/category/directory to create the tree

		$tree->display();

		//echo $idtree;

	break;

	

	case tree2 :

	echo "<div id='module'><h3>NETWORK TREE</h3><p>&nbsp;</p>";

	echo "<p>Keterangan:<br> <span style='color:#006600'>Hijau</span> : Jml Active Member<br><span style='color:#0000CC'>Biru</span> : Free Member<br><span style='color:#FF0000'>Merah</span> : Blokir Member</p><p>&nbsp;</p>";

		$lv=5;

		for($i=0;$i<$lv;$i++) {

			$j = $i + 1;

			//$db->select("username", "upline", "upline$i='$mid'");

			$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

?>



<div style="width: 98%; padding: 2px; margin: 0;">

            <div id="newsBox">

              <!-- NEWS ITEMS GO HERE - Repeat Sections as many times as you want -->

              <!--NEWS ITEM-->

              <div class="newsItem"> <a class="newsTitle">Level <?= $j; ?>: <span style="color:#006600"><?= $ja; ?></span> <span style="color:#0000CC"><?= $jf; ?></span> <span style="color:#FF0000"><?= $jb; ?></span></a>

                  <div style="display:none;">

                    <div class="newsContent">

                      <?

					 

		//$csq=myfetch("SELECT konten FROM konten WHERE url='caragabung'");

		//echo $db->jumlahdl($mid, "1");

		$db->select("a.username, a.nama, a.status, a.blokir, a.hp, a.phone, a.email, 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'");

		?>

                  <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D7D7D7">

      <tr>

        <td align="center" bgcolor="#FFCC00"><strong>#</strong></td>

        <td align="center" bgcolor="#FFCC00"><strong>Username (Nama) </strong></td>

        <td align="center" bgcolor="#FFCC00"><strong>Sponsor/Upline</strong></td>

        <td align="center" bgcolor="#FFCC00"><strong>HP/Telp</strong></td>

        

        <td align="center" bgcolor="#FFCC00"><strong>Status</strong></td>

      </tr>

   <?

   		$n=1;

		while($row = $db->fetch_row()) {

			if($row[2] > 0) {

				$status = date("d.m.y", strtotime($row[7]));

				$cl_status = "status_active";

			} else if($row[3] > 0) {

				$status = "BLOKIR";

				$cl_status = "status_blokir";	

			} else {

				$status = "FREE";

				$cl_status = "status_free";

			}			

   ?>  

	  <tr>

        <td bgcolor="#FFFFFF"><?= $n; ?></td>

        <td bgcolor="#FFFFFF"><?= $row[0]; ?> (<?= $row[1]; ?>)</td>

        <td bgcolor="#FFFFFF"><?= $row[9]; ?>/<?= $row[8]; ?></td>

        <td bgcolor="#FFFFFF"><?= $row[4]; ?>/<?= $row[5]; ?></td>

       

        <td bgcolor="#FFFFFF" class="<?= $cl_status; ?>" align="center"><?= $status; ?></td>

      </tr>

	 <?

	 	$n++;

	 }

	 ?> 

    </table>  </div>

                  </div>

              </div>

              <!-- end news items -->

            </div>

</div>

	

	  <?

		}

	?>		

	  <!-- this script is required for your newsbox to work; also, modify the variables defined below to customize the look of the newbox contents. -->

	  <!-- bg = background color; fg = text color for your article; link = the color for your links -->

	  <!-- altbg = background color of alternating row ; altfg = text color for your article on an alternating row; altlink = the color for your links on an alernating row -->

	  <script type="text/javascript">newsBox = new newsBox({'bg':'#f7f7f7','fg':'#000000','link':'#0000cc','altbg':'#ffffff','altfg':'#000000','altlink':'#0000cc'});</script>

	<p>&nbsp;</p>

	<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#CCCCCC" >

      <tr class="tbl_header">

        <td width="39%" align="center">Username</td>

        <td width="30%" align="center">KIRI</td>

        <td width="31%" align="center">KANAN</td>

      </tr>

    

      <tr>

        <td bgcolor="#FFFFFF"><?= $user_session; ?></td>

        <td align="center" bgcolor="#FFFFFF"><?= memberkiri($user_session, "and b.status=1"); ?></td>

        <td align="center" bgcolor="#FFFFFF"><?= memberkanan($user_session, "and b.status=1"); ?></td>

      </tr>

 <?

 $paket = $db->dataupline("paket", $user_session);

 if($paket > 1 ) {

 	for($i=1;$i<$paket;$i++) {

		$db->select("username", "banner_kanan", "username='$user_session-0$i'", "username");

		$row = $db->fetch_row();

	?>	

      <tr>

        <td bgcolor="#FFFFFF"><?= $row[0]; ?></td>

        <td align="center" bgcolor="#FFFFFF"><?= memberkiri($row[0], "and b.status=1"); ?></td>

        <td align="center" bgcolor="#FFFFFF"><?= memberkanan($row[0], "and b.status=1"); ?></td>

      </tr>

    <?

	}

}

?>	  

</table>

	<p>&nbsp;</p>

	</div>

	  

      <?	

	//echo "</div>";

	break;

}

?>	

</p>

