Projekt

Obecné

Profil

Stáhnout (12 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/styles.min.css">
17

    
18
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.min.js"></script>
19
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular-resource.min.js"></script>
20
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular-sanitize.min.js"></script>
21

    
22
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
23
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
24

    
25
    <?php
26
    //$base_url = 'http://students.kiv.zcu.cz/~valesz/index.php/api/v1';
27
    $base_url = './../backend/public/api/v1';
28

    
29
    include_once '../backend/lib/generateToken.php';
30
    $token = generateToken();
31
    ?>
32
    <script>
33
        var API_URL = '<?=$base_url ?>';
34
        var API_TOKEN = '<?=$token ?>';
35
    </script>
36

    
37
    <script src="./app.min.js"></script>
38
</head>
39
<body ng-controller="mainController" class="container-fluid">
40

    
41

    
42
<div id="loadingScreen" ng-show="showLoadingScreen">
43
    <h1 id="logo">
44
        <img src="./assets/img/favicon.png" alt="logo"> Průjezd vozidel
45
        <small class="text-muted">Plzeňský kraj</small>
46
    </h1>
47
    <div class="loading"></div>
48
    <noscript id="noscript">Aplikace vyžaduje Javascript. Aktivujte Javascript a znovu načtěte tuto stránku.
49
    </noscript>
50
</div>
51

    
52
<div class="row h-100" ng-init="load()">
53

    
54
    <!--SEARCH section-->
55
    <section class="search col-12 col-lg-3" id="search" ng-controller="searchController">
56

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

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

    
84
            <div class="result-locations mb-4 mt-4">
85
                <h5>Lokality</h5>
86

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

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

    
105
                <div ng-show="locations.length==0 && !showSearchLoading">
106
                    <small class="form-text text-muted text-center">Žádná lokalita</small>
107
                </div>
108

    
109
                <div class="loading" ng-show="showSearchLoading"></div>
110
            </div>
111
        </div>
112
        <footer class="text-center mb-2 mt-2 w-100">
113
            <small class="text-muted">© 2018 FAV, ZČU • version: {{ config.APP_VERSION }}</small>
114
        </footer>
115
    </section>
116

    
117

    
118
    <!--INFO section-->
119
    <section class="info col-12 col-lg-5" id="info" ng-show="$root.selectDevice!=null"
120
             ng-controller="infoController">
121

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

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

    
148
                <div class="form-group col">
149
                    <label for="rangeToDate" class="invisible">Období</label>
150
                    <input type="date" id="rangeToDate"
151
                           class="form-control form-control-sm" ng-model="range.toDate" required
152
                           ng-class="{ 'is-invalid': range.fromDate>=range.toDate}"
153
                           ng-change="changeRange()"
154
                           ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
155
                    <div class="invalid-feedback">
156
                        Tento datum musí být vetší.
157
                    </div>
158
                </div>
159
            </div>
160

    
161
            <div class="form-row">
162
                <div class="form-group col">
163
                    <label for="rangeFromTime">
164
                        <div class="custom-control custom-checkbox">
165
                            <input type="checkbox" id="rangeIsTime" name="rangeIsTime" class="custom-control-input"
166
                                   checked required
167
                                   ng-model="range.isTime"
168
                                   ng-model-options="{debounce: 300}"
169
                                   ng-change="changeRange()">
170
                            <label for="rangeIsTime" class="custom-control-label">Zobrazit časové rozmezí dne</label>
171
                        </div>
172
                    </label>
173
                    <input type="time" id="rangeFromTime" class="form-control form-control-sm"
174
                           ng-model="range.fromTime" required
175
                           ng-class="{'is-invalid': range.fromTime>=range.toTime}"
176
                           ng-change="changeRange()"
177
                           ng-model-options="{debounce: 600}"
178
                           ng-show="range.isTime">
179
                    <div class="invalid-feedback" ng-show="range.isTime">
180
                        Tento čas musí být menší.
181
                    </div>
182
                </div>
183

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

    
199
        <div class="loading" ng-show="showInfoLoading"></div>
200

    
201
        <div id="graphs" ng-show="$root.selectDevice!=null && $root.selectDevice.traffics.length>0 && !showInfoLoading">
202
            <h4 class="mt-4">Průměrná rychlost</h4>
203
            <graph-average-speed></graph-average-speed>
204

    
205
            <h4 class="mt-4">Počet vozidel</h4>
206
            <graph-number-vehicles></graph-number-vehicles>
207

    
208
            <div class="text-center">
209
                <a class="btn btn-dark" href="{{ urlExportCsv }}" role="button">Export CSV</a>
210
            </div>
211

    
212
            <div class="text-center mb-2 mt-2 w-100">
213
                <small class="text-muted">zdroj dat: <a target="_blank" href="https://doprava.plzensky-kraj.cz">doprava.plzensky-kraj.cz</a>
214
                </small>
215
            </div>
216
        </div>
217

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

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

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

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

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

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

    
259
</body>
260
</html>
(6-6/8)