-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtmlcp1251.php
executable file
·201 lines (159 loc) · 11.8 KB
/
htmlcp1251.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<link rel="stylesheet" href="<?= $path ?>/_index.css">
<link rel="stylesheet" href="<?= $path ?>/forsuite.css">
<div class="content">
<div class="content__top clearfix">
<div class="current-weather">
<div class="current-weather__today">Ñåé÷àñ <span
class="current-weather__local-time"><?= date("H:i") ?></span></div>
<span class="current-weather__col current-weather__col_type_now t_c_<?= $city->fact->temperature ?>"><i
class="icon icon_size_48 icon_thumb_<?= $city->fact->getIcon() ?>" data-width="48"></i><span
class="current-weather__comment"><?= \YaWeather\ParseXml::encoding($city->fact->weather_type) ?></span><div
class="current-weather__thermometer current-weather__thermometer_type_now"><?= $city->fact->getTemperatureStr() ?>
°C
</div></span>
<?php
foreach ($city->getCurrentDay()->AdditionalState() as $key => $value) {
echo '<span class="current-weather__col current-weather__col_type_after t_c_'.$value->temperature_avg.'"><span
class="current-weather__thermometer-name">'.(\YaWeather\ParseXml::encoding($key)).'</span><i
class="icon icon_thumb_'.$value->getIcon().' icon_size_30"
data-width="30"></i><div
class="current-weather__thermometer current-weather__thermometer_type_after">'.$value->getTemperatureAvgStr().'</div></span>';
}
?>
<span class="current-weather__col current-weather__info"><div
class="current-weather__info-row">
<span class="current-weather__info-label">Âîñõîä: </span><?= $city->getCurrentDay()->sunrise ?><span
class="current-weather__info-label current-weather__info-label_type_sunset">Çàêàò: </span><?= $city->getCurrentDay()->sunset ?>
</div><div class="current-weather__info-row current-weather__info-row_type_wind"><span
class="current-weather__info-label">Âåòåð: </span> <span
class="wind-speed"><?= $city->fact->wind_speed ?> ì/ñ</span> <abbr
class=" icon-abbr" title="Âåòåð: ñåâåðî-âîñòî÷íûé"><?= \YaWeather\ParseXml::encoding($city->fact->getWindDirection()) ?></abbr><i
class="icon icon_size_12 icon_wind_<?= $city->fact->wind_direction ?> icon_wind"
data-width="12"></i></div><div
class="current-weather__info-row"><span
class="current-weather__info-label">Âëàæíîñòü: </span><?= $city->fact->humidity ?>%
</div><div class="current-weather__info-row"><span
class="current-weather__info-label">Äàâëåíèå: </span><?= $city->fact->pressure ?> ìì
ðò. ñò.
</div><div class="current-weather__info-row current-weather__info-row_type_time">Äàííûå
íà <?= $city->fact->getObservationTime() ?></div></span>
<div class="current-weather__yesterday">Â÷åðà â ýòî âðåìÿ: <?= $city->yesterday->getTemperatureStr() ?></div>
</div>
</div>
<div class="forecasts">
<div class="tabs-panes i-bem" data-bem="{"tabs-panes":{"id":"forecasts"}}">
<div class="tabs-panes__pane tabs-panes__pane_active_yes" role="tabpanel" aria-labelledby="forecasts-tab-0"
aria-expanded="true">
<ul class="forecast-brief forecast-item">
<?php
$i = 0;
foreach ($city->getListDays() as $key => $day) {
echo '<li class="forecast-brief__item">
<div class="forecast-brief__item-date ' . ($day->checkWeekend($key, true) ? "forecast-brief__item-date_weekend_yes" : "") . '"><span
class="forecast-brief__item-dayname">' . \YaWeather\ParseXml::encoding($day->getDayName($key)) . '</span><span
class="forecast-brief__item-day">' . \YaWeather\ParseXml::encoding($day->getDayNumber($key) . ' ' . ($i > 0 ? "" : $day->getMonthName($key))) . '</span></div>
<div class="forecast-brief__item-description t_c_' . $day->day->temperature_avg . '"><i
class="icon icon_thumb_' . $day->day->getIcon() . ' icon_size_30" data-width="30"></i>
<div class="forecast-brief__item-comment">' . \YaWeather\ParseXml::encoding($day->day->weather_type) . '</div>
<div class="forecast-brief__item-temp-day" title="Ìàêñèìàëüíàÿ òåìïåðàòóðà äí¸ì">
' . $day->day->getTemperatureAvgStr() . '
' . ($i > 0 ? "" : "äí¸ì") . '
</div>
</div>
<div class="forecast-brief__item-temp-night t_c_' . $day->day->temperature_avg . '" title="Ìèíèìàëüíàÿ òåìïåðàòóðà íî÷üþ">
' . $day->night->getTemperatureAvgStr() . '
' . ($i > 0 ? "" : "íî÷üþ") . '
</div>
</li>';
$i++;
if($i == 6) break;
/*if ($day->checkWeekend($key) && $i <= 5)
echo '<li class="forecast-brief__item forecast-brief__item_gap"> </li>';*/
}
?>
</ul>
</div>
<h1 class="title title_level_1">Ïðîãíîç íà 10 äíåé</h1>
<div class="tabs-panes__pane tabs-panes__pane_active_yes" role="tabpanel" aria-labelledby="forecasts-tab-1" aria-expanded="false">
<dl class="forecast-detailed forecast-item">
<?php
$i = 0;
foreach($city->getListDays() as $key => $day){
echo '<dt class="forecast-detailed__day ' . ($day->checkWeekend($key, true) ? "forecast-detailed__day_weekend" : "") . '">
<small class="forecast-detailed__weekday">' . \YaWeather\ParseXml::encoding($day->getDayName($key)) . '</small>
<strong class="forecast-detailed__day-number">' . $day->getDayNumber($key) . '<span class="forecast-detailed__day-month">'.\YaWeather\ParseXml::encoding($day->getMonthName($key)).'</span></strong>
</dt>';
echo '<dd class="forecast-detailed__day-info '.($i<1 ? "forecast-detailed__day-info_first": "").'">
<table class="weather-table">
<thead class="weather-table__head">
<tr>
<th class="weather-table__head-cell" colspan="3"></th>
<th class="weather-table__head-cell">
<div class="weather-table__value">Äàâëåíèå, <br>ìì ðò. ñò.</div>
</th>
<th class="weather-table__head-cell">
<div class="weather-table__value">Âëàæíîñòü</div>
</th>
<th class="weather-table__head-cell weather-table__head-cell_type_wind" colspan="2">
<div class="weather-table__value">Âåòåð, ì/ñ</div>
</th>
</tr>
</thead>';
//var_dump($day->getListDetail());
echo '<tbody class="weather-table__body">';
foreach ($day->getListDetail() as $key => $detail) {
echo '<tr class="weather-table__row t t_c_' . $detail->temperature_avg . '">
<td class="weather-table__body-cell weather-table__body-cell_type_daypart">
<div class="weather-table__daypart">'.\YaWeather\ParseXml::encoding($key).'</div>
<div class="weather-table__temp">'.$detail->getTemperatureFromTo().'</div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_icon">
<div class="weather-table__value"><i class="icon icon_size_30 icon_thumb_'.$detail->getIcon().'"
data-width="30"></i></div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_condition">
<div class="weather-table__value">' . \YaWeather\ParseXml::encoding($detail->weather_type) . '</div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_air-pressure">
<div class="weather-table__value">'.$detail->pressure.'</div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_humidity">
<div class="weather-table__value">'.$detail->humidity.'%</div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_wind">
<div class="weather-table__value"><abbr class=" icon-abbr"
title="Âåòåð: çàïàäíûé">'.\YaWeather\ParseXml::encoding($detail->getWindDirection()).'</abbr><i
class="icon icon_size_12 icon_wind_'.$detail->wind_direction.' icon_wind" data-width="12"></i><span
class="weather-table__wind"><span class="wind-speed">'.$detail->wind_speed.'</span></span></div>
</td>
<td class="weather-table__body-cell weather-table__body-cell_type_wind-strength">
<div class="weather-table__value"></div>
</td>
</tr>
';
}
echo '</tbody>';
echo '</table>
<!--<div class="forecast-detailed__geomagnetic-field">
<small class="forecast-detailed__key">Ìàãíèòíîå ïîëå:</small>
<div class="forecast-detailed__value">ñëàáî âîçìóùåííîå</div>
</div>-->
<div class="forecast-detailed__moon"><i class="icon icon_size_26 icon_moon_'.$day->moon_phase.'" title=""
data-width="26"></i></div>
<div class="forecast-detailed__sunset">
<small class="forecast-detailed__key">Çàêàò</small>
<div class="forecast-detailed__value">'.$day->sunset.'</div>
</div>
<div class="forecast-detailed__sunrise">
<small class="forecast-detailed__key">Âîñõîä</small>
<div class="forecast-detailed__value">'.$day->sunrise.'</div>
</div>
</dd>';
$i++;
}
?>
</dl>
</div>
</div>
</div>
</div>