Projekt

Obecné

Profil

Stáhnout (11.7 KB) Statistiky
| Větev: | Revize:
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/main.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.1/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-sm-6 col-lg-3" id="search" ng-controller="searchController"
59
             ng-class="{ 'col-sm-12': $root.selectDevice==null, 'col-sm-6': $root.selectDevice!=null }">
60

    
61
        <div class="w-100 searchWrapper">
62
            <header class="mt-2">
63
                <h1>
64
                    <img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
65
                    <small class="text-muted">Plzeňský kraj</small>
66
                </h1>
67
            </header>
68

    
69
            <form class="mb-4 mt-4">
70
                <div class="form-group">
71
                    <label for="searchLocation" class="h5">Hledání - lokalit</label>
72
                    <input type="search" id="searchLocation" name="location"
73
                           class="form-control form-control-sm" placeholder="Město, ulice, ..."
74
                           ng-model="search.q" required maxlength="255" autocomplete="off"
75
                           ng-change="searchLocations()"
76
                           ng-model-options="{debounce: 600}">
77
                </div>
78
                <div class="custom-control custom-checkbox mb-3">
79
                    <input type="checkbox" id="searchDirection" name="searchDirection" class="custom-control-input"
80
                           checked required
81
                           ng-model="search.isDirection"
82
                           ng-change="searchLocations()"
83
                           ng-model-options="{debounce: 600}">
84
                    <label for="searchDirection" class="custom-control-label">Rozlišovat směr</label>
85
                </div>
86
            </form>
87

    
88
            <div class="result-locations mb-4 mt-4">
89
                <h5>Lokality</h5>
90

    
91
                <div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
92
                    <a href="" id="location-{{location.id}}"
93
                       class="list-group-item list-group-item-action flex-column align-items-start"
94
                       ng-repeat="location in locations"
95
                       ng-click="selectDevice(location.id,location.direction)"
96
                       ng-class="{'active': $root.selectDevice.id == location.id && (!$root.selectDevice.direction  || $root.selectDevice.direction ==location.direction)}">
97

    
98
                        <div class="d-flex w-100 justify-content-between">
99
                            <h6 class="mb-1">{{location.name}}</h6>
100
                            <small ng-show="search.isDirection">{{location.direction ==1 ? 'po směru': 'proti směru' }}
101
                            </small>
102
                        </div>
103
                        <small>
104
                            <address>{{location.street}}, {{location.town}}</address>
105
                        </small>
106
                    </a>
107
                </div>
108

    
109
                <div ng-show="locations.length==0 && !showSearchLoading">
110
                    <small class="form-text text-muted text-center">Žádná lokalita</small>
111
                </div>
112

    
113
                <div class="loading" ng-show="showSearchLoading"></div>
114
            </div>
115
        </div>
116
        <footer class="text-center mb-2 mt-2 w-100">
117
            <small class="text-muted">2018 © FAV, ZČU</small>
118
        </footer>
119
    </section>
120

    
121

    
122
    <!--INFO section-->
123
    <section class="info col-12 col-sm-6 col-lg-4" id="info" ng-show="$root.selectDevice!=null"
124
             ng-controller="infoController">
125

    
126
        <header class="mt-2">
127
            <h4>{{$root.selectDevice.name}}
128
                <button type="button" class="close" aria-label="Close" ng-click="infoClose()">
129
                    <span aria-hidden="true">&times;</span>
130
                </button>
131
            </h4>
132
            <small>
133
                <address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
134
                <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>
135
            </small>
136
        </header>
137

    
138
        <div class="mb-4 mt-4" ng-form="rangeForm">
139
            <div class="form-row">
140
                <div class="form-group col">
141
                    <label for="rangeFromDate">Období</label>
142
                    <input type="date" id="rangeFromDate"
143
                           class="form-control form-control-sm" ng-model="range.fromDate" required
144
                           ng-class="{ 'is-invalid': range.fromDate>=range.toDate}"
145
                           ng-change="changeRange()"
146
                           ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
147
                    <div class="invalid-feedback">
148
                        Tento datum musí být menší.
149
                    </div>
150
                </div>
151

    
152

    
153
                <div class="form-group col">
154
                    <label for="rangeToDate" class="invisible">Období</label>
155
                    <input type="date" id="rangeToDate"
156
                           class="form-control form-control-sm" ng-model="range.toDate" 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 vetší.
162
                    </div>
163
                </div>
164
            </div>
165

    
166
            <div class="form-row">
167
                <div class="form-group col">
168
                    <label for="rangehFromTime">Časové rozmezí dne</label>
169
                    <input type="time" id="rangeFromTime" class="form-control form-control-sm"
170
                           ng-model="range.fromTime" required
171
                           ng-class="{'is-invalid': range.fromTime>=range.toTime}"
172
                           ng-change="changeRange()"
173
                           ng-model-options="{debounce: 600}">
174
                    <div class="invalid-feedback">
175
                        Tento čas musí být menší.
176
                    </div>
177
                </div>
178

    
179
                <div class="form-group col">
180
                    <label for="rangeToTime" class="invisible">Časové rozmezí dne</label>
181
                    <input type="time" id="rangeToTime" class="form-control form-control-sm"
182
                           ng-model="range.toTime" required
183
                           ng-class="{'is-invalid': range.fromTime>=range.toTime}"
184
                           ng-change="changeRange()"
185
                           ng-model-options="{debounce: 600}">
186
                    <div class="invalid-feedback">
187
                        Tento čas musí být vetší.
188
                    </div>
189
                </div>
190
            </div>
191
        </div>
192

    
193

    
194
        <div class="loading" ng-show="showInfoLoading"></div>
195

    
196
        <div id="graphs" ng-show="$root.selectDevice!=null && $root.selectDevice.traffics.length>0 && !showInfoLoading">
197
            <h4 class="mt-4">Průměrná rychlost</h4>
198
            <canvas id="graphAverageSpeed"></canvas>
199

    
200

    
201
            <h4 class="mt-4">Počet vozidel</h4>
202
            <form>
203
                <div class="form-group">
204
                    <select id="typeVehicle" class="custom-select custom-select-sm"
205
                            ng-model="typeVehicle"
206
                            ng-change="renderGraphNumberVehicles()"
207
                            ng-options="vehicle.id as vehicle.name for vehicle in filterVehicles">
208
                        <option value="">Všechna vozidla</option>
209
                    </select>
210
                </div>
211
            </form>
212
            <canvas id="graphNumberVehicles"></canvas>
213

    
214
        </div>
215

    
216
        <div ng-show="$root.selectDevice && $root.selectDevice.traffics.length==0 && !showInfoLoading">
217
            <small class="form-text text-muted text-center">Data nejsou k dispozici</small>
218
        </div>
219

    
220

    
221
    </section>
222

    
223

    
224
    <!--MAP section-->
225
    <section class="map col-12 col-sm-12 " id="map"
226
             ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-5': $root.selectDevice!=null }"
227
             ng-controller="mapController">
228
    </section>
229
</div>
230

    
231
<div class="modal fade" id="modalError" tabindex="-1" role="dialog">
232
    <div class="modal-dialog" role="document">
233
        <div class="modal-content">
234
            <div class="modal-header">
235
                <h5 class="modal-title">{{modalError.title}}</h5>
236
            </div>
237
            <div class="modal-body">
238
                <p ng-bind-html="modalError.body"></p>
239
            </div>
240
            <div class="modal-footer">
241
                <button type="button" class="btn btn-primary" data-dismiss="{{modalError.clickButton ? '' : 'modal'}}"
242
                        ng-click="modalError.clickButton && modalError.clickButton()">{{modalError.button}}
243
                </button>
244
            </div>
245
        </div>
246
    </div>
247
</div>
248

    
249
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
250
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
251
        crossorigin="anonymous"></script>
252

    
253
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
254
        integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T"
255
        crossorigin="anonymous"></script>
256

    
257
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
258
        type="text/javascript"></script>
259

    
260
<script type="text/javascript" src="./assets/libs/gmaps.min.js"></script>
261

    
262
</body>
263
</html>
(2-2/3)