« Back to History
delay.php
|
20260921_175631.php
Initial Domain Snapshot
Copy Code
<?php $st = $pdo->prepare(" SELECT psi.bill_no,psi.bill_date,psi.party, psi.transport,psi.station, DATEDIFF(CURDATE(), psi.bill_date) AS delay_days 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 ORDER BY delay_days DESC "); $st->execute([$company_id]); echo "<table class='table table-sm table-bordered table-striped'>"; echo "<thead><tr> <th>Bill</th><th>Date</th><th>Party</th> <th>Transport</th><th>Station</th><th>Delay</th> </tr></thead><tbody>"; foreach($st as $r){ $d = (int)$r['delay_days']; $class = ($d > 2) ? "text-danger fw-bold text-center" : "text-center"; echo "<tr> <td>".h($r['bill_no'])."</td> <td>".h($r['bill_date'])."</td> <td>".h($r['party'])."</td> <td>".h($r['transport'])."</td> <td>".h($r['station'])."</td> <td class='{$class}'>{$d}</td> </tr>"; } echo "</tbody></table>";