<?php
include 'db.php';

$sql="
SELECT *
FROM inverter_orders
WHERE preproduction_status!='Completed'
ORDER BY id DESC
";

$result=mysqli_query($conn,$sql);
?>

<div class="card">

<h2>Inverter Pre Production</h2>

<table class="table">

<tr>
    <th>Order</th>
    <th>Customer</th>
    <th>Model</th>
    <th>Qty</th>

    <th>PCB</th>
    <th>Transformer</th>
    <th>Cabinet</th>
    <th>Display</th>
    <th>Fan</th>

    <th>Barcode</th>
    <th>Action</th>
</tr>

<?php while($row=mysqli_fetch_assoc($result)): ?>

<tr>

<td><?= $row['order_no'] ?></td>
<td><?= $row['customer_name'] ?></td>
<td><?= $row['model'] ?></td>
<td><?= $row['qty'] ?></td>

<td><input type="checkbox"></td>
<td><input type="checkbox"></td>
<td><input type="checkbox"></td>
<td><input type="checkbox"></td>
<td><input type="checkbox"></td>

<td>
<?php if($row['barcode_status']=="No"): ?>
    <a href="generate_inverter_barcode.php?id=<?= $row['id'] ?>">
        Generate
    </a>
<?php else: ?>
    Generated
<?php endif; ?>
</td>

<td>
<a href="move_inverter_to_production.php?id=<?= $row['id'] ?>">
Move To Production
</a>
</td>

</tr>

<?php endwhile; ?>

</table>

</div>