1 |
0b27c108
|
Jan Kohlíček
|
<!doctype html>
|
2 |
e4f78eb8
|
Jan Kohlíček
|
<html ng-app="pvpk" lang="cs">
|
3 |
0b27c108
|
Jan Kohlíček
|
<head>
|
4 |
|
|
<meta charset="utf-8">
|
5 |
|
|
<title>Průjezd vozidel - Plzeňský kraj</title>
|
6 |
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
7 |
|
|
|
8 |
|
|
<meta name="description" content="Zobrazení dat o průjezdu vozidel pro Plzeňský kraj">
|
9 |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10 |
|
|
|
11 |
01189277
|
kohlicekjan
|
<link rel="manifest" href="app.webmanifest">
|
12 |
|
|
|
13 |
0b27c108
|
Jan Kohlíček
|
<link rel="apple-touch-icon" href="./assets/img/favicon.png">
|
14 |
|
|
<link rel="icon" href="./assets/img/favicon.png">
|
15 |
|
|
|
16 |
01189277
|
kohlicekjan
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
|
17 |
|
|
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
18 |
fb12df6d
|
Jan Kohlíček
|
<link rel="stylesheet" media="screen" href="./assets/css/styles.min.css">
|
19 |
0b27c108
|
Jan Kohlíček
|
|
20 |
01189277
|
kohlicekjan
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"></script>
|
21 |
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular-resource.min.js"></script>
|
22 |
|
|
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular-sanitize.min.js"></script>-->
|
23 |
e4f78eb8
|
Jan Kohlíček
|
|
24 |
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
|
25 |
fb12df6d
|
Jan Kohlíček
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
|
26 |
49df590a
|
Jan Kohlíček
|
|
27 |
b88dd6bb
|
Jan Kohlíček
|
<?php
|
28 |
|
|
//$base_url = 'http://students.kiv.zcu.cz/~valesz/index.php/api/v1';
|
29 |
|
|
$base_url = './../backend/public/api/v1';
|
30 |
0b27c108
|
Jan Kohlíček
|
|
31 |
b88dd6bb
|
Jan Kohlíček
|
include_once '../backend/lib/generateToken.php';
|
32 |
|
|
$token = generateToken();
|
33 |
|
|
?>
|
34 |
0b27c108
|
Jan Kohlíček
|
<script>
|
35 |
|
|
var API_URL = '<?=$base_url ?>';
|
36 |
|
|
var API_TOKEN = '<?=$token ?>';
|
37 |
|
|
</script>
|
38 |
|
|
|
39 |
b88dd6bb
|
Jan Kohlíček
|
<script src="./app.min.js"></script>
|
40 |
0b27c108
|
Jan Kohlíček
|
</head>
|
41 |
|
|
<body ng-controller="mainController" class="container-fluid">
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
<div id="loadingScreen" ng-show="showLoadingScreen">
|
45 |
e4f78eb8
|
Jan Kohlíček
|
<h1 id="logo">
|
46 |
|
|
<img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
|
47 |
01189277
|
kohlicekjan
|
<small>Plzeňský kraj</small>
|
48 |
e4f78eb8
|
Jan Kohlíček
|
</h1>
|
49 |
0b27c108
|
Jan Kohlíček
|
<div class="loading"></div>
|
50 |
49df590a
|
Jan Kohlíček
|
<noscript id="noscript">Aplikace vyžaduje Javascript. Aktivujte Javascript a znovu načtěte tuto stránku.
|
51 |
|
|
</noscript>
|
52 |
0b27c108
|
Jan Kohlíček
|
</div>
|
53 |
e4f78eb8
|
Jan Kohlíček
|
|
54 |
49df590a
|
Jan Kohlíček
|
<div class="row h-100" ng-init="load()">
|
55 |
0b27c108
|
Jan Kohlíček
|
|
56 |
d68f7bbd
|
Jan Kohlíček
|
<!--SEARCH section-->
|
57 |
fb12df6d
|
Jan Kohlíček
|
<section class="search col-12 col-lg-3" id="search" ng-controller="searchController">
|
58 |
0b27c108
|
Jan Kohlíček
|
|
59 |
|
|
<div class="w-100 searchWrapper">
|
60 |
|
|
<header class="mt-2">
|
61 |
|
|
<h1>
|
62 |
|
|
<img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
|
63 |
01189277
|
kohlicekjan
|
<small>Plzeňský kraj</small>
|
64 |
0b27c108
|
Jan Kohlíček
|
</h1>
|
65 |
|
|
</header>
|
66 |
|
|
|
67 |
01189277
|
kohlicekjan
|
<div class="mb-4 mt-4">
|
68 |
0b27c108
|
Jan Kohlíček
|
<div class="form-group">
|
69 |
|
|
<label for="searchLocation" class="h5">Hledání - lokalit</label>
|
70 |
|
|
<input type="search" id="searchLocation" name="location"
|
71 |
|
|
class="form-control form-control-sm" placeholder="Město, ulice, ..."
|
72 |
49df590a
|
Jan Kohlíček
|
ng-model="search.q" required maxlength="255" autocomplete="off"
|
73 |
|
|
ng-change="searchLocations()"
|
74 |
|
|
ng-model-options="{debounce: 600}">
|
75 |
0b27c108
|
Jan Kohlíček
|
</div>
|
76 |
|
|
<div class="custom-control custom-checkbox mb-3">
|
77 |
fb12df6d
|
Jan Kohlíček
|
<input type="checkbox" id="searchIsDirection" name="searchIsDirection" class="custom-control-input"
|
78 |
49df590a
|
Jan Kohlíček
|
checked required
|
79 |
|
|
ng-model="search.isDirection"
|
80 |
|
|
ng-change="searchLocations()"
|
81 |
|
|
ng-model-options="{debounce: 600}">
|
82 |
fb12df6d
|
Jan Kohlíček
|
<label for="searchIsDirection" class="custom-control-label">Rozlišovat směr</label>
|
83 |
0b27c108
|
Jan Kohlíček
|
</div>
|
84 |
01189277
|
kohlicekjan
|
</div>
|
85 |
0b27c108
|
Jan Kohlíček
|
|
86 |
49df590a
|
Jan Kohlíček
|
<div class="result-locations mb-4 mt-4">
|
87 |
0b27c108
|
Jan Kohlíček
|
<h5>Lokality</h5>
|
88 |
|
|
|
89 |
d68f7bbd
|
Jan Kohlíček
|
<div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
|
90 |
0b27c108
|
Jan Kohlíček
|
<a href="" id="location-{{location.id}}"
|
91 |
|
|
class="list-group-item list-group-item-action flex-column align-items-start"
|
92 |
|
|
ng-repeat="location in locations"
|
93 |
49df590a
|
Jan Kohlíček
|
ng-click="selectDevice(location.id,location.direction)"
|
94 |
|
|
ng-class="{'active': $root.selectDevice.id == location.id && (!$root.selectDevice.direction || $root.selectDevice.direction ==location.direction)}">
|
95 |
0b27c108
|
Jan Kohlíček
|
|
96 |
|
|
<div class="d-flex w-100 justify-content-between">
|
97 |
|
|
<h6 class="mb-1">{{location.name}}</h6>
|
98 |
49df590a
|
Jan Kohlíček
|
<small ng-show="search.isDirection">{{location.direction ==1 ? 'po směru': 'proti směru' }}
|
99 |
0b27c108
|
Jan Kohlíček
|
</small>
|
100 |
|
|
</div>
|
101 |
01189277
|
kohlicekjan
|
<address class="small">{{location.street}}, {{location.town}}</address>
|
102 |
|
|
|
103 |
0b27c108
|
Jan Kohlíček
|
</a>
|
104 |
|
|
</div>
|
105 |
|
|
|
106 |
01189277
|
kohlicekjan
|
<div class="form-text text-center small" ng-show="locations.length==0 && !showSearchLoading">
|
107 |
|
|
Žádná lokalita
|
108 |
0b27c108
|
Jan Kohlíček
|
</div>
|
109 |
|
|
|
110 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showSearchLoading"></div>
|
111 |
0b27c108
|
Jan Kohlíček
|
</div>
|
112 |
|
|
</div>
|
113 |
01189277
|
kohlicekjan
|
<footer class="text-center text-muted mb-2 mt-2 w-100 small">
|
114 |
|
|
© 2018 FAV, ZČU • version: {{ config.APP_VERSION }}
|
115 |
0b27c108
|
Jan Kohlíček
|
</footer>
|
116 |
|
|
</section>
|
117 |
|
|
|
118 |
|
|
|
119 |
d68f7bbd
|
Jan Kohlíček
|
<!--INFO section-->
|
120 |
fb12df6d
|
Jan Kohlíček
|
<section class="info col-12 col-lg-5" id="info" ng-show="$root.selectDevice!=null"
|
121 |
d68f7bbd
|
Jan Kohlíček
|
ng-controller="infoController">
|
122 |
0b27c108
|
Jan Kohlíček
|
|
123 |
|
|
<header class="mt-2">
|
124 |
49df590a
|
Jan Kohlíček
|
<h4>{{$root.selectDevice.name}}
|
125 |
d68f7bbd
|
Jan Kohlíček
|
<button type="button" class="close" aria-label="Close" ng-click="infoClose()">
|
126 |
0b27c108
|
Jan Kohlíček
|
<span aria-hidden="true">×</span>
|
127 |
|
|
</button>
|
128 |
49df590a
|
Jan Kohlíček
|
</h4>
|
129 |
01189277
|
kohlicekjan
|
<address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
|
130 |
0b27c108
|
Jan Kohlíček
|
</header>
|
131 |
|
|
|
132 |
01189277
|
kohlicekjan
|
<div class="form-inline mb-4 mt-2">
|
133 |
|
|
<label for="selectDeviceDirection" class="=hidden"></label>
|
134 |
|
|
<select id="selectDeviceDirection" class="custom-select custom-select-sm"
|
135 |
|
|
ng-model="$root.selectDevice.direction"
|
136 |
|
|
ng-change="changeDirection(direction.id)"
|
137 |
|
|
ng-options="direction.id as direction.name for direction in directions"
|
138 |
|
|
ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
|
139 |
|
|
</select>
|
140 |
|
|
</div>
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
<div class="alert alert-warning" role="alert"
|
144 |
|
|
ng-show="!(range.fromDate >= range.minDate && range.toDate <= range.maxDate && range.toDate >= range.minDate && range.fromDate <= range.maxDate)">
|
145 |
|
|
|
146 |
|
|
Data jsou k dispozici jen v rosahu {{range.minDate | date:"dd.MM.yyyy"}} - {{range.maxDate| date:"dd.MM.yyyy"}}
|
147 |
|
|
|
148 |
|
|
</div>
|
149 |
|
|
|
150 |
|
|
|
151 |
49df590a
|
Jan Kohlíček
|
<div class="mb-4 mt-4" ng-form="rangeForm">
|
152 |
|
|
<div class="form-row">
|
153 |
|
|
<div class="form-group col">
|
154 |
|
|
<label for="rangeFromDate">Období</label>
|
155 |
|
|
<input type="date" id="rangeFromDate"
|
156 |
|
|
class="form-control form-control-sm" ng-model="range.fromDate" required
|
157 |
|
|
ng-class="{ 'is-invalid': range.fromDate>=range.toDate}"
|
158 |
|
|
ng-change="changeRange()"
|
159 |
|
|
ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
|
160 |
|
|
<div class="invalid-feedback">
|
161 |
|
|
Tento datum musí být menší.
|
162 |
|
|
</div>
|
163 |
|
|
</div>
|
164 |
|
|
|
165 |
|
|
<div class="form-group col">
|
166 |
|
|
<label for="rangeToDate" class="invisible">Období</label>
|
167 |
|
|
<input type="date" id="rangeToDate"
|
168 |
|
|
class="form-control form-control-sm" ng-model="range.toDate" required
|
169 |
|
|
ng-class="{ 'is-invalid': range.fromDate>=range.toDate}"
|
170 |
|
|
ng-change="changeRange()"
|
171 |
|
|
ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
|
172 |
|
|
<div class="invalid-feedback">
|
173 |
|
|
Tento datum musí být vetší.
|
174 |
|
|
</div>
|
175 |
|
|
</div>
|
176 |
|
|
</div>
|
177 |
|
|
<div class="form-row">
|
178 |
|
|
<div class="form-group col">
|
179 |
fb12df6d
|
Jan Kohlíček
|
<label for="rangeFromTime">
|
180 |
|
|
<div class="custom-control custom-checkbox">
|
181 |
|
|
<input type="checkbox" id="rangeIsTime" name="rangeIsTime" class="custom-control-input"
|
182 |
|
|
checked required
|
183 |
|
|
ng-model="range.isTime"
|
184 |
|
|
ng-model-options="{debounce: 300}"
|
185 |
|
|
ng-change="changeRange()">
|
186 |
|
|
<label for="rangeIsTime" class="custom-control-label">Zobrazit časové rozmezí dne</label>
|
187 |
|
|
</div>
|
188 |
|
|
</label>
|
189 |
49df590a
|
Jan Kohlíček
|
<input type="time" id="rangeFromTime" class="form-control form-control-sm"
|
190 |
|
|
ng-model="range.fromTime" required
|
191 |
|
|
ng-class="{'is-invalid': range.fromTime>=range.toTime}"
|
192 |
|
|
ng-change="changeRange()"
|
193 |
fb12df6d
|
Jan Kohlíček
|
ng-model-options="{debounce: 600}"
|
194 |
|
|
ng-show="range.isTime">
|
195 |
|
|
<div class="invalid-feedback" ng-show="range.isTime">
|
196 |
49df590a
|
Jan Kohlíček
|
Tento čas musí být menší.
|
197 |
|
|
</div>
|
198 |
|
|
</div>
|
199 |
|
|
|
200 |
|
|
<div class="form-group col">
|
201 |
|
|
<label for="rangeToTime" class="invisible">Časové rozmezí dne</label>
|
202 |
|
|
<input type="time" id="rangeToTime" class="form-control form-control-sm"
|
203 |
|
|
ng-model="range.toTime" required
|
204 |
|
|
ng-class="{'is-invalid': range.fromTime>=range.toTime}"
|
205 |
|
|
ng-change="changeRange()"
|
206 |
fb12df6d
|
Jan Kohlíček
|
ng-model-options="{debounce: 600}"
|
207 |
|
|
ng-show="range.isTime">
|
208 |
|
|
<div class="invalid-feedback" ng-show="range.isTime">
|
209 |
49df590a
|
Jan Kohlíček
|
Tento čas musí být vetší.
|
210 |
|
|
</div>
|
211 |
|
|
</div>
|
212 |
|
|
</div>
|
213 |
|
|
</div>
|
214 |
|
|
|
215 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showInfoLoading"></div>
|
216 |
0b27c108
|
Jan Kohlíček
|
|
217 |
49df590a
|
Jan Kohlíček
|
<div id="graphs" ng-show="$root.selectDevice!=null && $root.selectDevice.traffics.length>0 && !showInfoLoading">
|
218 |
01189277
|
kohlicekjan
|
<h4 class="mt-4">{{range.isTime ? "Průměrná rychlost za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
|
219 |
b88dd6bb
|
Jan Kohlíček
|
<graph-average-speed></graph-average-speed>
|
220 |
49df590a
|
Jan Kohlíček
|
|
221 |
01189277
|
kohlicekjan
|
<h4 class="mt-4">{{range.isTime ? "Počet vozidel za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
|
222 |
b88dd6bb
|
Jan Kohlíček
|
<graph-number-vehicles></graph-number-vehicles>
|
223 |
49df590a
|
Jan Kohlíček
|
|
224 |
274760e7
|
Jan Kohlíček
|
<div class="text-center">
|
225 |
|
|
<a class="btn btn-dark" href="{{ urlExportCsv }}" role="button">Export CSV</a>
|
226 |
|
|
</div>
|
227 |
|
|
|
228 |
01189277
|
kohlicekjan
|
<div class="text-center mb-2 mt-2 w-100 small">
|
229 |
|
|
zdroj dat: <a class="source-link" target="_blank" rel="noopener"
|
230 |
|
|
href="https://doprava.plzensky-kraj.cz">doprava.plzensky-kraj.cz</a>
|
231 |
|
|
|
232 |
fb12df6d
|
Jan Kohlíček
|
</div>
|
233 |
49df590a
|
Jan Kohlíček
|
</div>
|
234 |
d68f7bbd
|
Jan Kohlíček
|
|
235 |
01189277
|
kohlicekjan
|
<div class="form-text text-center small"
|
236 |
|
|
ng-show="$root.selectDevice && $root.selectDevice.traffics.length==0 && !showInfoLoading">
|
237 |
|
|
Data nejsou k dispozici
|
238 |
d68f7bbd
|
Jan Kohlíček
|
</div>
|
239 |
|
|
</section>
|
240 |
|
|
|
241 |
|
|
<!--MAP section-->
|
242 |
fb12df6d
|
Jan Kohlíček
|
<section class="map col-12" id="map"
|
243 |
|
|
ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-4': $root.selectDevice!=null }"
|
244 |
d68f7bbd
|
Jan Kohlíček
|
ng-controller="mapController">
|
245 |
0b27c108
|
Jan Kohlíček
|
</section>
|
246 |
|
|
</div>
|
247 |
|
|
|
248 |
e4f78eb8
|
Jan Kohlíček
|
<div class="modal fade" id="modalError" tabindex="-1" role="dialog">
|
249 |
0b27c108
|
Jan Kohlíček
|
<div class="modal-dialog" role="document">
|
250 |
|
|
<div class="modal-content">
|
251 |
|
|
<div class="modal-header">
|
252 |
49df590a
|
Jan Kohlíček
|
<h5 class="modal-title">{{modalError.title}}</h5>
|
253 |
0b27c108
|
Jan Kohlíček
|
</div>
|
254 |
|
|
<div class="modal-body">
|
255 |
01189277
|
kohlicekjan
|
<p>{{modalError.body}}</p>
|
256 |
0b27c108
|
Jan Kohlíček
|
</div>
|
257 |
|
|
<div class="modal-footer">
|
258 |
e4f78eb8
|
Jan Kohlíček
|
<button type="button" class="btn btn-primary" data-dismiss="{{modalError.clickButton ? '' : 'modal'}}"
|
259 |
|
|
ng-click="modalError.clickButton && modalError.clickButton()">{{modalError.button}}
|
260 |
|
|
</button>
|
261 |
0b27c108
|
Jan Kohlíček
|
</div>
|
262 |
|
|
</div>
|
263 |
|
|
</div>
|
264 |
|
|
</div>
|
265 |
|
|
|
266 |
|
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
267 |
|
|
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
268 |
|
|
crossorigin="anonymous"></script>
|
269 |
e4f78eb8
|
Jan Kohlíček
|
|
270 |
01189277
|
kohlicekjan
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
|
271 |
|
|
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
|
272 |
0b27c108
|
Jan Kohlíček
|
crossorigin="anonymous"></script>
|
273 |
|
|
|
274 |
d68f7bbd
|
Jan Kohlíček
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
|
275 |
|
|
type="text/javascript"></script>
|
276 |
|
|
|
277 |
0b27c108
|
Jan Kohlíček
|
</body>
|
278 |
|
|
</html>
|