<?php 
session_start();
$ref=$_GET['ref'];
if($ref=='market_ahr7n@1')
{
    $user_con_join="";
}
else
{
if($_SESSION["loggedin"]!=TRUE)
{
   	echo "<script>window.location='index.php?login=error';</script>";
} 
}

// session_regenerate_id();
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
$site_url="https://re.hrdandrecruitments.com/leads/";
$user_id=$_SESSION["session_id"];
$session_fullname=$_SESSION["fullname"];
$team_manager_session=$_SESSION['team_manager'];
   if($user_id!=1)
{
    $user_con=" and team_manager='$session_fullname'";
}
else
{
    
}


?>

<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>PROVINCIA</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
   
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i,800" rel="stylesheet">
    
    <link rel="stylesheet" href="css/bootstrap.min.css">
    
    <link rel="stylesheet" href="css/font-awesome.min.css">
    
    <link rel="stylesheet" href="css/adminpro-custon-icon.css">
    
    <link rel="stylesheet" href="css/meanmenu.min.css">
   
    <link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css">
    
    <link rel="stylesheet" href="css/animate.css">
   
    <link rel="stylesheet" href="css/normalize.css">
   
    <link rel="stylesheet" href="css/tab-menus.css">
    
    <link rel="stylesheet" href="css/tabs.css">
    
    <link rel="stylesheet" href="style.css">
     <link rel="stylesheet" href="css/select2/select2.min.css">
      <link rel="stylesheet" href="css/chosen/bootstrap-chosen.css">
      
    
    <link rel="stylesheet" href="css/responsive.css">
    
      <link rel="stylesheet" href="css/data-table/bootstrap-table.css">
    <link rel="stylesheet" href="css/data-table/bootstrap-editable.css">
    
    <script src="js/vendor/modernizr-2.8.3.min.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css">
<style>
body
{
    font-family: "Merriweather Sans", sans-serif !important;
    font-optical-sizing: auto;
    font-weight: <weight>;
    font-style: normal;  
}
</style>
    <style>
        .ddback{
            background-color: #d9d9d9 !important;
        }
    </style>
</head>

<body class="materialdesign">
   
    <div class="wrapper-pro">
        <div class="left-sidebar-pro">
            <nav id="sidebar" style="width: 10%;" >
                <div class="sidebar-header" >
                <?php if(in_array("project_dashboard1",$arr)){ ?>
                 <a href="main_dashboard.php"><img src="https://static.vecteezy.com/system/resources/previews/005/601/782/non_2x/world-education-logo-design-vector.jpg" alt="" />
                    </a>
                <?php }else{ ?>  <a href="#"><img src="https://static.vecteezy.com/system/resources/previews/005/601/782/non_2x/world-education-logo-design-vector.jpg" alt="" />
                    </a>
        <?php } ?> 
                    <h3>LEADS</h3>
                    
                    <p></p>
                    <strong></strong>
                </div>
                <div class="left-custom-menu-adp-wrap">
                    <ul class="nav navbar-nav left-sidebar-menu-pro" >
                        
                        
                          
                          <li class="nav-item"><a href="#" data-toggle="dropdown" role="button" aria-expanded="false" class="nav-link dropdown-toggle"><i class="fa big-icon fa-pie-chart"></i> <span class="mini-dn">Lead Details</span> <span class="indicator-right-menu mini-dn"><i class="fa indicator-mn fa-angle-left"></i></span></a>
                            <div role="menu" class="dropdown-menu left-menu-dropdown animated flipInX ddback ">
                              
                                     <?php                          
                             if($team_manager_session=="Admin")
    {
      ?>
       <a href="new_lead.php" class="dropdown-item">Add New Lead</a>
      <?php
    }
    
    ?>
                      
                                
                                
                               
                                       
                                <a href="lead_list.php" class="dropdown-item">Total Leads</a>
      <?php                          
                             if($team_manager_session=="Admin")
    {
      ?>
        <a href="assign_leads.php" class="dropdown-item">Lead Generated Dashboard</a>
      <?php
    }
    
    ?>
                              
                              
                                 
                             
                               <a href="lead_dashboard.php" class="dropdown-item">Lead Assigned Dashboard</a>
                               

                                
                            </div>
                        </li>
                        
                        
                       
                        
                        
                        
                      
                                
                                
                        
                   
                                

                                                
                     
                        
                      
                          
                      
                    </ul>
                </div>
            </nav>
        </div>
        <!-- Header top area start-->
        <div class="content-inner-all">
             <div class="header-top-area">
                <div class="fixed-header-top">
                    <div class="container-fluid">
                        <div class="row">
                           
                            <div class="col-lg-10 col-md-1 col-sm-1 col-xs-12">
                                <div class="header-top-menu tabl-d-n">
                                    <ul class="nav navbar-nav mai-top-nav">
                                        
                                         <li class="nav-item"><button type="button" id="sidebarCollapse" class="btn bar-button-pro header-drl-controller-btn btn-info navbar-btn">
                                    <i class="fa fa-bars"></i>
                                </button>
                                <div class="admin-logo logo-wrap-pro">
                                    <a href="#"><img src="img/logo/log.png" alt="" />
                                    </a>
                                </div>
                                        </li>
                                        
                                        
                                        
                                
                                 
                                    </ul>
                                </div>
                            </div>
                            <div class="col-lg-2 col-md-5 col-sm-6 col-xs-12">
                                <div class="header-right-info">
                                    <!-- <ul class="nav navbar-nav mai-top-nav header-right-menu">-->
                                   
                                                
                                                
                                                
                                                
                                    <!--        </ul>-->
                                    <!--    </li>-->
                                        
                                    <!--</ul>-->
                                    <ul class="nav navbar-nav mai-top-nav header-right-menu">
                                        
                                        <?php
                                         $server = "localhost";
    $user = "hrdant7r_market";
    $password = "gAw=6Y79}FDN";
    $db = "hrdant7r_market";

    $conn = new mysqli($server,$user,$password,$db);
                                        if($_SESSION["fullname"]=='Pashmi')
                                        {
                                            ?>
                                                       <li class="nav-item">
                                            <a href="#" data-toggle="dropdown" role="button" aria-expanded="false" class="nav-link dropdown-toggle">
                                                <span class="adminpro-icon adminpro-user header-riht-inf"></span>
                                                <span class="admin-name">Module Users</span>
                                                <span class="author-project-icon adminpro-icon adminpro-down-arrow"></span>
                                            </a>
                                            <ul role="menu" class="dropdown-header-top author-log dropdown-menu animated flipInX">
                                             
                                             <?php
                                             
                       
                                             
                                             $sql = "SELECT * FROM leads_accounts where id!='1' ";

$sql_exe = mysqli_query($conn,$sql);

while($fetch_qr = mysqli_fetch_array($sql_exe)){
$username=$fetch_qr['username'];
$password=$fetch_qr['password'];
$fullname=$fetch_qr['fullname'];
?>
                                             
                                                <li><a target="_blank" href="login.php?user=<?php echo $username;?>&pass=<?php echo $password;?>"><?php echo $fullname;?></a>
                                                </li>
                                                
                                                <?php
}
                                                ?>
                                            
                                            <?php
                                        }
                                 ?>
                                        
                                        
                                                <li style="font-size:14px"><a style="font-size:15px" href="logout.php"><span class="adminpro-icon adminpro-locked author-log-ic"></span>Log Out</a>
                                                </li>
                                     
                                        
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div> 
            
<!--            <script>-->




<!--    function menucorrect(event)-->
<!--    {-->
   
        
       
<!--            var testDiv1 = event.target.parentElement;-->
<!--            var testDiv = testDiv1.getElementsByTagName("div")[0];-->
            
<!--           let rect = testDiv1.getBoundingClientRect();-->
<!--           var Y=rect.y;-->
<!--              console.log(testDiv1);-->

<!--    testDiv.style.marginTop=Y+"px";-->
<!--     testDiv.style.position="fixed";-->
            
        
<!--    }-->
    
    
<!--    window.addEventListener("load",addclick);-->
    
       

<!--    function addclick()-->
<!--    {-->
<!--          var length=document.getElementsByClassName("nav-item1").length;-->
        
<!--        for(var i=0;i<length;i++)-->
<!--        {-->
<!--          document.getElementsByClassName("nav-item1")[i].addEventListener("click",menucorrect); -->
<!--        } -->
<!--    }-->

    
<!--</script>  -->