$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
Username |
Reports |
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
>
=$Username?> |
=number_format($Reports)?> |
}
?>
$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 1 WEEK
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
Reports resolved in the last week
Username |
Reports |
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
>
=$Username?> |
=number_format($Reports)?> |
}
?>
$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 1 MONTH
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
Reports resolved in the last month
Username |
Reports |
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
>
=$Username?> |
=number_format($Reports)?> |
}
?>
$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
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
Reports resolved since Reports v2 (2009-07-27)
Username |
Reports |
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
>
=$Username?> |
=number_format($Reports)?> |
}
?>
Different view modes by person
By ID of torrent reported:
By group ID 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
FROM reportsv2 AS r
LEFT JOIN users_main AS um ON r.ResolverID = um.ID
WHERE r.Status = 'InProgress'
GROUP BY r.ResolverID");
$Staff = $DB->to_array();
?>
Currently assigned reports by staff member
Staff Member |
Current Count |
foreach ($Staff as $Array) {
if ($Array['Username'] == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
>
=display_str($Array['Username'])?>'s reports
|
=number_format($Array['Count'])?> |
} ?>
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)) {
?>
Type |
Current Count |
foreach ($Current as $Array) {
//Ugliness
foreach ($Types as $Category) {
if (!empty($Category[$Array['Type']])) {
$Title = $Category[$Array['Type']]['title'];
break;
}
}
?>
>
=display_str($Title)?>
|
=number_format($Array['Count'])?>
|
}
}
?>