<?php
session_start();

// Check if the user is logged in
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) {
    header("Location: login.php");
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Leads Dashboard</title>

    <!-- Custom fonts for this template-->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">

</head>

<body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

            <!-- Sidebar - Brand -->
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
                <div class="sidebar-brand-icon rotate-n-15">
                    <i class="fas fa-laugh-wink"></i>
                </div>
                <div class="sidebar-brand-text mx-3">Campaigns<sup>gtp</sup></div>
            </a>

            <!-- Divider -->
            <hr class="sidebar-divider my-0">

            <!-- Nav Item - Dashboard -->
            <li class="nav-item active">
                <a class="nav-link" href="dash.php">
                    <i class="fas fa-fw fa-tachometer-alt"></i>
                    <span>Dashboard</span></a>
            </li>
                   <hr class="sidebar-divider my-0">
            <li class="nav-item active">
                <a class="nav-link" href="news.php">
                    <!--<i class="fas fa-fw fa-tachometer-alt"></i>-->
                    <span>Newsletter</span></a>
            </li>

            
            <!-- Sidebar Toggler (Sidebar) -->
            <div class="text-center d-none d-md-inline">
                <button class="rounded-circle border-0" id="sidebarToggle"></button>
            </div>
           
        </ul>
        <!-- End of Sidebar -->

        <!-- Content Wrapper -->
        <div id="content-wrapper" >

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                    <!-- Sidebar Toggle (Topbar) -->
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>

                   

                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">


                        <div class="topbar-divider d-none d-sm-block"></div>

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo $_SESSION["username"];?></span>
                                <img class="img-profile rounded-circle"
                                    src="img/undraw_profile.svg">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                                
                                <a class="dropdown-item" href="logout.php" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>

                            </div>
                        </li>

                    </ul>

                </nav>
                <!-- End of Topbar -->
                
                
                
                <!-- Begin Page Content-->
<div class="container-xl px-4 mt-n10" bis_skin_checked="1">
    
   <h3>Main form Leads </h3> 
<div class="row" bis_skin_checked="1" style="Padding-top:20px;">
   
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-primary text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Total Leads</div>
                                                    <?php 
  
$con = mysqli_connect("localhost","collinsg_camgtpu","dh+z9*R*V0mR","collinsg_camgtpu"); 


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from campaignleads"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar feather-xl text-white-50"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                        <a class="text-white stretched-link" href="dashboard.php">View </a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-warning text-white h-100" bis_skin_checked="1">
                                         <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from campaignleads WHERE status='0'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                    <div class="card-body" bis_skin_checked="1">
                                                
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Lead Pending</div>
                                                                                    
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                
                                           
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign feather-xl text-white-50"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="leads.php?status='.preg_replace('#[-]+#','-',trim(0)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                        <?php     } 
  

  
?> 
             
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-success text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads in Progress</div>
                                                                                                <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from campaignleads WHERE status='1'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
             
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-square feather-xl text-white-50"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="leads.php?status='.preg_replace('#[-]+#','-',trim(1)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-danger text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads Answered</div>
                                                   <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from campaignleads WHERE status='2'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-circle feather-xl text-white-50"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="leads.php?status='.preg_replace('#[-]+#','-',trim(2)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                         <h3>Popup form Leads </h3> 
<div class="row" bis_skin_checked="1" style="Padding-top:20px;">
   
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-primary text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Total Leads</div>
                                                    <?php 
  



  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from pop_up"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar feather-xl text-white-50"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                        <a class="text-white stretched-link" href="popup_leads.php">View </a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-warning text-white h-100" bis_skin_checked="1">
                                         <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from pop_up WHERE status='0'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                    <div class="card-body" bis_skin_checked="1">
                                                
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Lead Pending</div>
                                                                                    
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                
                                           
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign feather-xl text-white-50"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="pop_up_leads.php?status='.preg_replace('#[-]+#','-',trim(0)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                        <?php     } 
  

  
?> 
             
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-success text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads in Progress</div>
                                                                                                <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from pop_up WHERE status='1'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
             
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-square feather-xl text-white-50"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="pop_up_leads.php?status='.preg_replace('#[-]+#','-',trim(1)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-danger text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads Answered</div>
                                                   <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from pop_up WHERE status='2'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-circle feather-xl text-white-50"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="pop_up_leads.php?status='.preg_replace('#[-]+#','-',trim(2)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        
                           <h3>Contact form Leads </h3> 
<div class="row" bis_skin_checked="1" style="Padding-top:20px;">
   
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-primary text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Total Leads</div>
                                                    <?php 


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from contact"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar feather-xl text-white-50"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                        <a class="text-white stretched-link" href="contact_leads.php">View </a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-warning text-white h-100" bis_skin_checked="1">
                                         <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from contact WHERE status='0'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                    <div class="card-body" bis_skin_checked="1">
                                                
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Lead Pending</div>
                                                                                    
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                
                                           
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign feather-xl text-white-50"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="con_leads.php?status='.preg_replace('#[-]+#','-',trim(0)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                        <?php     } 
  

  
?> 
             
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-success text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads in Progress</div>
                                                                                                <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from contact WHERE status='1'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
             
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-square feather-xl text-white-50"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="con_leads.php?status='.preg_replace('#[-]+#','-',trim(1)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-xl-3 mb-4" bis_skin_checked="1">
                                <div class="card bg-danger text-white h-100" bis_skin_checked="1">
                                    <div class="card-body" bis_skin_checked="1">
                                        <div class="d-flex justify-content-between align-items-center" bis_skin_checked="1">
                                            <div class="me-3" bis_skin_checked="1">
                                                <div class="text-white-75 small" bis_skin_checked="1">Leads Answered</div>
                                                   <?php 
  


  
    // SQL query to display row count 
    // in building table 
    $sql = "SELECT * from contact WHERE status='2'"; 
  
    if ($result = mysqli_query($con, $sql)) { 
  
    // Return the number of rows in result set 
    $rowcount = mysqli_num_rows( $result ); 

?>
                                                <div class="text-lg fw-bold" bis_skin_checked="1"><?php echo $rowcount;?></div>
                                    <?php     } 
  

  
?> 
                                            </div>
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-circle feather-xl text-white-50"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>
                                        </div>
                                    </div>
                                    <div class="card-footer d-flex align-items-center justify-content-between small" bis_skin_checked="1">
                                       <?php echo' <a class="text-white stretched-link" href="con_leads.php?status='.preg_replace('#[-]+#','-',trim(2)).'">'?>View Leads</a>
                                        <div class="text-white" bis_skin_checked="1"><svg class="svg-inline--fa fa-angle-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 41.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"></path></svg><!-- <i class="fas fa-angle-right"></i> Font Awesome fontawesome.com --></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                         
                        
                        </div>


           <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy;  2024</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="logout.php">Logout</a>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin-2.min.js"></script>

    <!-- Page level plugins -->
    <script src="vendor/chart.js/Chart.min.js"></script>

    <!-- Page level custom scripts -->
    <script src="js/demo/chart-area-demo.js"></script>
    <script src="js/demo/chart-pie-demo.js"></script>
    

</body>

</html>