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 |
|
|
<link rel="apple-touch-icon" href="./assets/img/favicon.png">
|
12 |
|
|
<link rel="icon" href="./assets/img/favicon.png">
|
13 |
|
|
|
14 |
e4f78eb8
|
Jan Kohlíček
|
<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 |
fb12df6d
|
Jan Kohlíček
|
<link rel="stylesheet" media="screen" href="./assets/css/styles.min.css">
|
17 |
0b27c108
|
Jan Kohlíček
|
|
18 |
49df590a
|
Jan Kohlíček
|
<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 |
e4f78eb8
|
Jan Kohlíček
|
|
23 |
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
|
24 |
fb12df6d
|
Jan Kohlíček
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
|
25 |
49df590a
|
Jan Kohlíček
|
|
26 |
0b27c108
|
Jan Kohlíček
|
|
27 |
|
|
<script>
|
28 |
|
|
<?php
|
29 |
|
|
/* JEN PRO TESTOVANI, POZDEJI SE ODSTRANIT, A NAHRADIT NASDILENOU KNIHOVNOU */
|
30 |
49df590a
|
Jan Kohlíček
|
//$base_url = 'http://students.kiv.zcu.cz/~valesz/index.php/api/v1';
|
31 |
d68f7bbd
|
Jan Kohlíček
|
$base_url = './../backend/public/api/v1';
|
32 |
0b27c108
|
Jan Kohlíček
|
|
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 |
e4f78eb8
|
Jan Kohlíček
|
<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 |
0b27c108
|
Jan Kohlíček
|
<div class="loading"></div>
|
51 |
49df590a
|
Jan Kohlíček
|
<noscript id="noscript">Aplikace vyžaduje Javascript. Aktivujte Javascript a znovu načtěte tuto stránku.
|
52 |
|
|
</noscript>
|
53 |
0b27c108
|
Jan Kohlíček
|
</div>
|
54 |
e4f78eb8
|
Jan Kohlíček
|
|
55 |
49df590a
|
Jan Kohlíček
|
<div class="row h-100" ng-init="load()">
|
56 |
0b27c108
|
Jan Kohlíček
|
|
57 |
d68f7bbd
|
Jan Kohlíček
|
<!--SEARCH section-->
|
58 |
fb12df6d
|
Jan Kohlíček
|
<section class="search col-12 col-lg-3" id="search" ng-controller="searchController">
|
59 |
0b27c108
|
Jan Kohlíček
|
|
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 |
49df590a
|
Jan Kohlíček
|
ng-model="search.q" required maxlength="255" autocomplete="off"
|
74 |
|
|
ng-change="searchLocations()"
|
75 |
|
|
ng-model-options="{debounce: 600}">
|
76 |
0b27c108
|
Jan Kohlíček
|
</div>
|
77 |
|
|
<div class="custom-control custom-checkbox mb-3">
|
78 |
fb12df6d
|
Jan Kohlíček
|
<input type="checkbox" id="searchIsDirection" name="searchIsDirection" class="custom-control-input"
|
79 |
49df590a
|
Jan Kohlíček
|
checked required
|
80 |
|
|
ng-model="search.isDirection"
|
81 |
|
|
ng-change="searchLocations()"
|
82 |
|
|
ng-model-options="{debounce: 600}">
|
83 |
fb12df6d
|
Jan Kohlíček
|
<label for="searchIsDirection" class="custom-control-label">Rozlišovat směr</label>
|
84 |
0b27c108
|
Jan Kohlíček
|
</div>
|
85 |
|
|
</form>
|
86 |
|
|
|
87 |
49df590a
|
Jan Kohlíček
|
<div class="result-locations mb-4 mt-4">
|
88 |
0b27c108
|
Jan Kohlíček
|
<h5>Lokality</h5>
|
89 |
|
|
|
90 |
d68f7bbd
|
Jan Kohlíček
|
<div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
|
91 |
0b27c108
|
Jan Kohlíček
|
<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 |
49df590a
|
Jan Kohlíček
|
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 |
0b27c108
|
Jan Kohlíček
|
|
97 |
|
|
<div class="d-flex w-100 justify-content-between">
|
98 |
|
|
<h6 class="mb-1">{{location.name}}</h6>
|
99 |
49df590a
|
Jan Kohlíček
|
<small ng-show="search.isDirection">{{location.direction ==1 ? 'po směru': 'proti směru' }}
|
100 |
0b27c108
|
Jan Kohlíček
|
</small>
|
101 |
|
|
</div>
|
102 |
|
|
<small>
|
103 |
|
|
<address>{{location.street}}, {{location.town}}</address>
|
104 |
|
|
</small>
|
105 |
|
|
</a>
|
106 |
|
|
</div>
|
107 |
|
|
|
108 |
d68f7bbd
|
Jan Kohlíček
|
<div ng-show="locations.length==0 && !showSearchLoading">
|
109 |
0b27c108
|
Jan Kohlíček
|
<small class="form-text text-muted text-center">Žádná lokalita</small>
|
110 |
|
|
</div>
|
111 |
|
|
|
112 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showSearchLoading"></div>
|
113 |
0b27c108
|
Jan Kohlíček
|
</div>
|
114 |
|
|
</div>
|
115 |
|
|
<footer class="text-center mb-2 mt-2 w-100">
|
116 |
fb12df6d
|
Jan Kohlíček
|
<small class="text-muted">© 2018 FAV, ZČU • version: {{ config.APP_VERSION }}</small>
|
117 |
0b27c108
|
Jan Kohlíček
|
</footer>
|
118 |
|
|
</section>
|
119 |
|
|
|
120 |
|
|
|
121 |
d68f7bbd
|
Jan Kohlíček
|
<!--INFO section-->
|
122 |
fb12df6d
|
Jan Kohlíček
|
<section class="info col-12 col-lg-5" id="info" ng-show="$root.selectDevice!=null"
|
123 |
d68f7bbd
|
Jan Kohlíček
|
ng-controller="infoController">
|
124 |
0b27c108
|
Jan Kohlíček
|
|
125 |
|
|
<header class="mt-2">
|
126 |
49df590a
|
Jan Kohlíček
|
<h4>{{$root.selectDevice.name}}
|
127 |
d68f7bbd
|
Jan Kohlíček
|
<button type="button" class="close" aria-label="Close" ng-click="infoClose()">
|
128 |
0b27c108
|
Jan Kohlíček
|
<span aria-hidden="true">×</span>
|
129 |
|
|
</button>
|
130 |
49df590a
|
Jan Kohlíček
|
</h4>
|
131 |
d68f7bbd
|
Jan Kohlíček
|
<small>
|
132 |
|
|
<address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
|
133 |
49df590a
|
Jan Kohlíček
|
<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 |
d68f7bbd
|
Jan Kohlíček
|
</small>
|
135 |
0b27c108
|
Jan Kohlíček
|
</header>
|
136 |
|
|
|
137 |
49df590a
|
Jan Kohlíček
|
<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 |
fb12df6d
|
Jan Kohlíček
|
|
166 |
49df590a
|
Jan Kohlíček
|
<div class="form-row">
|
167 |
|
|
<div class="form-group col">
|
168 |
fb12df6d
|
Jan Kohlíček
|
<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 |
49df590a
|
Jan Kohlíček
|
<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 |
fb12df6d
|
Jan Kohlíček
|
ng-model-options="{debounce: 600}"
|
183 |
|
|
ng-show="range.isTime">
|
184 |
|
|
<div class="invalid-feedback" ng-show="range.isTime">
|
185 |
49df590a
|
Jan Kohlíček
|
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 |
fb12df6d
|
Jan Kohlíček
|
ng-model-options="{debounce: 600}"
|
196 |
|
|
ng-show="range.isTime">
|
197 |
|
|
<div class="invalid-feedback" ng-show="range.isTime">
|
198 |
49df590a
|
Jan Kohlíček
|
Tento čas musí být vetší.
|
199 |
|
|
</div>
|
200 |
|
|
</div>
|
201 |
|
|
</div>
|
202 |
|
|
</div>
|
203 |
|
|
|
204 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showInfoLoading"></div>
|
205 |
0b27c108
|
Jan Kohlíček
|
|
206 |
49df590a
|
Jan Kohlíček
|
<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 |
fb12df6d
|
Jan Kohlíček
|
<canvas id="graphNumberVehicles" class="mb-5"></canvas>
|
212 |
49df590a
|
Jan Kohlíček
|
|
213 |
274760e7
|
Jan Kohlíček
|
<div class="text-center">
|
214 |
|
|
<a class="btn btn-dark" href="{{ urlExportCsv }}" role="button">Export CSV</a>
|
215 |
|
|
</div>
|
216 |
|
|
|
217 |
fb12df6d
|
Jan Kohlíček
|
<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 |
49df590a
|
Jan Kohlíček
|
</div>
|
222 |
d68f7bbd
|
Jan Kohlíček
|
|
223 |
49df590a
|
Jan Kohlíček
|
<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 |
d68f7bbd
|
Jan Kohlíček
|
</div>
|
226 |
|
|
</section>
|
227 |
|
|
|
228 |
|
|
<!--MAP section-->
|
229 |
fb12df6d
|
Jan Kohlíček
|
<section class="map col-12" id="map"
|
230 |
|
|
ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-4': $root.selectDevice!=null }"
|
231 |
d68f7bbd
|
Jan Kohlíček
|
ng-controller="mapController">
|
232 |
0b27c108
|
Jan Kohlíček
|
</section>
|
233 |
|
|
</div>
|
234 |
|
|
|
235 |
e4f78eb8
|
Jan Kohlíček
|
<div class="modal fade" id="modalError" tabindex="-1" role="dialog">
|
236 |
0b27c108
|
Jan Kohlíček
|
<div class="modal-dialog" role="document">
|
237 |
|
|
<div class="modal-content">
|
238 |
|
|
<div class="modal-header">
|
239 |
49df590a
|
Jan Kohlíček
|
<h5 class="modal-title">{{modalError.title}}</h5>
|
240 |
0b27c108
|
Jan Kohlíček
|
</div>
|
241 |
|
|
<div class="modal-body">
|
242 |
e4f78eb8
|
Jan Kohlíček
|
<p ng-bind-html="modalError.body"></p>
|
243 |
0b27c108
|
Jan Kohlíček
|
</div>
|
244 |
|
|
<div class="modal-footer">
|
245 |
e4f78eb8
|
Jan Kohlíček
|
<button type="button" class="btn btn-primary" data-dismiss="{{modalError.clickButton ? '' : 'modal'}}"
|
246 |
|
|
ng-click="modalError.clickButton && modalError.clickButton()">{{modalError.button}}
|
247 |
|
|
</button>
|
248 |
0b27c108
|
Jan Kohlíček
|
</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 |
e4f78eb8
|
Jan Kohlíček
|
|
257 |
|
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
|
258 |
|
|
integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T"
|
259 |
0b27c108
|
Jan Kohlíček
|
crossorigin="anonymous"></script>
|
260 |
|
|
|
261 |
d68f7bbd
|
Jan Kohlíček
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
|
262 |
|
|
type="text/javascript"></script>
|
263 |
|
|
|
264 |
0b27c108
|
Jan Kohlíček
|
</body>
|
265 |
|
|
</html>
|