<?php
session_start();
@$userKey = $_SESSION['loginKey'];

if($userKey == "")
{
    echo "<script>window.open('login.php','_self')</script>";
}


include "control/activity.php";
$dd = new activity();


$table = "userdetails";
$condition = " where userKey='$userKey'";
$getuserdetails = $dd->single($table,$condition);
$getMemId = $getuserdetails['my_refral_id'];

 $table = "admin_calculation";
 $condition =null;
 $getAdminDetails = $dd->single($table,$condition);
 $telegram = $getDetailsAdmin['telegram'];
 $fevicon = $getAdminDetails['favicon'];
 
?>



<!DOCTYPE html>
<html lang="en" translate="no">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/svg+xml" href="temp_img/<?= $fevicon; ?>">
    <meta name="google" content="notranslate">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title><?= $getDetailsAdmin['title'];?></title>
    <link rel="stylesheet" href="css/slick.css" />
    <link rel="stylesheet" href="css/modules.css" />
    <link rel="stylesheet" href="css/style.css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/slick.min.js" type="text/javascript"></script>
    <script src="js/main.js" type="text/javascript"></script>
</head>
<body>
    <div id="app">
       <div class="mian myTeam">
         <!--NavBar-->
         <div class="navbar">
            <div class="navbar-fixed" style="background: linear-gradient(90deg, rgb(207, 3, 5) 0%, rgb(242, 63, 58) 100%);">
                <div class="navbar__content">
                    <div data-v-905dfe8c="" class="navbar__content-left" onclick="clicktoBack()"><div data-v-905dfe8c="" class="backIcon"></div></div>
                    <div data-v-905dfe8c="" class="navbar__content-center"><div data-v-905dfe8c="" class="navbar__content-title"> My Team </div></div>
                    <div class="navbar__content-right">
                        <div data-v-7c8bbbf4="" data-v-106b99c8="" class="c-row">
                            <i data-v-7c8bbbf4="" data-v-106b99c8="" class="van-icon van-icon-notes-o" style="font-size: 25px;"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--NavBar-->

        <!--promotion-->
        <div class="promotion">
            <div class="tab">
                <ul class="c-row c-row-between">
                    <li data-v-7c8bbbf4="" onclick="location.href='promotion.php'">Overview</li>
                    <li data-v-7c8bbbf4="" onclick="location.href='myTeam.php'" class="action block-click">My Team</li>
                    <!--<li data-v-7c8bbbf4="" onclick="location.href='promotionDes.php'">Receipt history</li>-->
                    <li data-v-7c8bbbf4="" onclick="location.href='tutorial.php'">Tutorial</li>
                </ul>
            </div>
            <div class="box">
                <div data-v-7c8bbbf4="" class="tit">Live Team(1 Everyone)</div>
                <!--div class="c-row c-row-between p-l-15 p-r-15 m-t-5">
                    <div data-v-0ff6946a="" class="p-r-10">
                        <input data-v-0ff6946a="" type="text" maxlength="5" placeholder="UID" oninput="value=value.replace(/\D/g,'')" class="ipt">
                    </div>
                    <div data-v-0ff6946a="" class="btn c-tc">Search</div>
                </div-->  
                <div class="table">
                    <select class="form-control" onchange="getSelectData()" id="getSelectLevel">
                            <option value="em">Select Level</option>
                            <option value='level_1'>Level-1</option>
                            <option value='level_2'>Level-2</option>
                            <option value='level_3'>Level-3</option>
                            <option value='level_4'>Level-4</option>
                            <option value='level_5'>Level-5</option>
                            <option value='level_6'>Level-6</option>
                            <option value='level_7'>Level-7</option>
                            <option value='level_8'>Level-8</option>
                            <option value='level_9'>Level-9</option>
                            <option value='level_10'>Level-10</option>
                        </select>
<script>
    function getSelectData()
    {
       var iiid = document.getElementById("getSelectLevel").value;
       if(iiid != "em")
       {
           window.open('?lvl='+iiid,'_self');
       }
    }
</script>                        
                        
                        
                        
                        
                        
                    <div class="hd van-row">
                        
                        <div data-v-0ff6946a="" class="c-tc van-col van-col--4" style="width: 60%;">UID</div>
                        <div data-v-0ff6946a="" class="c-tc van-ellipsis van-col van-col--6" style="float : right; margin-right:15px;" >Name</div>
                    </div>  
                    <div class="list">     
                        <div class="van-list">
                            <div id="van-list">
                                <div class="item">
                                    
                                    <?php
                                      if($_REQUEST['lvl'] == "")
                                      {
                                          $condition = " where level_1='$getMemId'";
                                      }else{
                                          $lvl = $_REQUEST['lvl'];
                                          $condition = " where $lvl='$getMemId'";
                                      }
                                      $table = "userdetails";
                                      
                                      $getList = $dd->fetch_multi($table,$condition);
                                      if(count($getList) > 0){
                                        foreach($getList as $key){
                                      ?>
                                     <div class="bd van-row">
                                        <div data-v-0ff6946a="" class="c-tc van-col">ID-<?= $key->my_refral_id; ?></div>
                                        <div data-v-0ff6946a="" class="c-tc van-ellipsis van-col">+91XXXXX<?= substr($key->mobile,5); ?></div>
                                       
                                    </div> 
                                    
                                    <?php     
                                     } }else{
                                    ?>
                                    </div>       
                                </div>  
                                <div class="van-list__finished-text">Not available anymore</div>
                                <div class="van-list__placeholder"></div>    
                            <?php } ?>
                        </div>       
                    </div>       
                </div>       
            </div>
        </div>
        <!--promotion-->
        </div>
        <?php include "footer.php"; ?>
    </div>
</body>
<script>
  function clicktoBack()
  {
    window.open('index.php','_self');
  }
</script>
</html>