<?php 
include('include/session.php');
// session_start();
include('include/navigation.php');
include('connection.php');
$dbConnection = new DbConnection();
$connection = $dbConnection->connection;
?>
<html lang="en">
<head>
    <link rel="stylesheet" href="assets/css/style.css">
<?php
include('include/header_links.php');

?>
<body>
    <div class="container_main">
        <div id="warantee_button">
     <button class="reset-button item-right"><a href="_arrival_store.php"><i class="fa-solid fa-backward"></i></a></button> 
     <!--<div class="item-left"><a href="_store_approved_list.php" class="reset-button"> Stock Approved List</a></div>-->
      </div>
        <h1>--Stock Approved List--</h1>
     
        <table class="table table-striped">
  <thead>
    <tr>
      <th scope="col">S.no</th>
      
      <th scope="col">Category</th>
      <th scope="col">Product</th>
      <th scope="col">variation</th>
      <th scope="col">Price</th>
      <th scope="col">Quantity</th>
      <th scope="col">Defective Product</th>
     
    </tr>
  </thead>
  <tbody>
  <?php
    $query = "SELECT * FROM arrival_store WHERE quality_check_no = 0";
    $result = mysqli_query($connection, $query);
    $id = 1;

    if ($result && mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_assoc($result)) {
            echo "<tr>";

            // Output table data
            echo "<td>{$id}</td>";
            echo "<td>{$row['category']}</td>";
            echo "<td>{$row['product']}</td>";
            echo "<td>{$row['variation']}</td>";
            echo "<td>{$row['price']}</td>";
            echo "<td>{$row['quantity']}</td>";
             echo "<td>{$row['quality_check_no']}</td>";

            echo "</tr>";

            // Increment id for next row
            $id++;
        }
    }
?>
  </tbody>
</table>
</div>
<section class="footer">
    <?php
     include_once("include/footer_two.php");
  ?>
     </section>
  </body>
 
  <?php 
 include("include/footer_link.php");
  ?>

 
<script src="assets/script/script.js"></script>
</html>

<?php
//ob_end_flush(); // Send the buffered output
?>
</html>