Changeset 214 for trunk/system
- Timestamp:
- May 11, 2009, 9:28:16 PM (16 years ago)
- Location:
- trunk/system
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/traffic_shaping_routerboard.php
r213 r214 75 75 $Commands[] = ' /queue tree add name='.$Member['Name'].'-in limit-at='.$SpeedOut.' max-limit='.$UserMaxSpeedOut.' parent=main-in queue=wireless-default'; 76 76 77 $DbResult2 = $Database->select('NetworkDevice', 'COUNT(*)', ' Member='.$Member['Id']);77 $DbResult2 = $Database->select('NetworkDevice', 'COUNT(*)', 'Used = 1 AND Member='.$Member['Id']); 78 78 $Row = $DbResult2->fetch_row(); 79 79 $HostCount = $Row[0]; … … 88 88 } 89 89 90 $DbResult2 = $Database->select('NetworkDevice', '*', ' Member = '.$Member['Id']);90 $DbResult2 = $Database->select('NetworkDevice', '*', 'Used = 1 AND Member = '.$Member['Id']); 91 91 while($Device = $DbResult2->fetch_assoc()) 92 92 { -
trunk/system/netwatch_import.php
r213 r214 34 34 { 35 35 $Online = 1; 36 $Values = array('Online' => $Online, 36 $Values = array('Online' => $Online, 'LastOnline' => 'NOW()'); 37 37 } else 38 38 { … … 45 45 { 46 46 $DbResult = $Database->select('NetworkInterface', 'Id', 'LocalIP = "'.$Properties['host'].'"'); 47 $DbRow = $DbResult->fetch_a rray();47 $DbRow = $DbResult->fetch_assoc(); 48 48 $HostId = $DbRow['Id']; 49 49 $DbResult2 = $Database->select('stat_hosts', '*', '(host_id="'.$HostId.'") AND (time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); … … 54 54 } 55 55 56 // Update device online state 57 $DbResult = $Database->select('NetworkDevice', 'Id', 'Used=1'); 58 while($Device = $DbResult->fetch_assoc()) 59 { 60 $DbResult2 = $Database->select('NetworkInterface', 'SUM(Online)', 'Device='.$Device['Id']); 61 $DbRow = $DbResult2->fetch_array(); 62 if($DbRow['SUM(Online)'] > 0) $Online = 1; else $Online = 0; 63 $Database->update('NetworkDevice', 'Id='.$Device['Id'], array('Online' => $Online)); 64 } 65 56 66 ?>
Note:
See TracChangeset
for help on using the changeset viewer.