diff --git a/homepage/index.php b/homepage/index.php index 8bcb502..32c0047 100644 --- a/homepage/index.php +++ b/homepage/index.php @@ -29,6 +29,26 @@ if(isset($_POST['view'])){ if($_POST['view'] == "Spectrogram"){include('spectrogram.php');} if($_POST['view'] == "Overview"){include('overview.php');} if($_POST['view'] == "Database"){include('viewdb.php');} + if($_POST['view'] == "Species Stats"){include('stats.php');} + if($_POST['view'] == "History"){include('history.php');} + if($_POST['view'] == "Tools"){ + echo "
"; + } + if($_POST['view'] == "Live Stream"){ + echo ""; + } + if($_POST['view'] == "Extractions"){include('play.php');} + if($_POST['view'] == "Settings"){include('scripts/config.php');} + if($_POST['view'] == "Advanced"){include('scripts/advanced.php');} + if($_POST['view'] == "Log"){ + $url = 'http://birdnetpi.local:8080'; + header("location: $url;"); + } if($_POST['view'] == "Included"){ if(isset($_POST['species']) && isset($_POST['add'])){ $file='/home/pi/BirdNET-Pi/include_species_list.txt'; @@ -37,22 +57,22 @@ if(isset($_POST['view'])){ file_put_contents("$file", "$str"); if(isset($_POST['species'])){ foreach ($_POST['species'] as $selectedOption) - file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", $selectedOption."\n", FILE_APPEND); + file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", $selectedOption."\n", FILE_APPEND); } } elseif(isset($_POST['species']) && isset($_POST['del'])){ - $file = '/home/pi/BirdNET-Pi/include_species_list.txt'; - $str = file_get_contents("$file"); - $str = preg_replace('/^\h*\v+/m', '', $str); - file_put_contents("$file", "$str"); - foreach($_POST['species'] as $selectedOption) { + $file = '/home/pi/BirdNET-Pi/include_species_list.txt'; + $str = file_get_contents("$file"); + $str = preg_replace('/^\h*\v+/m', '', $str); + file_put_contents("$file", "$str"); + foreach($_POST['species'] as $selectedOption) { $content = file_get_contents("/home/pi/BirdNET-Pi/include_species_list.txt"); $newcontent = str_replace($selectedOption, "", "$content"); file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", "$newcontent"); - } - $file = '/home/pi/BirdNET-Pi/include_species_list.txt'; - $str = file_get_contents("$file"); - $str = preg_replace('/^\h*\v+/m', '', $str); - file_put_contents("$file", "$str"); + } + $file = '/home/pi/BirdNET-Pi/include_species_list.txt'; + $str = file_get_contents("$file"); + $str = preg_replace('/^\h*\v+/m', '', $str); + file_put_contents("$file", "$str"); } include('scripts/include_list.php'); } @@ -81,74 +101,5 @@ if(isset($_POST['view'])){ } include('scripts/exclude_list.php'); } - if($_POST['view'] == "Species Stats"){ - include('stats.php'); - if(isset($_POST['species'])){ - $data = [ 'species' => $_POST['species'] ]; - httpPost('/stats.php', $data); - } - } - if($_POST['view'] == "History"){ - include('history.php'); - $data = [ 'date' => $_POST['date'] ]; - httpPost('/history.php', $data); - } - if($_POST['view'] == "Tools"){ - echo ""; - } - if($_POST['view'] == "Live Stream"){ - echo "";} - if($_POST['view'] == "Extractions"){ - include('play.php'); - $data = []; - httpPost('/play.php', $data);} - if($_POST['view'] == "Settings"){ - if(isset($_POST['submit'])){ - $data = [ - 'latitude' => $_POST["latitude"], - 'longitude' => $_POST["longitude"], - 'birdweather_id' => $_POST["birdweather_id"], - 'pushed_app_key' => $_POST["pushed_app_key"], - 'pushed_app_secret' => $_POST["pushed_app_secret"], - 'language' => $_POST["language"], - 'submit' => $_POST["submit"], - ]; - $url = $_SERVER['HTTP_REFERER']; - httpPost("$url/scripts/update_config.php", $data); - } - include('scripts/config.php'); - } - if($_POST['view'] == "Advanced"){ - if(isset($_POST['submit'])){ - $data = [ - 'caddy_pwd' => $_POST["caddy_pwd"], - 'ice_pwd' => $_POST["ice_pwd"], - 'webterminal_url' => $_POST["webterminal_url"], - 'birdnetlog_url' => $_POST["birdnetlog_url"], - 'birdnetpi_url' => $_POST["birdnetpi_url"], - 'overlap' => $_POST["overlap"], - 'confidence' => $_POST["confidence"], - 'sensitivity' => $_POST["sensitivity"], - 'full_disk' => $_POST["full_disk"], - 'rec_card' => $_POST["rec_card"], - 'channels' => $_POST["channels"], - 'recording_length' => $_POST["recording_length"], - 'extraction_length' => $_POST["extraction_length"], - 'audiofmt' => $_POST["audiofmt"], - 'status' => "Success" - ]; - $url = $_SERVER['HTTP_REFERER']; - httpPost("$url/scripts/update_config.php", $data); - } - include('scripts/advanced.php'); - } - if($_POST['view'] == "Log"){ - $url = 'http://birdnetpi.local:8080'; - header("location: $url;");} } ?> diff --git a/scripts/advanced.php b/scripts/advanced.php index 96c9d7f..736d655 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -146,10 +146,6 @@ if(isset($_POST['submit'])) { $fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); fwrite($fh, $contents); fwrite($fh2, $contents2); - @session_start(); - if(true){ - $_SESSION['success'] = 1; - } } ?> diff --git a/scripts/backup_inprogress.html b/scripts/backup_inprogress.html deleted file mode 100644 index f671163..0000000 --- a/scripts/backup_inprogress.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - A backup is being made that includes all ofWarning!
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.
You have been warned!