Unsupported scripts and control panel web app for a hosting company
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.

adminusers.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?PHP
  2. if (!defined('LIB_DATABASE')) { require_once('lib/database.php'); }
  3. if (!defined('LIB_COMMON')) { require_once('lib/common.php'); }
  4. if (!defined('ADMIN') || !ADMIN) { die('Admins only'); }
  5. ?>
  6. <div class="block" id="users">
  7. <h2>ADMIN: Users</h2>
  8. <table class="innerblock">
  9. <tr>
  10. <th>&nbsp;</th>
  11. <th>Name</th>
  12. <th>E-Mail</th>
  13. <th>Bandwidth</th>
  14. <th>HDD</th>
  15. <th>Actions</th>
  16. </tr>
  17. <?PHP
  18. $i = 0;
  19. $sql = 'SELECT user_id, user_name, user_email, band_used, band_total, hdd_used, hdd_total FROM users';
  20. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  21. while ($row = mysql_fetch_array($res)) {
  22. ?>
  23. <tr class="<?PHP echo ($i == 0) ? 'even' : 'odd'; ?>">
  24. <td><?PHP echo $row['user_id']; ?>.</td>
  25. <td><?PHP echo h($row['user_name']); ?></td>
  26. <td><?PHP echo h($row['user_email']); ?></td>
  27. <td><?PHP
  28. $p = round(100 * $row['band_used'] / $row['band_total'],0);
  29. echo '<img src="'.CP_PATH.'res/bandout.png" style="width: '.$p.'px; height: 10px;" alt="Used" title="'.$p.'% used">';
  30. echo '<img src="'.CP_PATH.'res/bandfree.png" style="width: '.(100-$p).'px; height: 10px;" alt="Free" title="'.(100-$p).'% free">';
  31. ?></td>
  32. <td><?PHP
  33. $p = round(100 * $row['hdd_used'] / $row['hdd_total'],0);
  34. echo '<img src="'.CP_PATH.'res/bandout.png" style="width: '.$p.'px; height: 10px;" alt="Used" title="'.$p.'% used">';
  35. echo '<img src="'.CP_PATH.'res/bandfree.png" style="width: '.(100-$p).'px; height: 10px;" alt="Free" title="'.(100-$p).'% free">';
  36. ?></td>
  37. <td>
  38. <a href="<?PHP echo CP_PATH.'checkuser/'.$row['user_id']; ?>">Check</a>
  39. <a href="<?PHP echo CP_PATH.'spoofuser/'.$row['user_id']; ?>">Spoof</a>
  40. </td>
  41. </tr>
  42. <?PHP
  43. $i = 1 - $i;
  44. }
  45. ?>
  46. </table>
  47. </div>