<?php
header("Content-type: text/vnd.wap.wml");
/*	$Id: wap.php,v 1.2 2002/04/19 18:15:49 gimpster Exp $	*/

include('phpweather.inc');

echo "<?xml version=\"1.0\"?>\n";
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card id="weather" title="phpweather.net">
<?
$cities = array(
  'EKYT' => 'Aalborg',
  'BGTL' => 'Thule',
  'EGKK' => 'London',
  'EKCH' => 'Copenhagen',
  'ENGM' => 'Oslo',
  'ESSA' => 'Stockholm',
  'FCBB' => 'Congo',
  'LEMD' => 'Madrid',
  'LFPB' => 'Paris',
  'LIRA' => 'Roma',
  'KNYC' => 'New York',
  'NZCM' => 'Antarctica',
  'UUEE' => 'Moscow',
  'RKSS' => 'Seoul',
  'YSSY' => 'Sydney',
  'ZBAA' => 'Beijing'
  );

if (!isset($city)) {
  $city = 'EKYT';
}
$metar = get_metar($city);
pretty_print_metar_wap($metar, $cities[$city])
?>
    <p>
<?php

while (list($icao, $location) = each($cities)) {
  echo '
<anchor>' . $location . '
  <go href="http://' . $HTTP_HOST . $PHP_SELF . '" method="post">
    <postfield name="city" value="' . $icao . '"/>
  </go>
</anchor>
';
}

?>
  </p>
  </card>
</wml>
