Changeset 482 for trunk/Modules/Map/Map.php
- Timestamp:
- Feb 7, 2013, 9:45:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Map/Map.php
r474 r482 61 61 while($Link = $DbResult->fetch_assoc()) 62 62 { 63 $DbResult2 = $this->Database->query('SELECT * FROM NetworkDevice WHERE NetworkDevice.Id = (SELECTDevice FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')');64 $DbResult3 = $this->Database->query('SELECT * FROM NetworkDevice WHERE NetworkDevice.Id = (SELECTDevice FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')');63 $DbResult2 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')'); 64 $DbResult3 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')'); 65 65 if(($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0)) 66 66 { … … 68 68 $Device2 = $DbResult3->fetch_assoc(); 69 69 if(($Device1['Used'] == 1) and ($Device2['Used'] == 1)) 70 $Output .= 'new GPolyline([new GLatLng('.$Device1[' PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#4F4FBF", 3, 0.8), ';70 $Output .= 'new GPolyline([new GLatLng('.$Device1['Latitude'].', '.$Device1['Longitude'].'),new GLatLng('.$Device2['Latitude'].', '.$Device2['Longitude'].')], "#4F4FBF", 3, 0.8), '; 71 71 } 72 72 } … … 99 99 NetworkDevices = ['; 100 100 101 $DbResult = $this->Database->query('SELECT * FROM NetworkDevice WHERE Used=1'); 101 $DbResult = $this->Database->query('SELECT GROUP_CONCAT(NetworkDevice.Name SEPARATOR ",") AS Name, '. 102 'MapPosition.Latitude AS Latitude, MapPosition.Longitude AS Longitude, MapPosition.Name AS NodeName '. 103 'FROM NetworkDevice LEFT JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition '. 104 'WHERE (NetworkDevice.Used=1) AND (NetworkDevice.MapPosition IS NOT NULL) '. 105 'GROUP BY NetworkDevice.MapPosition'); 102 106 while($Device = $DbResult->fetch_assoc()) 103 107 { 104 $Output .= 'new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), {title: "'.$Device['Name'].'", icon:tinyIcon }), '; 108 $Output .= 'new GMarker(new GLatLng('.$Device['Latitude'].', '. 109 $Device['Longitude'].'), {title: "'.$Device['NodeName'].': '.$Device['Name'].'", icon:tinyIcon }), '; 105 110 } 106 111 $Output .= '];
Note:
See TracChangeset
for help on using the changeset viewer.