Files
nexusphp/public/takeupdate.php

30 lines
1007 B
PHP
Raw Normal View History

2020-12-26 01:42:23 +08:00
<?php
2021-01-13 19:32:26 +08:00
require_once("../include/bittorrent.php");
2022-08-20 19:11:28 +08:00
function bark($msg) {
stdhead();
stdmsg("Failed", $msg);
stdfoot();
exit;
}
dbconn();
loggedinorreturn();
user_can('staffmem', true);
2025-06-17 20:54:18 +07:00
if (empty($_POST['delreport'])) {
stderr('Error', $lang_functions['select_at_least_one_record']);
}
2020-12-26 01:42:23 +08:00
if ($_POST['setdealt']){
2021-03-31 03:17:33 +08:00
$res = sql_query ("SELECT id FROM reports WHERE dealtwith=0 AND id IN (" . implode(", ", $_POST['delreport']) . ")");
2020-12-26 01:42:23 +08:00
while ($arr = mysql_fetch_assoc($res))
2021-03-31 03:17:33 +08:00
sql_query ("UPDATE reports SET dealtwith=1, dealtby = {$CURUSER['id']} WHERE id = {$arr['id']}") or sqlerr();
2020-12-26 01:42:23 +08:00
$Cache->delete_value('staff_new_report_count');
}
elseif ($_POST['delete']){
2021-03-31 03:17:33 +08:00
$res = sql_query ("SELECT id FROM reports WHERE id IN (" . implode(", ", $_POST['delreport']) . ")");
2020-12-26 01:42:23 +08:00
while ($arr = mysql_fetch_assoc($res))
2021-03-31 03:17:33 +08:00
sql_query ("DELETE from reports WHERE id = {$arr['id']}") or sqlerr();
2020-12-26 01:42:23 +08:00
$Cache->delete_value('staff_new_report_count');
$Cache->delete_value('staff_report_count');
2022-08-20 19:11:28 +08:00
}
2020-12-26 01:42:23 +08:00
header("Location: reports.php");