forked from Kazeeem/Mini-classroom-php-version
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect-class.php
More file actions
104 lines (97 loc) · 3.31 KB
/
select-class.php
File metadata and controls
104 lines (97 loc) · 3.31 KB
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
102
103
104
<?php
include 'lib/Session.php';
Session::checkStudentSession();
spl_autoload_register(function($class){
include_once "classes/".$class.".php";
});
$class = new ClassApp();
?>
<!DOCTYPE html>
<html lang=" en">
<head>
<title>Mini-Classroom | Select A Class</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="Mini-class App designs/mathisi logo.png" type="image/png">
<link href="css/selectclass.css" rel="stylesheet">
<style type="text/css">
.choose-item {
display: inline-block;
text-decoration: none;
background-color: #C63305;
color: #000;
padding: 12px 25px;
border-radius: 30px;
color: #fff;
}
.success {
background: #274970;
color: white;
padding: 10px;
z-index: 30;
width: 100%;
margin: 40px auto 20px 10px;
}
.error {
background: #C63305;
color: white;
padding: 10px;
z-index: 30;
width: 100%;
margin: 40px auto;
}
.color {
color: #C63305;
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
margin: 10px;
}
</style>
</head>
<body>
<?php
if (isset($_GET['action']) && $_GET['action'] == 'logout') {
Session::destroy();
}
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit'])) {
$enroll = $class->enrollToClass($_POST, Session::get('studentId'));
}
?>
<header>
<a href="index.html">
<img src="Mini-class App designs/Logo.svg" class="logo" alt="Logo" style="width: 100px; height: 100px;">
</a>
<a href="?action=logout" class="sign-out-btn">Sign Out</a>
</header>
<div class="content">
<div class="content-field">
<h2>Select Class</h2>
<?php
if (isset($enroll)) {
echo $enroll;
}
?>
<form class="cc-form" action="" method="post">
<!---<label>Create class</label><br>-->
<select class="choose-item" name="classId">
<option>Select Class</option>
<!-- get all classes -->
<?php
$getAllClasses = $class->selectAllClasses();
if ($getAllClasses) {
while ($result = $getAllClasses->fetch_assoc()) {
?>
<option value="<?php echo $result['id']; ?>"><?php echo $result['class_name']; ?></option>
<?php } } ?>
</select>
<button class="select" name="submit">Enroll</button>
</form>
</div>
<div class="content-img">
<img src="./Mini-class App designs/undraw_exams_g4ow.svg" width="60%">
</div>
</div>
<br>
</body>
</html>