2013-05-28 08:01:02 +00:00
< ? php
2013-04-05 08:00:43 +00:00
if ( ! check_perms ( 'site_view_flow' )) {
error ( 403 );
}
2012-10-11 08:00:15 +00:00
View :: show_header ( 'Upscale Pool' );
2011-03-28 14:21:28 +00:00
define ( 'USERS_PER_PAGE' , 50 );
2013-05-28 08:01:02 +00:00
list ( $Page , $Limit ) = Format :: page_limit ( USERS_PER_PAGE );
2011-03-28 14:21:28 +00:00
2013-05-15 08:00:54 +00:00
$RS = $DB -> query ( "
SELECT
SQL_CALC_FOUND_ROWS
m . ID ,
m . Username ,
m . Uploaded ,
m . Downloaded ,
m . PermissionID ,
m . Enabled ,
i . Donor ,
i . Warned ,
i . JoinDate ,
i . RatioWatchEnds ,
i . RatioWatchDownload ,
m . RequiredRatio
2013-02-22 08:00:24 +00:00
FROM users_main AS m
2013-07-13 08:00:46 +00:00
LEFT JOIN users_info AS i ON i . UserID = m . ID
2011-03-28 14:21:28 +00:00
WHERE i . RatioWatchEnds != '0000-00-00 00:00:00'
2013-05-15 08:00:54 +00:00
AND m . Enabled = '1'
ORDER BY i . RatioWatchEnds ASC
LIMIT $Limit " );
2013-07-13 08:00:46 +00:00
$DB -> query ( 'SELECT FOUND_ROWS()' );
2011-03-28 14:21:28 +00:00
list ( $Results ) = $DB -> next_record ();
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT COUNT ( UserID )
FROM users_info
WHERE BanDate != '0000-00-00 00:00:00'
AND BanReason = '2' " );
2011-03-28 14:21:28 +00:00
list ( $TotalDisabled ) = $DB -> next_record ();
$DB -> set_query_id ( $RS );
2013-10-01 23:08:42 +00:00
?>
< div class = " header " >
< h2 > Upscale Pool </ h2 >
</ div >
< ?
2013-07-10 00:08:53 +00:00
if ( $DB -> has_results ()) {
2011-03-28 14:21:28 +00:00
?>
2013-10-01 23:08:42 +00:00
< div class = " box pad thin " >
< p > There are currently < ? = number_format ( $Results ) ?> enabled users on Ratio Watch and <?=number_format($TotalDisabled)?> already disabled.</p>
2011-03-28 14:21:28 +00:00
</ div >
< div class = " linkbox " >
< ?
2013-05-15 08:00:54 +00:00
$Pages = Format :: get_pages ( $Page , $Results , USERS_PER_PAGE , 11 );
2011-03-28 14:21:28 +00:00
echo $Pages ;
?>
</ div >
< table width = " 100% " >
< tr class = " colhead " >
< td > User </ td >
2013-10-01 23:08:42 +00:00
< td class = " number_column " > Uploaded </ td >
< td class = " number_column " > Downloaded </ td >
< td class = " number_column " > Ratio </ td >
< td class = " number_column " > Required Ratio </ td >
< td class = " number_column tooltip " title = " How much the user needs to upload to meet his or her required ratio " > Deficit </ td >
< td class = " number_column tooltip " title = " How much the user has downloaded on Ratio Watch " > Gamble </ td >
< td > Registration Date </ td >
< td class = " tooltip " title = " If the time shown here ends in "ago", then this is how long the user has been on ratio watch and/or below his or her required ratio. If the time shown here does not end in "ago", then this is the time until the two week Ratio Watch period expires. " > Ratio Watch Ended / Ends </ td >
2011-03-28 14:21:28 +00:00
< td > Lifespan </ td >
</ tr >
< ?
2013-05-15 08:00:54 +00:00
while ( list ( $UserID , $Username , $Uploaded , $Downloaded , $PermissionID , $Enabled , $Donor , $Warned , $Joined , $RatioWatchEnds , $RatioWatchDownload , $RequiredRatio ) = $DB -> next_record ()) {
2013-07-13 08:00:46 +00:00
$Row = $Row === 'b' ? 'a' : 'b' ;
2011-03-28 14:21:28 +00:00
?>
< tr class = " row<?= $Row ?> " >
2012-10-11 08:00:15 +00:00
< td >< ? = Users :: format_username ( $UserID , true , true , true , true ) ?> </td>
2013-10-01 23:08:42 +00:00
< td class = " number_column " >< ? = Format :: get_size ( $Uploaded ) ?> </td>
< td class = " number_column " >< ? = Format :: get_size ( $Downloaded ) ?> </td>
< td class = " number_column " >< ? = Format :: get_ratio_html ( $Uploaded , $Downloaded ) ?> </td>
< td class = " number_column " >< ? = number_format ( $RequiredRatio , 2 ) ?> </td>
< td class = " number_column " >< ? if (( $Downloaded * $RequiredRatio ) > $Uploaded ) { echo Format :: get_size (( $Downloaded * $RequiredRatio ) - $Uploaded );} ?> </td>
< td class = " number_column " >< ? = Format :: get_size ( $Downloaded - $RatioWatchDownload ) ?> </td>
2013-07-13 08:00:46 +00:00
< td >< ? = time_diff ( $Joined , 2 ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< ? = time_diff ( $RatioWatchEnds ) ?> </td>
< td >< ? //time_diff(strtotime($Joined), strtotime($RatioWatchEnds))?></td>
</ tr >
< ? } ?>
</ table >
< div class = " linkbox " >
2013-04-05 08:00:43 +00:00
< ? echo $Pages ; ?>
2011-03-28 14:21:28 +00:00
</ div >
2013-07-13 08:00:46 +00:00
< ?
} else { ?>
2011-03-28 14:21:28 +00:00
< h2 align = " center " > There are currently no users on ratio watch .</ h2 >
2013-07-13 08:00:46 +00:00
< ?
}
2012-10-11 08:00:15 +00:00
View :: show_footer ();
2011-03-28 14:21:28 +00:00
?>