new ui
This commit is contained in:
+7
-94
@@ -155,93 +155,6 @@ if(isset($_POST['submit'])) {
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<style>
|
<style>
|
||||||
/* Chrome, Safari, Edge, Opera */
|
|
||||||
input::-webkit-outer-spin-button,
|
|
||||||
input::-webkit-inner-spin-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Firefox */
|
|
||||||
input[type=number] {
|
|
||||||
-moz-appearance: textfield;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
|
|
||||||
' Calibri', 'Trebuchet MS', 'sans-serif';
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
/* Create two unequal columns that floats next to each other */
|
|
||||||
.column {
|
|
||||||
float: left;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.first {
|
|
||||||
width: calc(50% - 70px);
|
|
||||||
}
|
|
||||||
.second {
|
|
||||||
width: calc(50% - 70px);
|
|
||||||
}
|
|
||||||
.
|
|
||||||
/* Clear floats after the columns */
|
|
||||||
.row:after {
|
|
||||||
content: "";
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background-color: rgb(119, 196, 135);
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
font-size:large;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.block {
|
|
||||||
display: block;
|
|
||||||
width:50%;
|
|
||||||
border: none;
|
|
||||||
padding: 10px 10px;
|
|
||||||
font-size: medium;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
text-align:left;
|
|
||||||
margin-left:20px;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin-bottom:0px;
|
|
||||||
}
|
|
||||||
h3 {
|
|
||||||
margin-left: -10px;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
float:left;
|
|
||||||
width: 40%;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
input,select {
|
|
||||||
width: 60%;
|
|
||||||
text-align:center;
|
|
||||||
font-size:large;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 1000px) {
|
|
||||||
h2,h3 {
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
form {
|
|
||||||
margin:0;
|
|
||||||
}
|
|
||||||
.column {
|
|
||||||
float: none;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
input, label {
|
|
||||||
width: 100%;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<?php
|
<?php
|
||||||
@@ -252,20 +165,20 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<h2>Advanced Settings</h2>
|
<h2>Advanced Settings</h2>
|
||||||
<body style="background-color: rgb(119, 196, 135);">
|
<body>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column first">
|
<div class="column first">
|
||||||
<form action="advanced.php" method="POST">
|
<form action="advanced.php" method="POST">
|
||||||
<h3>Defaults</h3>
|
<h3>Defaults</h3>
|
||||||
<label>Full Disk Behavior: </label>
|
<label>Full Disk Behavior: </label>
|
||||||
<label style="width:30%;" for="purge">
|
<label for="purge">
|
||||||
<input style="width:15%;" name="full_disk" type="radio" id="purge" value="purge"
|
<input name="full_disk" type="radio" id="purge" value="purge"
|
||||||
<?php
|
<?php
|
||||||
if (strcmp($newconfig['FULL_DISK'], "purge") == 0) {
|
if (strcmp($newconfig['FULL_DISK'], "purge") == 0) {
|
||||||
echo "checked";
|
echo "checked";
|
||||||
}?>>Purge</label>
|
}?>>Purge</label>
|
||||||
<label style="width:30%;" for="keep">
|
<label for="keep">
|
||||||
<input style="width:15%" name="full_disk" type="radio" id="keep" value="keep"
|
<input name="full_disk" type="radio" id="keep" value="keep"
|
||||||
<?php
|
<?php
|
||||||
if (strcmp($newconfig['FULL_DISK'], "keep") == 0) {
|
if (strcmp($newconfig['FULL_DISK'], "keep") == 0) {
|
||||||
echo "checked";
|
echo "checked";
|
||||||
@@ -334,11 +247,11 @@ if(isset($_SESSION['success'])){
|
|||||||
?></button>
|
?></button>
|
||||||
<br>
|
<br>
|
||||||
</form>
|
</form>
|
||||||
<form action="config.php" style="margin:0;">
|
<form action="config.php">
|
||||||
<button type="submit" class="block">Basic Settings</button>
|
<button type="submit" class="block">Basic Settings</button>
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<form action="index.html" style="margin:0;">
|
<form action="index.html">
|
||||||
<button type="submit" class="block">Tools</button>
|
<button type="submit" class="block">Tools</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-102
@@ -6,111 +6,10 @@ ini_set('display_errors',1);
|
|||||||
?>
|
?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<style>
|
<style>
|
||||||
/* Chrome, Safari, Edge, Opera */
|
|
||||||
input::-webkit-outer-spin-button,
|
|
||||||
input::-webkit-inner-spin-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Firefox */
|
|
||||||
input[type=number] {
|
|
||||||
-moz-appearance: textfield;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
|
|
||||||
' Calibri', 'Trebuchet MS', 'sans-serif';
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
/* Create two unequal columns that floats next to each other */
|
|
||||||
.column {
|
|
||||||
float: left;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.first {
|
|
||||||
width: calc(50% - 70px);
|
|
||||||
}
|
|
||||||
.second {
|
|
||||||
width: calc(50% - 30px);
|
|
||||||
}
|
|
||||||
.
|
|
||||||
/* Clear floats after the columns */
|
|
||||||
.row:after {
|
|
||||||
content: "";
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background-color: rgb(119, 196, 135);
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.block {
|
|
||||||
display: block;
|
|
||||||
width:50%;
|
|
||||||
border: none;
|
|
||||||
padding: 10px 10px;
|
|
||||||
font-size: medium;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
font-size:large;
|
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
|
|
||||||
select option {
|
|
||||||
font-size:large;
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
text-align:left;
|
|
||||||
margin-left:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin-bottom:0px;
|
|
||||||
}
|
|
||||||
h3 {
|
|
||||||
margin-left: -10px;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
float:left;
|
|
||||||
width:40%;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width:60%;
|
|
||||||
text-align:center;
|
|
||||||
font-size:large;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
select {
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin-bottom:0px;
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
form {
|
|
||||||
text-align:left;
|
|
||||||
margin-left:0px;
|
|
||||||
}
|
|
||||||
.column {
|
|
||||||
float: none;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
input, label {
|
|
||||||
width:100%;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<h2>Basic Settings</h2>
|
<h2>Basic Settings</h2>
|
||||||
<body style="background-color: rgb(119, 196, 135);">
|
<body>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column first">
|
<div class="column first">
|
||||||
<form action="write_config.php" method="POST" name="normal">
|
<form action="write_config.php" method="POST" name="normal">
|
||||||
|
|||||||
+7
-33
@@ -21,42 +21,16 @@ $totalcount = $result1->fetchArray(SQLITE3_ASSOC);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
input {
|
|
||||||
width:auto;
|
|
||||||
}
|
|
||||||
center {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background-color: rgb(119, 196, 135);
|
|
||||||
}
|
|
||||||
button,input {
|
|
||||||
font-size: medium;
|
|
||||||
}
|
|
||||||
table,th,td {
|
|
||||||
background-color: rgb(219, 255, 235);
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
width:30%;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
border: 1px solid green;
|
|
||||||
width:80%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form style="margin-left: -150px;text-align:center;" action="" name="submit" method="POST">
|
<form action="" method="POST">
|
||||||
<input type="date" name="date" value="<?php echo $theDate;?>">
|
<input type="date" name="date" value="<?php echo $theDate;?>">
|
||||||
<button type="submit" class="block">Submit Date</button>
|
<button type="submit" name="view" value="History">Submit Date</button>
|
||||||
</form>
|
</form>
|
||||||
<div style="margin-left: -150px;">
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total Detections For The Day</th>
|
<th>Total Detections For The Day</th>
|
||||||
@@ -67,14 +41,14 @@ hr {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
||||||
echo "<img src=\"/Charts/$chart?nocache=time()\" style=\"height:auto;width: 100%;padding: 5px;margin-left: auto;margin-right: auto;display: block;\">";
|
echo "<img src=\"/Charts/$chart?nocache=time()\" >";
|
||||||
} else {
|
} else {
|
||||||
echo "<p style=\"text-align:center;margin-left:-150px;\">No Charts for $theDate</p>";
|
echo "<p>No Charts for $theDate</p>";
|
||||||
}
|
}
|
||||||
echo "<hr>";
|
echo "<hr>";
|
||||||
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart2)) {
|
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart2)) {
|
||||||
echo "<img src=\"/Charts/$chart2?nocache=time()\" style=\"height:auto;width: 100%;padding: 5px;margin-left: auto;margin-right: auto;display: block;\">";
|
echo "<img src=\"/Charts/$chart2?nocache=time()\">";
|
||||||
} else {
|
} else {
|
||||||
echo "<p style=\"text-align:center;margin-left:-150px;\">No Charts For $theDate</p>";
|
echo "<p>No Charts For $theDate</p>";
|
||||||
}?>
|
}?>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ install_depends() {
|
|||||||
apt -qqq update && apt -qqy upgrade
|
apt -qqq update && apt -qqy upgrade
|
||||||
echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections
|
echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections
|
||||||
apt install -qqy caddy lynx ftpd sqlite3 php-sqlite3 alsa-utils \
|
apt install -qqy caddy lynx ftpd sqlite3 php-sqlite3 alsa-utils \
|
||||||
pulseaudio avahi-utils sox libsox-fmt-mp3 php php-fpm php-mysql php-xml \
|
pulseaudio avahi-utils sox libsox-fmt-mp3 php php-fpm php-curl php-xml \
|
||||||
php-zip icecast2 swig ffmpeg wget unzip curl cmake make bc libjpeg-dev \
|
php-zip icecast2 swig ffmpeg wget unzip curl cmake make bc libjpeg-dev \
|
||||||
zlib1g-dev python3-dev python3-pip python3-venv
|
zlib1g-dev python3-dev python3-pip python3-venv
|
||||||
wget -c ${gotty_url} -O - | tar -xz -C /usr/local/bin/
|
wget -c ${gotty_url} -O - | tar -xz -C /usr/local/bin/
|
||||||
|
|||||||
+18
-52
@@ -20,7 +20,7 @@ if($statement == False) {
|
|||||||
$result = $statement->execute();
|
$result = $statement->execute();
|
||||||
$totalcount = $result->fetchArray(SQLITE3_ASSOC);
|
$totalcount = $result->fetchArray(SQLITE3_ASSOC);
|
||||||
|
|
||||||
$statement2 = $db->prepare('SELECT COUNT(*) FROM detections WHERE Date == DATE(\'now\')');
|
$statement2 = $db->prepare('SELECT COUNT(*) FROM detections WHERE Date == DATE(\'now\', \'localtime\')');
|
||||||
if($statement2 == False) {
|
if($statement2 == False) {
|
||||||
echo "Database is busy";
|
echo "Database is busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
@@ -44,9 +44,10 @@ if($statement4 == False) {
|
|||||||
$result4 = $statement4->execute();
|
$result4 = $statement4->execute();
|
||||||
$mostrecent = $result4->fetchArray(SQLITE3_ASSOC);
|
$mostrecent = $result4->fetchArray(SQLITE3_ASSOC);
|
||||||
$comname = preg_replace('/ /', '_', $mostrecent['Com_Name']);
|
$comname = preg_replace('/ /', '_', $mostrecent['Com_Name']);
|
||||||
$scilink = preg_replace('/ /', '_', $mostrecent['Sci_Name']);
|
$comname = preg_replace('/\'/', '', $comname);
|
||||||
|
$filename = "/By_Date/".$mostrecent['Date']."/".$comname."/".$mostrecent['File_Name'];
|
||||||
|
|
||||||
$statement5 = $db->prepare('SELECT COUNT(DISTINCT(Com_Name)) FROM detections WHERE Date == Date(\'now\')');
|
$statement5 = $db->prepare('SELECT COUNT(DISTINCT(Com_Name)) FROM detections WHERE Date == Date(\'now\',\'localtime\')');
|
||||||
if($statement5 == False) {
|
if($statement5 == False) {
|
||||||
echo "Database is busy";
|
echo "Database is busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
@@ -62,48 +63,13 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Overview</title>
|
<title>Overview</title>
|
||||||
<!-- CSS FOR STYLING THE PAGE -->
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color:black;
|
|
||||||
}
|
|
||||||
table, th {
|
|
||||||
background-color: rgb(119, 196, 135);
|
|
||||||
border:none;
|
|
||||||
}
|
|
||||||
th {
|
|
||||||
padding: 0 5px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background-color: rgb(219, 295, 235);
|
|
||||||
border:none;
|
|
||||||
font-size:large;
|
|
||||||
cursor:pointer;
|
|
||||||
}
|
|
||||||
.center {
|
|
||||||
display: block;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
width: 90%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
.center2 {
|
|
||||||
display: block;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: rgb(119, 196, 135);">
|
<body>
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
<table style="padding-bottom:3%;display:block;width:50%;margin-left:auto;margin-right:auto;">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
<th>Today</th>
|
<th>Today</th>
|
||||||
@@ -120,31 +86,31 @@ button {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<table style="padding-bottom:3%;display:block;width:90%;margin-left:auto;margin-right:auto;">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="border:none;background-color: rgb(119, 196, 135);"></th>
|
<th</th>
|
||||||
<th style="border:none;">Scientific Name</th>
|
<th>Scientific Name</th>
|
||||||
<th style="border:none;">Common Name</th>
|
<th>Common Name</th>
|
||||||
<th style="border:none;">Listen</th>
|
<th>Listen</th>
|
||||||
<th style="border:none;">Confidence</th>
|
<th>Confidence</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Most Recent Detection</th>
|
<th>Most Recent Detection</th>
|
||||||
<td><a href="https://wikipedia.org/wiki/<?php echo $scilink;?>" target="top"/><?php echo $mostrecent['Sci_Name'];?></a></td>
|
<td><a href="https://wikipedia.org/wiki/<?php echo $scilink;?>" target="top"/><?php echo $mostrecent['Sci_Name'];?></a></td>
|
||||||
<form action="/stats.php" name="species" method="POST">
|
<form action="" method="POST">
|
||||||
<td><button type="submit" name="species" value="<?php echo $mostrecent['Com_Name'];?>"><?php echo $mostrecent['Com_Name'];?></button></td></form>
|
<td><input type="hidden" name="view" value="Species Stats"><button type="submit" name="species" value="<?php echo $mostrecent['Com_Name'];?>"><?php echo $mostrecent['Com_Name'];?></button></td></form>
|
||||||
<td><a href="/By_Date/<?php echo$myDate."/".$comname."/".$mostrecent['File_Name'];?>" target="footer"/><?php echo $mostrecent['Date']." ".$mostrecent['Time'];?></a></td>
|
<td><?php echo $mostrecent['Date']." ".$mostrecent['Time'];?><br><audio controls><source src="<?php echo $filename;?>"></audio></td>
|
||||||
<td><?php echo $mostrecent['Confidence'];?></td>
|
<td><?php echo $mostrecent['Confidence'];?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
||||||
echo "<img src=\"/Charts/$chart?nocache=time()\" style=\"width: 100%;padding: 5px;margin-left: auto;margin-right: auto;display: block;\">";
|
echo "<img src=\"/Charts/$chart?nocache=time()\">";
|
||||||
} else {
|
} else {
|
||||||
echo "<p style=\"text-align:center;margin-left:-150px;\">No Detections For Today</p>";
|
echo "<p>No Detections For Today</p>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<h2>Currently Analyzing</h2>
|
<h2>Currently Analyzing</h2>
|
||||||
<img src='/spectrogram.png?nocache=<?php echo time();?>' style="width: 100%;padding: 5px;">
|
<img src='/spectrogram.png?nocache=<?php echo time();?>' >
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-2
@@ -53,13 +53,12 @@ if(isset($_POST['bydate'])){
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="play.css">
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="column left">
|
<div class="column left">
|
||||||
<table style="float:top;">
|
<table>
|
||||||
<?php
|
<?php
|
||||||
if(!isset($_POST['species'])){
|
if(!isset($_POST['species'])){
|
||||||
while($results=$result->fetchArray(SQLITE3_ASSOC))
|
while($results=$result->fetchArray(SQLITE3_ASSOC))
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
|
|||||||
$refreshtime = $config['RECORDING_LENGTH'];
|
$refreshtime = $config['RECORDING_LENGTH'];
|
||||||
header("refresh:$refreshtime");
|
header("refresh:$refreshtime");
|
||||||
?>
|
?>
|
||||||
<body style='background-color:rgb(119, 196, 135)'>
|
<body>
|
||||||
<img src='/spectrogram.png?nocache=<?php echo time();?>' style='display: block; height: 100%; width: 100%;'>
|
<img src='/spectrogram.png?nocache=<?php echo time();?>'>
|
||||||
|
|||||||
+19
-124
@@ -8,25 +8,16 @@ if($db == False) {
|
|||||||
echo "Database busy";
|
echo "Database busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
}
|
}
|
||||||
$statement = $db->prepare('SELECT Com_Name, COUNT(*), MAX(Confidence), Sci_Name FROM detections GROUP BY Com_Name ORDER BY COUNT(*) DESC');
|
$statement = $db->prepare('SELECT Date, Time, File_Name, Com_Name, COUNT(*), MAX(Confidence) FROM detections GROUP BY Com_Name ORDER BY COUNT(*) DESC');
|
||||||
if($statement == False) {
|
if($statement == False) {
|
||||||
echo "Database busy";
|
echo "Database busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
}
|
}
|
||||||
$result = $statement->execute();
|
$result = $statement->execute();
|
||||||
|
|
||||||
|
|
||||||
$statement2 = $db->prepare('SELECT Com_Name FROM detections GROUP BY Com_Name ORDER BY Com_Name ASC');
|
|
||||||
if($statement2 == False) {
|
|
||||||
echo "Database busy";
|
|
||||||
header("refresh: 0;");
|
|
||||||
}
|
|
||||||
$result2 = $statement2->execute();
|
|
||||||
|
|
||||||
if(isset($_POST['species'])){
|
if(isset($_POST['species'])){
|
||||||
$selection = $_POST['species'];
|
$selection = $_POST['species'];
|
||||||
$statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date from detections
|
$statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date, Time from detections WHERE Com_Name = \"$selection\"");
|
||||||
WHERE Com_Name = \"$selection\"");
|
|
||||||
if($statement3 == False) {
|
if($statement3 == False) {
|
||||||
echo "Database busy";
|
echo "Database busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
@@ -35,142 +26,46 @@ if(isset($_POST['species'])){
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>BirdNET-Pi DB</title>
|
<title>BirdNET-Pi DB</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
<style>
|
<style>
|
||||||
/* Chrome, Safari, Edge, Opera */
|
|
||||||
input::-webkit-outer-spin-button,
|
|
||||||
input::-webkit-inner-spin-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Firefox */
|
|
||||||
input[type=number] {
|
|
||||||
-moz-appearance: textfield;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
|
|
||||||
' Calibri', 'Trebuchet MS', 'sans-serif';
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
/* Create two unequal columns that floats next to each other */
|
|
||||||
.column {
|
|
||||||
float: left;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.first {
|
|
||||||
width: calc(50% - 70px);
|
|
||||||
}
|
|
||||||
.second {
|
|
||||||
width: calc(50% + 70px);
|
|
||||||
}
|
|
||||||
.
|
|
||||||
/* Clear floats after the columns */
|
|
||||||
.row:after {
|
|
||||||
content: "";
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background-color: rgb(119, 196, 135);
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color:black;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.block {
|
|
||||||
display: block;
|
|
||||||
width:40%;
|
|
||||||
margin-left:auto;
|
|
||||||
border: none;
|
|
||||||
padding: 5px 5px;
|
|
||||||
font-size: medium;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
background-color: rgb(219, 295, 235);
|
|
||||||
border:none;
|
|
||||||
font-size:large;
|
|
||||||
cursor:pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
width:75%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
select option {
|
|
||||||
font-size:large;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
float:left;
|
|
||||||
display:block;
|
|
||||||
margin-right:auto;
|
|
||||||
font-size:large;
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
h3 {
|
|
||||||
margin-bottom:0px;
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
form {
|
|
||||||
text-align:left;
|
|
||||||
margin-left:0px;
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
.column {
|
|
||||||
float: none;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
input, label, img {
|
|
||||||
width:100%;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: rgb(119, 196, 135);">
|
<body>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column first">
|
<div class="column first">
|
||||||
<?php if(!isset($_POST['species'])){
|
<?php if(!isset($_POST['species'])){
|
||||||
echo "<p style=\"text-align:center;font-size:large;\">Choose a species below to show statistics.</p>";
|
echo "<p>Choose a species below to show statistics.</p>";
|
||||||
};?>
|
};?>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Common Name</th>
|
<th>Common Name</th>
|
||||||
<th>Occurrences</th>
|
<th>Occurrences</th>
|
||||||
<th>Max Confidence Score</th>
|
<th>Max Confidence Score</th>
|
||||||
|
<th>Best Recording</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($results=$result->fetchArray(SQLITE3_ASSOC))
|
while($results=$result->fetchArray(SQLITE3_ASSOC))
|
||||||
{
|
{
|
||||||
$comname = preg_replace('/ /', '_', $results['Com_Name']);
|
$comname = preg_replace('/ /', '_', $results['Com_Name']);
|
||||||
$comlink = "/By_Date/".date('Y-m-d')."/".$comname;
|
$comname = preg_replace('/\'/', '', $comname);
|
||||||
$sciname = preg_replace('/ /', '_', $results['Sci_Name']);
|
$filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<form action="stats.php" method="POST">
|
<form action="" method="POST">
|
||||||
<td><button type="submit" name="species" value="<?php echo $results['Com_Name'];?>"><?php echo $results['Com_Name'];?></button></td></form>
|
<td><input type="hidden" name="view" value="Species Stats">
|
||||||
|
<button type="submit" name="species" value="<?php echo $results['Com_Name'];?>"><?php echo $results['Com_Name'];?></button>
|
||||||
|
</td>
|
||||||
|
</form>
|
||||||
<td><?php echo $results['COUNT(*)'];?></td>
|
<td><?php echo $results['COUNT(*)'];?></td>
|
||||||
<td><?php echo $results['MAX(Confidence)'];?></td>
|
<td><?php echo $results['MAX(Confidence)'];?></td>
|
||||||
|
<td><audio controls><source src="<?php echo $filename;?>"></audio></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -198,20 +93,20 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
|
|||||||
$count = $results['COUNT(*)'];
|
$count = $results['COUNT(*)'];
|
||||||
$maxconf = $results['MAX(Confidence)'];
|
$maxconf = $results['MAX(Confidence)'];
|
||||||
$date = $results['Date'];
|
$date = $results['Date'];
|
||||||
|
$time = $results['Time'];
|
||||||
$name = $results['Com_Name'];
|
$name = $results['Com_Name'];
|
||||||
$sciname = $results['Sci_Name'];
|
$sciname = $results['Sci_Name'];
|
||||||
$dbname = preg_replace('/ /', '_', $results['Com_Name']);
|
$comname = preg_replace('/ /', '_', $results['Com_Name']);
|
||||||
$dbname = preg_replace('/\'/', '', $dbname);
|
$comname = preg_replace('/\'/', '', $comname);
|
||||||
$dbsciname = preg_replace('/ /', '_', $results['Sci_Name']);
|
$filename = "/By_Date/".$date."/".$comname."/".$results['File_Name'];
|
||||||
$filename = "/By_Date/".$date."/".$dbname."/".$results['File_Name'];
|
|
||||||
$imagelink = shell_exec("/home/pi/BirdNET-Pi/scripts/get_image.sh $dbsciname");
|
$imagelink = shell_exec("/home/pi/BirdNET-Pi/scripts/get_image.sh $dbsciname");
|
||||||
$imagecitation = shell_exec("/home/pi/BirdNET-Pi/scripts/get_citation.sh $dbsciname");
|
$imagecitation = shell_exec("/home/pi/BirdNET-Pi/scripts/get_citation.sh $dbsciname");
|
||||||
$str= "<tr>
|
$str= "<tr>
|
||||||
<td><a href=\"https://wikipedia.org/wiki/$dbsciname\" target=\"top\"/>$sciname</a></td>
|
<td><a href=\"https://wikipedia.org/wiki/$dbsciname\" target=\"top\"/>$sciname</a></td>
|
||||||
<td>$count</td>
|
<td>$count</td>
|
||||||
<td>$maxconf</td>
|
<td>$maxconf</td>
|
||||||
<td><a href=\"$filename\" target=\"footer\">Listen</a></td>
|
<td>$date $time <audio controls><source src=\"$filename\"></audio></td>
|
||||||
<td><a href=\"https://allaboutbirds.org/guide/$dbname\" target=\"top\"/>All About Birds</a></td>
|
<td><a href=\"https://allaboutbirds.org/guide/$comname\" target=\"top\"/>All About Birds</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>";
|
</table>";
|
||||||
echo str_pad($str, 4096);
|
echo str_pad($str, 4096);
|
||||||
|
|||||||
+3
-13
@@ -11,7 +11,7 @@ if($db == False){
|
|||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
}
|
}
|
||||||
|
|
||||||
$statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\') ORDER BY Time DESC');
|
$statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC');
|
||||||
if($statement0 == False){
|
if($statement0 == False){
|
||||||
echo "Database is busy";
|
echo "Database is busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
@@ -26,7 +26,7 @@ if($statement1 == False){
|
|||||||
$result1 = $statement1->execute();
|
$result1 = $statement1->execute();
|
||||||
$totalcount = $result1->fetchArray(SQLITE3_ASSOC);
|
$totalcount = $result1->fetchArray(SQLITE3_ASSOC);
|
||||||
|
|
||||||
$statement2 = $db->prepare('SELECT COUNT(*) FROM detections WHERE Date == DATE(\'now\')');
|
$statement2 = $db->prepare('SELECT COUNT(*) FROM detections WHERE Date == DATE(\'now\', \'localtime\')');
|
||||||
if($statement2 == False){
|
if($statement2 == False){
|
||||||
echo "Database is busy";
|
echo "Database is busy";
|
||||||
header("refresh: 0;");
|
header("refresh: 0;");
|
||||||
@@ -67,21 +67,13 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>BirdNET-Pi DB</title>
|
<title>BirdNET-Pi DB</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
<style>
|
<style>
|
||||||
a {
|
|
||||||
text-decoration:none;
|
|
||||||
color:black;
|
|
||||||
}
|
|
||||||
.a2 { color:blue;}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: rgb(119, 196, 135);">
|
<body>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Number of Detections</h2>
|
<h2>Number of Detections</h2>
|
||||||
<div class="row">
|
|
||||||
<div class="column2">
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
@@ -96,8 +88,6 @@ a {
|
|||||||
<td><a href="/stats.php"/><?php echo $speciestally['COUNT(DISTINCT(Com_Name))'];?></a></td>
|
<td><a href="/stats.php"/><?php echo $speciestally['COUNT(DISTINCT(Com_Name))'];?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<h2>Today's Detections</h2>
|
<h2>Today's Detections</h2>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user