-
Notifications
You must be signed in to change notification settings - Fork 0
/
landing.php
492 lines (458 loc) · 22 KB
/
landing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<?php
require_once 'users/init.php';
require_once 'app/database_layer.php';
require_once 'app/constants.php';
require_once $abs_us_root.$us_url_root.'users/includes/template/prep.php';
if ($user->isLoggedIn()) {
//die;
require_once 'users/init.php';
}
$projects = getNumberPublicResearch();
$researches = getNumberOfResearches();
$public_researches = clone(getPublicResearches());
$public_images = getNumberofPublicImages();
// Caso queiramos usar o font awesome do site
// <script src="https://kit.fontawesome.com/b41bdf02f7.js" crossorigin="anonymous"></script>
$ip = $_SERVER['REMOTE_ADDR'];
logger("","Visitor","Visit from $ip.");
$visitor_data = @json_decode(file_get_contents(
"http://www.geoplugin.net/json.gp?ip=" . $ip));
insertDatabaseVisitorInfo($visitor_data);
$visitors_statistics = clone(getAllDatabaseVisitorInfo());
$countries_statistics = clone(getCountryTotals());
// echo 'Country Name: ' . $ipdat->geoplugin_countryName . "\n";
// echo 'City Name: ' . $ipdat->geoplugin_city . "\n";
// echo 'Continent Name: ' . $ipdat->geoplugin_continentName . "\n";
// echo 'Latitude: ' . $ipdat->geoplugin_latitude . "\n";
// echo 'Longitude: ' . $ipdat->geoplugin_longitude . "\n";
// echo 'Currency Symbol: ' . $ipdat->geoplugin_currencySymbol . "\n";
// echo 'Currency Code: ' . $ipdat->geoplugin_currencyCode . "\n";
// echo 'Timezone: ' . $ipdat->geoplugin_timezone;
?>
<style>
@font-face {
font-family: 'Aeros';
src: url('app/css/Aeros.ttf') format('truetype');
}
.vector-map {
width: 100%;
height: 300px;
}
.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
button {
cursor: pointer;
border: none;
color: rgb(45, 73, 56);
font-size: 20px;
border-radius: 4px;
box-shadow: inset 0px 3px 5px rgba(60, 112, 182, 0.5), 0px 0px 10px rgba(0,0,0,0.15);
background: rgb(2,0,36);
background: linear-gradient(45deg, rgba(2,0,36,0) 5%, rgba(255,255,255,.5) 6%, rgba(255,255,255,0) 9%, rgba(255,255,255,.5) 10%, rgba(255,255,255,0) 17%, rgba(255,255,255,.5) 19%, rgba(255,255,255,0) 21%);
background-size: 150%;
background-position: right;
transition: 1s;
}
button:hover {
background-position: left;
color: #96af9e;
box-shadow: inset 0px 3px 5px rgba(255,255,255,1), 0px 0px 10px rgba(0,0,0,0.25);
}
button:focus {
outline: none;
}
.float{
position:fixed;
width:15mm;
height: 15mm;
bottom:40px;
right:40px;
background-color:#0C9;
color:#FFF;
border-radius:50px;
text-align:center;
box-shadow: 2px 2px 3px #999;
}
</style>
<link rel="stylesheet" href="app/css/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="app/js/jvectormap/jquery-jvectormap-2.0.5.css" type="text/css" media="screen"/>
<script src="app/js/jvectormap/jquery-jvectormap-2.0.5.min.js"></script>
<script src="app/js/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script>
let cities = <?php echo json_encode($visitors_statistics->results()); ?>;
</script>
<body>
<div class="row">
<div class="col-md-12">
<ul id="tabsJustified" class="nav nav-tabs">
<li class="nav-item">
<a href="" id="tab_home" data-target="#home_bsl" data-toggle="tab" class="nav-link small text-uppercase active show">
<?=lang("TAB_HOME");?>
</a>
</li>
<?php if (!$user->isLoggedIn()) { ?>
<li class="nav-item"><a href="" id="tab_researches" data-target="#researches" data-toggle="tab" class="nav-link small text-uppercase">
<?=lang("TAB_RESEARCHES");?>
</a>
</li>
<?php } ?>
<li class="nav-item"><a href="" id="tab_tutorials" data-target="#tutorials" data-toggle="tab" class="nav-link small text-uppercase">
<?=lang("TAB_TUTORIALS");?>
</a>
</li>
<li class="nav-item"><a href="" id="tab_services" data-target="#services" data-toggle="tab" class="nav-link small text-uppercase">
<?=lang("TAB_SERVICES");?>
</a>
</li>
</ul>
<br>
<div id="tabsJustifiedContent" class="tab-content">
<div id="home_bsl" class="tab-pane fade active show">
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-success">
<h4 class="alert-heading" style="font-family: 'Aeros',serif"><a style="color: #02a7e9">
B</a>IO<a style="color: #68b849">S</a>PECKLE <a style="color: #f1893a">L<a>ASER On CLOUDS</h4>
<?=lang("WELCOME_MSG"); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h3 class="mb-0 stat-timer"><?=$projects;?></h3>
<p class="text-success ml-2 mb-0 font-weight-medium">+11%</p>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-success ">
<h3><i class="fa fa-book float-right"></i></h3>
</div>
</div>
</div>
<h6 class="text-muted font-weight-bold"><?=lang("LAND_PUBLISHED");?></h6>
</div>
</div>
</div>
<div class="col-sm-4 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h3 class="mb-0 stat-timer"><?=$researches;?></h3>
<p class="text-success ml-2 mb-0 font-weight-medium">+11%</p>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-success">
<h3><i class="fa fa-users float-right"></i></h3>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal"><?=lang("LAND_RESEARCHES");?></h6>
</div>
</div>
</div>
<div class="col-sm-3 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h3 class="mb-0 stat-timer"><?=$public_images;?></h3>
<p class="text-sucess ml-2 mb-0 font-weight-medium">+12.4%</p>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-danger">
<h3><i class="fa fa-file-image-o float-right"></i></h3>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal"><?=lang("NUMBER_OF_PUBLIC_IMAGES");?></h6>
</div>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<div role="alert" class="alert alert-success">
<div class="text-success font-weight-bold">
<a style="color: #02a7e9; font-family: 'Aeros',serif">B</a>
<a style="color: #68b849; font-family: 'Aeros',serif">S</a>
<a style="color: #f1893a; font-family: 'Aeros',serif">L</a> <?=lang("AROUND_WORLD");?></div>
</div>
<table class="table table-hover table-sm alert-primary">
<thead>
<tr>
<th><?=lang("GEN_COUNTRY");?></th>
<th><?=lang("GEN_CONTINENT");?></th>
<th class="text-right"><?=lang("GEN_VISITORS");?></th>
</tr>
</thead>
<tbody>
<?php
if ($countries_statistics->count() > 0) {
// Para totalizar as visitas por país
foreach ($countries_statistics->results() as $visitor) {
// Busca o nome da bandeira
$key = array_search($visitor->bsl_visitors_data_country, CI_COUNTRIES_ARRAY);
$icon_name = strtolower($key);
?>
<tr>
<td id="country_name">
<i class="flag-icon flag-icon-<?=$icon_name?>"></i>  <?=$visitor->bsl_visitors_data_country;?>
</td>
<td><?=$visitor->bsl_visitors_data_continent;?></td>
<td id="country_visitors" datatype="<?=$visitor->bsl_visitors_data_city;?>" class="text-right font-weight-bold">
<?=$visitor->count;?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<div class="col-md-7"><!-- mapa -->
<div id="audience-map" class="vector-map"></div>
</div>
</div><!-- end row -->
<br>
</div>
<?php if (!$user->isLoggedIn()) { ?>
<div id="researches" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-success">
<h4 class="alert-heading" style="font-family: 'Aeros',serif"><a style="color: #02a7e9">
B</a>IO<a style="color: #68b849">S</a>PECKLE <a style="color: #f1893a">L<a>ASER On CLOUDS</h4>
<h4><?=lang("RESEARCHES_TEXT"); ?></h4>
</div>
</div>
</div>
<?php
if (!$user->isLoggedIn()) {
?>
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-info">
<a><?=lang("TEXT_MUST_LOGIN"); ?></a>
</div>
</div>
</div>
<?php
}
?>
<?php
if ($public_researches->count() > 0) {
foreach ($public_researches->results() as $research) {
?>
<div class="row">
<div class="col-12 my-2">
<div class="card card-body p-3 text-black bg-dark">
<div class="list-group-item d-block">
<div class="row">
<div class="col-3">
<?php if ($research->bsl_sample_data_cover_image == null) { ?>
<img src="app/images/default.bmp" class="img-fluid rounded-circle mx-auto d-block" style="height: 20mm">
<?php
} else { ?>
<img src="<?='data:image/bmp;base64,' . $research->bsl_sample_data_cover_image;?>" class="img-fluid rounded-circle mx-auto d-block" style="height: 20mm">
<?php
} ?>
</div>
<div class="col-3 text-center text-sm-left">
<h5><span class="text-muted">Research: <?=$research->bsl_sample_data_unique_id;?></span></h5>
<span class="text-muted">Researcher Name: <?=$research->lname . ', ' . $research->fname; ?></span>
<br>
<span class="badge badge-success">Country: <?=$research->locale; ?></span>
</div>
<div class="col-6 text-center text-sm-left">
<label for="observation_text_area"><?=lang("OBSERVATIONS_MSG"); ?></label>
<textarea style="width: 100%" readonly><?=$research->bsl_sample_data_obs; ?></textarea>
</div>
</div>
</div>
<div>
<span class="text-primary">
<a class="badge badge-primary float-right" href="<?=$research->bsl_sample_data_published_DOI_URL; ?>">
Published: <?=$research->bsl_sample_data_published_DOI_URL; ?></a>
</span>
</div>
</div>
</div>
</div>
<?php
}
} else { ?>
<div class="row">
<div class="col-12 my-2">
<div class="card card-body p-3 text-black bg-dark">
<div class="list-group-item d-block">
<div class="row">
--------------
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div> <!-- tab pane -->
<?php } ?>
<div id="tutorials" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-success">
<h4 class="alert-heading" style="font-family: 'Aeros',serif"><a style="color: #02a7e9">
B</a>IO<a style="color: #68b849">S</a>PECKLE <a style="color: #f1893a">L<a>ASER On CLOUDS</h4>
<h4><?=lang("TUTORIALS_TEXT"); ?></h4>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-warning">
<h6><?=lang("TUTORIALS_MSG"); ?></h6>
</div>
</div>
</div>
</div> <!-- tab pane -->
<div id="services" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-success">
<h4 class="alert-heading" style="font-family: 'Aeros',serif"><a style="color: #02a7e9">
B</a>IO<a style="color: #68b849">S</a>PECKLE <a style="color: #f1893a">L<a>ASER On CLOUDS</h4>
<h4><?=lang("SERVICES_TEXT"); ?></h4>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div role="alert" class="alert alert-warning">
<h6><?=lang("SERVICES_MSG"); ?></h6>
</div>
</div>
</div>
</div> <!-- tab pane -->
</div> <!-- tab content -->
</div> <!-- col class -->
</div> <!-- row -->
<?php
if ($user->isLoggedIn()) {
require_once $abs_us_root . $us_url_root . 'users/includes/html_footer.php';
}
?>
<!--a href="#home_bsl" class="float" style="padding-top: 3mm">
<i class="fa fa-home my-float fa-2x"></i>
</a-->
</body>
<script>
function changeTabtoResearch() {
let tab_elem = document.getElementById("tab_researches");
tab_elem.className = "nav-link small text-uppercase active show";
let tab_elem1 = document.getElementById("tab_home");
tab_elem1.className = "nav-link small text-uppercase";
let tab_elem2 = document.getElementById("home_bsl");
tab_elem2.className = "tab-pane fade";
let tab_elem3 = document.getElementById("researches");
tab_elem3.className = "tab-pane fade active show";
}
function changeTabtoTutorial() {
let tab_elem = document.getElementById("tab_tutorials");
tab_elem.className = "nav-link small text-uppercase active show";
let tab_elem1 = document.getElementById("tab_home");
tab_elem1.className = "nav-link small text-uppercase";
let tab_elem2 = document.getElementById("home_bsl");
tab_elem2.className = "tab-pane fade";
let tab_elem3 = document.getElementById("tutorials");
tab_elem3.className = "tab-pane fade active show";
}
function changeTabtoServices() {
let tab_elem = document.getElementById("tab_services");
tab_elem.className = "nav-link small text-uppercase active show";
let tab_elem1 = document.getElementById("tab_home");
tab_elem1.className = "nav-link small text-uppercase";
let tab_elem2 = document.getElementById("home_bsl");
tab_elem2.className = "tab-pane fade";
let tab_elem3 = document.getElementById("services");
tab_elem3.className = "tab-pane fade active show";
}
// Fun Facts
function count($this) {
var current = parseInt($this.html(), 10);
current = current + 1; /* Where 50 is increment */
$this.html(++current);
if (current > $this.data('count')) {
$this.html($this.data('count'));
} else {
setTimeout(function() {
count($this)
}, 50);
}
}
window.onpopstate = function() {
switch(location.hash) {
case '#home':
//alert("home");
break
case '#login':
//alert("login");
break
default:
//alert("def");
location.replace("http://bslonclouds.com/");
}
}
if($('#audience-map').length) {
let markers = [];
for(var i = 0; i < cities.length; i++) {
let obj = {};
let lat = cities[i].bsl_visitors_data_latitude;
let lon = cities[i].bsl_visitors_data_longitude;
let ctname = cities[i].bsl_visitors_data_city;
obj["latLng"] = [lat, lon];
obj["name"] = ctname;
markers.push(obj);
}
$('#audience-map').vectorMap({
map: 'world_mill_en',
panOnDrag: true,
focusOn: {
x: 0.5,
y: 0.5,
scale: 1,
animate: true
},
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
markers: markers,
});
}
$(".stat-timer").each(function() {
$(this).data('count', parseInt($(this).html(), 10));
$(this).html('0');
count($(this));
});
</script>