@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $api = $this->di->get("ipstack"); |
19 | 19 | $ipstack = $api["config"]; |
20 | 20 | $getipInfo = new Models\Curl; |
21 | - $extra = "&fields=ip"; |
|
22 | - $userIp = $getipInfo->cUrl($ipstack["url"]. "check". '?access_key='. $ipstack["key"]. $extra); |
|
21 | + $extra = "&fields=ip"; |
|
22 | + $userIp = $getipInfo->cUrl($ipstack["url"]."check".'?access_key='.$ipstack["key"].$extra); |
|
23 | 23 | $apiResult = json_decode($userIp, true); |
24 | 24 | |
25 | 25 | $session->set("userIp", $apiResult["ip"]); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | $extra = "?lang=sv&units=auto"; |
56 | 56 | $mapDiv = $map->getMap($location["latitude"], $location["longitude"]); |
57 | - $weatherJson = $getJson->cUrl($darksky["url"]. $darksky["key"]. "/". $location["latitude"]. ",". $location["longitude"]. $extra); |
|
57 | + $weatherJson = $getJson->cUrl($darksky["url"].$darksky["key"]."/".$location["latitude"].",".$location["longitude"].$extra); |
|
58 | 58 | |
59 | 59 | $weather = json_decode($weatherJson, true); |
60 | 60 | $page->add("weather/weather", [ |
@@ -90,16 +90,16 @@ discard block |
||
90 | 90 | $url = []; |
91 | 91 | $extra = "?lang=sv&units=auto"; |
92 | 92 | $time = time() - (30 * 24 * 60 * 60); |
93 | - for ($i=0; $i < 31; $i++) { |
|
94 | - $time = time() - ($i * 24 * 60 * 60); |
|
95 | - array_push($url, $darksky["url"]. $darksky["key"]. "/". $location["latitude"]. ",". $location["longitude"]. ",". $time. $extra); |
|
93 | + for ($i = 0; $i < 31; $i++) { |
|
94 | + $time = time() - ($i * 24 * 60 * 60); |
|
95 | + array_push($url, $darksky["url"].$darksky["key"]."/".$location["latitude"].",".$location["longitude"].",".$time.$extra); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | 99 | $mapDiv = $map->getMap($location["latitude"], $location["longitude"]); |
100 | 100 | $weatherJson = $getJson->cUrlMulti($url); |
101 | 101 | $weather = []; |
102 | - for ($i=0; $i < count($weatherJson); $i++) { |
|
102 | + for ($i = 0; $i < count($weatherJson); $i++) { |
|
103 | 103 | array_push($weather, json_decode($weatherJson[$i], true)); |
104 | 104 | } |
105 | 105 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $getJson = new Curl; |
13 | 13 | $test = $validateIP->validate($ipNumber); |
14 | 14 | if ($test[0]) { |
15 | - $location = $getJson->cUrl($ipstack["url"]. $ipNumber. '?access_key='. $ipstack["key"]); |
|
15 | + $location = $getJson->cUrl($ipstack["url"].$ipNumber.'?access_key='.$ipstack["key"]); |
|
16 | 16 | $location = json_decode($location, true); |
17 | 17 | $latitude = $location["latitude"]; |
18 | 18 | $longitude = $location["longitude"]; |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | "latitude"=> $latitude, |
22 | 22 | "longitude"=> $longitude); |
23 | 23 | } else { |
24 | - $search = array('å','ä','ö'); |
|
25 | - $replace = array('a','a','o'); |
|
24 | + $search = array('å', 'ä', 'ö'); |
|
25 | + $replace = array('a', 'a', 'o'); |
|
26 | 26 | $ipNumber = str_replace($search, $replace, $ipNumber); |
27 | - $location = $getJson->cUrl($mapquest["url"]. $mapquest["key"]. $mapquest["extra"]. $ipNumber); |
|
27 | + $location = $getJson->cUrl($mapquest["url"].$mapquest["key"].$mapquest["extra"].$ipNumber); |
|
28 | 28 | $location = json_decode($location, true); |
29 | 29 | $latitude = $location["results"][0]["locations"][0]["latLng"]["lat"]; |
30 | 30 | $longitude = $location["results"][0]["locations"][0]["latLng"]["lng"]; |