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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. #declare(strict_types=1);
  3. if (!check_perms('site_view_flow')) {
  4. error(403);
  5. }
  6. View::show_header('Upscale Pool');
  7. define('USERS_PER_PAGE', 50);
  8. list($Page, $Limit) = Format::page_limit(USERS_PER_PAGE);
  9. $RS = $DB->query("
  10. SELECT
  11. SQL_CALC_FOUND_ROWS
  12. m.ID,
  13. m.Username,
  14. m.Uploaded,
  15. m.Downloaded,
  16. m.PermissionID,
  17. m.Enabled,
  18. i.Donor,
  19. i.Warned,
  20. i.JoinDate,
  21. i.RatioWatchEnds,
  22. i.RatioWatchDownload,
  23. m.RequiredRatio
  24. FROM users_main AS m
  25. LEFT JOIN users_info AS i ON i.UserID = m.ID
  26. WHERE i.RatioWatchEnds IS NOT NULL
  27. AND m.Enabled = '1'
  28. ORDER BY i.RatioWatchEnds ASC
  29. LIMIT $Limit");
  30. $DB->query('SELECT FOUND_ROWS()');
  31. list($Results) = $DB->next_record();
  32. $DB->query("
  33. SELECT COUNT(UserID)
  34. FROM users_info
  35. WHERE BanDate IS NOT NULL
  36. AND BanReason = '2'");
  37. list($TotalDisabled) = $DB->next_record();
  38. $DB->set_query_id($RS);
  39. ?>
  40. <div class="header">
  41. <h2>Upscale Pool</h2>
  42. </div>
  43. <?php
  44. if ($DB->has_results()) {
  45. ?>
  46. <div class="box pad">
  47. <p>There are currently <?=number_format($Results)?> enabled users
  48. on Ratio Watch and <?=number_format($TotalDisabled)?> already
  49. disabled.</p>
  50. </div>
  51. <div class="linkbox">
  52. <?php
  53. $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
  54. echo $Pages; ?>
  55. </div>
  56. <table width="100%">
  57. <tr class="colhead">
  58. <td>User</td>
  59. <td class="number_column">Uploaded</td>
  60. <td class="number_column">Downloaded</td>
  61. <td class="number_column">Ratio</td>
  62. <td class="number_column">Required Ratio</td>
  63. <td class="number_column">Deficit</td>
  64. <td class="number_column">Gamble</td>
  65. <td>Registration Date</td>
  66. <td>Ratio Watch Ended/Ends</td>
  67. <td>Lifespan</td>
  68. </tr>
  69. <?php
  70. while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio) = $DB->next_record()) {
  71. ?>
  72. <tr class="row">
  73. <td>
  74. <?=Users::format_username($UserID, true, true, true, true)?>
  75. </td>
  76. <td class="number_column">
  77. <?=Format::get_size($Uploaded)?>
  78. </td>
  79. <td class="number_column">
  80. <?=Format::get_size($Downloaded)?>
  81. </td>
  82. <td class="number_column">
  83. <?=Format::get_ratio_html($Uploaded, $Downloaded)?>
  84. </td>
  85. <td class="number_column">
  86. <?=number_format($RequiredRatio, 2)?>
  87. </td>
  88. <td class="number_column">
  89. <?php if (($Downloaded * $RequiredRatio) > $Uploaded) {
  90. echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);
  91. } ?>
  92. </td>
  93. <td class="number_column">
  94. <?=Format::get_size($Downloaded - $RatioWatchDownload)?>
  95. </td>
  96. <td>
  97. <?=time_diff($Joined, 2)?>
  98. </td>
  99. <td>
  100. <?=time_diff($RatioWatchEnds)?>
  101. </td>
  102. <td>
  103. <?//time_diff(strtotime($Joined), strtotime($RatioWatchEnds))?>
  104. </td>
  105. </tr>
  106. <?php
  107. } ?>
  108. </table>
  109. <div class="linkbox">
  110. <?= $Pages; ?>
  111. </div>
  112. <?php
  113. } else { ?>
  114. <h2>There are currently no users on ratio watch.</h2>
  115. <?php
  116. }
  117. View::show_footer();