This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
390 lines (362 loc) · 22.7 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<?php
$debug = false;
if ($debug) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
error_log('Home page is running in debug mode!');
}
$print_login_state = false;
require_once 'DB_CONFIG.php';
require_once dirname(__FILE__).'/core/core.php';
require_once dirname(__FILE__).'/admin/async_login_handler.php';
$db = new DBHelper($default_database, $default_sql_user, $default_sql_password, $sql_url, $default_table, $db_cols);
$loginStatus = getLoginState();
?>
<title>Amphibian Disease Portal</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8"/>
<meta name="theme-color" content="#5677fc"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" media="screen" href="css/main.css"/>
<link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<link rel="prerender" href="https://amphibiandisease.org/project.php" />
<link href="https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Sans+Mono|Roboto:400,100,300,500,700,100italic,300italic,400italic,500italic,700italic" rel='stylesheet' type='text/css'/>
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon32.png" />
<link rel="icon" type="image/png" sizes="64x64" href="assets/favicon64.png" />
<link rel="icon" type="image/png" sizes="128x128" href="assets/favicon128.png" />
<link rel="icon" type="image/png" sizes="256x254" href="assets/favicon256.png" />
<link rel="icon" type="image/png" sizes="512x512" href="assets/favicon512.png" />
<link rel="icon" type="image/png" sizes="1024x1024" href="assets/favicon1024.png" />
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html"/>
<link rel="import" href="bower_components/paper-toggle-button/paper-toggle-button.html"/>
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html"/>
<link rel="import" href="bower_components/paper-toast/paper-toast.html"/>
<link rel="import" href="bower_components/paper-input/paper-input.html"/>
<link rel="import" href="bower_components/paper-spinner/paper-spinner.html"/>
<link rel="import" href="bower_components/paper-slider/paper-slider.html"/>
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html"/>
<link rel="import" href="bower_components/paper-radio-group/paper-radio-group.html"/>
<link rel="import" href="bower_components/paper-radio-button/paper-radio-button.html"/>
<link rel="import" href="bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html"/>
<link rel="import" href="bower_components/paper-button/paper-button.html"/>
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html"/>
<link rel="import" href="bower_components/paper-menu/paper-menu.html"/>
<link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html"/>
<link rel="import" href="bower_components/paper-fab/paper-fab.html"/>
<link rel="import" href="bower_components/paper-item/paper-item.html"/>
<link rel="import" href="bower_components/paper-card/paper-card.html"/>
<link rel="import" href="bower_components/gold-email-input/gold-email-input.html"/>
<link rel="import" href="bower_components/gold-phone-input/gold-phone-input.html"/>
<link rel="import" href="bower_components/iron-collapse/iron-collapse.html"/>
<link rel="import" href="bower_components/iron-form/iron-form.html"/>
<link rel="import" href="bower_components/iron-label/iron-label.html"/>
<link rel="import" href="bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html"/>
<link rel="import" href="bower_components/font-roboto/roboto.html"/>
<link rel="import" href="bower_components/iron-icons/iron-icons.html"/>
<link rel="import" href="bower_components/iron-icons/image-icons.html"/>
<link rel="import" href="bower_components/iron-icons/social-icons.html"/>
<link rel="import" href="bower_components/iron-icons/editor-icons.html"/>
<link rel="import" href="bower_components/neon-animation/neon-animation.html"/>
<link rel="import" href="bower_components/google-map/google-map.html"/>
<link rel="import" href="bower_components/google-map/google-map-marker.html"/>
<link rel="import" href="bower_components/google-map/google-map-poly.html"/>
<link rel="import" href="polymer-elements/copyright-statement.html"/>
<link rel="import" href="polymer-elements/glyphicon-social-icons.html"/>
<script type="text/javascript">
(function(){var p=[],w=window,d=document,e=f=0;p.push('ua='+encodeURIComponent(navigator.userAgent));e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
e|=(e&16&&({}.toString).toString().indexOf("\n")===-1)?32:0;p.push('e='+e);f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
p.push('f='+f);p.push('r='+Math.random().toString(36).substring(7));p.push('w='+screen.width);p.push('h='+screen.height);var s=d.createElement('script');
s.src='bower_components/whichbrowser/detect.php?' + p.join('&');d.getElementsByTagName('head')[0].appendChild(s);})();
/*window.onerror = function(e) {
console.warn("Error thrown: "+e);
return true;
}*/
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/purl.min.js"></script>
<script type="text/javascript" src="js/xmlToJSON.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.min.js"></script>
<script type="text/javascript" src="bower_components/js-base64/base64.min.js"></script>
<script type="text/javascript" src="bower_components/imagelightbox/dist/imagelightbox.min.js"></script>
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
<script type="text/javascript" src="js/c.min.js"></script>
<script type="text/javascript" src="js/global-search.min.js"></script>
</head>
<body class="container-fluid">
<header id="header-bar" class="fixed-bar clearfix row">
<div class="logo-container">
<div class="square-object">
<div class="square tile">
<img src="assets/aw_logo512-trans.png" alt="AmphibiaWeb logo" class="content click" data-href="http://amphibiaweb.org/" data-newtab="true"/>
</div>
</div>
</div>
<p class="col-xs-12 text-right">
<?php
$user = $_COOKIE['amphibiandisease_fullname'];
$test = $loginStatus['status'];
if ($test) {
?>
Logged in as <span class='header-bar-user-name'><?php echo $user; ?></span>
<paper-icon-button icon="icons:dashboard" class="click" data-href="https://amphibiandisease.org/admin-page.html" data-toggle="tooltip" title="Administration Dashboard" data-placement="bottom"> </paper-icon-button>
<?php
} else {
# TODO replace login icon with glyphicon login icon
?>
<paper-button class="click materialgreen" data-toggle="tooltip" title="Login" data-href="https://amphibiandisease.org/admin" data-placement="bottom">
<iron-icon icon="icons:exit-to-app"></iron-icon>
Log In
</paper-button>
<paper-button class="click materialgreen" data-toggle="tooltip" title="Sign Up" data-href="https://amphibiandisease.org/admin-login.php?q=create" data-placement="bottom">
<iron-icon icon="icons:lightbulb-outline"></iron-icon>
Sign Up
</paper-button>
<?php
} ?>
<paper-icon-button icon="icons:update" class="click" data-toggle="tooltip" title="News & Updates" data-href="http://updates.amphibiandisease.org" data-placement="bottom"> </paper-icon-button>
<paper-icon-button icon="icons:language" class="click" data-toggle="tooltip" title="Project Browser" data-href="https://amphibiandisease.org/project.php" data-placement="bottom"> </paper-icon-button>
<paper-icon-button icon="icons:account-box" class="click" data-toggle="tooltip" title="Profiles" data-href="https://amphibiandisease.org/profile.php" data-placement="bottom"> </paper-icon-button>
</p>
</header>
<main>
<h1 id="title" class="main-title">The Amphibian Disease Portal</h1>
<section id="main-body" class="row">
<h2 class="col-xs-12 subtitle">A repository for aggregating information on <i>Bd</i> and <i>Bsal</i></h2>
<section class="col-xs-12" id="global-data-vis">
<div id="alt-map" hidden></div>
<div class="map-container" id="global-map-container">
<!-- <google-map id="global-data-map" map-type="terrain" api-key="AIzaSyAZvQMkfFkbqNStlgzNjw1VOWBASd74gq4" zoom="3" min-zoom="3"></google-map> -->
</div>
<script type="infowindow/html" id="infowindow_template">
<div class="cartodb-popup v2">
<a href="#close" class="cartodb-popup-close-button close">x</a>
<div class="cartodb-popup-content-wrapper">
<div class="cartodb-popup-header">
<img style="width: 100%" src="https://cartodb.com/assets/logos/logos_full_cartodb_light.png"/>
</div>
<div class="cartodb-popup-content">
<!-- content.data contains the field info -->
<h4>Species: </h4>
<p>{{content.data.genus}} {{content.data.specificepithet}}</p>
<p>Tested {{content.data.diseasetested}} as {{content.data.diseasedetected}} (Fatal: {{content.data.fatal}})</p>
</div>
</div>
<div class="cartodb-popup-tip-container"></div>
</div>
</script>
<div class="center-block" id="post-map-container">
<p class="text-center center-block text-muted" id="post-map-subtitle">
All Projects
</p>
</div>
<div class="form form-horizontal row" id="global-records-search">
<h3 class="col-xs-12">Search & Visualize Records <span class="badge">BETA</span></h3>
<div class="col-xs-12 col-md-6 col-lg-8">
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong><span class="glyphicon glyphicon-info-sign"></span> Tip:</strong> Your search will be restricted to the parts of the world viewable in the map. Zoom and pan to restrict your search area, then click "search" to perform your search. <button class="btn btn-link alert-link" id="show-more-tips">More tips...</button>
<iron-collapse id="more-tips">
<ul>
<li>
Search results are public data only if you're logged out
</li>
<li>
If you're logged in, data from projects you have permission to view will also be shown
</li>
<li>
Under "Advanced", you can toggle "Search In Map View" to always search by the numerical bounds entered, rather than merely what is visible.
</li>
</ul>
</iron-collapse>
</div>
<div class="form-group" id="taxa-input-container">
<label for="taxa-input" class="col-xs-4 col-sm-2 control-label">Taxon filter</label>
<div class="col-xs-6 col-sm-9">
<input type="text" id="taxa-input" class="form-control submit-project-search" placeholder="e.g., Batrachoseps attenuatus. Default: No filter"/>
</div>
<div class="col-xs-2 col-sm-1">
<span class="glyphicon glyphicon-info-sign" title="Enter a scientific name for a species or group of species, such as 'Batrachoseps attenuatus'. Simple substring match. Uses canonical AmphibiaWeb taxa." data-toggle="tooltip"></span>
</div>
</div>
<div class="row">
<div class="col-xs-12 center-block text-center">
<paper-button id="toggle-global-search-filters" raised>
<iron-icon icon="icons:filter-list"></iron-icon>
<span class="action-word">Show</span> Advanced Options
</paper-button>
<iron-collapse id="global-search-filters">
<div class="collapse-content text-left">
<div class="form-group paper-elements">
<label for="disease-status" class="col-xs-4 col-sm-2 control-label">Disease Status</label>
<div class="col-xs-8 col-sm-10 ">
<paper-radio-group id="disease-status" selected="any">
<paper-radio-button name="any" data-search="*">Any</paper-radio-button>
<paper-radio-button name="positive" data-search="true">Positive</paper-radio-button>
<paper-radio-button name="negative" data-search="false">Negative</paper-radio-button>
</paper-radio-group>
</div>
</div>
<div class="form-group paper-elements">
<label for="morbidity-status" class="col-xs-4 col-sm-2 control-label">Morbidity Status</label>
<div class="col-xs-8 col-sm-10 ">
<paper-radio-group id="morbidity-status" selected="any">
<paper-radio-button name="any" data-search="*">Any</paper-radio-button>
<paper-radio-button name="positive" data-search="true">Positive</paper-radio-button>
<paper-radio-button name="negative" data-search="false">Negative</paper-radio-button>
</paper-radio-group>
</div>
</div>
<div class="form-group paper-elements">
<label for="pathogen-choice" class="col-xs-4 col-sm-2 control-label">Pathogen</label>
<div class="col-xs-8 col-sm-10 ">
<paper-radio-group id="pathogen-choice" selected="any">
<paper-radio-button name="any" data-search="*">Any</paper-radio-button>
<paper-radio-button name="bd" data-search="Batrachochytrium dendrobatidis"><span class="sciname">Batrachochytrium dendrobatidis</span></paper-radio-button>
<paper-radio-button name="bsal" data-search="Batrachochytrium salamandrivorans"><span class="sciname">Batrachochytrium salamandrivorans</span></paper-radio-button>
</paper-radio-group>
</div>
</div>
<div class="form-group">
<iron-label class="control-label col-xs-4 col-sm-2" for="use-viewport-bounds">
Search in map view
</iron-label>
<div class="col-xs-5 col-sm-8">
<paper-toggle-button id="use-viewport-bounds">Enabled</paper-toggle-button>
<span class="glyphicon glyphicon-info-sign" title="The bounds will be computed based on the area of the map that's visible" data-toggle="tooltip"></span>
</div>
</div>
<div class="form-group">
<iron-label class="control-label col-xs-4 col-sm-2" for="exact-species-search">
Exact Search
</iron-label>
<div class="col-xs-5 col-sm-8">
<paper-toggle-button id="exact-species-search">Enabled</paper-toggle-button>
<span class="glyphicon glyphicon-info-sign" title="The bounds will be computed based on the area of the map that's visible" data-toggle="tooltip"></span>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="bounds-container">Bounds</label>
<div class="col-xs-8 col-sm-10 table-responsive">
<table class="table table-bordered margin-table" id="bounds-container">
<tr>
<th>Point</th>
<th>Latitude <span class="text-muted">(decimal degrees)</span></th>
<th>Longitude <span class="text-muted">(decimal degrees)</span></th>
</tr>
<tr>
<td>NW</td>
<td>
<input type="number" id="north-coordinate" placeholder="37.872483" class="form-control coord-input lat-input submit-project-search" value="90"/>
</td>
<td>
<input type="number" id="west-coordinate" placeholder="-122.258922" class="form-control coord-input lng-input submit-project-search" value="-180"/>
</td>
</tr>
<tr>
<td>SE</td>
<td>
<input type="number" id="south-coordinate" placeholder="-37.7963646" class="form-control coord-input lat-input submit-project-search" value="-90"/>
</td>
<td>
<input type="number" id="east-coordinate" placeholder="144.9589851" class="form-control coord-input lng-input submit-project-search" value="180"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</iron-collapse>
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-md-6 col-lg-4 text-center center-block">
<button class="btn btn-success do-search" data-deep="true" id="do-global-deep-search" data-toggle="tooltip" title="Show only specific samples that match the search criteria"><iron-icon icon="icons:search"></iron-icon> <span class='hidden-xs'>Search In</span> Samples</button>
<button class="btn btn-primary do-search" data-deep="false" id="do-global-search" data-toggle="tooltip" title="Show all samples and species from each project containing at least one matching sample"><iron-icon icon="icons:search"></iron-icon> <span class='hidden-xs'>Search In</span> Projects</button>
<button class="btn btn-warning btn-sm" id="reset-global-map" data-toggle="tooltip" title="Right-Click to reset the search parameters, too"><iron-icon icon="icons:refresh"></iron-icon> Reset Map View</button>
</div>
</div>
</div>
</section>
</section>
<section id="landing-blurb" class="row">
<div class="subcontainer col-xs-12">
<br/><br/>
<div class="row">
<div class="card-container col-xs-12 col-md-6 col-lg-3">
<paper-card heading="How to Use" class="card-tile" elevation="2" animated-shadow>
<div class="card-content">
<p>
Learn the user workflow for the site
</p>
</div>
<div class="card-actions">
<paper-button class="click" data-href="https://amphibian-disease-tracker.readthedocs.org" data-newtab="true">
<iron-icon icon="icons:chrome-reader-mode"></iron-icon>
Documentation
</paper-button>
</div>
</paper-card>
</div>
<div class="card-container col-xs-12 col-md-6 col-lg-3">
<paper-card heading="Blog" class="card-tile" elevation="2" animated-shadow>
<div class="card-content">
<p>
Keep up to date with the project
</p>
</div>
<div class="card-actions">
<paper-button class="click" data-href="http://updates.amphibiandisease.org/" data-newtab="true">
<iron-icon icon="icons:update"></iron-icon>
Updates & Blog
</paper-button>
</div>
</paper-card>
</div>
<div class="card-container col-xs-12 col-md-6 col-lg-3">
<paper-card heading="Browse Project Data" class="card-tile" elevation="2" animated-shadow>
<div class="card-content">
<p>
See all projects and access datasets
</p>
</div>
<div class="card-actions">
<paper-button class="click" data-href="https://amphibiandisease.org/project.php">
<iron-icon icon="icons:language"></iron-icon>
<span class='hidden-md-lg'>View the </span> Project Browser
</paper-button>
</div>
</paper-card>
</div>
<div class="card-container col-xs-12 col-md-6 col-lg-3">
<paper-card heading="AmphibiaWeb" class="card-tile" elevation="2" animated-shadow>
<div class="card-content">
<p>
Visit AmphibiaWeb!
</p>
</div>
<div class="card-actions">
<paper-button class="click" data-href="http://amphibiaweb.org" data-newtab="true">
amphibiaweb.org
</paper-button>
</div>
</paper-card>
</div>
</div>
</div>
<br/><br/>
</section>
</main>
<?php
require_once("./footer.php");
?>
</body>
</html>