Changeset 208 for trunk/system/netwatch_import.php
- Timestamp:
- May 6, 2009, 8:21:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/netwatch_import.php
r187 r208 33 33 { 34 34 $Online = 1; 35 $Values = array(' online' => $Online, 'last_online' => 'NOW()');35 $Values = array('Online' => $Online, 'LastOnline' => 'NOW()'); 36 36 } else 37 37 { 38 38 $Online = 0; 39 $Values = array(' online' => $Online);39 $Values = array('Online' => $Online); 40 40 } 41 41 42 $DbResult = $Database->update(' hosts', 'IP="'.$Properties['host'].'"', $Values);42 $DbResult = $Database->update('NetworkInterface', 'LocalIP = "'.$Properties['host'].'"', $Values); 43 43 if($Online == 1) 44 44 { 45 $DbResult = $Database->select(' hosts', 'id', 'IP="'.$Properties['host'].'"');45 $DbResult = $Database->select('NetworkInterface', 'Id', 'LocalIP = "'.$Properties['host'].'"'); 46 46 $DbRow = $DbResult->fetch_array(); 47 $HostId = $DbRow[' id'];47 $HostId = $DbRow['Id']; 48 48 $DbResult2 = $Database->select('stat_hosts', '*', '(host_id="'.$HostId.'") AND (time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 49 49 if($DbResult2->num_rows == 0) $Database->query('REPLACE INTO stat_hosts (host_id, time) VALUES ("'.$HostId.'", DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');
Note:
See TracChangeset
for help on using the changeset viewer.