-
Notifications
You must be signed in to change notification settings - Fork 0
/
course.php
101 lines (96 loc) · 4.99 KB
/
course.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<title>Syllavid</title>
<!--<link rel="icon" type="image/png" href="assets/icon.png">-->
<link rel="stylesheet" type="text/css" href="/stylesheet.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<?php
include_once('navbar.php');
$servername = "localhost";
$username = "root";
$password = "";
$database = "id5480287_syllavid";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_GET["c"])) {
$course_id = $_GET["c"];
$sql = "SELECT * FROM courses WHERE id='" . $course_id . "';";
$course_result = $conn->query($sql);
if ($course_result->num_rows > 0) {
while ($course_row=mysqli_fetch_row($course_result)) {
?>
<section>
<div class="container">
</div>
<br></br>
<div class="container">
<table class="table table-bordered">
<tbody>
<?php
$sql = "SELECT * FROM coures_topics WHERE course_id='" . $course_id . "';";
$topic_result = $conn->query($sql);
$unit_ctr = 0;
while ($topic_row = $topic_result->fetch_assoc()) {
$unit_ctr++;
?>
<tr>
<td>Unit <?php echo $unit_ctr . ": " . $row["topic"] ?></td>
<td>
<?php
$sql = "SELECT * FROM topic_vids WHERE topic_id='" . $topic_row["id"] . "';";
$vid_result = $conn->query($sql);
while ($vid_row = $vid_result->fetch_assoc()) {
echo '<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/' . $vid_row["vid_link"] . '"></iframe>';
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td>Unit 1: Decision making tools</td>
<td>Resources: videos, texts, websites, links to documentaries, books</td>
</tr>
<tr>
<td>Unit 2: Forecasting</td>
<td><iframe class="embed-responsive-item" src="https://www.youtube.com/embed/Wo5YWXDRXv8"></iframe></td>
<!-- <td>YouTube videos</td> -->
</tr>
<tr>
<td>Unit 3: Project Management</td>
<td>YouTube videos</td>
</tr>
<tr>
<td>Exam Review: Units 1, 2 and 3</td>
<td>Student notes, study guides, price questions</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php
}
}
else {
die("Page Not Found");
}
}
else {
die("Page Not Found");
}
?>
</body>
</html>