69 lines
2.2 KiB
PHP
69 lines
2.2 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Doctors</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="<?= base_url('css/app.css') ?>">
|
|
</head>
|
|
<body class="app-body app-page--admin">
|
|
|
|
<div class="container py-5">
|
|
|
|
<h2 class="text-center mb-4 app-heading">Doctors</h2>
|
|
|
|
<?php if (session()->getFlashdata('success')): ?>
|
|
<div class="alert alert-success app-alert text-center"><?= esc(session()->getFlashdata('success')) ?></div>
|
|
<?php endif; ?>
|
|
<?php if (session()->getFlashdata('error')): ?>
|
|
<div class="alert alert-danger app-alert text-center"><?= esc(session()->getFlashdata('error')) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="text-center mb-4">
|
|
<a href="<?= base_url('admin/doctors/add') ?>" class="btn btn-app-primary">Add doctor</a>
|
|
</div>
|
|
|
|
<div class="app-table-wrap">
|
|
|
|
<table class="table table-bordered table-hover text-center align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>Sl No</th>
|
|
<th>Name</th>
|
|
<th>Specialization</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<?php $i = 1; ?>
|
|
<?php foreach ($doctors as $doc): ?>
|
|
<tr>
|
|
<td><?= $i++ ?></td>
|
|
<td><?= esc($doc->name) ?></td>
|
|
<td><?= esc($doc->specialization ?? 'N/A') ?></td>
|
|
<td>
|
|
<a href="<?= base_url('admin/deleteDoctor/' . $doc->id) ?>"
|
|
class="btn btn-outline-danger btn-sm rounded-pill px-3"
|
|
onclick="return confirm('Delete this doctor?');">
|
|
Delete
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="text-center mt-4">
|
|
<a href="<?= base_url('admin/dashboard') ?>" class="btn btn-app-outline px-4">Back to dashboard</a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|