mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-18 16:03:12 -04:00
99 lines
3.7 KiB
PHP
99 lines
3.7 KiB
PHP
<?php
|
|
if (!check_perms('site_view_flow')) {
|
|
error(403);
|
|
}
|
|
View::show_header('Upscale Pool');
|
|
define('USERS_PER_PAGE', 50);
|
|
list($Page, $Limit) = Format::page_limit(USERS_PER_PAGE);
|
|
|
|
$RS = $DB->query("
|
|
SELECT
|
|
SQL_CALC_FOUND_ROWS
|
|
um.ID,
|
|
um.Username,
|
|
uls.Uploaded,
|
|
uls.Downloaded,
|
|
um.PermissionID,
|
|
um.Enabled,
|
|
i.Donor,
|
|
i.Warned,
|
|
i.JoinDate,
|
|
i.RatioWatchEnds,
|
|
i.RatioWatchDownload,
|
|
um.RequiredRatio
|
|
FROM users_main AS um
|
|
INNER JOIN users_leech_stats AS uls ON (uls.UserID = um.ID)
|
|
INNER JOIN users_info AS i ON (i.UserID = um.ID)
|
|
WHERE i.RatioWatchEnds > now()
|
|
AND um.Enabled = '1'
|
|
ORDER BY i.RatioWatchEnds ASC
|
|
LIMIT $Limit");
|
|
$DB->query('SELECT FOUND_ROWS()');
|
|
list($Results) = $DB->next_record();
|
|
$DB->query("
|
|
SELECT COUNT(UserID)
|
|
FROM users_info
|
|
WHERE BanDate IS NOT NULL
|
|
AND BanReason = '2'");
|
|
list($TotalDisabled) = $DB->next_record();
|
|
$DB->set_query_id($RS);
|
|
?>
|
|
<div class="header">
|
|
<h2>Upscale Pool</h2>
|
|
</div>
|
|
<?php
|
|
if ($DB->has_results()) {
|
|
?>
|
|
<div class="box pad thin">
|
|
<p>There are currently <?=number_format($Results)?> enabled users on Ratio Watch and <?=number_format($TotalDisabled)?> already disabled.</p>
|
|
</div>
|
|
<div class="linkbox">
|
|
<?php
|
|
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
|
|
echo $Pages;
|
|
?>
|
|
</div>
|
|
<table width="100%">
|
|
<tr class="colhead">
|
|
<td>User</td>
|
|
<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>
|
|
<td>Lifespan</td>
|
|
</tr>
|
|
<?php
|
|
while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio) = $DB->next_record()) {
|
|
$Row = $Row === 'b' ? 'a' : 'b';
|
|
|
|
?>
|
|
<tr class="row<?=$Row?>">
|
|
<td><?=Users::format_username($UserID, true, true, true, true)?></td>
|
|
<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"><?php if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);} ?></td>
|
|
<td class="number_column"><?=Format::get_size($Downloaded - $RatioWatchDownload)?></td>
|
|
<td><?=time_diff($Joined, 2)?></td>
|
|
<td><?=time_diff($RatioWatchEnds)?></td>
|
|
<td><?php /*time_diff(strtotime($Joined), strtotime($RatioWatchEnds))*/?></td>
|
|
</tr>
|
|
<?php
|
|
} ?>
|
|
</table>
|
|
<div class="linkbox">
|
|
<?php echo $Pages; ?>
|
|
</div>
|
|
<?php
|
|
} else { ?>
|
|
<h2 align="center">There are currently no users on ratio watch.</h2>
|
|
<?php
|
|
}
|
|
|
|
View::show_footer();
|