forked from zjutjh/NexusPHP
/
takeupdate.php
27 lines (26 loc) · 940 Bytes
/
takeupdate.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
<?php
require_once("include/bittorrent.php");
function bark($msg) {
stdhead();
stdmsg("Failed", $msg);
stdfoot();
exit;
}
dbconn();
loggedinorreturn();
if (get_user_class() < $staffmem_class)
permissiondenied();
if ($_POST['setdealt']){
$res = sql_query ("SELECT id FROM reports WHERE dealtwith=0 AND id IN (" . implode(", ", $_POST[delreport]) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("UPDATE reports SET dealtwith=1, dealtby = $CURUSER[id] WHERE id = $arr[id]") or sqlerr();
$Cache->delete_value('staff_new_report_count');
}
elseif ($_POST['delete']){
$res = sql_query ("SELECT id FROM reports WHERE id IN (" . implode(", ", $_POST[delreport]) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("DELETE from reports WHERE id = $arr[id]") or sqlerr();
$Cache->delete_value('staff_new_report_count');
$Cache->delete_value('staff_report_count');
}
header("Refresh: 0; url=reports.php");