From aaeda89f14ef4bbfd778d309cce5222ee1397789 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Fri, 15 Apr 2022 12:01:46 -0400 Subject: [PATCH] spectrogram, species stats, and log now have navigation bar changed all POSTs to GET --- homepage/index.php | 11 +---- homepage/views.php | 85 +++++++++++++++++------------------ scripts/advanced.php | 60 ++++++++++++------------- scripts/config.php | 20 ++++----- scripts/exclude_list.php | 4 +- scripts/history.php | 6 +-- scripts/include_list.php | 4 +- scripts/overview.php | 8 ++-- scripts/play.php | 20 ++++----- scripts/service_controls.php | 26 +++++------ scripts/spectrogram.php | 13 +++--- scripts/stats.php | 14 +++--- scripts/system_controls.php | 8 ++-- scripts/todays_detections.php | 14 +++--- 14 files changed, 143 insertions(+), 150 deletions(-) diff --git a/homepage/index.php b/homepage/index.php index f2eacb7..a24da86 100644 --- a/homepage/index.php +++ b/homepage/index.php @@ -46,7 +46,7 @@ if(isset($_GET['stream'])){ } } } else { - echo " + echo "
@@ -54,13 +54,6 @@ if(isset($_GET['stream'])){

BirdNET-Pi

"; } -if(isset($_GET['log'])) { - if (file_exists('./scripts/thisrun.txt')) { - header("Location: /log");} -} elseif(isset($_GET['spectrogram'])){ - header("Location: /spectrogram.php"); -} else { - echo " + echo "

Basic Settings

-
+
-
+
diff --git a/scripts/exclude_list.php b/scripts/exclude_list.php index 5e5770e..dbbbaa0 100644 --- a/scripts/exclude_list.php +++ b/scripts/exclude_list.php @@ -4,7 +4,7 @@
-
+

All Species Labels

fetchArray(SQLITE3_ASSOC);
- + diff --git a/scripts/include_list.php b/scripts/include_list.php index 34928e0..6c90849 100644 --- a/scripts/include_list.php +++ b/scripts/include_list.php @@ -17,7 +17,7 @@ $eachlines = file($filename, FILE_IGNORE_NEW_LINES);

Warning!
If this list contains ANY species, the system will ONLY recognize those species. Keep this list EMPTY unless you are ONLY interested in detecting specific species.

-
+

All Species Labels

diff --git a/scripts/overview.php b/scripts/overview.php index 00991ee..c622faa 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -81,7 +81,7 @@ body::-webkit-scrollbar { Today - +
@@ -91,13 +91,13 @@ body::-webkit-scrollbar { Species Detected Today -
+
Total Number of Species -
+
@@ -117,7 +117,7 @@ if (file_exists('./Charts/'.$chart)) {

Most Recent Detection:

-
+ diff --git a/scripts/play.php b/scripts/play.php index e9d385b..b893ac1 100644 --- a/scripts/play.php +++ b/scripts/play.php @@ -10,7 +10,7 @@ if($db == False){ } #By Date -if(isset($_POST['bydate'])){ +if(isset($_GET['bydate'])){ $statement = $db->prepare('SELECT DISTINCT(Date) FROM detections GROUP BY Date'); if($statement == False){ echo "Database is busy"; @@ -20,8 +20,8 @@ if(isset($_POST['bydate'])){ $view = "bydate"; #Specific Date -} elseif(isset($_POST['date'])) { - $date = $_POST['date']; +} elseif(isset($_GET['date'])) { + $date = $_GET['date']; session_start(); $_SESSION['date'] = $date; $statement = $db->prepare("SELECT DISTINCT(Com_Name) FROM detections WHERE Date == \"$date\" ORDER BY Com_Name"); @@ -33,7 +33,7 @@ if(isset($_POST['bydate'])){ $view = "date"; #By Species -} elseif(isset($_POST['byspecies'])) { +} elseif(isset($_GET['byspecies'])) { $statement = $db->prepare('SELECT DISTINCT(Com_Name) FROM detections ORDER BY Com_Name'); session_start(); if($statement == False){ @@ -44,8 +44,8 @@ if(isset($_POST['bydate'])){ $view = "byspecies"; #Specific Species -} elseif(isset($_POST['species'])) { - $species = $_POST['species']; +} elseif(isset($_GET['species'])) { + $species = $_GET['species']; session_start(); $_SESSION['species'] = $species; $statement = $db->prepare("SELECT * FROM detections WHERE Com_Name == \"$species\" ORDER BY Com_Name"); @@ -75,12 +75,12 @@ if(isset($_POST['bydate'])){
- + prepare("SELECT * FROM detections where Com_Name == \"$name\" AND Date == \"$date\" ORDER BY Time DESC"); diff --git a/scripts/service_controls.php b/scripts/service_controls.php index db4684d..8abde5e 100644 --- a/scripts/service_controls.php +++ b/scripts/service_controls.php @@ -3,87 +3,87 @@

- +

Live Audio Stream

-
+

Web Terminal

-
+

BirdNET Log

-
+

Extraction Service

-
+

BirdNET Analysis Server

-
+

BirdNET Analysis Client

-
+

Streamlit Statistics

-
+

Recording Service

-
+

Chart Viewer

-
+

Spectrogram Viewer

-
+

Pushed Notifications

-
+ -
+
diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php index 2ed5f72..fece0d0 100644 --- a/scripts/spectrogram.php +++ b/scripts/spectrogram.php @@ -1,11 +1,12 @@ "; -header("Refresh: $refresh;"); +echo ""; +$_GET['view'] = "Spectrogram"; ?> diff --git a/scripts/stats.php b/scripts/stats.php index e2ff7fb..7f3b3f7 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -24,8 +24,8 @@ $result2 = $statement2->execute(); -if(isset($_POST['species'])){ - $selection = $_POST['species']; +if(isset($_GET['species'])){ + $selection = $_GET['species']; $statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date, Time from detections WHERE Com_Name = \"$selection\""); if($statement3 == False) { echo "Database busy"; @@ -57,7 +57,7 @@ $comname = preg_replace('/\'/', '', $comname); $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name']; ?> - + @@ -69,12 +69,12 @@ $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];
-

Choose a species to load images from Wikimedia Commons.

-fetchArray(SQLITE3_ASSOC)){ $count = $results['COUNT(*)']; @@ -123,7 +123,7 @@ $comname = preg_replace('/\'/', '', $comname); $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name']; ?> - +
Occurrences:
Max Confidence:
diff --git a/scripts/system_controls.php b/scripts/system_controls.php index cf48963..35e5072 100644 --- a/scripts/system_controls.php +++ b/scripts/system_controls.php @@ -3,16 +3,16 @@

- + -
+
-
+
-
+
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php index d1cce8f..dd748d2 100644 --- a/scripts/todays_detections.php +++ b/scripts/todays_detections.php @@ -3,9 +3,9 @@ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); -if(isset($_POST['display_limit'])) { - if(is_numeric($_POST['display_limit'])) { - $display_limit = $_POST['display_limit'] + 40; +if(isset($_GET['display_limit'])) { + if(is_numeric($_GET['display_limit'])) { + $display_limit = $_GET['display_limit'] + 40; } } else { $display_limit = 40; @@ -95,14 +95,14 @@ $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC); -
+
-
+
-
+
@@ -137,7 +137,7 @@ $sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']); // don't show the button if there's no more detections to be displayed, we're at the end of the list if($iterations == $display_limit) { ?>
-
+