query("SELECT DISTINCT category_code, category FROM procurement_items WHERE category IS NOT NULL ORDER BY category_code, category")->fetchAll(); $departments = $pdo->query("SELECT DISTINCT department FROM procurement_items WHERE department IS NOT NULL ORDER BY department")->fetchAll(PDO::FETCH_COLUMN); $statuses = $pdo->query("SELECT DISTINCT status FROM procurement_items WHERE status IS NOT NULL ORDER BY status")->fetchAll(PDO::FETCH_COLUMN); // ดึงรายการจัดซื้อทั้งหมด $stmt = $pdo->query("SELECT * FROM procurement_items ORDER BY id ASC"); $items = $stmt->fetchAll(); ?>
| ลำดับ | รหัส | รายการครุภัณฑ์ | หมวดหมู่ | หน่วยงาน | งบตั้งต้น | จัดซื้อจริง | ความคืบหน้า | สถานะปัจจุบัน | Timeline | จัดการ |
|---|---|---|---|---|---|---|---|---|---|---|
| = $row['seq_no'] ?> | = $row['item_code'] ?: '-' ?> |
= htmlspecialchars($row['item_name']) ?>
= $row['quantity'] ?> = $row['unit'] ?> (= $row['plan_type'] ?>)
|
= $row['category_code'] ? '[' . $row['category_code'] . '] ' : '' ?>= htmlspecialchars($row['category']) ?> | = htmlspecialchars($row['department']) ?> | = number_format($row['total_price'], 0) ?> | = $row['procured_price'] > 0 ? number_format($row['procured_price'], 0) : '-' ?> |
|
'bg-warning text-dark', 'อยู่ระหว่างดำเนินการ' => 'bg-primary', 'ใบส่งซื้อ/ทำสัญญา' => 'bg-info text-dark', 'ดำเนินการเสร็จสิ้น' => 'bg-success', default => 'bg-secondary' }; ?> = $row['status'] ?> | = getTimelineBadge($row['due_date'], $row['status']) ?> |