<?php
  session_start();
  include('includes/connection.php');
  include('includes/checklogin.php');
  check_login(); 
  $userid = $_SESSION['loginid'];
?>

<!DOCTYPE html>
<html>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<?php include("includes/head.php"); ?>

<body class="hold-transition sidebar-mini">
  <div class="wrapper">
    <?php include("includes/nav.php"); ?>
    <?php include("includes/sidebar.php"); ?>

    <div class="content-wrapper">
      <section class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-4">
              <h1>Sales Details Reports </h1>
            </div>
            <div class="col-sm-2">
                
            </div>            
            <div class="col-sm-6">
              <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
                <li class="breadcrumb-item"><a href="sales_billing_manage.php">Sales Details Creation</a></li>
                <li class="breadcrumb-item active">Manage Sales Details</li>
              </ol>
            </div>
          </div>
        </div>
      </section>

      <section class="content">
        <div class="row">
          <div class="col-12">
            <div class="card">&nbsp;&nbsp;&nbsp;&nbsp;

    <form class="form" id="data" action="salesdetails_report_end.php" method="post">

      <div class="row">&nbsp;&nbsp;&nbsp;&nbsp;
          <div class="col-md-5 form-group">
              <label for="purchase_idno">Purchase No</label>  
              <select name="purchase_idno" id="purchase_idno" class="form-control">
                  <option> Select Purchase No</option>&nbsp;&nbsp;&nbsp;&nbsp;
                  <?php 
                      $sqlsss = "SELECT purchase_idno FROM trn_sales ORDER BY purchase_idno";
                      $result = $mysqli->query($sqlsss);
                      while($row = mysqli_fetch_array($result)) 
                      {
                  ?>
                  <option value="<?php echo $row['purchase_idno']; ?>"> <?php echo $row['purchase_idno'];?></option>
                  <?php  
                      }
                  ?>
              </select>
          </div>  

          <div class="col-md-5 form-group">
              <label for="purchase_product">Purchase Product</label>  
              <select name="purchase_product" id="purchase_product" class="form-control">
                  <option>Select Purchase Product</option>&nbsp;&nbsp;&nbsp;&nbsp;
                  <?php 
                      $sqlsss = "SELECT purchase_product FROM trn_sales ORDER BY purchase_product";
                      $result = $mysqli->query($sqlsss);
                      while($row = mysqli_fetch_array($result)) 
                      {
                  ?>
                  <option value="<?php echo $row['purchase_product']; ?>"> <?php echo $row['purchase_product'];?></option>
                  <?php  
                      }
                  ?>
              </select>
          </div>
      </div>

      <div class="row">&nbsp;&nbsp;&nbsp;&nbsp;
          <div class="col-md-5 form-group">
              <label for="purchase_model">Purchase Model</label>  
              <select name="purchase_model" id="purchase_model" class="form-control">
                  <option>Select Purchase Model</option>&nbsp;&nbsp;&nbsp;&nbsp;
                  <?php 
                      $sqlsss = "SELECT purchase_model FROM trn_sales ORDER BY purchase_model";
                      $result = $mysqli->query($sqlsss);
                      while($row = mysqli_fetch_array($result)) 
                      {
                  ?>
                  <option value="<?php echo $row['purchase_model']; ?>"> <?php echo $row['purchase_model'];?></option>
                  <?php  
                      }
                  ?>
              </select>
          </div>
     
          <div class="col-md-5 form-group">
              <label for="name">Name</label>  
              <select name="name" id="name" class="form-control">
                  <option>Select Name</option>&nbsp;&nbsp;&nbsp;&nbsp;
                  <?php 
                      $sqlsss = "SELECT name FROM trn_sales ORDER BY name";
                      $result = $mysqli->query($sqlsss);
                      while($row = mysqli_fetch_array($result)) 
                      {
                  ?>
                  <option value="<?php echo $row['name']; ?>"> <?php echo $row['name'];?></option>
                  <?php  
                      }
                  ?>
              </select>
          </div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

          <a href="stockdetails_report_end.php"><button type="show" class="btn btn-success" style="height:40px;" id="show" name="show">SHOW</button></a>  

      </div>
    </form>
  
    <div class="card-body">
    </tfoot> 
      </div>
     </div>
    </div>
   </div>
  </section><br>
</div>

  <?php include("includes/footer.php"); ?>
  <aside class="control-sidebar control-sidebar-dark"></aside>
</div>
  
  <script src="plugins/jquery/jquery.min.js"></script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="plugins/datatables/jquery.dataTables.js"></script>
  <script src="plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
  <script src="dist/js/adminlte.min.js"></script>
  <script src="dist/js/demo.js"></script>

  <script>
    $(function() 
    {
      $("#table1").DataTable();
      $('#table2').DataTable
      ({
        "paging": true,
        "lengthChange": false,
        "searching": false,
        "ordering": true,
        "info": true,
        "autoWidth": false,
      });
    });
  </script>

</body>
</html>
