Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upscale_pool.php 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. if (!check_perms('site_view_flow')) {
  3. error(403);
  4. }
  5. View::show_header('Upscale Pool');
  6. define('USERS_PER_PAGE', 50);
  7. list($Page, $Limit) = Format::page_limit(USERS_PER_PAGE);
  8. $RS = $DB->query("
  9. SELECT
  10. SQL_CALC_FOUND_ROWS
  11. m.ID,
  12. m.Username,
  13. m.Uploaded,
  14. m.Downloaded,
  15. m.PermissionID,
  16. m.Enabled,
  17. i.Donor,
  18. i.Warned,
  19. i.JoinDate,
  20. i.RatioWatchEnds,
  21. i.RatioWatchDownload,
  22. m.RequiredRatio
  23. FROM users_main AS m
  24. LEFT JOIN users_info AS i ON i.UserID = m.ID
  25. WHERE i.RatioWatchEnds != NULL
  26. AND m.Enabled = '1'
  27. ORDER BY i.RatioWatchEnds ASC
  28. LIMIT $Limit");
  29. $DB->query('SELECT FOUND_ROWS()');
  30. list($Results) = $DB->next_record();
  31. $DB->query("
  32. SELECT COUNT(UserID)
  33. FROM users_info
  34. WHERE BanDate != NULL
  35. AND BanReason = '2'");
  36. list($TotalDisabled) = $DB->next_record();
  37. $DB->set_query_id($RS);
  38. ?>
  39. <div class="header">
  40. <h2>Upscale Pool</h2>
  41. </div>
  42. <?
  43. if ($DB->has_results()) {
  44. ?>
  45. <div class="box pad thin">
  46. <p>There are currently <?=number_format($Results)?> enabled users on Ratio Watch and <?=number_format($TotalDisabled)?> already disabled.</p>
  47. </div>
  48. <div class="linkbox">
  49. <?
  50. $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
  51. echo $Pages;
  52. ?>
  53. </div>
  54. <table width="100%">
  55. <tr class="colhead">
  56. <td>User</td>
  57. <td class="number_column">Uploaded</td>
  58. <td class="number_column">Downloaded</td>
  59. <td class="number_column">Ratio</td>
  60. <td class="number_column">Required Ratio</td>
  61. <td class="number_column tooltip" title="How much the user needs to upload to meet his or her required ratio">Deficit</td>
  62. <td class="number_column tooltip" title="How much the user has downloaded on Ratio Watch">Gamble</td>
  63. <td>Registration Date</td>
  64. <td class="tooltip" title="If the time shown here ends in &quot;ago&quot;, 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 &quot;ago&quot;, then this is the time until the two week Ratio Watch period expires.">Ratio Watch Ended/Ends</td>
  65. <td>Lifespan</td>
  66. </tr>
  67. <?
  68. while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio) = $DB->next_record()) {
  69. ?>
  70. <tr class="row">
  71. <td><?=Users::format_username($UserID, true, true, true, true)?></td>
  72. <td class="number_column"><?=Format::get_size($Uploaded)?></td>
  73. <td class="number_column"><?=Format::get_size($Downloaded)?></td>
  74. <td class="number_column"><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td>
  75. <td class="number_column"><?=number_format($RequiredRatio, 2)?></td>
  76. <td class="number_column"><? if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);} ?></td>
  77. <td class="number_column"><?=Format::get_size($Downloaded - $RatioWatchDownload)?></td>
  78. <td><?=time_diff($Joined, 2)?></td>
  79. <td><?=time_diff($RatioWatchEnds)?></td>
  80. <td><?//time_diff(strtotime($Joined), strtotime($RatioWatchEnds))?></td>
  81. </tr>
  82. <? } ?>
  83. </table>
  84. <div class="linkbox">
  85. <? echo $Pages; ?>
  86. </div>
  87. <?
  88. } else { ?>
  89. <h2 align="center">There are currently no users on ratio watch.</h2>
  90. <?
  91. }
  92. View::show_footer();
  93. ?>