|
27 | 27 | $data['latitude'] = isset($_GET['lat']) ? $_GET['lat'] : ''; |
28 | 28 | $data['longitude'] = isset($_GET['long']) ? $_GET['long'] : ''; |
29 | 29 |
|
30 | | -$selected = ' checked'; |
31 | | -$data['call_forecast'] = ($data['call'] == 'forecast') ? $selected : ''; |
32 | | -$data['call_current'] = ($data['call'] == 'current') ? $selected : ''; |
33 | | -$data['call_usage'] = ($data['call'] == 'usage') ? $selected : ''; |
34 | | -$data['units_M'] = ($data['units'] == 'M') ? $selected : ''; |
35 | | -$data['units_I'] = ($data['units'] == 'I') ? $selected : ''; |
36 | | -$data['units_S'] = ($data['units'] == 'S') ? $selected : ''; |
| 30 | +$check = ' checked'; |
| 31 | +$data['call_forecast'] = ($data['call'] == 'forecast') ? $check : ''; |
| 32 | +$data['call_current'] = ($data['call'] == 'current') ? $check : ''; |
| 33 | +$data['call_usage'] = ($data['call'] == 'usage') ? $check : ''; |
| 34 | +$data['units_M'] = ($data['units'] == 'M') ? $check : ''; |
| 35 | +$data['units_I'] = ($data['units'] == 'I') ? $check : ''; |
| 36 | +$data['units_S'] = ($data['units'] == 'S') ? $check : ''; |
37 | 37 |
|
38 | 38 | $data['pageTitle'] = 'weatherbit-api-wrapper v' . Weatherbit::VERSION; |
39 | 39 |
|
|
63 | 63 |
|
64 | 64 | if (!empty($data['city'])) { |
65 | 65 | $weatherbit->setLocationByCity($data['city'], $data['country']); |
66 | | - } elseif (!empty($latitude)) { |
| 66 | + } elseif (!empty($data['latitude'])) { |
67 | 67 | $weatherbit->setLocationByLatitudeLongitude($data['latitude'], $data['longitude']); |
68 | | - } elseif (!empty($ipAddress)) { |
| 68 | + } elseif (!empty($data['ipAddress'])) { |
69 | 69 | $weatherbit->setLocationByIP($data['ipAddress']); |
70 | 70 | } |
71 | 71 |
|
@@ -151,7 +151,7 @@ function printForm() |
151 | 151 | Units: |
152 | 152 | <input type="radio" name="units" value="M"' . $data['units_M'] . '>M - Metric (Celcius, m/s, mm)</input> |
153 | 153 | |
154 | | - <input type="radio" name="units" value="I"' . $data['units_I'] . '>I - Imperial Fahrenheit (F, mph, in)</input> |
| 154 | + <input type="radio" name="units" value="I"' . $data['units_I'] . '>I - Imperial (Fahrenheit, mph, in)</input> |
155 | 155 | |
156 | 156 | <input type="radio" name="units" value="S"' . $data['units_S'] . '>S - Scientific (Kelvin, m/s, mm)</input> |
157 | 157 | </select> |
|
0 commit comments