@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | $timeRefined = $time; |
9 | 9 | |
10 | 10 | $dates = []; |
11 | - for ($i=0; $i < $days; $i++) { |
|
12 | - $date = strtotime($timeRefined . "-" . $i ."day"); |
|
11 | + for ($i = 0; $i < $days; $i++) { |
|
12 | + $date = strtotime($timeRefined . "-" . $i . "day"); |
|
13 | 13 | array_push($dates, date("Y-m-d", $date) . "T" . date("h:m:s", $date)); |
14 | 14 | } |
15 | 15 | |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | |
20 | 20 | public static function wheatherThirtyActionGet($res = null, $time = null, $accessKey = null) : array |
21 | 21 | { |
22 | - for ($j=0; $j < count($time); $j++) { |
|
23 | - ${"ch$j"} = curl_init('https://api.darksky.net/forecast/'.$accessKey.'/'.$res[0]->latitude . |
|
24 | - ','. $res[0]->longitude . "," . $time[$j] . "?exclude=minutely?exclude=hourly"); |
|
22 | + for ($j = 0; $j < count($time); $j++) { |
|
23 | + ${"ch$j"} = curl_init('https://api.darksky.net/forecast/' . $accessKey . '/' . $res[0]->latitude . |
|
24 | + ',' . $res[0]->longitude . "," . $time[$j] . "?exclude=minutely?exclude=hourly"); |
|
25 | 25 | } |
26 | 26 | $mhcurl = curl_multi_init(); |
27 | - for ($i=0; $i < count($time); $i++) { |
|
27 | + for ($i = 0; $i < count($time); $i++) { |
|
28 | 28 | curl_setopt(${"ch$i"}, CURLOPT_RETURNTRANSFER, true); |
29 | 29 | curl_multi_add_handle($mhcurl, ${"ch$i"}); |
30 | 30 | } |
31 | 31 | $responseArray = []; |
32 | - for ($k=0; $k < count($time); $k++) { |
|
32 | + for ($k = 0; $k < count($time); $k++) { |
|
33 | 33 | $running = null; |
34 | 34 | do { |
35 | 35 | curl_multi_exec($mhcurl, $running); |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | |
49 | 49 | public static function wheatherActionGet($res = null, $accessKey = null) : array |
50 | 50 | { |
51 | - for ($j=0; $j < count($res); $j++) { |
|
52 | - ${"ch$j"} = curl_init('https://api.darksky.net/forecast/'.$accessKey.'/'.$res[$j]->latitude . |
|
53 | - ','. $res[$j]->longitude . "?exclude=minutely?exclude=hourly"); |
|
51 | + for ($j = 0; $j < count($res); $j++) { |
|
52 | + ${"ch$j"} = curl_init('https://api.darksky.net/forecast/' . $accessKey . '/' . $res[$j]->latitude . |
|
53 | + ',' . $res[$j]->longitude . "?exclude=minutely?exclude=hourly"); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | 58 | $mhcurl = curl_multi_init(); |
59 | - for ($i=0; $i < count($res); $i++) { |
|
59 | + for ($i = 0; $i < count($res); $i++) { |
|
60 | 60 | curl_setopt(${"ch$i"}, CURLOPT_RETURNTRANSFER, true); |
61 | 61 | curl_multi_add_handle($mhcurl, ${"ch$i"}); |
62 | 62 | } |
63 | 63 | $responseArray = []; |
64 | - for ($k=0; $k < count($res); $k++) { |
|
64 | + for ($k = 0; $k < count($res); $k++) { |
|
65 | 65 | $running = null; |
66 | 66 | do { |
67 | 67 | curl_multi_exec($mhcurl, $running); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function streetActionGet($lat, $long) : string |
83 | 83 | { |
84 | 84 | |
85 | - $curlh = curl_init('https://nominatim.openstreetmap.org/[email protected]&format=jsonv2&lat=' .$long. "&lon=".$lat); |
|
85 | + $curlh = curl_init('https://nominatim.openstreetmap.org/[email protected]&format=jsonv2&lat=' . $long . "&lon=" . $lat); |
|
86 | 86 | |
87 | 87 | curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
88 | 88 |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | if (filter_var($ipAdress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { |
61 | 61 | $ipInfo["Type"] = "Valid IPv4"; |
62 | - $ipInfo["Domain"] = gethostbyaddr($ipAdress) ?? "" ; |
|
62 | + $ipInfo["Domain"] = gethostbyaddr($ipAdress) ?? ""; |
|
63 | 63 | $ipInfoJson = json_encode($ipInfo, JSON_PRETTY_PRINT); |
64 | 64 | return [$ipInfoJson]; |
65 | 65 | } else { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | |
22 | 22 | // http://api.ipstack.com/79.138.27.9?access_key=ae68fdd7e0843f6cbbaf81475db34e24 |
23 | - $curlh = curl_init('http://api.ipstack.com/'.$ipAdress.'?access_key='.$accessKey.''); |
|
23 | + $curlh = curl_init('http://api.ipstack.com/' . $ipAdress . '?access_key=' . $accessKey . ''); |
|
24 | 24 | curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
25 | 25 | |
26 | 26 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // Initialize CURL: |
46 | 46 | |
47 | 47 | // http://api.ipstack.com/79.138.27.9?access_key=ae68fdd7e0843f6cbbaf81475db34e24 |
48 | - $curlh = curl_init('http://api.ipstack.com/'.$ipAdress.'?access_key='.$accessKey.''); |
|
48 | + $curlh = curl_init('http://api.ipstack.com/' . $ipAdress . '?access_key=' . $accessKey . ''); |
|
49 | 49 | curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
50 | 50 | |
51 | 51 | // Store the data: |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $time = $this->di->get("request")->getPost("date") ?? ""; |
62 | 62 | $ipInfo["IP"] = $this->di->get("request")->getPost("ip") ?? $ipAdress; |
63 | 63 | $array = []; |
64 | - $apiEx = $this->di->get("ExternalApi"); |
|
64 | + $apiEx = $this->di->get("ExternalApi"); |
|
65 | 65 | $res = $apiEx->validateipActionGet($ipInfo["IP"], $keykey); |
66 | 66 | |
67 | 67 | $obj = json_decode($res); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $darkSkyKey = $this->di->get("apikeyDarkSky"); |
132 | 132 | |
133 | 133 | $array = []; |
134 | - $apiEx = $this->di->get("ExternalApi"); |
|
134 | + $apiEx = $this->di->get("ExternalApi"); |
|
135 | 135 | $res = $apiEx->validateipActionGet($ipInfo["IP"], $keykey); |
136 | 136 | |
137 | 137 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | // $ipInfo["IP"] = $ipAdress; |
88 | 88 | // } |
89 | 89 | $ipInfo["IP"] = $this->di->get("request")->getGet("ip") ?? $ipAdress; |
90 | - $apiEx = $this->di->get("ExternalApi"); |
|
90 | + $apiEx = $this->di->get("ExternalApi"); |
|
91 | 91 | $res = $apiEx->validateipActionGet($ipInfo["IP"], $keykey); |
92 | 92 | $obj = $res; |
93 | 93 | $obj = json_decode($res); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Anax\View; |
3 | 3 | |
4 | -$cord = $longitude . "%2C" . $latitude ."&layer=mapnik&marker=" . $latitude . "%2C" . $longitude . ""; |
|
4 | +$cord = $longitude . "%2C" . $latitude . "&layer=mapnik&marker=" . $latitude . "%2C" . $longitude . ""; |
|
5 | 5 | print_r($cord); |
6 | 6 | ?> |
7 | 7 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -namespace Anax\View ; |
|
2 | +namespace Anax\View; |
|
3 | 3 | |
4 | 4 | use Anax\Controller; |
5 | 5 |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Anax\View; |
3 | 3 | |
4 | -$res1 = (array) $res[0]; |
|
4 | +$res1 = (array) $res[0]; |
|
5 | 5 | $resObj = json_decode($res1[0]); |
6 | 6 | if (isset($resObj->latitude)) { |
7 | 7 | $streetinfo = json_decode($streetname); |
8 | - $streetinfoArray = (array) $streetinfo; |
|
8 | + $streetinfoArray = (array) $streetinfo; |
|
9 | 9 | |
10 | - $resThirty1 = (array) $resThirty; |
|
10 | + $resThirty1 = (array) $resThirty; |
|
11 | 11 | $data = $resObj->daily->data; |
12 | 12 | |
13 | 13 | |
14 | 14 | $dataThirty = $resThirty1; |
15 | 15 | |
16 | 16 | |
17 | - $cord = $resObj->longitude . "%2C" . $resObj->latitude ."&layer=mapnik&marker=" . $resObj->latitude . "%2C" . $resObj->longitude . ""; |
|
17 | + $cord = $resObj->longitude . "%2C" . $resObj->latitude . "&layer=mapnik&marker=" . $resObj->latitude . "%2C" . $resObj->longitude . ""; |
|
18 | 18 | |
19 | 19 | // $resDecoded = parse_str($res, $output); |
20 | 20 | // // print_r($output[0]); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | <h3>Past week</h3> |
73 | 73 | <br> |
74 | 74 | <br> |
75 | - <?php for ($i=0; $i < count($data); $i++) { ?> |
|
75 | + <?php for ($i = 0; $i < count($data); $i++) { ?> |
|
76 | 76 | <div style="border-style: solid; float:left; font-size: 0.8rem; width: 10rem; height:12rem;"> |
77 | 77 | <table> |
78 | 78 | <tbody> |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | <h3>Past thirty days</h3> |
100 | 100 | <br> |
101 | 101 | <br> |
102 | - <?php for ($i=0; $i < count($dataThirty); $i++) { ?> |
|
102 | + <?php for ($i = 0; $i < count($dataThirty); $i++) { ?> |
|
103 | 103 | <div style="border-style: solid; float:left; font-size: 0.8rem; width: 10rem; height:12rem; background-color:grey;"> |
104 | 104 | <table> |
105 | 105 | <tbody> |
@@ -6,7 +6,7 @@ |
||
6 | 6 | "services" => [ |
7 | 7 | "apikeyDarkSky" => [ |
8 | 8 | "shared" => true, |
9 | - "callback" => function () { |
|
9 | + "callback" => function() { |
|
10 | 10 | $dirs = "87abcd4f5a83d4f77caf6be317702207"; |
11 | 11 | return $dirs; |
12 | 12 | }, |