Changeset 4 for www/statistic/bandwidth.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/statistic/bandwidth.php
r1 r4 1 <? 1 <?php 2 2 3 3 Header('Refresh: 10'); 4 4 5 include_once('/a/html/is/db.php'); 6 DB_Init('localhost','root','','is'); 7 DB_Query('SET CHARACTER SET latin2'); 5 include_once('../global.php'); 8 6 9 7 include_once('../style.php'); 10 ShowHeader('Zatí ¾ení linky do internetu','Zatí¾ení internetu');8 ShowHeader('Zatížení linky do internetu','Zatížení internetu'); 11 9 12 10 include_once('../finance/include.php'); … … 16 14 17 15 $HostsStat = array(); 18 DB_Select('known_hosts','*');19 while($Row = DB_Row())16 $DbResult = $Database->select('known_hosts','*'); 17 while($Row = $DbResult->fetch_array()) 20 18 { 21 19 $HostsStat[$Row['IP']] = $Row; … … 27 25 $TotalTrafficDown = 0; 28 26 $Users = array(); 29 DB_Select('users', 'id, CONCAT(second_name," ",first_name) as fullname, inet_tarif_now', 'inet=1 ORDER BY fullname');30 while($User = DB_Row())27 $DbResult = $Database->select('users', 'id, CONCAT(second_name," ",first_name) as fullname, inet_tarif_now', 'inet=1 ORDER BY fullname'); 28 while($User = $DbResult->fetch_array()) 31 29 { 32 DB_Save();33 34 30 // Read hosts traffic 35 31 $Hosts = array(); 36 32 $TotalUserTrafficUp = 0; 37 33 $TotalUserTrafficDown = 0; 38 DB_Select('hosts', '*', 'block=0 AND user='.$User['id']);39 while($Host = DB_Row())34 $DbResult2 = $Database->select('hosts', '*', 'block=0 AND user='.$User['id']); 35 while($Host = $DbResult2->fetch_array()) 40 36 { 41 37 if($Host['name'] == 'TBC') continue; … … 55 51 $TotalUserTrafficDown = $TotalUserTrafficDown + $TrafficDown; 56 52 57 DB_Save(); 58 DB_Select('known_hosts_ports', '*', 'host="'.$Host['IP'].'"'); 59 while($Port = DB_Row()) 53 $DbResult3 = $Database->select('known_hosts_ports', '*', 'host="'.$Host['IP'].'"'); 54 while($Port = $DbResult3->fetch_array()) 60 55 { 61 56 $Host['ports'][] = $Port; 62 57 } 63 DB_Load();64 58 if($Host['online'] == 1) $Hosts[] = $Host; 65 59 //echo($Row['IP'].' '.$Row['name'].'<br>'); … … 99 93 $User['hosts'] = $Hosts; 100 94 $Users[] = $User; 101 102 103 DB_Load();104 95 } 105 96 … … 122 113 123 114 // Show table 124 echo('Informace o zatí ¾ení internetu jednotlivými èleny sítì:<br>125 <table style="font-size: small;" cellspacing="0" border="1"><tr><th>Jméno èlena</th><th>Pøíchozí [B/s]</th><th>Odchozí [B/s]</th><th>Podíl [%]</th><th>Limit [B/s]</th></tr>');115 echo('Informace o zatíľení internetu jednotlivými členy sítě:<br> 116 <table style="font-size: small;" cellspacing="0" border="1"><tr><th>Jméno člena</th><th>Příchozí [B/s]</th><th>Odchozí [B/s]</th><th>Podíl [%]</th><th>Limit [B/s]</th></tr>'); 126 117 $TrafficDownT = 0; 127 118 $TrafficUpT = 0;
Note:
See TracChangeset
for help on using the changeset viewer.