38960-vm/includes/pages/insurance.php
2026-03-04 04:42:54 +00:00

42 lines
2.0 KiB
PHP

<?php
$insurance_companies = $db->query("SELECT * FROM insurance_companies ORDER BY id DESC")->fetchAll();
?>
<div class="card shadow-sm">
<div class="card-header py-3 d-flex justify-content-between align-items-center">
<h5 class="mb-0 fw-bold"><i class="bi bi-shield-check me-2 text-primary"></i> <?php echo __('insurance_companies'); ?></h5>
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addInsuranceModal">
<i class="bi bi-plus-lg"></i> <?php echo __('add_insurance'); ?>
</button>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead>
<tr>
<th>ID</th>
<th><?php echo __('name'); ?> (EN)</th>
<th><?php echo __('name'); ?> (AR)</th>
<th><?php echo __('email'); ?></th>
<th><?php echo __('phone'); ?></th>
<th><?php echo __('date'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($insurance_companies as $ic): ?>
<tr>
<td>#<?php echo $ic['id']; ?></td>
<td><?php echo htmlspecialchars($ic['name_en']); ?></td>
<td><?php echo htmlspecialchars($ic['name_ar']); ?></td>
<td><?php echo htmlspecialchars($ic['email'] ?: '-'); ?></td>
<td><?php echo htmlspecialchars($ic['phone'] ?: '-'); ?></td>
<td><?php echo date('Y-m-d', strtotime($ic['created_at'])); ?></td>
</tr>
<?php endforeach; if (empty($insurance_companies)): ?>
<tr><td colspan="6" class="text-center py-4 text-muted">No insurance companies found.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>