Changeset 40 for www/share/online.php
- Timestamp:
- Feb 1, 2008, 7:57:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/share/online.php
r1 r40 1 <? 2 include('../ db.php');3 DB_Init('localhost','root','','share');4 echo("\n====================== Kontrol elonline pocitacu ============================\n\n");1 <?php 2 include('../global.php'); 3 //$Database->select_db('share'); 4 echo("\n====================== Kontrola online pocitacu ============================\n\n"); 5 5 //while(true) 6 6 { … … 70 70 71 71 // Deaktivuj predchozi online pocitace 72 DB_Update('hosts', 1, array('online' => 0));72 $Database->update('hosts', 1, array('online' => 0)); 73 73 74 74 //print_r($Online); … … 76 76 foreach($Online as $Item) 77 77 { 78 DB_Query("SELECT * FROM hosts WHERE name='".$Item['host']."'");79 if( DB_NumRows()>0)78 $DbResult = $Database->query("SELECT * FROM hosts WHERE name='".$Item['host']."'"); 79 if($DbResult->num_rows > 0) 80 80 { 81 DB_Update('hosts',"name='".$Item['host']."'",array( 'IP' => $Item['IP'], 'MAC' => $Item['MAC'], 'online' => 1, 'lastdate' => 'NOW()', 'section' => $Section));82 } else DB_Insert('hosts',array('name' => $Item['host'], 'IP' => $Item['IP'], 'MAC' => $Item['MAC'], 'online' => 1,'date' => 'NOW()','lastdate' => 'NOW()', 'section' => $Section));81 $Database->update('hosts',"name='".$Item['host']."'",array( 'IP' => $Item['IP'], 'MAC' => $Item['MAC'], 'online' => 1, 'lastdate' => 'NOW()', 'section' => $Section)); 82 } else $Database->insert('hosts',array('name' => $Item['host'], 'IP' => $Item['IP'], 'MAC' => $Item['MAC'], 'online' => 1,'date' => 'NOW()','lastdate' => 'NOW()', 'section' => $Section)); 83 83 } 84 84 85 85 echo("\nSeznam offline pocitacu:\n"); 86 DB_Query("SELECT * FROM hosts WHERE online=0");87 while($Row = DB_Row())86 $DbResult = $Database->query("SELECT * FROM hosts WHERE online=0"); 87 while($Row = $DbResult->fetch_array()) 88 88 { 89 89 echo($Row['name'].", ");
Note:
See TracChangeset
for help on using the changeset viewer.