2011-03-28 14:21:28 +00:00
< ?
/*
2012-12-21 08:00:21 +00:00
* This page is to outline all of the views built into reports v2 .
2011-03-28 14:21:28 +00:00
* It ' s used as the main page as it also lists the current reports by type
2012-12-21 08:00:21 +00:00
* and the current in - progress reports by staff member .
2011-03-28 14:21:28 +00:00
* All the different views are self explanatory by their names .
*/
if ( ! check_perms ( 'admin_reports' )){
error ( 403 );
}
2012-10-11 08:00:15 +00:00
View :: show_header ( 'Reports V2!' , 'reportsv2' );
2012-08-19 08:00:19 +00:00
2011-03-28 14:21:28 +00:00
2013-03-05 08:00:26 +00:00
//Grab owner's ID, just for examples
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT ID, Username FROM users_main ORDER BY ID ASC LIMIT 1 " );
list ( $OwnerID , $Owner ) = $DB -> next_record ();
$Owner = display_str ( $Owner );
?>
2012-08-19 08:00:19 +00:00
< div class = " header " >
< h2 > Reports v2 Information !</ h2 >
< ? include ( 'header.php' ); ?>
</ div >
2011-03-28 14:21:28 +00:00
< br />
< div class = " box pad thin " style = " padding: 0px 0px 0px 20px; width: 70%; margin-left: auto; margin-right: auto " >
2012-09-01 08:00:24 +00:00
< table class = " layout " >< tr >< td style = " width: 50%; " >
2011-03-28 14:21:28 +00:00
< ?
$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 ();
?>
< strong > Reports resolved in the last 24 hours </ strong >
< table class = " border " >
< tr >
< td class = " head colhead_dark " > Username </ td >
< td class = " head colhead_dark " > Reports </ td >
</ tr >
< ? foreach ( $Results as $Result ) {
list ( $UserID , $Username , $Reports ) = $Result ;
?>
< tr >
< td >< a href = " reportsv2.php?view=resolver&id=<?= $UserID ?> " >< ? = $Username ?> </a></td>
2012-12-21 08:00:21 +00:00
< td >< ? = number_format ( $Reports ) ?> </td>
2011-03-28 14:21:28 +00:00
</ tr >
< ? } ?>
</ table >
< br />
< ?
2013-01-06 08:00:28 +00:00
$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 " );
2011-03-28 14:21:28 +00:00
$Results = $DB -> to_array ();
?>
< strong > Reports resolved in the last week </ strong >
< table class = " border " >
< tr >
< td class = " head colhead_dark " > Username </ td >
< td class = " head colhead_dark " > Reports </ td >
</ tr >
< ? foreach ( $Results as $Result ) {
2013-01-06 08:00:28 +00:00
list ( $UserID , $Username , $Reports ) = $Result ;
2011-03-28 14:21:28 +00:00
?>
< tr >
2012-12-27 08:00:27 +00:00
< td >< a href = " reportsv2.php?view=resolver&id=<?= $UserID ?> " >< ? = $Username ?> </a></td>
2012-12-21 08:00:21 +00:00
< td >< ? = number_format ( $Reports ) ?> </td>
2011-03-28 14:21:28 +00:00
</ tr >
< ? } ?>
</ table >
< br />
< ?
2013-01-06 08:00:28 +00:00
$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 " );
2011-03-28 14:21:28 +00:00
$Results = $DB -> to_array ();
?>
< strong > Reports resolved in the last month </ strong >
< table class = " border " >
< tr >
< td class = " head colhead_dark " > Username </ td >
< td class = " head colhead_dark " > Reports </ td >
</ tr >
< ? foreach ( $Results as $Result ) {
2013-01-06 08:00:28 +00:00
list ( $UserID , $Username , $Reports ) = $Result ;
2011-03-28 14:21:28 +00:00
?>
< tr >
2012-12-27 08:00:27 +00:00
< td >< a href = " reportsv2.php?view=resolver&id=<?= $UserID ?> " >< ? = $Username ?> </a></td>
2012-12-21 08:00:21 +00:00
< td >< ? = number_format ( $Reports ) ?> </td>
2011-03-28 14:21:28 +00:00
</ tr >
< ? } ?>
</ table >
< br />
< ?
$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 ();
?>
2012-12-21 08:00:21 +00:00
< strong > Reports resolved since Reports v2 ( 2009 - 07 - 27 ) </ strong >
2011-03-28 14:21:28 +00:00
< table class = " border " >
< tr >
< td class = " head colhead_dark " > Username </ td >
< td class = " head colhead_dark " > Reports </ td >
</ tr >
< ? foreach ( $Results as $Result ) {
list ( $Username , $Reports ) = $Result ;
?>
< tr >
< td >< ? = $Username ?> </td>
2012-12-21 08:00:21 +00:00
< td >< ? = number_format ( $Reports ) ?> </td>
2011-03-28 14:21:28 +00:00
</ tr >
< ? } ?>
</ table >
< br />
< h3 > Different view modes by person </ h3 >
< br />
2012-12-21 08:00:21 +00:00
< strong > By ID of torrent reported :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
Reports of torrents with ID = 1
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=torrent&id=1 " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=torrent&id=1</a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />
2012-12-21 08:00:21 +00:00
< strong > By group ID of torrent reported :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
Reports of torrents within the group with ID = 1
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=group&id=1 " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=group&id=1</a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />
2012-12-21 08:00:21 +00:00
< strong > By report ID :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
The report with ID = 1
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=report&id=1 " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=report&id=1</a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />
2012-12-21 08:00:21 +00:00
< strong > By reporter ID :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
Reports created by < ? = $Owner ?>
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=reporter&id=<?= $OwnerID ?> " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=reporter&id=<?=$OwnerID?></a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />
2012-12-21 08:00:21 +00:00
< strong > By uploader ID :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
Reports for torrents uploaded by < ? = $Owner ?>
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=uploader&id=<?= $OwnerID ?> " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=uploader&id=<?=$OwnerID?></a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />
2012-12-21 08:00:21 +00:00
< strong > By resolver ID :</ strong >
2011-03-28 14:21:28 +00:00
< ul >
< li >
Reports for torrents resolved by < ? = $Owner ?>
</ li >
< li >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=resolver&id=<?= $OwnerID ?> " > https ://< ? = SSL_SITE_URL ?> /reportsv2.php?view=resolver&id=<?=$OwnerID?></a>
2011-03-28 14:21:28 +00:00
</ li >
</ ul >
< br />< br />
< strong > For browsing anything more complicated than these , use the search feature .</ strong >
</ td >
< td style = " vertical-align: top; " >
< ?
$DB -> query ( " SELECT r.ResolverID,
2013-02-22 08:00:24 +00:00
um . Username ,
2011-03-28 14:21:28 +00:00
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 ();
?>
< strong > Currently assigned reports by staff member </ strong >
< table >
2012-09-01 08:00:24 +00:00
< tr class = " colhead " >
< td > Staff member </ td >
2012-12-21 08:00:21 +00:00
< td > Current count </ td >
2012-12-27 08:00:27 +00:00
< td > Tasted count </ td >
2011-03-28 14:21:28 +00:00
</ tr >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
foreach ( $Staff as $Array ) { ?>
< tr >
< td >
< a href = " reportsv2.php?view=staff&id=<?= $Array['ResolverID'] ?> " >< ? = display_str ( $Array [ 'Username' ]) ?> 's reports</a>
</ td >
2012-12-27 08:00:27 +00:00
< td >< ? = number_format ( $Array [ 'Count' ]) ?> </td>
2011-03-28 14:21:28 +00:00
< td >
2012-12-27 08:00:27 +00:00
< a href = " reportsv2.php?view=tasted&id=<?= $Array['ResolverID'] ?> " >< ? = number_format ( $Array [ 'Tasted' ]) ?> </a>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
}
?>
</ table >
< br />
< h3 > Different view modes by report type </ h3 >
< ?
$DB -> query ( " SELECT r.Type,
COUNT ( r . ID ) AS Count
2013-02-22 08:00:24 +00:00
FROM reportsv2 AS r
2011-03-28 14:21:28 +00:00
WHERE r . Status = 'New'
GROUP BY r . Type " );
$Current = $DB -> to_array ();
if ( ! empty ( $Current )) {
?>
< table >
2012-09-01 08:00:24 +00:00
< tr class = " colhead " >
< td > Type </ td >
2012-12-21 08:00:21 +00:00
< td > Current count </ td >
2011-03-28 14:21:28 +00:00
</ tr >
< ?
foreach ( $Current as $Array ) {
//Ugliness
foreach ( $Types as $Category ) {
if ( ! empty ( $Category [ $Array [ 'Type' ]])) {
$Title = $Category [ $Array [ 'Type' ]][ 'title' ];
break ;
}
}
?>
< tr >
< td >
< a href = " reportsv2.php?view=type&id=<?=display_str( $Array['Type'] )?> " >< ? = display_str ( $Title ) ?> </a>
</ td >
< td >
2012-12-21 08:00:21 +00:00
< ? = number_format ( $Array [ 'Count' ]) ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ?
}
}
?>
</ table >
</ td ></ tr ></ table >
</ div >
< ?
2012-10-11 08:00:15 +00:00
View :: show_footer ();
2011-03-28 14:21:28 +00:00
?>