1
|
<!doctype html>
|
2
|
<html ng-app="pvpk" lang="cs">
|
3
|
<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
|
<link rel="manifest" href="app.webmanifest">
|
12
|
|
13
|
<link rel="apple-touch-icon" href="./assets/img/favicon.png">
|
14
|
<link rel="icon" href="./assets/img/favicon.png">
|
15
|
|
16
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
|
17
|
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
18
|
<link rel="stylesheet" media="screen" href="./assets/css/styles.min.css">
|
19
|
|
20
|
<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
|
|
24
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
|
25
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
|
26
|
|
27
|
<?php
|
28
|
//$base_url = 'http://students.kiv.zcu.cz/~valesz/index.php/api/v1';
|
29
|
$base_url = './../backend/public/api/v1';
|
30
|
|
31
|
include_once '../backend/lib/generateToken.php';
|
32
|
$token = generateToken();
|
33
|
?>
|
34
|
<script>
|
35
|
var API_URL = '<?=$base_url ?>';
|
36
|
var API_TOKEN = '<?=$token ?>';
|
37
|
</script>
|
38
|
|
39
|
<script src="./app.min.js"></script>
|
40
|
</head>
|
41
|
<body ng-controller="mainController" class="container-fluid">
|
42
|
|
43
|
|
44
|
<div id="loadingScreen" ng-show="showLoadingScreen">
|
45
|
<h1 id="logo">
|
46
|
<img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
|
47
|
<small>Plzeňský kraj</small>
|
48
|
</h1>
|
49
|
<div class="loading"></div>
|
50
|
<noscript id="noscript">Aplikace vyžaduje Javascript. Aktivujte Javascript a znovu načtěte tuto stránku.
|
51
|
</noscript>
|
52
|
</div>
|
53
|
|
54
|
<div class="row h-100" ng-init="load()">
|
55
|
|
56
|
<!--SEARCH section-->
|
57
|
<section class="search col-12 col-lg-3" id="search" ng-controller="searchController">
|
58
|
|
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
|
<small>Plzeňský kraj</small>
|
64
|
</h1>
|
65
|
</header>
|
66
|
|
67
|
<div class="mb-4 mt-4">
|
68
|
<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
|
ng-model="search.q" required maxlength="255" autocomplete="off"
|
73
|
ng-change="searchLocations()"
|
74
|
ng-model-options="{debounce: 600}">
|
75
|
</div>
|
76
|
<div class="custom-control custom-checkbox mb-3">
|
77
|
<input type="checkbox" id="searchIsDirection" name="searchIsDirection" class="custom-control-input"
|
78
|
checked required
|
79
|
ng-model="search.isDirection"
|
80
|
ng-change="searchLocations()"
|
81
|
ng-model-options="{debounce: 600}">
|
82
|
<label for="searchIsDirection" class="custom-control-label">Rozlišovat směr</label>
|
83
|
</div>
|
84
|
</div>
|
85
|
|
86
|
<div class="result-locations mb-4 mt-4">
|
87
|
<h5>Lokality</h5>
|
88
|
|
89
|
<div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
|
90
|
<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
|
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
|
|
96
|
<div class="d-flex w-100 justify-content-between">
|
97
|
<h6 class="mb-1">{{location.name}}</h6>
|
98
|
<small ng-show="search.isDirection">{{location.direction ==1 ? 'po směru': 'proti směru' }}
|
99
|
</small>
|
100
|
</div>
|
101
|
<address class="small">{{location.street}}, {{location.town}}</address>
|
102
|
|
103
|
</a>
|
104
|
</div>
|
105
|
|
106
|
<div class="form-text text-center small" ng-show="locations.length==0 && !showSearchLoading">
|
107
|
Žádná lokalita
|
108
|
</div>
|
109
|
|
110
|
<div class="loading" ng-show="showSearchLoading"></div>
|
111
|
</div>
|
112
|
</div>
|
113
|
<footer class="text-center text-muted mb-2 mt-2 w-100 small">
|
114
|
© 2018 FAV, ZČU • version: {{ config.APP_VERSION }}
|
115
|
</footer>
|
116
|
</section>
|
117
|
|
118
|
|
119
|
<!--INFO section-->
|
120
|
<section class="info col-12 col-lg-5" id="info" ng-show="$root.selectDevice!=null"
|
121
|
ng-controller="infoController">
|
122
|
|
123
|
<header class="mt-2">
|
124
|
<h4>{{$root.selectDevice.name}}
|
125
|
<button type="button" class="close" aria-label="Close" ng-click="infoClose()">
|
126
|
<span aria-hidden="true">×</span>
|
127
|
</button>
|
128
|
</h4>
|
129
|
<address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
|
130
|
</header>
|
131
|
|
132
|
<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
|
<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
|
<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
|
<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
|
ng-model-options="{debounce: 600}"
|
194
|
ng-show="range.isTime">
|
195
|
<div class="invalid-feedback" ng-show="range.isTime">
|
196
|
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
|
ng-model-options="{debounce: 600}"
|
207
|
ng-show="range.isTime">
|
208
|
<div class="invalid-feedback" ng-show="range.isTime">
|
209
|
Tento čas musí být vetší.
|
210
|
</div>
|
211
|
</div>
|
212
|
</div>
|
213
|
</div>
|
214
|
|
215
|
<div class="loading" ng-show="showInfoLoading"></div>
|
216
|
|
217
|
<div id="graphs" ng-show="$root.selectDevice!=null && $root.selectDevice.traffics.length>0 && !showInfoLoading">
|
218
|
<h4 class="mt-4">{{range.isTime ? "Průměrná rychlost za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
|
219
|
<graph-average-speed></graph-average-speed>
|
220
|
|
221
|
<h4 class="mt-4">{{range.isTime ? "Počet vozidel za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
|
222
|
<graph-number-vehicles></graph-number-vehicles>
|
223
|
|
224
|
<div class="text-center">
|
225
|
<a class="btn btn-dark" href="{{ urlExportCsv }}" role="button">Export CSV</a>
|
226
|
</div>
|
227
|
|
228
|
<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
|
</div>
|
233
|
</div>
|
234
|
|
235
|
<div class="form-text text-center small"
|
236
|
ng-show="$root.selectDevice && $root.selectDevice.traffics.length==0 && !showInfoLoading">
|
237
|
Data nejsou k dispozici
|
238
|
</div>
|
239
|
</section>
|
240
|
|
241
|
<!--MAP section-->
|
242
|
<section class="map col-12" id="map"
|
243
|
ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-4': $root.selectDevice!=null }"
|
244
|
ng-controller="mapController">
|
245
|
</section>
|
246
|
</div>
|
247
|
|
248
|
<div class="modal fade" id="modalError" tabindex="-1" role="dialog">
|
249
|
<div class="modal-dialog" role="document">
|
250
|
<div class="modal-content">
|
251
|
<div class="modal-header">
|
252
|
<h5 class="modal-title">{{modalError.title}}</h5>
|
253
|
</div>
|
254
|
<div class="modal-body">
|
255
|
<p>{{modalError.body}}</p>
|
256
|
</div>
|
257
|
<div class="modal-footer">
|
258
|
<button type="button" class="btn btn-primary" data-dismiss="{{modalError.clickButton ? '' : 'modal'}}"
|
259
|
ng-click="modalError.clickButton && modalError.clickButton()">{{modalError.button}}
|
260
|
</button>
|
261
|
</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
|
|
270
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
|
271
|
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
|
272
|
crossorigin="anonymous"></script>
|
273
|
|
274
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
|
275
|
type="text/javascript"></script>
|
276
|
|
277
|
</body>
|
278
|
</html>
|