diff --git a/scripts/advanced.php b/scripts/advanced.php index 8252746..892fead 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -155,93 +155,6 @@ if(isset($_POST['submit'])) {

Advanced Settings

- +

Defaults

- -
diff --git a/scripts/config.php b/scripts/config.php index 421b5c9..8bc9a39 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -6,111 +6,10 @@ ini_set('display_errors',1); ?>

Basic Settings

- +
diff --git a/scripts/history.php b/scripts/history.php index c8e0237..71f9b44 100644 --- a/scripts/history.php +++ b/scripts/history.php @@ -21,42 +21,16 @@ $totalcount = $result1->fetchArray(SQLITE3_ASSOC); ?> - - + - +
-
+
@@ -67,14 +41,14 @@ hr { "; + echo ""; } else { - echo "

No Charts for $theDate

"; + echo "

No Charts for $theDate

"; } echo "
"; if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart2)) { - echo ""; + echo ""; } else { - echo "

No Charts For $theDate

"; + echo "

No Charts For $theDate

"; }?> diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 0727717..211a6a1 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -17,7 +17,7 @@ install_depends() { apt -qqq update && apt -qqy upgrade echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections 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 \ zlib1g-dev python3-dev python3-pip python3-venv wget -c ${gotty_url} -O - | tar -xz -C /usr/local/bin/ diff --git a/scripts/overview.php b/scripts/overview.php index edbc53f..d95a8a8 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -20,7 +20,7 @@ if($statement == False) { $result = $statement->execute(); $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) { echo "Database is busy"; header("refresh: 0;"); @@ -44,9 +44,10 @@ if($statement4 == False) { $result4 = $statement4->execute(); $mostrecent = $result4->fetchArray(SQLITE3_ASSOC); $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) { echo "Database is busy"; header("refresh: 0;"); @@ -62,48 +63,13 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC); Overview - - - - - +
-
Total Detections For The Day
+
@@ -120,31 +86,31 @@ button {
-
Total Today
+
- - - - - + + + + + - - - + + +
Scientific NameCommon NameListenConfidenceScientific NameCommon NameListenConfidence
Most Recent Detection
" target="footer"/>

"; + echo ""; } else { - echo "

No Detections For Today

"; + echo "

No Detections For Today

"; } ?>

Currently Analyzing

- + diff --git a/scripts/play.php b/scripts/play.php index 0cddd5b..4f50b30 100644 --- a/scripts/play.php +++ b/scripts/play.php @@ -53,13 +53,12 @@ if(isset($_POST['bydate'])){ -
- +
fetchArray(SQLITE3_ASSOC)) diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php index 9f2ca18..248b9f9 100644 --- a/scripts/spectrogram.php +++ b/scripts/spectrogram.php @@ -7,5 +7,5 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) { $refreshtime = $config['RECORDING_LENGTH']; header("refresh:$refreshtime"); ?> - - + + diff --git a/scripts/stats.php b/scripts/stats.php index 3b102ee..c534daf 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -8,25 +8,16 @@ if($db == False) { echo "Database busy"; 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) { echo "Database busy"; header("refresh: 0;"); } $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'])){ $selection = $_POST['species']; - $statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date from detections - WHERE Com_Name = \"$selection\""); + $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"; header("refresh: 0;"); @@ -35,142 +26,46 @@ if(isset($_POST['species'])){ } ?> -BirdNET-Pi DB - - +
Choose a species below to show statistics.

"; + echo "

Choose a species below to show statistics.

"; };?>
+ fetchArray(SQLITE3_ASSOC)) { $comname = preg_replace('/ /', '_', $results['Com_Name']); -$comlink = "/By_Date/".date('Y-m-d')."/".$comname; -$sciname = preg_replace('/ /', '_', $results['Sci_Name']); +$comname = preg_replace('/\'/', '', $comname); +$filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name']; ?> - - + + + + fetchArray(SQLITE3_ASSOC)){ $count = $results['COUNT(*)']; $maxconf = $results['MAX(Confidence)']; $date = $results['Date']; + $time = $results['Time']; $name = $results['Com_Name']; $sciname = $results['Sci_Name']; - $dbname = preg_replace('/ /', '_', $results['Com_Name']); - $dbname = preg_replace('/\'/', '', $dbname); - $dbsciname = preg_replace('/ /', '_', $results['Sci_Name']); - $filename = "/By_Date/".$date."/".$dbname."/".$results['File_Name']; + $comname = preg_replace('/ /', '_', $results['Com_Name']); + $comname = preg_replace('/\'/', '', $comname); + $filename = "/By_Date/".$date."/".$comname."/".$results['File_Name']; $imagelink = shell_exec("/home/pi/BirdNET-Pi/scripts/get_image.sh $dbsciname"); $imagecitation = shell_exec("/home/pi/BirdNET-Pi/scripts/get_citation.sh $dbsciname"); $str= " - - + +
Common Name Occurrences Max Confidence ScoreBest Recording
+ +
$sciname $count $maxconfListenAll About Birds$date $time All About Birds
"; echo str_pad($str, 4096); diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 3bd7238..567acc9 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -11,7 +11,7 @@ if($db == False){ 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){ echo "Database is busy"; header("refresh: 0;"); @@ -26,7 +26,7 @@ if($statement1 == False){ $result1 = $statement1->execute(); $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){ echo "Database is busy"; header("refresh: 0;"); @@ -67,21 +67,13 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC); BirdNET-Pi DB - - +

Number of Detections

-
-
@@ -96,8 +88,6 @@ a {
Total
-
-

Today's Detections