<?php
include "header.php";
?>
<!-- Main Working Space Start -->
<div class="col-md-12 mt-4" style="height: 73vh;">
    <div class="card my-4">
        <div class="col-md-12 card-header ">
                <div class="row">
                  <div class="col-md-3 ">
                    <h4 class=""><b>Leads Dahboard</b></h4>
                  </div>
                  <div class="col-md-6">
                    <nav style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
                        <ol class="breadcrumb mt-2">
                            <!-- <li class="breadcrumb-item"><a href="index.php">Projection</a></li> -->
                            <!-- <li class="breadcrumb-item active" aria-current="page">Projection List</li> -->
                        </ol>
                    </nav>
                  </div>
                </div>
            </div>
        </div>
        <div class="card-body">
            <div class="col-md-12">
                <div class="row">
                    <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css /> -->
<div class="container">
    <div class="row">
        <div class="col-md-3 col-sm-6">
            <div class="serviceBox">
                <div class="service-icon">
                    <span><i class="fa fa-globe"></i></span>
                </div>
<?php
include  "dbconfig.php";
$link =opencon();
$total = "SELECT COUNT(Lead_Status) as total FROM new_lead";
$total_exe = mysqli_query($link,$total);
while($total_qr = mysqli_fetch_array($total_exe)){
?>
                <h3 class="title"><?php echo $total_qr['total']; }?></h3>
                <h3>Total Leads</h3>
<?php
$sql1="SELECT COUNT(Lead_Status) as assigned FROM new_Lead WHERE Team_Manager!=''";
$sql1_exe = mysqli_query($link,$sql1);
while($assigned_qr=mysqli_fetch_array($sql1_exe)){
?>
                <p class="mt-4"><span style="float: left;"><b>Assigned :</b></span><span style="float: right;"><b><?php echo $assigned_qr['assigned']; }?></b></span></p><br>
<?php
$sql2="SELECT COUNT(Lead_Status) as not_assigned FROM new_Lead WHERE Team_Manager=''";
$sql2_exe = mysqli_query($link,$sql2);
while($assigned2_qr=mysqli_fetch_array($sql2_exe)){
?>            
                <p class="mt-3"><span style="float: left;"><b>Not Assigned :</b></span><span style="float: right;"><b><?php echo $assigned2_qr['not_assigned']; }?></b></span></p>
                <!-- <p class="description">Lorem ipsum dolor sit amet conse ctetur adipisicing elit. Qui quaerat fugit quas veniam perferendis repudiandae sequi, dolore quisquam illum.</p> -->
            </div>
        </div>
        <div class="col-md-3 col-sm-6">
            <div class="serviceBox blue">
                <div class="service-icon">
                    <span><i class="fa fa-rocket"></i></span>
                </div>
<?php 
$assign = "SELECT COUNT(Lead_Status) as assign FROM new_lead WHERE Lead_Status='Pipeline' OR Lead_Status='Sure Pipeline' OR Lead_Status='Projected' OR Lead_Status='Not Interested'";
$assign_exe = mysqli_query($link,$assign);
while($assigned_qr= mysqli_fetch_array($assign_exe)){
?>
                <h3 class="title"><?php echo $assigned_qr['assign']; }?></h3>
                <h3>Assigned Leads</h3>
<?php
$connected = "SELECT COUNT(Lead_Status) as connected FROM new_lead WHERE Lead_Status='Pipeline' OR Lead_Status='Sure Pipeline' OR Lead_Status='Projected'";
$connected_exe = mysqli_query($link,$connected);
while($connected_qr= mysqli_fetch_array($connected_exe)){
?>
                <p class="mt-3"><span style="float: left;"><b>Connected :</b></span><span style="float: right;"><b><?php echo $connected_qr['connected']; }?></b></span></p><br>
<?php
$sql1 = "SELECT COUNT(Lead_Status) as not_interest FROM new_lead WHERE Lead_Status='Not Interested'";
$sql1_exe = mysqli_query($link,$sql1);
while($sql1_fetch=mysqli_fetch_array($sql1_exe)){
?>
                <p class="mt-3"><span style="float: left;"><b>Not Connected :</b></span><span style="float: right;"><b><?php echo $sql1_fetch['not_interest']; }?></b></span></p><br>
                <!-- <p class="description">Lorem ipsum dolor sit amet conse ctetur adipisicing elit. Qui quaerat fugit quas veniam perferendis repudiandae sequi, dolore quisquam illum.</p> -->
            </div>
        </div>
        <div class="col-md-3 col-sm-6">
            <div class="serviceBox yellow">
                <div class="service-icon">
                    <span><i class="fa fa-globe"></i></span>
                </div>
<?php
$connected = "SELECT COUNT(Lead_Status) as connected FROM new_lead WHERE Lead_Status='Pipeline' OR Lead_Status='Sure Pipeline' OR Lead_Status='Projected'";
$connected_exe = mysqli_query($link,$connected);
while($connected_qr= mysqli_fetch_array($connected_exe)){
?>
                <h4 class="title"><?php echo $connected_qr['connected']; }?></h4>
                <h3>Connected Leads</h3>
<?php
$sql1 = "SELECT COUNT(Lead_Status) as pipeline FROM new_lead WHERE Lead_Status='Pipeline'";
$sql1_exe = mysqli_query($link,$sql1);
while($sql1_fetch=mysqli_fetch_array($sql1_exe)){
?>
                <p class=""><span style="float: left;"><b>Pipeline :</b></span><span style="float: right;"><b><?php echo $sql1_fetch['pipeline']; }?></b></span></p><br>
<?php
$sql1 = "SELECT COUNT(Lead_Status) as sure_pipeline FROM new_lead WHERE Lead_Status='Sure Pipeline'";
$sql1_exe = mysqli_query($link,$sql1);
while($sql1_fetch=mysqli_fetch_array($sql1_exe)){
?>
                <p class="mt-1"><span style="float: left;"><b>Sure Pipeline :</b></span><span style="float: right;"><b><?php echo $sql1_fetch['sure_pipeline']; }?></b></span></p><br>
<?php
$sql1 = "SELECT COUNT(Lead_Status) as projection FROM new_lead WHERE Lead_Status='Projected'";
$sql1_exe = mysqli_query($link,$sql1);
while($sql1_fetch=mysqli_fetch_array($sql1_exe)){
?>
                <p><span style="float: left;"><b>Projected :</b></span><span style="float: right;"><b><?php echo $sql1_fetch['projection']; }?></b></span></p><br>
                <!-- <p class="description">Lorem ipsum dolor sit amet conse ctetur adipisicing elit. Qui quaerat fugit quas veniam perferendis repudiandae sequi, dolore quisquam illum.</p> -->
            </div>
        </div>
        <div class="col-md-3 col-sm-6">
            <div class="serviceBox darkblue">
                <div class="service-icon">
                    <span><i class="fa fa-rocket"></i></span>
                </div>
<?php
$sql1 = "SELECT COUNT(Lead_Status) as not_interest FROM new_lead WHERE Lead_Status='Not Interested'";
$sql1_exe = mysqli_query($link,$sql1);
while($sql1_fetch=mysqli_fetch_array($sql1_exe)){
?>
                <h3 class="title"><b><?php echo $sql1_fetch['not_interest']; ?></b></h3>
                <h3>Not Connected Leads</h3>
                <p class="mt-3"><span style="float: left;"><b>Not Interested :</b></span><span style="float: right;"><b><?php echo $sql1_fetch['not_interest']; }?></b></span></p><br>
                <!-- <p class="description">Lorem ipsum dolor sit amet conse ctetur adipisicing elit. Qui quaerat fugit quas veniam perferendis repudiandae sequi, dolore quisquam illum.</p> -->
            </div>
        </div>
    </div>
</div>
                </div>
            </div>
            <!-- <div style="border-radius:82% 18% 81% 19% / 15% 83% 17% 85% ; height: 250px; width: 450px; background-image: linear-gradient(red, yellow);"></div> -->
        </div>
    
</div>


<!-- Main Working Space End -->



<?php
include "footer.php";
?>