-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml.php
executable file
·196 lines (162 loc) · 12.2 KB
/
html.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
<link rel="stylesheet" href="<?= $path ?>/_index.css">
<div class="content">
<div class="content__top clearfix">
<div class="navigation-city"><h1 class="title title_level_1"><?= $city->city ?>. Погода</h1></div>
<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">пасмурно</span><div
class="current-weather__thermometer current-weather__thermometer_type_now"><?= $city->fact->getTemperatureStr() ?>
°C
</div></span><span
class="current-weather__col current-weather__col_type_after t_c_<?= $city->getCurrentDay()->night->temperature_avg ?>"><span
class="current-weather__thermometer-name">ночью</span><i
class="icon icon_thumb_<?= $city->getCurrentDay()->night->getIcon() ?> icon_size_30"
data-width="30"></i><div
class="current-weather__thermometer current-weather__thermometer_type_after"><?= $city->getCurrentDay()->night->getTemperatureAvgStr() ?>
</div></span><span
class="current-weather__col current-weather__col_type_after t_c_<?= $city->getCurrentDay()->day->temperature_avg ?>"><span
class="current-weather__thermometer-name">днём</span><i
class="icon icon_thumb_<?= $city->getCurrentDay()->day->getIcon() ?> icon_size_30"
data-width="30"></i><div
class="current-weather__thermometer current-weather__thermometer_type_after"><?= $city->getCurrentDay()->day->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="Ветер: северо-восточный"><?= $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">' . $day->getDayName($key) . '</span><span
class="forecast-brief__item-day">' . $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">' . $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->night->temperature_avg . '" title="Минимальная температура ночью">
' . $day->night->getTemperatureAvgStr() . '
' . ($i > 0 ? "" : "ночью") . '
</div>
</li>';
if ($day->checkWeekend($key)) {
echo '<li class="forecast-brief__item forecast-brief__item_gap"> </li>';
}
$i++;
}
?>
</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">' . $day->getDayName($key) . '</small>
<strong class="forecast-detailed__day-number">' . $day->getDayNumber($key) . '<span class="forecast-detailed__day-month">'.$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">'.$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">' . $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="Ветер: западный">'.$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>