-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.php
More file actions
100 lines (81 loc) · 2.17 KB
/
class.php
File metadata and controls
100 lines (81 loc) · 2.17 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
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<?php // init
include_once("connection.php");
include_once("stickerfunctions.php");
include_once("function.php");
if(!empty($_GET['classid'])){
$_SESSION['classid'] = $_GET['classid'];
} elseif(!empty($_SESSION['classid'])){
} else {
echo "A class has not been chosen";
}
$classid = $_SESSION['classid'];
include_once("connection.php");
$classquery = $db_stickers->query("SELECT * FROM offerings WHERE classid=$classid");
$classresult = array();
while ($data_result = $classquery->fetch_assoc()) {
array_push($classresult, $data_result);
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="stickers.css">
<title><?php echo $classresult[0]['classname']; ?></title>
</head>
<body>
<div class="classdata">
<br>
<a class="back" href="index.php">Back</a>
<h3><?php echo $classresult[0]['classname'] . ", taught by " . $classresult[0]['facilitator']; ?></h3>
<p>
<?php echo $classresult[0]['description'];
if (preg_match('/<p/',$classresult[0]["image"])){
} else {
?>
<?php
}
?>
</p>
<img id="classimage" src='<?php echo $classresult[0]["image"]; ?>'>
<p>
<?php
//render students that have stickered this class
$blackstickers = getstudents($classid,"blackstickers");
$greystickers = getstudents($classid,"greystickers");
$whitestickers = getstudents($classid,"whitestickers");
$blackstickers = explode(",", $blackstickers[0]);
$greystickers = explode(",", $greystickers[0]);
$whitestickers = explode(",", $whitestickers[0]);
if ($blackstickers[0] == 0 && $greystickers[0] == 0 && $whitestickers[0] == 0) {
?>
<h3> No Stickers on this class </h3>
<?php
} else {
?> <h3> Stickers on this class: </h3> <?php
}
foreach($blackstickers as $sticker){
echo "<div class = " . "black" . ">" . idToName($sticker) . "</div>";
}
foreach($greystickers as $sticker){
echo "<div class = " . "grey" . ">" . idToName($sticker) . "</div>";
}
foreach($whitestickers as $sticker){
echo "<div class = " . "white" . ">" . idToName($sticker) . "</div>";
}
?>
<p>
</div>
</body>
</html>
<style>
#classimage {
display:block;
margin-right:auto;
margin-left:auto;
width:30%;
}
</style>