<?php
require_once __DIR__ . '/_admin.php';
$pdo = pdoOrFail();
$leads = $pdo->query('SELECT * FROM contact_leads ORDER BY created_at DESC, id DESC')->fetchAll();
adminHeader('Gelen Formlar');
?>
<div class="admin-card table-wrap"><table><thead><tr><th>Tarih</th><th>Ad Soyad</th><th>Telefon</th><th>Sube</th><th>Hizmet</th><th>Mesaj</th></tr></thead><tbody>
<?php foreach ($leads as $lead): ?><tr><td><?= e($lead['created_at']) ?></td><td><?= e($lead['full_name']) ?></td><td><a href="tel:<?= e($lead['phone']) ?>"><?= e($lead['phone']) ?></a></td><td><?= e($lead['branch']) ?></td><td><?= e($lead['service']) ?></td><td><?= e($lead['message']) ?></td></tr><?php endforeach; ?>
</tbody></table></div>
<?php adminFooter(); ?>
