152 lines
4.1 KiB
Plaintext
152 lines
4.1 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "Appointments";
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
|
|
@if (ViewBag.tip != null) {
|
|
<div class="alert alert-success" role="alert">
|
|
@ViewBag.tip
|
|
</div>
|
|
}
|
|
|
|
<div class="titlebar">
|
|
<h2>My appointments</h2>
|
|
@if (ViewBag.role == 1) {<a href="./Create" class="btn btn-primary">Make a new appointment</a>}
|
|
</div>
|
|
|
|
@if (ViewBag.role == 1) {
|
|
<table class="table table-hover">
|
|
<tr>
|
|
<th>Doctor</th>
|
|
<th>Appointment date</th>
|
|
<th>Status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
@foreach (var item in ViewBag.appointments) {
|
|
<tr>
|
|
<td>
|
|
<div class="userprofile">
|
|
<img src='@item.Item2.avatar' class="avatar" />
|
|
<span class="displaname">@item.Item2.displayName</span>
|
|
</div>
|
|
</td>
|
|
<td>@item.Item1.appointmentDate</td>
|
|
<td>
|
|
@if (item.Item1.status == 0) {
|
|
<span class="badge badge-warning">Pending</span>
|
|
} else if (item.Item1.status == 1) {
|
|
<span class="badge badge-info">Waiting for serve</span>
|
|
} else if (item.Item1.status == -1) {
|
|
<span class="badge badge-secondary">Cancelled</span>
|
|
} else if (item.Item1.status == 2) {
|
|
<span class="badge badge-info">Completed</span>
|
|
} else {
|
|
<span class="badge badge-secondary">Unknown</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (item.Item1.status == 0) {
|
|
<a href='./Cancel/@item.Item1.uuid' class="btn btn-sm btn-danger">Cancel</a>
|
|
} else if (item.Item1.status == 2) {
|
|
<a href="./Detail/@item.Item1.uuid" class="btn btn-sm btn-primary">Detail</a>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
} else if (ViewBag.role == 2) {
|
|
<table class="table table-hover">
|
|
<tr>
|
|
<th>Patient</th>
|
|
<th>Appointment date</th>
|
|
<th>Status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
@foreach (var item in ViewBag.appointments) {
|
|
<tr>
|
|
<td>
|
|
<div class="userprofile">
|
|
<img src='@item.Item2.avatar' class="avatar" />
|
|
<span class="displaname">@item.Item2.displayName</span>
|
|
</div>
|
|
</td>
|
|
<td>@item.Item1.appointmentDate</td>
|
|
<td>
|
|
@if (item.Item1.status == 0) {
|
|
<span class="badge badge-warning">Pending</span>
|
|
} else if (item.Item1.status == 1) {
|
|
<span class="badge badge-info">Waiting for serve</span>
|
|
} else if (item.Item1.status == -1) {
|
|
<span class="badge badge-secondary">Cancelled</span>
|
|
} else if (item.Item1.status == 2) {
|
|
<span class="badge badge-info">Completed</span>
|
|
} else {
|
|
<span class="badge badge-secondary">Unknown</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (item.Item1.status == 0) {
|
|
<a href='./Approve/@item.Item1.uuid' class="btn btn-sm btn-primary">Approve</a>
|
|
<a href='./Cancel/@item.Item1.uuid' class="btn btn-sm btn-danger">Cancel</a>
|
|
} else if (item.Item1.status == 1) {
|
|
<a href="./UploadImage/@item.Item1.uuid" class="btn btn-sm btn-primary">Upload Image</a>
|
|
} else if (item.Item1.status == 2) {
|
|
<a href="./Detail/@item.Item1.uuid" class="btn btn-sm btn-primary">Detail</a>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
}
|
|
|
|
@section Scripts {
|
|
<style>
|
|
.titlebar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.badge {
|
|
border-radius: 0.25rem;
|
|
border-width: 1px;
|
|
}
|
|
|
|
.badge-warning {
|
|
background-color: #ffc107;
|
|
border-color: #ffc107;
|
|
}
|
|
|
|
.badge-success {
|
|
background-color: #28a745;
|
|
border-color: #28a745;
|
|
}
|
|
|
|
.badge-danger {
|
|
background-color: #dc3545;
|
|
border-color: #dc3545;
|
|
}
|
|
|
|
.badge-info {
|
|
background-color: #17a2b8;
|
|
border-color: #17a2b8;
|
|
}
|
|
|
|
.badge-secondary {
|
|
background-color: #6c757d;
|
|
border-color: #6c757d;
|
|
}
|
|
|
|
.userprofile .displaname {
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.userprofile .avatar {
|
|
width: 30px;
|
|
height: 30px;
|
|
border-radius: 50%;
|
|
}
|
|
</style>
|
|
} |