<?php
	include "admin_top_menu.php";
	include "admin_side_menu.php";
?>
  
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Dashboard
        <small>Version 2.1</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Info boxes -->
      <div class="row">
        <div class="col-md-3 col-sm-6 col-xs-12">
		<a href="swatch_display.php">
          <div class="info-box">
            <span class="info-box-icon bg-aqua"><i class="fa fa-files-o"></i></span>
            <div class="info-box-content">
              <span class="info-box-text">Products</span>
              <span class="info-box-number">
				<?php
					$query = mysqli_query($conn,"SELECT count(sid) FROM swatch")or die(mysqli_error($conn));
					$row = mysqli_fetch_array($query);
					echo $row['count(sid)'];
				?>
			  </span>
            </div>
            <!-- /.info-box-content -->
          </div></a>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
		
        <div class="col-md-3 col-sm-6 col-xs-12">
		<a href="customer.php">
          <div class="info-box">
            <span class="info-box-icon bg-red"><i class="fa fa-users"></i></span>
            <div class="info-box-content">
              <span class="info-box-text">Customers</span>
              <span class="info-box-number">
				<?php
					$query = mysqli_query($conn,"SELECT count(cus_id) FROM customer")or die(mysqli_error($conn));
					$row = mysqli_fetch_array($query);
					echo $row['count(cus_id)'];
				?>
			  </span>
            </div>
            <!-- /.info-box-content -->
          </div></a>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->

        <!-- fix for small devices only -->
        <div class="clearfix visible-sm-block"></div>

        <div class="col-md-3 col-sm-6 col-xs-12">
		<a href="report.php">
          <div class="info-box">
            <span class="info-box-icon bg-green"><i class="fa fa-envelope-o"></i></span>
            <div class="info-box-content">
              <span class="info-box-text">Transactions</span>
              <span class="info-box-number">
				<?php
					$count=0;
					$qry=mysqli_query($conn,"SELECT * FROM track_sample t, customer c, swatch s where t.cus_id=c.cus_id and t.sw_id=s.sid")or die(mysqli_error($conn));
					while($row=mysqli_fetch_array($qry))
					{
						$count++;
					}
					echo $count;
				?>
			  </span>
            </div>
            <!-- /.info-box-content -->
          </div></a>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
		
        <div class="col-md-3 col-sm-6 col-xs-12">
		<a href="manufacturer.php">
          <div class="info-box">
            <span class="info-box-icon bg-yellow"><i class="fa fa-user"></i></span>
            <div class="info-box-content">
              <span class="info-box-text">Manufacturar</span>
              <span class="info-box-number">
				<?php
					$query = mysqli_query($conn,"SELECT count(mid) FROM manufacturer")or die(mysqli_error($conn));
					$row = mysqli_fetch_array($query);
					echo $row['count(mid)'];
				?>
			  </span>
            </div>
            <!-- /.info-box-content -->
          </div></a>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
		
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

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

  
  