Files
bildirchin/views/admin/orders.php
T

60 lines
3.3 KiB
PHP

<?php
$pageTitle = 'مدیریت سفارش‌ها';
require __DIR__ . '/layout_header.php';
?>
<div class="bg-white rounded-2xl border border-stone-200 shadow-sm overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-right text-xs">
<thead class="bg-stone-50 text-stone-600 border-b">
<tr>
<th class="p-3.5">کد سفارش</th>
<th class="p-3.5">خریدار</th>
<th class="p-3.5">شهر / آدرس</th>
<th class="p-3.5">مبلغ کل</th>
<th class="p-3.5">روش ارسال / پرداخت</th>
<th class="p-3.5">وضعیت</th>
<th class="p-3.5">تاریخ</th>
<th class="p-3.5 text-center">عملیات</th>
</tr>
</thead>
<tbody class="divide-y divide-stone-100">
<?php if (empty($orders)): ?>
<tr><td colspan="8" class="p-8 text-center text-stone-400">سفارشی یافت نشد.</td></tr>
<?php else: ?>
<?php foreach ($orders as $ord): ?>
<tr class="hover:bg-stone-50">
<td class="p-3.5 font-bold font-mono text-stone-900"><?= htmlspecialchars($ord['order_code']) ?></td>
<td class="p-3.5">
<span class="font-bold text-stone-900 block"><?= htmlspecialchars($ord['customer_name']) ?></span>
<span class="text-[11px] text-stone-400"><?= htmlspecialchars($ord['customer_phone']) ?></span>
</td>
<td class="p-3.5 text-stone-600 max-w-xs truncate"><?= htmlspecialchars($ord['city']) ?> - <?= htmlspecialchars($ord['address']) ?></td>
<td class="p-3.5 font-black text-amber-900"><?= \Bildirchin\Helpers::formatPrice($ord['final_amount']) ?></td>
<td class="p-3.5 text-stone-500">
<span class="block"><?= htmlspecialchars($ord['shipping_method']) ?></span>
<span class="text-[10px] text-stone-400"><?= htmlspecialchars($ord['payment_method']) ?></span>
</td>
<td class="p-3.5">
<span class="px-2.5 py-1 rounded-full text-[10px] font-bold bg-amber-100 text-amber-800">
<?= htmlspecialchars($ord['status']) ?>
</span>
</td>
<td class="p-3.5 text-[11px] text-stone-400"><?= \Bildirchin\Helpers::getJalaliDate($ord['created_at']) ?></td>
<td class="p-3.5 text-center">
<a href="/admin/order/<?= $ord['id'] ?>" class="px-3 py-1.5 rounded-lg bg-stone-100 text-stone-800 hover:bg-amber-500 hover:text-stone-950 font-bold transition">
مشاهده فاکتور
</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php
require __DIR__ . '/layout_footer.php';
?>