Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv29026
Modified Files:
index.php
Log Message:
Various updates to ensure that it works with the new features.
Index: index.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/index.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- index.php 2001/05/21 10:43:46 1.11
+++ index.php 2001/06/27 11:30:31 1.12
@@ -12,14 +12,11 @@
/* Checkpoint, we store the time */
$time[] = array(microtime(), 'start');
-/* This constant points to the base-directory. It should not end in a
- slash. */
-define('PHPWEATHER_BASE_DIR', getcwd());
require('phpweather.php');
//define('DEBUG', true);
- $obj = new phpweather(array());
+$obj = new phpweather(array());
if (empty($action)) {
/* No action - we display a form from which the user can select a
@@ -29,13 +26,13 @@
<p>Select a country:</p>
<form action="index.php" method="post">
<input type="hidden" name="action" value="show_stations">
-<select name="country" size="10">
+<select name="cc" size="10">
';
$countries = $obj->db->get_countries();
$num_countries = count($countries);
- for ($i = 0; $i < $num_countries; $i++) {
- echo "<option name=\"$countries[$i]\">$countries[$i]</option>\n";
+ while (list($cc, $country) = each($countries)) {
+ echo "<option value=\"$cc\">$country</option>\n";
}
echo '</select>
<p><input type="submit"></p>
@@ -45,13 +42,15 @@
} elseif ($action == 'show_stations') {
/* A country has just been selected - we make a form with all
stations in that country. */
+ $country = '';
+ $icaos = $obj->db->get_icaos($cc, $country);
+
echo '<form action="index.php" method="post">
<input type="hidden" name="action" value="show_weather">
<p>Select a station from ' . $country . ':</p>
<select name="icao" size="10">
';
- $icaos = $obj->db->get_icaos($country);
while (list($icao, $name) = each($icaos)) {
echo "<option value=\"$icao\">$name</option>\n";
}
_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins