<div class="container-fluid">
	<div class="row column_title">
		<div class="col-md-12">
			<div class="page_title">
				<h2>Course Details</h2>
			</div>
		</div>
	</div>

	<div class="card shadow mb-4">
		<div class="card-body">
			<table class="table table-bordered">
				<tr>
					<th style="width: 220px;">courseID</th>
					<td><?= isset($course['courseID']) ? html_escape((string)$course['courseID']) : html_escape((string)$courseId) ?></td>
				</tr>
				<tr>
					<th>category</th>
					<td><?= isset($course['category']) ? html_escape((string)$course['category']) : '' ?></td>
				</tr>
				<tr>
					<th>title</th>
					<td><?= isset($course['title']) ? html_escape((string)$course['title']) : '' ?></td>
				</tr>
				<tr>
					<th>description</th>
					<td><?= isset($course['description']) ? html_escape((string)$course['description']) : '' ?></td>
				</tr>
				<tr>
					<th>duration</th>
					<td><?= isset($course['duration']) ? (int)$course['duration'] : 0 ?></td>
				</tr>
				<tr>
					<th>price</th>
					<td><?= isset($course['price']) ? html_escape((string)$course['price']) : '' ?></td>
				</tr>
				<tr>
					<th>thumbnail</th>
					<td>
						<?php if (!empty($course['thumbnail'])) { ?>
							<a href="<?= html_escape((string)$course['thumbnail']) ?>" target="_blank"><?= html_escape((string)$course['thumbnail']) ?></a>
							<div class="mt-2">
								<img class="img-thumbnail" src="<?= html_escape((string)$course['thumbnail']) ?>" style="height:140px;width:140px;">
							</div>
						<?php } ?>
					</td>
				</tr>
				<tr>
					<th>userId</th>
					<td><?= isset($course['userId']) ? html_escape((string)$course['userId']) : '' ?></td>
				</tr>
			</table>

			<div class="mt-3">
				<a class="btn btn-info" href="<?= base_url('courses/edit/' . $courseId) ?>">Edit</a>
				<a class="btn btn-secondary" href="<?= base_url('episodes/index/' . $courseId) ?>">Episodes</a>
				<a class="btn btn-danger" href="<?= base_url('courses/delete/' . $courseId) ?>" onclick="return confirm('Delete this course?')">Delete</a>
				<a class="btn btn-secondary" href="<?= base_url('courses') ?>">Back</a>
			</div>
		</div>
	</div>
</div>

