1 |
0b27c108
|
Jan Kohlíček
|
<!doctype html>
|
2 |
|
|
<html ng-app="pvpk" class="no-js" 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 |
|
|
<script>
|
15 |
|
|
document.documentElement.className = document.documentElement.className.replace("no-js", "js");
|
16 |
|
|
</script>
|
17 |
|
|
|
18 |
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
|
19 |
|
|
integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
20 |
|
|
<link rel="stylesheet" media="screen" href="./assets/css/main.css">
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
|
24 |
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.min.js"></script>
|
25 |
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-resource.min.js"></script>
|
26 |
|
|
|
27 |
|
|
<script>
|
28 |
|
|
<?php
|
29 |
|
|
/* JEN PRO TESTOVANI, POZDEJI SE ODSTRANIT, A NAHRADIT NASDILENOU KNIHOVNOU */
|
30 |
d68f7bbd
|
Jan Kohlíček
|
$base_url = './../backend/public/api/v1';
|
31 |
0b27c108
|
Jan Kohlíček
|
|
32 |
|
|
include_once '../backend/lib/generateToken.php';
|
33 |
|
|
$token = generateToken();
|
34 |
|
|
?>
|
35 |
|
|
var API_URL = '<?=$base_url ?>';
|
36 |
|
|
var API_TOKEN = '<?=$token ?>';
|
37 |
|
|
</script>
|
38 |
|
|
|
39 |
|
|
<script src="./app.js"></script>
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
|
43 |
|
|
</head>
|
44 |
|
|
<body ng-controller="mainController" class="container-fluid">
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
<div id="loadingScreen" ng-show="showLoadingScreen">
|
48 |
|
|
<div class="loading"></div>
|
49 |
|
|
</div>
|
50 |
|
|
<div class="row h-100">
|
51 |
|
|
|
52 |
d68f7bbd
|
Jan Kohlíček
|
<!--SEARCH section-->
|
53 |
|
|
<section class="search col-12 col-sm-6 col-lg-3" id="search" ng-controller="searchController"
|
54 |
|
|
ng-class="{ 'col-sm-12': $root.selectDevice==null, 'col-sm-6': $root.selectDevice!=null }">
|
55 |
0b27c108
|
Jan Kohlíček
|
|
56 |
|
|
<div class="w-100 searchWrapper">
|
57 |
|
|
<header class="mt-2">
|
58 |
|
|
<h1>
|
59 |
|
|
<img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
|
60 |
|
|
<small class="text-muted">Plzeňský kraj</small>
|
61 |
|
|
</h1>
|
62 |
|
|
</header>
|
63 |
|
|
|
64 |
|
|
<form class="mb-4 mt-4">
|
65 |
|
|
<div class="form-group">
|
66 |
|
|
<label for="searchLocation" class="h5">Hledání - lokalit</label>
|
67 |
|
|
<input type="search" id="searchLocation" name="location"
|
68 |
|
|
class="form-control form-control-sm" placeholder="Město, ulice, ..."
|
69 |
|
|
ng-model="search.location" required maxlength="255" autocomplete="off"
|
70 |
d68f7bbd
|
Jan Kohlíček
|
ng-change="searchLocations(true)">
|
71 |
0b27c108
|
Jan Kohlíček
|
</div>
|
72 |
|
|
|
73 |
|
|
<div class="custom-control custom-checkbox mb-3">
|
74 |
|
|
<!-- ng-true-value="ofCourse" ng-false-value="iWish" -->
|
75 |
|
|
<input type="checkbox" id="searchDirection" name="searchDirection" class="custom-control-input"
|
76 |
|
|
checked ng-model="search.direction" required ng-change="searchLocations()">
|
77 |
|
|
<label for="searchDirection" class="custom-control-label">Rozlišovat směr</label>
|
78 |
|
|
</div>
|
79 |
|
|
|
80 |
|
|
<div class="form-row">
|
81 |
|
|
<div class="form-group col">
|
82 |
|
|
<label for="searchFromDate">Období</label>
|
83 |
|
|
<input type="date" id="searchFromDate" name="fromDate"
|
84 |
|
|
class="form-control form-control-sm" ng-model="search.fromDate" required
|
85 |
d68f7bbd
|
Jan Kohlíček
|
ng-class="{ 'is-invalid': search.fromDate>search.toDate}"
|
86 |
|
|
max="{{maxDate | date:'yyyy-MM-dd'}}">
|
87 |
0b27c108
|
Jan Kohlíček
|
<div class="invalid-feedback">
|
88 |
|
|
Tento datum musí být menší.
|
89 |
|
|
</div>
|
90 |
|
|
</div>
|
91 |
|
|
|
92 |
|
|
<div class="form-group col">
|
93 |
|
|
<label for="searchToDate" class="invisible">Období</label>
|
94 |
|
|
<input type="date" id="searchToDate" name="toDateTime"
|
95 |
|
|
class="form-control form-control-sm" ng-model="search.toDate" required
|
96 |
d68f7bbd
|
Jan Kohlíček
|
ng-class="{ 'is-invalid': search.fromDate>search.toDate}"
|
97 |
|
|
max="{{maxDate | date:'yyyy-MM-dd'}}">
|
98 |
0b27c108
|
Jan Kohlíček
|
<div class="invalid-feedback">
|
99 |
|
|
Tento datum musí být vetší.
|
100 |
|
|
</div>
|
101 |
|
|
</div>
|
102 |
|
|
</div>
|
103 |
|
|
|
104 |
|
|
<div class="form-row">
|
105 |
|
|
<div class="form-group col">
|
106 |
|
|
<label for="searchFromTime">Časové rozmezí dne</label>
|
107 |
|
|
<input type="time" id="searchFromTime" class="form-control form-control-sm"
|
108 |
|
|
ng-model="search.fromTime" required
|
109 |
|
|
ng-class="{'is-invalid': search.fromTime>search.toTime}">
|
110 |
|
|
<div class="invalid-feedback">
|
111 |
|
|
Tento čas musí být menší.
|
112 |
|
|
</div>
|
113 |
|
|
</div>
|
114 |
|
|
|
115 |
|
|
<div class="form-group col">
|
116 |
|
|
<label for="searchToTime" class="invisible">Časové rozmezí dne</label>
|
117 |
|
|
<input type="time" id="searchToTime" class="form-control form-control-sm"
|
118 |
|
|
ng-model="search.toTime" required
|
119 |
|
|
ng-class="{'is-invalid': search.fromTime>search.toTime}">
|
120 |
|
|
<div class="invalid-feedback">
|
121 |
|
|
Tento čas musí být vetší.
|
122 |
|
|
</div>
|
123 |
|
|
</div>
|
124 |
|
|
</div>
|
125 |
|
|
</form>
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
<div class="result-locations mb-5 mt-5">
|
129 |
|
|
<h5>Lokality</h5>
|
130 |
|
|
|
131 |
d68f7bbd
|
Jan Kohlíček
|
<div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
|
132 |
0b27c108
|
Jan Kohlíček
|
<!-- class = active -->
|
133 |
|
|
<a href="" id="location-{{location.id}}"
|
134 |
|
|
class="list-group-item list-group-item-action flex-column align-items-start"
|
135 |
|
|
ng-repeat="location in locations"
|
136 |
|
|
ng-click="selectDevice(location.id)"
|
137 |
d68f7bbd
|
Jan Kohlíček
|
ng-class="{'active': $root.selectDevice.id == location.id}">
|
138 |
0b27c108
|
Jan Kohlíček
|
|
139 |
|
|
<div class="d-flex w-100 justify-content-between">
|
140 |
|
|
<h6 class="mb-1">{{location.name}}</h6>
|
141 |
|
|
<small ng-show="search.direction">{{location.direction ==1 ? 'po směru': 'proti směru' }}
|
142 |
|
|
</small>
|
143 |
|
|
</div>
|
144 |
|
|
<small>
|
145 |
|
|
<address>{{location.street}}, {{location.town}}</address>
|
146 |
|
|
</small>
|
147 |
|
|
</a>
|
148 |
|
|
</div>
|
149 |
|
|
|
150 |
d68f7bbd
|
Jan Kohlíček
|
<div ng-show="locations.length==0 && !showSearchLoading">
|
151 |
0b27c108
|
Jan Kohlíček
|
<small class="form-text text-muted text-center">Žádná lokalita</small>
|
152 |
|
|
</div>
|
153 |
|
|
|
154 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showSearchLoading"></div>
|
155 |
0b27c108
|
Jan Kohlíček
|
|
156 |
|
|
</div>
|
157 |
|
|
|
158 |
|
|
</div>
|
159 |
|
|
<footer class="text-center mb-2 mt-2 w-100">
|
160 |
|
|
<small class="text-muted">2018 © FAV, ZČU</small>
|
161 |
|
|
</footer>
|
162 |
|
|
</section>
|
163 |
|
|
|
164 |
|
|
|
165 |
d68f7bbd
|
Jan Kohlíček
|
<!--INFO section-->
|
166 |
|
|
<section class="info col-12 col-sm-6 col-lg-3" id="info" ng-show="$root.selectDevice!=null"
|
167 |
|
|
ng-controller="infoController">
|
168 |
0b27c108
|
Jan Kohlíček
|
|
169 |
|
|
<header class="mt-2">
|
170 |
|
|
|
171 |
d68f7bbd
|
Jan Kohlíček
|
<h5>{{$root.selectDevice.name}}
|
172 |
|
|
<button type="button" class="close" aria-label="Close" ng-click="infoClose()">
|
173 |
0b27c108
|
Jan Kohlíček
|
<span aria-hidden="true">×</span>
|
174 |
|
|
</button>
|
175 |
d68f7bbd
|
Jan Kohlíček
|
</h5>
|
176 |
|
|
<small>
|
177 |
|
|
<address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
|
178 |
|
|
</small>
|
179 |
0b27c108
|
Jan Kohlíček
|
</header>
|
180 |
|
|
|
181 |
d68f7bbd
|
Jan Kohlíček
|
<div class="loading" ng-show="showInfoLoading"></div>
|
182 |
0b27c108
|
Jan Kohlíček
|
|
183 |
|
|
|
184 |
d68f7bbd
|
Jan Kohlíček
|
<h3 class="mt-5">Graf #1</h3>
|
185 |
|
|
|
186 |
|
|
<h3 class="mt-5">Graf #2</h3>
|
187 |
|
|
<div class="form-group">
|
188 |
|
|
<label for="searchVehicle">Vozidla</label>
|
189 |
|
|
<select id="searchVehicle" class="custom-select custom-select-sm" ng-model="search.vehicle">
|
190 |
|
|
<option value="">Všechna vozidla</option>
|
191 |
|
|
<option ng-repeat="vehicle in vehicles" value="{{vehicle.id}}">{{vehicle.name}}</option>
|
192 |
|
|
</select>
|
193 |
|
|
</div>
|
194 |
0b27c108
|
Jan Kohlíček
|
|
195 |
d68f7bbd
|
Jan Kohlíček
|
<h3 class="mt-5">Graf #3</h3>
|
196 |
0b27c108
|
Jan Kohlíček
|
|
197 |
d68f7bbd
|
Jan Kohlíček
|
|
198 |
|
|
</section>
|
199 |
|
|
|
200 |
|
|
<!--MAP section-->
|
201 |
0b27c108
|
Jan Kohlíček
|
<section class="map col-12 col-sm-12" id="map"
|
202 |
d68f7bbd
|
Jan Kohlíček
|
ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-6': $root.selectDevice!=null }"
|
203 |
|
|
ng-controller="mapController">
|
204 |
|
|
|
205 |
0b27c108
|
Jan Kohlíček
|
|
206 |
|
|
</section>
|
207 |
|
|
|
208 |
|
|
|
209 |
|
|
</div>
|
210 |
|
|
|
211 |
|
|
<div class="modal fade" id="modalExpiredToken" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
212 |
|
|
aria-hidden="true">
|
213 |
|
|
<div class="modal-dialog" role="document">
|
214 |
|
|
<div class="modal-content">
|
215 |
|
|
<div class="modal-header">
|
216 |
|
|
<h5 class="modal-title" id="exampleModalLabel">Platnost webové aplikace vypršela</h5>
|
217 |
|
|
</div>
|
218 |
|
|
<div class="modal-body">
|
219 |
|
|
<p>Pro obnovení platnosti stačí stisknout tlačítko <strong>Obnovit</strong>.</p>
|
220 |
|
|
</div>
|
221 |
|
|
<div class="modal-footer">
|
222 |
|
|
<button type="button" class="btn btn-primary" ng-click="reloadApp()">Obnovit</button>
|
223 |
|
|
</div>
|
224 |
|
|
</div>
|
225 |
|
|
</div>
|
226 |
|
|
</div>
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
230 |
|
|
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
231 |
|
|
crossorigin="anonymous"></script>
|
232 |
|
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
|
233 |
|
|
integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm"
|
234 |
|
|
crossorigin="anonymous"></script>
|
235 |
|
|
|
236 |
d68f7bbd
|
Jan Kohlíček
|
<!--async defer-->
|
237 |
|
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
|
238 |
|
|
type="text/javascript"></script>
|
239 |
|
|
|
240 |
|
|
<script type="text/javascript" src="./assets/libs/gmaps.min.js"></script>
|
241 |
|
|
|
242 |
0b27c108
|
Jan Kohlíček
|
|
243 |
|
|
</body>
|
244 |
|
|
</html>
|