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.

bandwidth.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?PHP
  2. if (defined('NOBILLREF')) { return; }
  3. require_once('lib/profiler.php');
  4. $sql = 'SELECT band_total, band_used, hdd_total, hdd_used FROM users WHERE user_id = '.UID;
  5. $ress = mq($sql, __FILE__, __LINE__);
  6. $row = mysql_fetch_array($ress);
  7. $used = round($row[1] * (150/($row[0])),0);
  8. $free = 150 - $used;
  9. $hused = round($row[3] * (150/($row[2])),0);
  10. $hfree = 150 - $hused;
  11. $sql = 'SELECT MIN(up_expires) FROM userpackages WHERE';
  12. $sql .= ' user_id = '.UID.' AND up_invoice = 1 AND up_active = 1';
  13. $ress = mq($sql, __FILE__, __LINE__);
  14. $pay = mysql_fetch_array($ress);
  15. $next = $pay[0];
  16. ?>
  17. <table id="bandwidth" class="righthead">
  18. <tr>
  19. <th>Bandwidth</th>
  20. <td>
  21. <img src="<?PHP echo CP_PATH; ?>res/bandout-001.png" alt="[Red]" title="Bandwidth used" width="<?PHP echo $used; ?>" height="10"><img src="<?PHP echo CP_PATH; ?>res/bandfree-001.png" alt="[Green]" title="Free bandwidth" width="<?PHP echo $free; ?>" height="10">
  22. </td>
  23. <td><?PHP echo niceSize($row[1]).' / '.niceSize($row[0]); ?></td>
  24. </tr>
  25. <tr>
  26. <th>Hard drive</th>
  27. <td>
  28. <img src="<?PHP echo CP_PATH; ?>res/bandout-001.png" alt="[Red]" title="Hard drive space used" width="<?PHP echo $hused; ?>" height="10"><img src="<?PHP echo CP_PATH; ?>res/bandfree-001.png" alt="[Green]" title="Free space" width="<?PHP echo $hfree; ?>" height="10">
  29. </td>
  30. <td><?PHP echo niceSize($row[3]).' / '.niceSize($row[2]); ?></td>
  31. </tr>
  32. <tr>
  33. <th>Next payment</th>
  34. <td colspan="2" style="text-align: center"><?PHP echo date('l, jS F, Y', $next); ?></td>
  35. </tr>
  36. </table>