<?php

  //invoice.php  

  include('db_con.php');

  include('header.php');

  include('function.php');

  

  if (isset($_SESSION['user_id'])) {

    $user_type = $_SESSION['user_type'];

    $user_id = $_SESSION['user_id'];

    $user_name = $_SESSION['user_name'];

    $branch_id = $_SESSION['branch_id'];

    $branch_name = $_SESSION['branch_name'];

    $store_id = $_SESSION['store_id'];

    $store_name = $_SESSION['store_name'];

}else{

  header('Location: login');

  die();

}



$dated = date('Y-m-d');



  if(isset($_POST["print"]))

  {

   

   $fdate = $_POST['fdate'];

   $tdate = $_POST['tdate'];

  

    $item_no = $_POST['item_no'];

     $branch_id = $_POST['branch_id'];



     $sm_id = $_POST['sm_id'];

  

  

  

      

      //$result = $statement->fetchAll();



      header('location:rpt_sale_report_of_item_preview?print=1&item_no='.$item_no.'&branch_id='.$branch_id.'&sm_id='.$sm_id.'&fdate='.$fdate.'&tdate='.$tdate.'');

  }

           

  ?>

<!DOCTYPE html>

<html lang="en">

  <head>

    <title></title>

    

    <style>

      /* Remove the navbar's default margin-bottom and rounded borders */ 

      .navbar {

      margin-bottom: 4px;

      border-radius: 0;

      }

      /* Add a gray background color and some padding to the footer */

      footer {

      background-color: #f2f2f2;

      padding: 25px;

      }

      .carousel-inner img {

      width: 100%; /* Set width to 100% */

      margin: auto;

      min-height:200px;

      }

      

      .navbar-brand:hover

      {

      background-color:#ffffff;

      }

      /* Hide the carousel text when the screen is less than 600 pixels wide */

      @media (max-width: 600px) {

      .carousel-caption {

      display: none; 

      }

      }

    </style>

     



    <title>Sale Report Of Item</title>



    <!-- Bootstrap Core CSS -->

   

  </head>

  <body>

    <style>

      .box

      {

      width: 100%;

      max-width: 1390px;

      border-radius: 5px;

      border:1px solid #ccc;

      padding: 15px;

      margin: 0 auto;                

      margin-top:50px;

      box-sizing:border-box;

      }

    </style>

    <link rel="stylesheet" href="css/datepicker.css">

    <script src="js/bootstrap-datepicker1.js"></script>

    <link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/css/bootstrap-select.min.css" />

    <script>

      $(document).ready(function(){

        $('#fdate').datepicker({

          format: "yyyy-mm-dd",

          autoclose: true

        });

        $('#tdate').datepicker({

          format: "yyyy-mm-dd",

          autoclose: true

        });

      });

    </script>

    <div class="container-fluid">

     

          <?php include('top-pannel.php');?>

       <form method="post" id="report_form">

      <br />

      

        <div class="table-responsive">

          <table class="table table-bordered">

            <tr>

              <td colspan="2" align="center"><h2 style="margin-top:10.5px">Sale Report of Item</h2></td>

            </tr>

            <tr>

                <td colspan="2">

                  <div class="row">

                    <div class="col-md-4">



                    <br />

                    <br />

                    <b>Select Item :</b>



                     <select name="item_no" id="item_no" class="form-control input-sm item_no selectpicker" data-show-subtext="true" data-live-search="true" required />

                    <option value="ALL">ALL</option>

                       

                         <?php echo fill_itemstock($connect);?>



                        </select>

                        <br />

                        <br />



                          <br />

                      <select name="branch_id" id="branch_id" class="form-control branch_id" />

                      <option value="0">All</option>

                        <?php echo fill_branch($connect);?>

                      </select>

                      <br />

                      

                  

                     <br />



                       <select name="sm_id" id="sm_id" class="form-control sm_id" />

                      <option value="0">All</option>

                        <?php echo fill_sm($connect);?>

                      </select>

                      <br />

                          

                      <br />

                    

                     

                      

                     <b>From :</b><input type="text" name="fdate" id="fdate" class="form-control input-sm" readonly value="<?php echo $dated; ?>" AutoComplete="off" required />  <br />



                     <b>To :</b><input type="text" name="tdate" id="tdate" class="form-control input-sm" readonly value="<?php echo $dated; ?>" AutoComplete="off" required />  <br />       

              

                 





                  

                  

                

                    </div>



                    

                  </div>

                  



                 





                  </td>

                  </tr>

                

          

            

              <tr>

                <td colspan="2" align="center">

                <input type="submit" name="print" id="print" class="btn btn-info" value="Preview" />

                 

                 

                </td>

              </tr>

          </table>

        </div>

      </form>



     

      

