
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php $view='contacts/index.php'; ?>
<div class="d-flex justify-content-between align-items-center mb-2">
  <h4 class="mb-0"><?= e(t('contacts.title')) ?></h4>
  <form class="d-flex gap-2" method="get" action="<?= e(base_url($config, '/index.php')) ?>">
    <input type="hidden" name="r" value="contacts/index">
    <input class="form-control" name="q" placeholder="<?= e(t('global.search')) ?>" value="<?= e($q) ?>">
    <button class="btn btn-outline-primary"><?= e(t('global.search')) ?></button>
  </form>
</div>

<div class="card shadow-sm">
  <div class="table-responsive">
    <table class="table table-striped mb-0 align-middle">
      <thead>
        <tr>
          <th>#</th>
          <th><?= e(t('contacts.mobile')) ?></th>
          <th><?= e(t('contacts.name')) ?></th>
          <th><?= e(t('contacts.city')) ?></th>
          <th>Created</th>
        </tr>
      </thead>
      <tbody>
      <?php foreach ($rows as $r): ?>
        <tr>
          <td><?= (int)$r['id'] ?></td>
          <td><span class="badge badge-soft"><?= e(($r['country_code'] ?? '').($r['mobile'] ?? '')) ?></span></td>
          <td><?= e($r['full_name'] ?? '') ?></td>
          <td><?= e($r['city'] ?? '') ?></td>
          <td class="text-muted small"><?= e($r['created_at'] ?? '') ?></td>
        </tr>
      <?php endforeach; ?>
      </tbody>
    </table>
  </div>
</div>
