Changeset 4 for www/statistic/known_mac.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/known_mac.php
r1 r4 1 <? 1 <?php 2 2 3 include('../db.php'); 4 DB_Init('localhost', 'root', '', 'is'); 3 include('../global.php'); 4 include('../style.php'); 5 ShowHeader('Známé MAC adresy', 'Známé fyzické adresy'); 5 6 6 7 // Preload list from database 7 8 $Hosts = array(); 8 DB_Select('hosts', '*');9 while($Row = DB_Row())9 $DbResult = $Database->select('hosts', '*'); 10 while($Row = $DbResult->fetch_array()) 10 11 { 11 12 $Macs[$Row['MAC']] = $Row['name']; … … 28 29 $Hosts['127.0.0.1'] = 'LOCALHOST'; 29 30 30 DB_Init('localhost', 'root', '','statistic');31 $Database->select_db('statistic'); 31 32 32 33 echo('<table border="1" cellspacing="0" cellpadding="1" style="font-size: 10; font-family: Arial;">'); 33 echo('<tr><th><a href="?order=mac">MAC</a></th><th><a href="?order=ip">Adresa</a></th><th><a href="?order=interface">Rozhran ní</a></th><th><a href="?order=first_time">Poprvé</a></th><th><a href="?order=last_time">Naposled</a></th></tr>');34 echo('<tr><th><a href="?order=mac">MAC</a></th><th><a href="?order=ip">Adresa</a></th><th><a href="?order=interface">Rozhraní</a></th><th><a href="?order=first_time">Poprvé</a></th><th><a href="?order=last_time">Naposled</a></th></tr>'); 34 35 if(array_key_exists('order', $_GET)) $Order = ' ORDER BY '.$_GET['order']; 35 36 else $Order = ' ORDER BY ip'; 36 DB_Select('known_mac', '*', '1'.$Order);37 while($Row = DB_Row())37 $DbResult = $Database->select('known_mac', '*', '1'.$Order); 38 while($Row = $DbResult->fetch_array()) 38 39 { 39 40 if(array_key_exists($Row['mac'], $Macs)) $Row['mac'] = $Macs[$Row['mac']]; … … 41 42 echo('<tr align="right"><td>'.$Row['mac'].'</td><td>'.$Row['ip'].'</td><td>'.$Row['interface'].'</td><td>'.$Row['first_time'].'</td><td>'.$Row['last_time'].'</td></tr>'); 42 43 } 43 echo('</table>Údaje se aktualizují ka¾dých 50 sekund.'); 44 echo('</table>Údaje se aktualizují každých 50 sekund.'); 45 46 ShowFooter(); 44 47 ?>
Note:
See TracChangeset
for help on using the changeset viewer.