-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog_A_viewFlags.php
65 lines (55 loc) · 2.33 KB
/
blog_A_viewFlags.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
<div id="adminTools" class="adminTools">
<?PHP
session_start();
if($_SESSION["admin"]==1)
{
require_once("blog_db.php");
$db = new DB();
$SQL = "SELECT reportID, reportDate, reason, userID, blogID, commentID, postID FROM flag WHERE checked<>1 ORDER BY reportDate ASC";
$matrix = $db->getData($SQL);
echo "<form action='blog_A_checkFlags.php' method='post'>";
for($i = 0; $i<count($matrix); $i++)
{
if(isset($matrix[$i][3])) {
$userID = $matrix[$i][3];
$SQL = "SELECT alias FROM user WHERE userID=$userID";
$temp = $db->getData($SQL);
$alias = $temp[0][0];
} else {
$userID = 0;
$SQL = "SELECT alias FROM user WHERE userID=$userID";
$temp = $db->getData($SQL);
$alias = $temp[0][0];
}
echo "Flagid: [".$matrix[$i][0]."]<br />";
if($matrix[$i][3]!=null)
{
echo "Användare: ".$alias.".<br />";
}
if($matrix[$i][4]!=null)
{
echo "BlogID: ".$matrix[$i][4].".<br />";
$blogID=$matrix[$i][4];
}
if($matrix[$i][6]!=null)
{
echo "InläggID: ".$matrix[$i][6].".<br />";
$postID = $matrix[$i][6];
}
if($matrix[$i][5]!=null)
{
echo "KommentarID: ".$matrix[$i][5].".<br />";
$commentID = $matrix[$i][5];
$SQL = "SELECT postID FROM comment WHERE commentID=$commentID";
$temp = $db->getData($SQL);
$postID = $temp[0][0];
}
echo "Datum: ".$matrix[$i][1].".<br />";
echo "andledning: ".$matrix[$i][2].".<br />
<a href='blog_blog.php?blogID=$blogID#$postID'>Länk till inlägget</a>
<input type='checkbox' name='reportID[]' value='".$matrix[$i][0]."'><br /><br />";
}
echo "<input type='submit' value='Checka' class='button'>";
}
?>
</div>