/
mywarnings.php
58 lines (35 loc) · 1.4 KB
/
mywarnings.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
<?php
$userid = getSessionVariable('user_id');
$warnings = getWarningsForUser($userid);
$user = mysql_fetch_assoc(getUserByID($userid));
$options = "";
$types = array(RES_WARNING_ACTIVE => "Active", RES_WARNING_NOTE => "Note", RES_WARNING_INACTIVE => "Inactive");
while($row = mysql_fetch_assoc($warnings)){
$options = $options."<option value=\"".$row['warn_id']."\">".$row['time']." - ".$types[$row['type']]."</option>";
}
echo "<center><h3>View Warnings For ".$user['name']."</h3>";
if($options != ""){
echo "<form action=\"index.php\" method=\"GET\">
<input type=\"hidden\" name=\"pageid\" value=\"viewmywarning\">
<select name=\"warn_id\">".$options."</select><input type=\"submit\" value=\"View\"></form>";
}
else{
echo "<h4>You don't have any warnings. :)</h4>";
}
if($pageid == "viewmywarning"){
$warning = mysql_fetch_assoc(getWarningByID($_GET['warn_id']));
echo "<table class=\"warning\">
<tr>
<td colspan=2 class=\"centeredcellbold\">Warning Reason</td>
</tr>
<tr>
<td colspan=2 class=\"centeredcell\"><textarea cols=\"55\" rows=\"7\" readonly>".$warning['reason']."</textarea></td>
</tr>
<tr>
<td class=\"centeredcellbold\">Type: ".getWarningType($warning['type'])."</td>
<td class=\"centeredcellbold\">Time: ".$warning['time']."</td>
</tr>
</table>";
}
echo "</center>";
?>