BioTorrents.de’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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 IS NOT 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 IS NOT 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. <?php
  43. if ($DB->has_results()) {
  44. ?>
  45. <div class="box pad">
  46. <p>There are currently <?=number_format($Results)?> enabled users
  47. on Ratio Watch and <?=number_format($TotalDisabled)?> already
  48. disabled.</p>
  49. </div>
  50. <div class="linkbox">
  51. <?php
  52. $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
  53. echo $Pages; ?>
  54. </div>
  55. <table width="100%">
  56. <tr class="colhead">
  57. <td>User</td>
  58. <td class="number_column">Uploaded</td>
  59. <td class="number_column">Downloaded</td>
  60. <td class="number_column">Ratio</td>
  61. <td class="number_column">Required Ratio</td>
  62. <td class="number_column">Deficit</td>
  63. <td class="number_column">Gamble</td>
  64. <td>Registration Date</td>
  65. <td>Ratio Watch Ended/Ends</td>
  66. <td>Lifespan</td>
  67. </tr>
  68. <?php
  69. while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio) = $DB->next_record()) {
  70. ?>
  71. <tr class="row">
  72. <td>
  73. <?=Users::format_username($UserID, true, true, true, true)?>
  74. </td>
  75. <td class="number_column">
  76. <?=Format::get_size($Uploaded)?>
  77. </td>
  78. <td class="number_column">
  79. <?=Format::get_size($Downloaded)?>
  80. </td>
  81. <td class="number_column">
  82. <?=Format::get_ratio_html($Uploaded, $Downloaded)?>
  83. </td>
  84. <td class="number_column">
  85. <?=number_format($RequiredRatio, 2)?>
  86. </td>
  87. <td class="number_column">
  88. <?php if (($Downloaded * $RequiredRatio) > $Uploaded) {
  89. echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);
  90. } ?>
  91. </td>
  92. <td class="number_column">
  93. <?=Format::get_size($Downloaded - $RatioWatchDownload)?>
  94. </td>
  95. <td>
  96. <?=time_diff($Joined, 2)?>
  97. </td>
  98. <td>
  99. <?=time_diff($RatioWatchEnds)?>
  100. </td>
  101. <td>
  102. <?//time_diff(strtotime($Joined), strtotime($RatioWatchEnds))?>
  103. </td>
  104. </tr>
  105. <?php
  106. } ?>
  107. </table>
  108. <div class="linkbox">
  109. <?= $Pages; ?>
  110. </div>
  111. <?php
  112. } else { ?>
  113. <h2>There are currently no users on ratio watch.</h2>
  114. <?php
  115. }
  116. View::show_footer();