Added recordings map
This commit is contained in:
parent
0384e3ee48
commit
8a246e7dc1
@ -16,8 +16,10 @@ try {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die("Error : ".$e->getMessage());
|
die("Error : ".$e->getMessage());
|
||||||
}
|
}
|
||||||
|
$req = $db->prepare('SELECT * FROM `records`');
|
||||||
|
$req->execute();
|
||||||
|
$result = $req->fetchAll();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -25,10 +27,15 @@ try {
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Explore | Chiro - Canto</title>
|
<title>Explore | Chiro - Canto</title>
|
||||||
<link rel="stylesheet" type="text/css" href="/styles/style.css">
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
|
||||||
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
|
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
|
||||||
crossorigin=""/>
|
crossorigin=""/>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
|
<!-- Make sure you put this AFTER Leaflet's CSS -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="/styles/style.css">
|
||||||
|
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
|
||||||
|
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
|
||||||
|
crossorigin=""></script>
|
||||||
</head>
|
</head>
|
||||||
<?php
|
<?php
|
||||||
include("$root/analytics/matomo.php");
|
include("$root/analytics/matomo.php");
|
||||||
@ -42,12 +49,11 @@ include("$root/analytics/matomo.php");
|
|||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
</section>
|
</section>
|
||||||
<?php include("$root/footer.php");?>
|
<?php include("$root/footer.php");?>
|
||||||
|
<script>
|
||||||
|
let obs = <?= json_encode($result);?>
|
||||||
|
</script>
|
||||||
<script src="/scripts/script.js"></script>
|
<script src="/scripts/script.js"></script>
|
||||||
<script src='/scripts/jquery/script.js'></script>
|
<script src='/scripts/jquery/script.js'></script>
|
||||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
|
|
||||||
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
|
|
||||||
crossorigin=""></script>
|
|
||||||
<script src="scripts/map.js"></script>
|
<script src="scripts/map.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,9 +1,13 @@
|
|||||||
var mymap = L.map('map').setView([51.505, -0.09], 13);
|
var map = L.map('map').setView([0, 0], 13).setZoom(1);
|
||||||
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
|
||||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
maxZoom: 18,
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||||
id: 'mapbox/streets-v11',
|
}).addTo(map);
|
||||||
tileSize: 512,
|
|
||||||
zoomOffset: -1,
|
for (let record of obs) {
|
||||||
accessToken: 'pk.eyJ1IjoidW5jbGVzYW11bHVzIiwiYSI6ImNrbXVmanF1bzEwd2Mybm82Nzlobm42bHAifQ.fKY7fUnY-MpzZUcseao0zg'
|
L.circleMarker([record['lat'], record['lng']], {
|
||||||
}).addTo(mymap);
|
radius: 2
|
||||||
|
}).addTo(map).on("click", function (e) {
|
||||||
|
e.target.bindPopup(`<em>${record['species']}</em> recorded on ${record['date']} <a href="/storage/records/${record['file_name']}"><i style="font-size:24px" class="fa"></i></a>`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -52,7 +52,7 @@ include("$root/analytics/matomo.php");
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?=$data['species']." ".$data['subspecies']?></td>
|
<td><em><?=$data['species']." ".$data['subspecies']?></em></td>
|
||||||
<td><a href="../spectrograms/?record=<?=$data['id']?>"><?=$data['file_name']?></a></td>
|
<td><a href="../spectrograms/?record=<?=$data['id']?>"><?=$data['file_name']?></a></td>
|
||||||
<td><?=$data['recordist_name']?></td>
|
<td><?=$data['recordist_name']?></td>
|
||||||
<td><?=$data['license']?></td>
|
<td><?=$data['license']?></td>
|
||||||
|
68
public/explore/users/index.php
Normal file
68
public/explore/users/index.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
session_reset();
|
||||||
|
session_start();
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||||
|
require "$root/database/credentials.php";
|
||||||
|
// Connect the database
|
||||||
|
try {
|
||||||
|
$db = new PDO("mysql:host=$host;dbname=$database;charset=utf8",
|
||||||
|
$user,
|
||||||
|
$password,
|
||||||
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||||
|
));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
die("Error : ".$e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$req = $db->prepare('SELECT * FROM `authors`');
|
||||||
|
$req->execute();
|
||||||
|
$result = $req->fetchAll();
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Explore | Chiro - Canto</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/styles/style.css">
|
||||||
|
</head>
|
||||||
|
<?php
|
||||||
|
include("$root/analytics/matomo.php");
|
||||||
|
?>
|
||||||
|
<body>
|
||||||
|
<?php include("$root/menu.php");?>
|
||||||
|
<?php include("$root/header.php");?>
|
||||||
|
<section>
|
||||||
|
<h3>Explore</h3>
|
||||||
|
<h4>Random Record</h4>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Private message link</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach($result as $row) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th><?=$row['firstname']?> <?=$row['lastname']?></th>
|
||||||
|
<th><?=$row['username']?></th>
|
||||||
|
<th><a href="/discussion/messages/?author=<?=$row['id']?>"><img src="/media/icons/bubble.png" alt="message bubble"></a></th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<?php include("$root/footer.php");?>
|
||||||
|
</body>
|
||||||
|
<script src="/scripts/script.js"></script>
|
||||||
|
</html>
|
@ -1,11 +1,11 @@
|
|||||||
<header>
|
<header>
|
||||||
<div class="container row">
|
<div class="container row">
|
||||||
<a href="/">
|
<div class="container column">
|
||||||
<div class="container column">
|
<a href="/">
|
||||||
<h1>Chiro - Canto</h1>
|
<h1>Chiro - Canto</h1>
|
||||||
<h2>Bat sound sharing tools</h2>
|
<h2>Bat sound sharing tools</h2>
|
||||||
</div>
|
</a>
|
||||||
</a>
|
</div>
|
||||||
<?php include("$root/search/searchbar.php");?>
|
<?php include("$root/search/searchbar.php");?>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
@ -37,9 +37,11 @@ if ($data = $req->fetch()) {
|
|||||||
<?=$taxa_counter?> Taxa Available<br>
|
<?=$taxa_counter?> Taxa Available<br>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$bytes = disk_free_space ("$root/storage/records");
|
$bytes = disk_free_space("$root/storage/records");
|
||||||
|
$total = disk_total_space("$root/storage/records");
|
||||||
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
|
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
|
||||||
$base = 1024;
|
$base = 1024;
|
||||||
$class = min((int)log($bytes , $base) , count($si_prefix) - 1);
|
$class = min((int)log($bytes , $base) , count($si_prefix) - 1);
|
||||||
echo sprintf('%1.2f', $bytes / pow($base,$class)).' '.$si_prefix[$class];?> of Free space <br>
|
echo sprintf('%1.2f', $bytes / pow($base,$class)).' '.$si_prefix[$class];?> of Free space <br>
|
||||||
|
<progress id="space" max="<?=$total?>" value="<?=$total-$bytes?>"> <?=$bytes?> </progress>
|
||||||
</div>
|
</div>
|
BIN
public/media/icons/bubble.png
Normal file
BIN
public/media/icons/bubble.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -32,6 +32,9 @@
|
|||||||
</a><a href="/explore/guano">
|
</a><a href="/explore/guano">
|
||||||
<li>guano</li>
|
<li>guano</li>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="/explore/users">
|
||||||
|
<li>users</li>
|
||||||
|
</a>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div></li>
|
</div></li>
|
||||||
|
@ -614,4 +614,14 @@ article#guano {
|
|||||||
|
|
||||||
.spectro {
|
.spectro {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#map {
|
||||||
|
height: 50vh;
|
||||||
|
width: 50vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
i, .fa {
|
||||||
|
height: 0.1em;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user