-
Notifications
You must be signed in to change notification settings - Fork 0
/
modules.php
72 lines (63 loc) · 1.41 KB
/
modules.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
<?php
session_start();
if(!isset($_SESSION['user'])){
header('Location: login.php');exit;
}
if($_SESSION['type']==0){
header('Location: profile.php?msg=Please%20activate%20your%20account&type=info');exit;
}
$listOfModules = '';
$i = 0;
include 'bdd.php';
$req = $pdo->query('SELECT Module_ID, Module_Title FROM hoppy_modules');
while($data = $req->fetch()){
if($i%2==0){
$listOfModules .= '<div class="row">';
}
$listOfModules .= '<div class="col-sm-6">
<div class="card">
<div class="card-body">
<h4 class="card-title">'.$data['Module_Title'].'</h4>
<a href="lectures.php?module='.$data['Module_ID'].'" class="btn btn-primary">See lectures</a>
</div>
</div>
</div>';
if($i%2==1){
$listOfModules .= '</div>
<br><br>';
}
$i++;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include ('head.html'); ?>
<style>
.icon{
position: absolute;
top: 6px;
right: 10px;
width: 20px;
padding-left: 5px;
line-height: 23px;
font-size: 20px;
}
</style>
<!-- Title website -->
<title>Hoppy - Modules</title>
</head>
<body>
<?php include ('nav.php'); ?>
<div class="container">
<div class="page-header">
<h3>Available Modules</h3>
<div class="dropdown-divider"></div>
</div>
<?php echo $msg; ?>
<br>
<?php echo $listOfModules; ?>
</div><br><br>
<?php include ('footer.html'); ?>
</body>
</html>