47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
require_once 'db/config.php';
|
|
$db = db();
|
|
|
|
$skill_id = $_GET['skill_id'] ?? 0;
|
|
|
|
// Fetch skill details
|
|
$stmt = $db->prepare("SELECT * FROM skills WHERE id = ?");
|
|
$stmt->execute([$skill_id]);
|
|
$skill = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
if (!$skill) {
|
|
// or redirect to dashboard with an error
|
|
die('Skill not found!');
|
|
}
|
|
|
|
// Basic page layout
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Learning: <?php echo htmlspecialchars($skill['title']); ?></title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
<div class="container mt-5">
|
|
<a href="dashboard.php" class="btn btn-secondary mb-4">Back to Dashboard</a>
|
|
<h1><?php echo htmlspecialchars($skill['title']); ?></h1>
|
|
<p class="text-muted"><?php echo htmlspecialchars($skill['category']); ?></p>
|
|
<hr>
|
|
<p><?php echo nl2br(htmlspecialchars($skill['description'])); ?></p>
|
|
<div class="mt-4">
|
|
<h3>Course Content</h3>
|
|
<p><em>(Content for this course will be added soon.)</em></p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|