67 lines
3.9 KiB
PHP
67 lines
3.9 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">عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-stone-100">
|
|
<?php if (empty($inquiries)): ?>
|
|
<tr><td colspan="8" class="p-8 text-center text-stone-400">استعلامی ثبت نشده است.</td></tr>
|
|
<?php else: ?>
|
|
<?php foreach ($inquiries as $inq): ?>
|
|
<tr class="hover:bg-stone-50">
|
|
<td class="p-3.5 font-bold text-stone-900"><?= htmlspecialchars($inq['customer_name']) ?></td>
|
|
<td class="p-3.5 font-mono text-stone-700">
|
|
<a href="tel:<?= $inq['phone'] ?>" class="text-amber-700 font-bold hover:underline"><?= htmlspecialchars($inq['phone']) ?></a>
|
|
</td>
|
|
<td class="p-3.5 text-stone-600"><?= htmlspecialchars($inq['company_name'] ?: '-') ?></td>
|
|
<td class="p-3.5 font-bold text-amber-900"><?= htmlspecialchars($inq['product_requested']) ?></td>
|
|
<td class="p-3.5 text-stone-600"><?= htmlspecialchars($inq['estimated_qty'] ?: '-') ?></td>
|
|
<td class="p-3.5 text-stone-600"><?= htmlspecialchars($inq['city'] ?: '-') ?></td>
|
|
<td class="p-3.5">
|
|
<span class="px-2.5 py-1 rounded-full text-[10px] font-bold <?= $inq['status'] === 'new' ? 'bg-rose-100 text-rose-800' : 'bg-emerald-100 text-emerald-800' ?>">
|
|
<?= $inq['status'] === 'new' ? 'جدید' : 'رسیدگی شده' ?>
|
|
</span>
|
|
</td>
|
|
<td class="p-3.5">
|
|
<form action="/admin/wholesale-inquiry/update-status" method="POST">
|
|
<input type="hidden" name="id" value="<?= $inq['id'] ?>">
|
|
<input type="hidden" name="status" value="<?= $inq['status'] === 'new' ? 'contacted' : 'new' ?>">
|
|
<button type="submit" class="px-2.5 py-1 rounded bg-stone-100 hover:bg-stone-200 text-stone-700 text-xs">
|
|
<?= $inq['status'] === 'new' ? 'تغییر به بررسیشده' : 'تغییر به جدید' ?>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php if ($inq['notes']): ?>
|
|
<tr class="bg-amber-50/30">
|
|
<td colspan="8" class="p-2.5 px-4 text-[11px] text-stone-600">
|
|
<span class="font-bold text-amber-800">یادداشت متقاضی:</span> <?= htmlspecialchars($inq['notes']) ?>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
require __DIR__ . '/layout_footer.php';
|
|
?>
|