« Back to History
pending_summary.php
|
20260721_154033.php
Initial Bulk Import
Copy Code
<?php $st = $pdo->prepare(" SELECT psi.bill_date d,COUNT(*) c FROM parcel_stock_in psi LEFT JOIN parcel_send_entry pse ON pse.company_id = psi.company_id AND psi.bill_no = pse.bill_no WHERE psi.company_id = ? AND pse.id IS NULL AND psi.cleared_unknown = 0 GROUP BY psi.bill_date ORDER BY psi.bill_date "); $st->execute([$company_id]); echo "<table class='table table-sm table-bordered table-striped'>"; echo "<thead><tr> <th>Date</th><th>Pending Count</th> </tr></thead><tbody>"; $total = 0; foreach($st as $r){ $total += $r['c']; echo "<tr> <td>".h($r['d'])."</td> <td class='text-center fw-bold'>{$r['c']}</td> </tr>"; } echo "<tr class='table-secondary fw-bold'> <td class='text-end'>TOTAL</td> <td class='text-center'>{$total}</td> </tr>"; echo "</tbody></table>";