<?= $this->extend('layouts/owner') ?>
<?= $this->section('content') ?>
<div class="container-fluid"><div class="d-flex justify-content-between mb-3"><h3>Detail Order <?= esc($order['order_number']) ?></h3><a class="btn btn-secondary" href="<?= site_url('owner/order') ?>">Kembali</a></div>
<div class="card mb-3"><div class="card-body row"><div class="col-md-6"><strong>Customer</strong><br><?= esc($order['customer_name']) ?><br><?= esc($order['customer_phone'] ?: '-') ?></div><div class="col-md-6"><strong>Status</strong><br><?= esc(strtoupper($order['payment_status'])) ?> / <?= esc(strtoupper($order['production_status'] ?: 'antrian')) ?><br>Target: <?= esc($order['target_date'] ?: '-') ?></div></div></div>
<div class="card"><div class="card-header">Item Pesanan</div><div class="card-body p-0"><table class="table mb-0"><thead><tr><th>Produk</th><th>Qty</th><th>Harga</th><th>Subtotal</th></tr></thead><tbody><?php foreach ($items as $item): ?><tr><td><?= esc($item['product_name']) ?></td><td><?= esc($item['qty']) ?></td><td>Rp <?= number_format($item['price'], 0, ',', '.') ?></td><td>Rp <?= number_format($item['subtotal'], 0, ',', '.') ?></td></tr><?php endforeach ?><tr class="table-light"><th colspan="3">Total</th><th>Rp <?= number_format($order['total'], 0, ',', '.') ?></th></tr></tbody></table></div></div></div>
<?= $this->endSection() ?>
