/* * This page is to outline all the sexy views build into reports v2. * It's used as the main page as it also lists the current reports by type * and also current in progress reports by staff member. * All the different views are self explanatory by their names. */ if(!check_perms('admin_reports')){ error(403); } show_header('Reports V2!', 'reportsv2'); //Grab owners ID, just for examples $DB->query("SELECT ID, Username FROM users_main ORDER BY ID ASC LIMIT 1"); list($OwnerID, $Owner) = $DB->next_record(); $Owner = display_str($Owner); ?>
$DB->query("SELECT um.ID, um.Username, COUNT(r.ID) AS Reports FROM reportsv2 AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.LastChangeTime > NOW() - INTERVAL 24 HOUR GROUP BY r.ResolverID ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
Reports resolved in the last 24 hours
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reportsv2 AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.LastChangeTime > NOW() - INTERVAL 1 WEEK GROUP BY r.ResolverID ORDER BY Reports DESC"); $Results = $DB->to_array(); ?> Reports resolved in the last week
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reportsv2 AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.LastChangeTime > NOW() - INTERVAL 1 MONTH GROUP BY r.ResolverID ORDER BY Reports DESC"); $Results = $DB->to_array(); ?> Reports resolved in the last month
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reportsv2 AS r JOIN users_main AS um ON um.ID=r.ResolverID GROUP BY r.ResolverID ORDER BY Reports DESC"); $Results = $DB->to_array(); ?> Reports resolved since reportsv2 (2009-07-27)
Different view modes by personBy ID of torrent reported.
By GroupID of torrent reported.
By Report ID.
By Reporter ID.
By uploader ID.
By resolver ID.
For browsing anything more complicated than these, use the search feature. |
$DB->query("SELECT r.ResolverID,
um.Username,
COUNT(r.ID) AS Count,
COUNT(tasted.Tasted) AS Tasted
FROM reportsv2 AS r
LEFT JOIN users_main AS um ON r.ResolverID=um.ID
LEFT JOIN torrents AS tasted ON tasted.ID=r.TorrentID AND tasted.Tasted = '1'
WHERE r.Status = 'InProgress'
GROUP BY r.ResolverID");
$Staff = $DB->to_array();
?>
Currently assigned reports by staff member
Different view modes by report type$DB->query("SELECT r.Type, COUNT(r.ID) AS Count FROM reportsv2 AS r WHERE r.Status='New' GROUP BY r.Type"); $Current = $DB->to_array(); if(!empty($Current)) { ?>
|