<?php    include_once('../config/db.php');  
         include_once('../config/check.php'); 
       //  include_once('../functions/sale/sale.php');


$allleads = $conn->query("SELECT count(*) total FROM  crmlead where branch= '$storeID' ")->fetch();

                          



?>

<!DOCTYPE html>
<html>
<head>
<?php include_once('../inc/slink.php');   ?>  
</head>
<body <?php include_once('../inc/snav.php');  ?>>
<div class="wrapper">

  <!-- Main Header -->
    <header class="main-header">

    <!-- Logo -->
       <?php include_once('../inc/sbrand.php');   ?>

    <!-- Header Navbar -->
    <?php include_once('../inc/snavbar.php');   ?>

  </header>
 
  <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
     <?php include_once('../inc/smenu.php'); ?>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
 

   <section class="content-header" >
                <div class="row">
                    <div class="col-md-12">               
                        <!-- Start -->
                        <div class="box box-success" style="border:solid;border-color:green;border-width:thin; padding-top:0px; padding-bottom:0px;">
                            <div class="box-body without-border" style="border-bottom:solid; border-width:thin;border-color:green; padding-bottom:0px;">
                    
                            <div class="col-lg-3 col-md-6 col-xs-12">
                                <div class="small-box bg-green">
                                    <div class="inner">
                                    <h4 style="font-size:18px; font-weight:800px; font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;" > <i class="fa fa-money fa-lg"></i> All Sales </h4>

                                    <p style="font-size:15px;color:white;"> <?php echo number_format( $allleads['total'], 2); ?> </p>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="col-lg-3 col-md-6 col-xs-12">
                                <div class="small-box bg-yellow">
                                    <div class="inner">
                                    <h4 style="font-size:18px; font-weight:800px; font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;" > <i class="fa fa-money fa-lg"></i> Cash Sales </h4>

                                    <p style="font-size:15px;color:white;"> <?php echo number_format( $allleads['total'], 2); ?>  </p>
                                    </div>
                                    <!-- <a href="#" class="small-box-footer"> <i class="fa fa-arrow-LOCK"></i></a> -->
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-6 col-xs-12">
                                <div class="small-box bg-yellow">
                                    <div class="inner">
                                    <h4 style="font-size:18px; font-weight:800px; font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;" > <i class="fa fa-file-o fa-lg"></i> Invoices  </h4>
                                    <p style="font-size:15px;color:white;"> <?php echo number_format( $allleads['total'] , 2); ?> </p>
                                    </div>
                                
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-6 col-xs-12">
                                <div class="small-box bg-red">
                                    <div class="inner">
                                    <h4 style="font-size:18px; font-weight:800px; font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;" >  <i class="fa fa-times fa-lg"></i> Balances  </h4>
                                    <p style="font-size:15px;color:white;"> <?php echo number_format( $allleads['total'], 2); ?> </p>
                                    </div>
                                
                                </div>
                            </div>

                            </div>

                            <!-- <div class="box-footer">                     -->
                    
                            <!-- <div class="col-sm-3 col-xs-6">
                            <div class="description-block border-right" style="border-color:green;" >
                                <h5 class="description-header"><?php echo ""; ?></h5>
                                <span class="description-text">TOTAL SALES </span>
                            </div>
                            </div>
                            <div class="col-sm-3 col-xs-6">
                            <div class="description-block border-right" style="border-color:green;" >
                                <h5 class="description-header"><?php echo "$"; ?></h5>
                                <span class="description-text">Cash Sales </span>
                            </div>
                            </div> -->
                            <!-- /.col -->
                        
                            <!-- /.col -->
                            <!-- <div class="col-sm-3 col-xs-6">
                            <div class="description-block border-right" style="border-color:green;">
                                <h5 class="description-header"> <?php echo "$"; ?> </h5>
                                <span class="description-text"> Invoices </span>
                            </div>
                            </div>
                       
                            <div class="col-sm-3 col-xs-6">
                            <div class="description-block" style="border-color:green;" >
                                <h5 class="description-header"><?php echo "$"; ?></h5>
                                <span class="description-text"> BALANCES </span>
                            </div>
                            </div> -->
                        <!-- </div> -->
                           
                                
                    </div>
                </div>
                <!-- second row-->
                      <div class="row">
                            <div class="col-md-12">  
                                                                      
                            </div>
                            
                          
                           
                             <!-- second Row data -->
                                <div class="col-md-12">
                                  <!-- BAR CHART -->
                                    <div class="col-md-8">                                   
                                        <div class="box box-default" style="border:solid;border-color:white;border-width:thin;" >
                                               <div class="box-header with-border" style="background-color:white;color:white;" >
                                                  <h5 class="box-title" style="color:green;"> All Leads by Month </h5> 
                                                </div>          
                                                <div class="box-body" >
                                                   <canvas id="mycanvas"></canvas>
                                                     
                                                </div>
                                            
                                        </div>
                                    </div>
                                     <!-- END BAR CHART -->                            
                                     <!-- PIE CHART -->
                                    <div class="col-md-4">
                                       <div class="box box-sucess"  class="bg-white" style="border:solid;border-width:thin;">
                                              <!-- DONUT CHART -->                                         
                                              <div class="box-header with-border" style="background-color:white;color:white;">
                                                <h3 class="box-title" style="color:green;">  All leads by products </h3>

                                                <div class="box-tools pull-right">
                                                  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                                  </button>
                                                  <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                                                </div>
                                              </div>
                                              <div class="box-body">
                                                <canvas id="mycanvaspie" ></canvas>
                                              </div>                                            
                                               <!-- /.box -->
                                        </div>
                                    </div>
                                    <!-- END PIE CHART -->


                                </div>
                             <!-- END SECOND ROW -->
                             <!-- THIRD ROW -->
                              <div class="col-md-12">
                                   <!-- BAR CHART -->
                                  
                                   <!-- END BAR CHART -->                            
                                </div>
                             <!-- END THIRD ROW -->

                          </div>
       </div>
   </section>


  
  

   
</div>
  <!-- /.content-wrapper -->
  
  <!-- Main Footer -->
  <footer class="main-footer">
    <?php  include_once('../inc/sfooter.php'); ?>
  </footer>
  
</div>
<?php include_once('../inc/slinkjs.php') ?>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    
    <?php include('analytics/load.php') ?>


</body>
</html>










