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.

admin.users.php 1.6KB

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