<?php 
ob_start();
session_start();
if($_SESSION['userid']=="")
{
	header("location:index.php?msg1=notauthorized");
	exit();
}
	
	?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Report Dashboard</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="plugins/morris/morris.css">
  <!-- jvectormap -->
  <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  <!-- Date Picker -->
  <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
  <!-- bootstrap wysihtml5 - text editor -->
  <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

  
</head>
<body class="hold-transition skin-red sidebar-mini">
<div class="wrapper">
<?php include ("include/connection.php");?>
<?php include ("include/header.inc.php");?>
 
 <?php include ("include/navigation.inc.php");
function counter($table){
$rs=mysql_query("select count(*) from `$table`");
$row = mysql_fetch_row($rs);
return $row["0"];
} 
 
 ?> 

  
  <div class="content-wrapper">
  
    <section class="content-header">
      <h1>
        Report
        
      </h1>
      <ol class="breadcrumb">
        <li><a href="desktop.php"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Report</li>
      </ol>
    </section>

    
    <section class="content">
      
      <div class="row">
        
      </div>
     
     
    <div id="reportdata">
        
    </div>
    
        <div class="col-sm-6">
              <div class="form-group">
              <label>From Date</label>
              <input type="date" class="form-control"  name="fromdate" id="fromdate" required>
              </div>
              </div>    
              <div class="col-sm-6">
              <div class="form-group">
              <label>To Date</label>
              <input type="date" class="form-control"  name="todate" id="todate" required>
              </div>
              </div>  
             
              <div class="text-center">
  
 <input type="submit" class="btn btn-primary" value="Submit" onclick="myfunction()"  name="submit" ></div>
                
               <br><br><br>
    
<script>
  function myfunction()
  {
      var fromdate = document.getElementById("fromdate").value;
      var todate = document.getElementById("todate").value;
                   $.ajax({
                url: "ajax_report.php",
                type: "POST",
                data: { fromdate: fromdate, todate : todate },
               success : function(data){
                document.getElementById("reportdata").innerHTML = data;
                //alert(data);        
               }
            });
 
  }
</script>
     
    
    </section>
  
  </div>
  
  <?php include("include/footer.inc.php");?>
<script src="dist/js/pages/dashboard.js"></script>

</div>



</body>
</html>
