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 627B

123456789101112131415161718192021222324252627
  1. <?PHP
  2. chdir('..'); // So all our includes work right
  3. require('ext/pie.php');
  4. require('lib/common.php');
  5. require('lib/database.php');
  6. require('lib/account.php');
  7. $total = 0;
  8. $sql = 'SELECT site_name, site_bandin, site_bandout FROM sites WHERE user_id = '.UID;
  9. $res = mysql_query($sql);
  10. $stuf = array();
  11. while ($row = mysql_fetch_array($res)) {
  12. $stuff[($row['site_name'])] = ((int)$row['site_bandin'] + (int)$row['site_bandout'] ) ;
  13. $total += $stuff[($row['site_name'])];
  14. }
  15. $im = doPie('Bandwidth usage', $stuff);
  16. header('Content-type: image/png');
  17. imagepng($im);
  18. ?>