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

<!-- HTML START -->
<!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">
    <!-- Navbar -->
    <?php include("includes/nav.php"); ?>
    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    <?php include("includes/sidebar.php"); ?>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-4">
              <h1>PriceList 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="productrecord_registration_manage.php">PriceList Creation</a></li>
                <li class="breadcrumb-item active">Manage PriceList</li>
              </ol>
            </div>
          </div>
        </div><!-- /.container-fluid -->
      </section>

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

    <div class="card-body">
        
        <table id="report_table" name="report_table" class="table table-hover table-bordered table-striped"> 
            <thead>
                <tr>
                    <th style="width:7%">SL No</th>
                    <th style="width:10%">Name</th>
                    <th style="width:13%">Value</th>
                    <th style="width:13%">Price List</th>
                    <th style="width:13%">Description</th>
                </tr>
            </thead>

        <?php

        // SELECT QUERY START
          $ret = "SELECT * FROM mst_product";           
          $stmt = $mysqli->prepare($ret);
          $stmt->execute();
          $res = $stmt->get_result();       
          
          $cnt=1;
          while ($rows = $res->fetch_object())        
          {   
        ?> 
       
<!-- Report Table START -->
        <tbody>
          <tr> 
              <td> <?php echo $cnt;?> </td>
              <td> <?php echo $rows->productrecord_name;?> </td>
              <td> <?php echo $rows->productrecord_value;?> </td>
              <td> <?php echo $rows->productrecord_pricelist;?> </td> 
              <td> <?php echo $rows->productrecord_description;?> </td>
          </tr>

        <?php 
            $cnt=$cnt+1;
            } 
        ?>        
        <!-- SELECT QUERY END -->
      
        </tbody>
     </tfoot> 
  </table>   
            
    </div>
    <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->

        <a href="pricelist_report_start.php"><button type="back" class="btn btn-primary" style="height:40px;float:right;">BACK</button></a> 

      </section><br>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <?php include("includes/footer.php"); ?>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
      <!-- Control sidebar content goes here -->
    </aside>
    <!-- /.control-sidebar -->
  </div>
  <!-- ./wrapper -->

  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js"></script>
  <!-- Bootstrap 4 -->
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <!-- DataTables -->
  <script src="plugins/datatables/jquery.dataTables.js"></script>
  <script src="plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
  <!-- AdminLTE App -->
  <script src="dist/js/adminlte.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="dist/js/demo.js"></script>

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

</body>
</html>
<!-- HTML END -->
