source: subversion/applications/mobile/healthwhere/index.php @ 34887

Last change on this file since 34887 was 21241, checked in by avantman42, 9 years ago

Removed source column in OS-created postcode DB. No need for it, and should make DB file smaller
Now using OS postcode data (OS OpenData? Code-Point® Open)
Re-licensed (GPL v2) because PHPCoord is licensed under GPL v2

File size: 2.7 KB
Line 
1<?php
2/*
3Healthwhere, a web service to find local pharmacies and hospitals
4Copyright (C) 2009-2010 Russell Phillips (russ@phillipsuk.org)
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License along
17with this program; if not, write to the Free Software Foundation, Inc.,
1851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21require ('inc_head.php');
22$txtPostcode = $_COOKIE ["Postcode"];
23$txtLatitude = $_COOKIE ["Latitude"];
24$txtLongitude = $_COOKIE ["Longitude"];
25
26if (isset ($_COOKIE ["Distance"]))
27        $txtDistance = $_COOKIE ["Distance"];
28else
29        $txtDistance = DEFAULT_MAX_DIST;
30
31if (isset ($_COOKIE ["HourOffset"]))
32        $iHourOffset = $_COOKIE ["HourOffset"];
33else
34        $iHourOffset = 0;
35require_once ("inc_head_html.php");
36?>
37<b>Healthwhere</b>
38
39<p>
40<form action = "results.php" method = "get">
41<table border = "0">
42<tr><th colspan = "2">
43Your Position
44</th></tr>
45<tr><td>UK Postcode:</td>
46<td><input name = "txtPostcode" value = "<?=$txtPostcode?>"></td></tr>
47<tr><td colspan = "2" align = "center">or</td></tr>
48<tr><td>Latitude:</td>
49<td><input name = "txtLatitude" id = "txtLatitude" value = "<?=$txtLatitude?>"></td></tr>
50<tr><td>Longitude:</td>
51<td><input name = "txtLongitude" id = "txtLongitude" value = "<?=$txtLongitude?>"></td></tr>
52</table>
53<div id = "divLatLon"></div>
54</p>
55
56<p>
57<table border = "0">
58<tr><th colspan = "2">
59Other details
60</th></tr>
61<tr><td>
62Max distance:</td><td>
63<select name = "txtDistance">
64
65<?php
66$aiDistances = array (2, 5, 10, 25, 50);
67foreach ($aiDistances as $iDistance)
68        if ($iDistance == $txtDistance)
69                echo "<option value = '$iDistance' selected>$iDistance miles</option>\n";
70        else
71                echo "<option value = '$iDistance'>$iDistance miles</option>\n";
72?>
73
74</td>
75</tr><tr>
76<td>Current time:</td>
77<td>
78<select name = "selHourOffset">
79<?php
80for ($i=0; $i<=23; $i++) {
81        echo "<option value = '";
82        echo $i - (int) date ("G") . "'";
83        if ($iHourOffset + (int) date ("G") == $i)
84                echo " selected";
85        echo ">" . str_pad ($i, 2, "0", STR_PAD_LEFT);
86        echo ":" . date ("i") . "</option>\n";
87}
88?>
89</select>
90</td></tr>
91</table>
92</p>
93
94<p>
95<input type = "submit" value = "Find pharmacies" name = "btnSubmit" class = "default">&nbsp;
96<input type = "submit" value = "Find hospitals" name = "btnSubmit" class = "default">
97</p>
98</form>
99
100<?php
101require ('inc_foot.php');
102?>
Note: See TracBrowser for help on using the repository browser.