
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Maksoft-POS</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" href="css/bootstrap.min.css">
   <link rel="stylesheet" href="css/datepicker.css">
   <link rel="stylesheet"href="xcss/custom.css">
   <link rel="stylesheet" href="css/footerstyle.css">
  <script src="js/jquery-1.9.1.min.js"></script>
  <script src="js/jquery.browser.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
   <script src="js/bootstrap-datepicker.js"></script>
    <script  src="js/jquery.printElement.js"></script>
    <script  src="js/myfucntions.js"></script>
    <style>
    body {
        background-image: url("img/bg.jpg") !important;
        background-color: #cccccc !important;
    }
    </style>
</head>
<script>
 $(document).ready(function(){
   var accesscode=151;
   check_Allow_Deny(accesscode);
  get_usersoptionList();
  Curr_Date();
	 $("#fdate").datepicker({
		 dateFormat:"yy-mm-dd"
	 });

   $("#tdate").datepicker({
     dateFormat:"yy-mm-dd"
   });

   function Curr_Date(){
    var jaxData="globeVar=10";
      $.ajax({
           type:"POST",url:"listcats.php",data:jaxData
           ,cache:false,
           success:function(response){
             //alert(response);
                         // alert(response);
     //$("#fdate").val(response);
      $("#fdate").val(response);

               }

           });//end of ajax call

   }

   function get_tankoptions(){

     var jaxData="globeVar=77";
      $.ajax({
           type:"POST",url:"listcats.php",data:jaxData
           ,cache:false,
           success:function(response){
             //alert(response);
                         // alert(response);
     $("#tank_names").html(response);

               }

           });//end of ajax call


   }


         $("#btn_report").click(function(){
         $("#errorzone").html("");
         var fromdate=$("#fdate").val();
         var staffid=$("#staffname").val();
         var itemData="date="+fromdate;
         //alert(itemData);
         $.ajax({
             type:"POST",url:"tanksummary.php",data:itemData,cache:false,
             beforeSend:function(){
   	        	$("#btn_report").html('<span id="spinoff" class="glyphicon"></span>Fetching Data....');
   $("#spinoff").addClass("glyphicon-refresh glyphicon-refresh-animate");
   //$("#viewclass").disable(true);

   		        },
             success:function(response){
                // alert(response);

                        $("#tablezone").html(response);


             },
             complete:function(){
                       //alert(rep);
              $("#btn_report").html("View Sales Analysis Report");
              $("#spinoff").removeClass("glyphicon-refresh glyphicon-refresh-animate");
              //$("#viewclass").disable(false);
              }


         });
         });



 });
</script>
<body>
    <?php
    include 'nav.php';
    ?>

  <div class='container-fluid'  id="content_zone">
    <div id='grnzone'>
<div class="row">
    <div class='col-sm-9'>
        <div class="col-sm-3">

          <div class="form-group">
            <label for="date">Date:</label>
                <input type="text" class="form-control input-sm" id="fdate" name="fdate">
          </div>

          <div clas='form-group' style="align:right;">
          <button type="button"  id="btn_report" class='btn btn-danger btn-block'>View Tank Analysis Report</button>
          </div>


        </div>

    </div>
<div class='col-sm-3'>

</div>
</div>

<div class='row'>
  <div class='container-fluid'>

    <div class='panel panel-default'>
    <div class="panel-heading">Tank Fuel Analysis</div>
    <div class="panel-body">
        <div id="errorzone">

        </div>

      <div id="report">
        <div id="tablezone"></div>
</div>
    </div>

    </div>


  </div>



</div>
</div>


  </div>

</body>
</html>
