| Current Path : /home2/wtmwscom/public_html/member/ |
| Current File : /home2/wtmwscom/public_html/member/downline_active.php |
<?php
$title= "Total Downline Active Distributor";
include 'header.php';
include_once('lib/ps_pagination.php');
$uid = $_SESSION['userid'];
$child_ids = get_child_ids($uid);
$uids = '';
foreach($child_ids as $key => $level){
foreach($level as $key => $value){
if($uids==''){
$uids = $value;
}
else{
$uids .= ', '.$value;
}
}
}
?>
<h1>Total Downline Active Distributor</h1>
<section>
<?php echo getMessage();?>
<section>
<table style="width: 100%;">
<thead>
<tr>
<th>S. No.</th>
<th>User Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Placement Id</th>
<th>Sponsor Id</th>
<th>Position</th>
<th>Register Date</th>
</tr>
</thead>
<?php
$query = "SELECT uid, login_id, refer_id, name, mobile, placement_id, position, reg_date FROM `user` WHERE `uid` IN ($uids) AND `uid`!='".$uid."' AND active_distributor=1 ORDER BY `reg_date` DESC";
if(!isset($_GET['page'])){ $i=1; }else{$i=(($_GET['page']-1)*20)+1;}
$pager = new PS_Pagination($link, $query, 20, 5);
$pager->setDebug(true);
$result = $pager->paginate();
if($result){?>
<tbody>
<?php
while($row = mysqli_fetch_object($result)){
$placement = mysqli_fetch_object(mysqli_query($connection, "SELECT login_id, name FROM user WHERE uid='$row->placement_id'"));
$sponsor = mysqli_fetch_object(mysqli_query($connection, "SELECT login_id, name FROM user WHERE uid='$row->refer_id'"));
?>
<tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?>>
<td><?php echo $i; ?></td>
<td><?php echo $row->login_id;?></td>
<td><?php echo $row->name;?></td>
<td><?php echo $row->mobile;?></td>
<td><?php echo $placement->name." (".$placement->login_id.")";?></td>
<td><?php echo $sponsor->name." (".$sponsor->login_id.")";?></td>
<td><?php echo $row->position== "L" ?"ORG1":"ORG2";?></td>
<td><?php echo date("d M, Y h:i A", strtotime($row->reg_date)); ?></td>
</tr>
<?php $i++;}?>
</tbody>
<?php }?>
</table>
<?php echo $pager->renderFullNav();?>
</section>
<?php include 'footer.php';?>