This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
processeditrequest.php
90 lines (84 loc) · 2.43 KB
/
processeditrequest.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
88
89
90
<?
require("include/top.php");
if (($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator' || $SESSION_LEVEL=='gloperator')) {
$fields = array(
"name" => "name",
"group1" => "group 1",
"group2" => "group 2",
"group3" => "group 3",
"download" => "primary download link",
"type" => "type(s)",
"party" => "release party",
"party_year" => "release party year",
"party_place" => "release party ranking",
);
if ($_POST["requestid"]) {
if ($_POST["approve"]) {
$sql = sprintf("select * from editrequests where id=%d",$_POST["requestid"]);
$r = mysql_query($sql);
$o = mysql_fetch_object($r);
$sql = sprintf("update prods set %s = '%s' where id=%d",
$o->field,addslashes($o->newvalue),$o->prodid);
$r = mysql_query($sql);
$sql = sprintf("update editrequests set approved = 1, gloperatorid = %d where id=%d",
$_SESSION["SCENEID_ID"],$_POST["requestid"]);
mysql_query($sql);
}
if ($_POST["decline"]) {
$sql = sprintf("update editrequests set approved = -1, gloperatorid = %d where id=%d",
$_SESSION["SCENEID_ID"],$_POST["requestid"]);
mysql_query($sql);
}
}
?>
<br>
<form action="processeditrequest.php" method="post" enctype="multipart/form-data">
<table bgcolor="#000000" cellspacing="1" cellpadding="2">
<tr>
<th colspan="6">process prod edit requests</th>
</tr>
<tr>
<th>requested by</th>
<th>prod</th>
<th>field</th>
<th>from</th>
<th>to</th>
<th>action</th>
</tr>
<?
$sql = "select *,prods.name as prodname,editrequests.id as id ";
$sql .= " from editrequests";
$sql .= " join users join prods ";
$sql .= " where editrequests.userid = users.id and approved = 0 and prods.id=editrequests.prodid";
$sql .= " order by datetime desc ";
$r = mysql_query($sql);
$n = 0;
while ($o = mysql_fetch_object($r)) {
$f = $o->field;
?>
<tr class="bg<?=(($n++&1)+1)?>">
<td><a href="user.php?who=<?=$o->userid?>"><img src="avatars/<?=$o->avatar?>" border="0"> <?=$o->nickname?></a></td>
<td><a href="prod.php?which=<?=$o->prodid?>"><?=$o->prodname?></a></td>
<td><?=$fields[$o->field]?></td>
<td><?=$o->$f?></td>
<td><?=$o->newvalue?></td>
<td>
<form action="processeditrequest.php" method="post">
<input name="requestid" type="hidden" value="<?=$o->id?>">
<input name="approve" type="submit" value="approve!">
<input name="decline" type="submit" value="decline!">
</form>
</td>
</tr>
<?
}
?>
</table>
</form>
<br />
<?
} else {
print("not now susan, my head hurts.");
}
require("include/bottom.php");
?>