pa help po dito, max 2 lang ang kaya nyang i return na hindi numerical value. ang prblema po e more than 2 ang nasa category
<tbody>
<?php
$total = 0;
$qry = $conn->query("SELECT s.*,i.name,i.description,i.category_id FROM
while($row = $qry->fetch_assoc()):
$total += $row['total']
?>
<tr>
<td class="py-1 px-2 text-center"><?php echo number_format($row['quantity']) ?></td>
<td class="py-1 px-2 text-center"><?php echo ($row['unit']) ?></td>
<td class="py-1 px-2">
<?php echo $row['name'] ?> <br>
<?php echo $row['description'] ?>
</td><?php $category = $row['category_id'];
if($category > 0): ?>
<td class="py-1 px-2 text-right"><?php echo ($category == 2)? "Cleaning Supplies" : "Furnitures" ?></td><?php endif; ?>
<td class="py-1 px-2 text-right"><?php echo number_format($row['price']) ?></td>
<td class="py-1 px-2 text-right"><?php echo number_format($row['total']) ?></td>
</tr>
<?php endwhile; ?>
</tbody>
<tbody>
<?php
$total = 0;
$qry = $conn->query("SELECT s.*,i.name,i.description,i.category_id FROM
stock_list s inner join item_list i on s.item_id = i.id where s.id in ({$stock_ids})");while($row = $qry->fetch_assoc()):
$total += $row['total']
?>
<tr>
<td class="py-1 px-2 text-center"><?php echo number_format($row['quantity']) ?></td>
<td class="py-1 px-2 text-center"><?php echo ($row['unit']) ?></td>
<td class="py-1 px-2">
<?php echo $row['name'] ?> <br>
<?php echo $row['description'] ?>
</td><?php $category = $row['category_id'];
if($category > 0): ?>
<td class="py-1 px-2 text-right"><?php echo ($category == 2)? "Cleaning Supplies" : "Furnitures" ?></td><?php endif; ?>
<td class="py-1 px-2 text-right"><?php echo number_format($row['price']) ?></td>
<td class="py-1 px-2 text-right"><?php echo number_format($row['total']) ?></td>
</tr>
<?php endwhile; ?>
</tbody>