From 840b071ffa6b6bfba0ebdff239d8cb8b12f3955d Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Fri, 25 Feb 2022 10:21:42 -0500 Subject: [PATCH] tweaks for this --- homepage/index.php | 54 ++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/homepage/index.php b/homepage/index.php index 31eb1c6..9793749 100644 --- a/homepage/index.php +++ b/homepage/index.php @@ -25,13 +25,16 @@ foreach($pages as $page){ echo $response; } if(isset($_POST['view'])){ + if($_POST['view'] == "System"){header('location:phpsysinfo/index.php');} + 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(isset($_POST['species'])){ - $data = [ 'species' => $_POST['species'] ]; - httpPost('/stats.php', $data);} + $data = [ 'species' => $_POST['species'] ]; + httpPost('/stats.php', $data); + } } if($_POST['view'] == "History"){ include('history.php'); @@ -42,40 +45,30 @@ if(isset($_POST['view'])){ echo "
-
"; + "; } if($_POST['view'] == "Live Stream"){ - echo "
";} + echo "";} if($_POST['view'] == "Extractions"){ include('play.php'); $data = []; httpPost('/play.php', $data);} - while($_POST['view'] == "Spectrogram"){ - ob_start(); - $time = time(); - echo str_pad("", '4096'); - ob_flush(); - flush(); - sleep($config['RECORDING_LENGTH']); - ob_clean(); - ob_end_clean(); - ob_end_flush();} - 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'] == "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 = [ @@ -100,7 +93,6 @@ if(isset($_POST['view'])){ } include('scripts/advanced.php'); } - if($_POST['view'] == "System"){header('location:phpsysinfo/index.php');} if($_POST['view'] == "Log"){ $url = 'http://birdnetpi.local:8080'; header("location: $url;");}