- Timestamp:
- Apr 16, 2010, 10:55:40 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/config.php
r7775 r7784 54 54 * Values to generate map 55 55 */ 56 $config['kml_file'] = $config['root'] . '/ map/inc/example.kml';56 $config['kml_file'] = $config['root'] . '/example.kml'; 57 57 // Should be something like: 58 58 // $config['kml_file'] = $config['root'] . '/kml.php?time=%TIMESTAMP%'; -
trunk/src/map/inc/kmlHandler.php
r7769 r7784 19 19 foreach($xml->Document->Folder->Placemark as $placemark) 20 20 { 21 /* 22 * Getting all data from the datatags in the KML file. 23 * First we declare variables we will use. 24 * Then we itirate trough all the data and fill the variables 25 */ 26 $location; 27 $status; 28 $interfaces; 29 $masterIP; 30 $nodeType; 31 $type; 32 $hostname; 33 $hasBeenChecked; 34 $checkExecutionTime; 35 $currentState; 36 $lastCheck; 37 $problemHasBeenAcknowledged; 38 39 foreach($placemark->ExtendedData->Data as $data) 40 { 41 foreach($data->attributes() as $nameAttribute => $name) 42 { 43 if($name == "location") 44 $location = $data->value; 45 elseif($name == "status") 46 $status = $data->value; 47 elseif($name == "interfaces") 48 $interfaces = $data->value; 49 elseif($name == "masterIP") 50 $masterIP = $data->value; 51 elseif($name == "nodeType") 52 $nodeType = $data->value; 53 elseif($name == "type") 54 $type = $data->value; 55 elseif($name == "hostname") 56 $hostname = $data->value; 57 elseif($name == "hasBeenChecked") 58 $hasBeenChecked = $data->value; 59 elseif($name == "checkExecutionTime") 60 $checkExecutionTime = $data->value; 61 elseif($name == "currentState") 62 $currentState = $data->value; 63 elseif($name == "problemHasBeenAcknowledged") 64 $problemHasBeenAcknowledged = $data->value; 65 elseif($name == "location") 66 $location = $data->value; 67 } 68 } 69 70 /* 71 * We now fill up our array with Longitude and Latitude and Name by accessing $placemark 72 * Then we fill the rest of the array with the variables we declared and filled earlier 73 */ 21 74 22 75 $markers[] = array( "latitude"=>$placemark->LookAt->latitude, 23 76 "longitude"=>$placemark->LookAt->longitude, 24 77 "name"=>$placemark->name, 25 " description"=>$placemark->description,26 " id"=>$counter);27 $counter++;78 "location"=>$location, 79 "status"=>$status); 80 28 81 } 29 82 return $markers; -
trunk/src/map/inc/node_info.php
r7782 r7784 2 2 require_once("../../config.php"); 3 3 require_once($config['root']."/map/inc/kmlHandler.php"); 4 5 4 if(isset($_GET['view'])) 6 5 { … … 45 44 elseif($_GET['type'] == "single") //Info for single nodes is stored here 46 45 { 47 $markers = get_node_array($config[' root']."/map/inc/example.kml");46 $markers = get_node_array($config['kml_file']); 48 47 49 printf($markers[5]['description']); 48 $description; 49 50 foreach($markers as $marker) 51 { 52 if($marker['name'] == $_GET['name']) 53 { 54 $name = $marker['name']; 55 $location = $marker['location']; 56 } 57 } 50 58 51 59 if($view == "beheerder")//Display part for beheerder view of a single node 52 { 60 { 53 61 echo <<<EOF 54 <div id="nodeinfo"> 55 62 <div id='nodeinfo'> 63 {$name}<br/> 64 Locatie: {$location} 56 65 </div> 57 66 <div id="timestamp"> -
trunk/src/map/index.php
r7779 r7784 5 5 6 6 #getting array from kmlHandler 7 $markers = get_node_array($config[' root']."/map/inc/example.kml");7 $markers = get_node_array($config['kml_file']); 8 8 9 9 # Key is defined to be the domain name if exists
Note:
See TracChangeset
for help on using the changeset viewer.