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