tweaks for this

This commit is contained in:
mcguirepr89
2022-02-25 10:21:42 -05:00
parent a9d386c621
commit 840b071ffa
+23 -31
View File
@@ -25,13 +25,16 @@ foreach($pages as $page){
echo $response; echo $response;
} }
if(isset($_POST['view'])){ 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'] == "Overview"){include('overview.php');}
if($_POST['view'] == "Database"){include('viewdb.php');} if($_POST['view'] == "Database"){include('viewdb.php');}
if($_POST['view'] == "Species Stats"){ if($_POST['view'] == "Species Stats"){
include('stats.php'); include('stats.php');
if(isset($_POST['species'])){ if(isset($_POST['species'])){
$data = [ 'species' => $_POST['species'] ]; $data = [ 'species' => $_POST['species'] ];
httpPost('/stats.php', $data);} httpPost('/stats.php', $data);
}
} }
if($_POST['view'] == "History"){ if($_POST['view'] == "History"){
include('history.php'); include('history.php');
@@ -42,40 +45,30 @@ if(isset($_POST['view'])){
echo "<form action=\"\" method=\"POST\"> echo "<form action=\"\" method=\"POST\">
<button type=\"submit\" name=\"view\" value=\"Settings\">Settings</button> <button type=\"submit\" name=\"view\" value=\"Settings\">Settings</button>
<button type=\"submit\" name=\"view\" value=\"System\">System Info</button> <button type=\"submit\" name=\"view\" value=\"System\">System Info</button>
</form>"; </form>";
} }
if($_POST['view'] == "Live Stream"){ if($_POST['view'] == "Live Stream"){
echo "<div class=\"stream\"><audio controls autoplay><source src=\"/stream\" type=\"audio/mpeg\"></audio></div>";} echo "<audio controls autoplay><source src=\"/stream\" type=\"audio/mpeg\"></audio>";}
if($_POST['view'] == "Extractions"){ if($_POST['view'] == "Extractions"){
include('play.php'); include('play.php');
$data = []; $data = [];
httpPost('/play.php', $data);} httpPost('/play.php', $data);}
while($_POST['view'] == "Spectrogram"){ if($_POST['view'] == "Settings"){
ob_start(); if(isset($_POST['submit'])){
$time = time(); $data = [
echo str_pad("<img src=\"/spectrogram.png?nocache=$time\">", '4096'); 'latitude' => $_POST["latitude"],
ob_flush(); 'longitude' => $_POST["longitude"],
flush(); 'birdweather_id' => $_POST["birdweather_id"],
sleep($config['RECORDING_LENGTH']); 'pushed_app_key' => $_POST["pushed_app_key"],
ob_clean(); 'pushed_app_secret' => $_POST["pushed_app_secret"],
ob_end_clean(); 'language' => $_POST["language"],
ob_end_flush();} 'submit' => $_POST["submit"],
if($_POST['view'] == "Settings"){ ];
if(isset($_POST['submit'])){ $url = $_SERVER['HTTP_REFERER'];
$data = [ httpPost("$url/scripts/update_config.php", $data);
'latitude' => $_POST["latitude"], }
'longitude' => $_POST["longitude"], include('scripts/config.php');
'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($_POST['view'] == "Advanced"){
if(isset($_POST['submit'])){ if(isset($_POST['submit'])){
$data = [ $data = [
@@ -100,7 +93,6 @@ if(isset($_POST['view'])){
} }
include('scripts/advanced.php'); include('scripts/advanced.php');
} }
if($_POST['view'] == "System"){header('location:phpsysinfo/index.php');}
if($_POST['view'] == "Log"){ if($_POST['view'] == "Log"){
$url = 'http://birdnetpi.local:8080'; $url = 'http://birdnetpi.local:8080';
header("location: $url;");} header("location: $url;");}