From 551c3222b65f5c68d2e0e45ddff7c5e814316ed1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 6 Dec 2008 09:48:44 +0000 Subject: added drawLocations --- data.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'data.php') diff --git a/data.php b/data.php index 97e59b4..b5c0b51 100644 --- a/data.php +++ b/data.php @@ -59,6 +59,7 @@ while ($data = $db->getNextObject()) { $data->lng = $lng_startpoint + ($data->pixel_x - $x_startpoint) / $dx_dLng; $data->lat = $lat_startpoint + ($y_startpoint - $data->pixel_y) / $dy_dLat; + $data->state = "offline"; $locations[$data->locid] = $data; } @@ -97,6 +98,19 @@ foreach ($lines as $num => $line) $links[$i]->ipfromLoc = $ipfromLoc; $links[$i]->iptoLoc = $iptoLoc; $links[$i]->label = $label; + if($locations[$locids[$ipfromLoc]]->state == "offline") + $locations[$locids[$ipfromLoc]]->state = "online"; + if($locations[$locids[$iptoLoc]]->state == "offline") + $locations[$locids[$iptoLoc]]->state = "online"; + + if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") || + ($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" ) || + ($locations[$locids[$iptoLoc]]->hastinc && $locations[$locids[$ipfromLoc]]->hastinc)) { + $link->label = -1; + $locations[$locids[$ipfromLoc]]->state = "tunnel"; + $locations[$locids[$iptoLoc]]->state = "tunnel"; + } + $i++; } } @@ -108,21 +122,14 @@ echo "\n"; echo "\n"; foreach ($locations as $location) { $data = $locations[$location->locid]; - printf("\t" . '' . "\n", - $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->gallery_link); + printf("\t" . '' . "\n", + $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link); } echo "\n"; echo "\n"; foreach ($links as $link) { - if (($nodename[$link->ipfromLoc] == "tunnel" && $locations[$locids[$link->ipfromLoc]]->locname=="housing") || - ($nodename[$link->iptoLoc] == "tunnel" && $locations[$locids[$link->iptoLoc]]->locname=="housing" )) - $link->label = -1; - - if ($locations[$locids[$link->iptoLoc]]->hastinc && $locations[$locids[$link->ipfromLoc]]->hastinc) - $link->label = -1; - $data1 = $locations[$locids[$link->ipfromLoc]]; $data2 = $locations[$locids[$link->iptoLoc]]; -- cgit v1.2.1