<?php
(@include ('../dt_page/lic.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>");
//$lic=$license;if(!$lic){echo "<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>";}$svr=$_SERVER['SERVER_NAME'];$c=curl_init();curl_setopt($c,CURLOPT_URL,"http://www.primadesain.com/verifylicenses.php");curl_setopt($c,CURLOPT_TIMEOUT,30);curl_setopt($c,CURLOPT_POST,1);curl_setopt($c,CURLOPT_RETURNTRANSFER,1);$postfields='svr='.$svr.'&lic='.$lic;curl_setopt($c,CURLOPT_POSTFIELDS,$postfields);$result=curl_exec($c);if($result=="fail"){echo "<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>";die();}
if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)){
echo "<p align=center><br><br><br><br><br><br><font size=\"6\" color=\"#FF0000\">ILLEGAL ACCESS !!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=../index.php\">";
exit();} 
?>
 <div class="row">
            <div class="col-md-12">
                <h1 class="page-header">
                    <img src="../themes/img/team.png" alt="Network" class="header-icon" width="30">
                    Network
                </h1>
            </div>
        </div>
<div class="row">
            <div class="col-md-4">
                <div class="input-group p-b-10">
                    <input id="ref_url" class="form-control" name="ref_url" type="text" value="https://<?php echo $domain; ?>/?<?php echo $reffa; ?>=<?php echo $user_session; ?>">
                    <span class="input-group-btn">
                        <button id="copy-ref-url" class="btn btn-primary" type="button">Copy</button>
                    </span>
                </div>

            </div>
           
        </div>
<?php
if($db->dataku("status", $user_session) == 0 || $db->dataku("blokir", $user_session) == 1) {
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$LANG["status0"]."</div>";
}else{
?>


               
<div class="row">
            	<div class="col-md-12">
                
                <div class="panel panel-inverse">
                        <div class="panel-heading bg-grey">
                            <h4 class="text-white">Generation</h4>
                        </div>
                        
                        <div class="panel-body">
                        
							<table id="data-table" class="table table-bordered" cellspacing="0" width="100%">
							<thead>
							<tr>
					  <th align="center">Username</th> 
                        <th align="center"><?php echo $LANG["name"]?></th> 
                        <th align="center"><?php echo $LANG["dtsp_joindate"]?></th> 
                        <th align="center">Up line</th> 
                        <th align="center">Level</th>
                        <th align="center">Status</th> 
                        <th align="center"><?php echo $LANG["updd_view"]?></th>
							</tr>
							</thead>
							<tbody>
<?
for($i=0;$i<100;$i++) {
	$db->select("a.id, a.username, a.nama, a.status, a.blokir, a.hp, a.email, a.tgl, a.upline, b.sponsor, b.posisi, b.level", "member as a inner join upline as b on a.username=b.username", "b.upline$i='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
			
		
			if($row[3] > 0) {
				$st = "<button class='btn btn-success btn-xs' type='button' >".$LANG["mbdepo_active"]."</button>";
			} else {
				$st = "<button class='btn btn-danger btn-xs' type='button' >".$LANG["mbdepo_nactive"]."</button>";
			}		
		$userspon=$row[9];
		$namaspon = "SELECT * FROM member WHERE username='$userspon'"; 
	 
        $resultnamaspon = mysql_query($namaspon);


$rownamaspon = mysql_fetch_array($resultnamaspon);
$namaspone = $rownamaspon['nama'];	


		$namar = "SELECT * FROM upline WHERE username='$user_session'"; 
        $resultr = mysql_query($namar);
$rowr = mysql_fetch_array($resultr);
$lvler = $rowr['level'];	
$levele = $row[11]-$lvler;
if($levele < 1){ $levele =""; }else{ $levele=$levele;}
?>				
				
<tr >
                            <td align="center"><?php echo $row[1]; ?></td>
                            <td align="center"><?php echo $row[2]; ?></td>
                            <td align="center"><?php echo formatgl($row[7]); ?></td>
                            <td align="center"><?php echo $namaspone; ?></td>
                            <td align="center">Generation <?php echo $levele; ?></td>
                            <td align="center"><?php echo $st; ?></td>
                            <td align="center">
                           
                          
                          
	
                            
                            </td>
                        </tr>
    
 <?
	
	}
	}
	?>
							</tbody>
							</table>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
			<!-- END PAGE CONTENT -->                       
                      
                            
                             <div class="modal fade" id="ajax" role="basic" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-body">
											<img src="../assets/global/img/loading-spinner-grey.gif" alt="" class="loading">
											<span>
											&nbsp;&nbsp;Loading... </span>
										</div>
									</div>
								</div>
							</div>
                    <?php } ?>