include("/home/marnit/lib/php/mysql.php");
include("/home/marnit/lib/php/html.php");
include("/home/marnit/lib/php/dir.php");
$m = new MySQL();
# Get map type via POST or GET
$type = isset($_POST['type']) ? $_POST['type'] : (
isset( $_GET['type']) ? $_GET['type'] : 'station');
$type = preg_match("/^(dir|rain|hum|temp|mean|gust|alarm|station)/", $type, $match) ? $match[1] : 'station';
# Fetch station position
$sql = "SELECT CONCAT(type, '-', number) AS id, lon, lat
FROM station
WHERE type = 'F'";
$tmp = $m->execute($sql);
$result = $tmp->get_result();
while ($row = mysql_fetch_assoc($result)) {
$position[$row["id"]] = $row["lon"] . ", " . $row["lat"];
}
$m->free_result();
$datafile = "/tmp/www/status.f.dat";
$lines = file($datafile);
$roadalarm = 0;
#head();
?>