<?php include 'header1.php'; 
//$sql="SELECT count(*) FROM tbl_clients";
//total User
echo $sql="select count(*) as total from tbl_login where Usr_Name!='qiadmin'";
$result=mysqli_query($con,$sql);
$data=mysqli_fetch_assoc($result);

$sql2="select count(*) as total from tbl_login2 where Usr_Name!='qiadmin'";
$result2=mysqli_query($con,$sql2);
$data2=mysqli_fetch_assoc($result2);

$users=$data['total']+$data2['total'];

$sql4="select count(*) as total from tbl_login where status='Deactive' ";
$result4=mysqli_query($con,$sql4);
$exp=mysqli_fetch_assoc($result4);

$sql5="select count(*) as total from tbl_login2 where status='Deactive' ";
$result5=mysqli_query($con,$sql5);
$exp2=mysqli_fetch_assoc($result5);

$expusers=$exp['total']+$exp2['total'];

$date123 = date("Y-m-d");
$date123=date("Y-m-d", strtotime($date123. ' +30 day'));

$sql6="select count(*) as total from tbl_login where status='Active' and DATE(expDate) > '$date123' and Usr_Name not in ('qiadmin','qiadmin2','rasika')";
$result6=mysqli_query($con,$sql6);
$paid=mysqli_fetch_assoc($result6);

$sql7="select count(*) as total from tbl_login2 where status='Active' and DATE(expDate) > '$date123' and Usr_Name not in ('qiadmin','qiadmin2')";
$result7=mysqli_query($con,$sql7);
$paid2=mysqli_fetch_assoc($result7);

$paidusers=$paid['total']+$paid2['total'];
$otherpaid=4;
$paidtotal=$paidusers+$otherpaid;

?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Dashboard1
        <small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard1</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Small boxes (Stat box) -->
      <div class="row">
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-aqua">
            <div class="inner">
              <h3><?php echo $users; ?></h3>

              <p>Total No. of User</p>
            </div>
            <div class="icon">
              <i class="ion ion-bag"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-green">
            <div class="inner">
              <h3><?php echo $users-$expusers; ?></h3>

              <p>Active App User</p>
            </div>
            <div class="icon">
              <i class="ion ion-stats-bars"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-yellow">
            <div class="inner">
              <h3><?php echo $expusers; ?></h3>

              <p>Expired License</p>
            </div>
            <div class="icon">
              <i class="ion ion-person-add"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-red">
            <div class="inner">
              <h3><?php echo $paidusers; ?> + <?php echo $otherpaid; ?> = <?php echo $paidtotal; ?></h3>
              <!-- <h3>65</h3> -->

              <p>30+ Exp Days Users</p>
            </div>
            <div class="icon">
              <i class="ion ion-pie-graph"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div>
        <!-- ./col -->
      </div>
      <!-- /.row -->
      <!-- Main row -->
      <div class="row">
        <!-- Left col -->

        <!-- right col -->
      </div>
      <!-- /.row (main row) -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<?php include 'footer.php'; ?>  