-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwarnings.php
87 lines (68 loc) · 1.89 KB
/
warnings.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
<?php
require_once("includes/header.inc.php");
$conn = dbConnect();
//Get tag list: $comic_tags[tag_name]
$sql = "select warning_name, warning_category from warnings ORDER BY `warning_name` ASC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$i = 0;
// output data of each row
while($row = $result->fetch_assoc()) {
$comic_warnings[$i]['name'] = $row["warning_name"];
$comic_warnings[$i]['category'] = $row["warning_category"];
$i++;
}
} else {
echo "0 results";
}
$conn->close();
$categories = array("Adult Themes", "Content", "Language", "Nudity/Sex", "Violence");
require_once("includes/meta.inc.php");
require_once("includes/css.inc.php");
?>
</head>
<body>
<?php require_once 'includes/menu.inc.php';?>
<div class="container panel panel-default">
<div class="panel-body">
<div class="row">
<h1>Warnings</h1>
<h2>Warnings in Alphabetical Order:</h2>
<div class="col-md-12">
<div id="alphabet-list">
<div class="row">
<ul class="list-unstyled">
<?php
foreach($comic_warnings as $warning) {
echo ' <li>'.$warning['name'].'</li>';
}?>
</ul>
</div><!--row-->
</div><!--alphabet list-->
</div><!--col-->
<div style="margin-top:50px;"> </div>
<h2>Warnings by Type:</h2>
<div class="col-md-12">
<div id="alphabet-list">
<div class="row">
<ul class="list-unstyled">
<?php
foreach($categories as $category){
echo ' <li><h3>'.$category.'</h3></li>';
foreach($comic_warnings as $warning) {
if ($warning['category'] == $category){
echo ' <li>'.$warning['name'].'</li>';
}
}
}
?>
</ul>
</div><!--row-->
</div><!--alphabet list-->
</div><!--col-->
</div><!--row-->
</div><!--panel body-->
</div> <!-- /container -->
<?php require_once 'includes/footer.inc.php';?>
</body>
</html>