91 lines
3.4 KiB
PHP
91 lines
3.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Doctor Dashboard</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--doctor">
|
|
|
|
<div class="container py-5">
|
|
|
|
<h2 class="text-center mb-4 app-heading">Doctor dashboard</h2>
|
|
|
|
<p class="text-center mb-4">
|
|
<a href="<?= base_url('doctor/profile') ?>" class="btn btn-outline-primary btn-sm rounded-pill px-3">Edit profile</a>
|
|
</p>
|
|
|
|
<?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="row">
|
|
|
|
<?php foreach ($appointments as $a): ?>
|
|
<div class="col-md-6 mb-4">
|
|
|
|
<div class="card app-card-dashboard p-4">
|
|
|
|
<h5 class="mb-2">👤 <?= esc($a->patient_name) ?></h5>
|
|
|
|
<p class="mb-1 small text-muted">📅 <?= esc($a->appointment_date) ?></p>
|
|
<p class="mb-3 small text-muted">⏰ <?= esc($a->appointment_time) ?></p>
|
|
|
|
<p class="mb-3">
|
|
<?php
|
|
$st = trim((string) $a->status);
|
|
if ($st === '') {
|
|
$st = 'pending';
|
|
} elseif ($st === 'confirmed') {
|
|
$st = 'approved';
|
|
} elseif ($st === 'cancelled') {
|
|
$st = 'rejected';
|
|
}
|
|
|
|
$badgeClass = match ($st) {
|
|
'pending' => 'bg-warning text-dark',
|
|
'approved' => 'bg-success',
|
|
'rejected' => 'bg-danger',
|
|
default => 'bg-secondary',
|
|
};
|
|
?>
|
|
<span class="badge <?= $badgeClass ?>"><?= esc(ucfirst($st)) ?></span>
|
|
</p>
|
|
|
|
<?php if ($st === 'pending'): ?>
|
|
<div class="d-flex gap-2 flex-wrap">
|
|
<form method="post" action="<?= base_url('doctor/appointment/' . $a->id . '/accept') ?>" class="d-inline">
|
|
<?= csrf_field() ?>
|
|
<button type="submit" class="btn btn-success btn-sm rounded-pill px-3">Accept</button>
|
|
</form>
|
|
<form method="post" action="<?= base_url('doctor/appointment/' . $a->id . '/reject') ?>" class="d-inline">
|
|
<?= csrf_field() ?>
|
|
<button type="submit" class="btn btn-outline-danger btn-sm rounded-pill px-3">Reject</button>
|
|
</form>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<?php if (empty($appointments)): ?>
|
|
<p class="text-center text-muted">No appointments yet.</p>
|
|
<?php endif; ?>
|
|
|
|
<div class="text-center mt-4">
|
|
<a href="<?= base_url('logout') ?>" class="btn btn-outline-danger btn-sm rounded-pill px-4">Logout</a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|