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.4KB

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