-
Notifications
You must be signed in to change notification settings - Fork 0
/
courses.php
67 lines (55 loc) · 1.33 KB
/
courses.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
<?php
include 'admin/error.php';
session_start();
// Include database connection file
include_once('admin/controller/database/db.php');
if (!isset($_SESSION['ID'])) {
header("Location:index.php");
exit();
}
if(2==$_SESSION['ROLE']){
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Saustudy</title>
<?php include 'css.php'; ?>
</head>
<body>
<?php include 'menu.php'; ?>
<div class="container ">
<div class="row mt-1">
<?php include 'slider.php'; ?>
</div>
<div class="row mt-1">
<?php
$sql = "SELECT * FROM courses";
$res = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($res)) {
?>
<div class="col-lg-4 col-md-4 col-sm-12 ">
<div class="card viral-card m-1 text-center p-1">
<h4>
<?php echo $row["course"]; ?>
</h4>
<form action="semesters.php" method="POST">
<button class="btn viral-card-2 m-3" type="submit" name="course_id"
value="<?php echo $row["course_id"]; ?>">View</button>
</form>
</div>
</div>
<?php }
?>
</div>
</div>
<?php include 'footer.php'; ?>
<?php include 'js.php'; ?>
</body>
</html>
<?php }else{
session_destroy();
header("Location:index.php");
}
?>