stats.php: cleanup html
This commit is contained in:
+21
-29
@@ -46,24 +46,23 @@ if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt") || strpos(fi
|
|||||||
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "");
|
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "");
|
||||||
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start\n##end\n");
|
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start\n##end\n");
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
|
if (get_included_files()[0] === __FILE__) {
|
||||||
|
echo '<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>BirdNET-Pi DB</title>
|
<title>BirdNET-Pi DB</title>
|
||||||
<style>
|
</head>';
|
||||||
</style>
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="stats">
|
<div class="stats">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div style="width: auto;
|
<div style="width: auto;
|
||||||
text-align: center">
|
text-align: center">
|
||||||
<form action="" method="GET">
|
<form action="views.php" method="GET">
|
||||||
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
||||||
<input type="hidden" name="view" value="Species Stats">
|
<input type="hidden" name="view" value="Species Stats">
|
||||||
<button <?php if(!isset($_GET['sort']) || $_GET['sort'] == "alphabetical"){ echo "style='background:#9fe29b !important;'"; }?> class="sortbutton" type="submit" name="sort" value="alphabetical">
|
<button <?php if(!isset($_GET['sort']) || $_GET['sort'] == "alphabetical"){ echo "style='background:#9fe29b !important;'"; }?> class="sortbutton" type="submit" name="sort" value="alphabetical">
|
||||||
@@ -74,7 +73,11 @@ if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt") || strpos(fi
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<table style="padding-top:10px">
|
<br>
|
||||||
|
<form action="views.php" method="GET">
|
||||||
|
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
||||||
|
<input type="hidden" name="view" value="Species Stats">
|
||||||
|
<table>
|
||||||
<?php
|
<?php
|
||||||
$birds = array();
|
$birds = array();
|
||||||
while($results=$result2->fetchArray(SQLITE3_ASSOC))
|
while($results=$result2->fetchArray(SQLITE3_ASSOC))
|
||||||
@@ -101,11 +104,7 @@ if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt") || strpos(fi
|
|||||||
if ($index < count($birds)) {
|
if ($index < count($birds)) {
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<form action="" method="GET">
|
|
||||||
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
|
||||||
<input type="hidden" name="view" value="Species Stats">
|
|
||||||
<button type="submit" name="species" value="<?php echo $birds[$index];?>"><?php echo $birds[$index];?></button>
|
<button type="submit" name="species" value="<?php echo $birds[$index];?>"><?php echo $birds[$index];?></button>
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
@@ -117,16 +116,7 @@ if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt") || strpos(fi
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
<style>
|
</form>
|
||||||
td {
|
|
||||||
padding: 0px;
|
|
||||||
width: calc(100% / <?php echo $num_cols;?>);
|
|
||||||
}
|
|
||||||
tr:first-child td {
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<dialog style="margin-top: 5px;max-height: 95vh;
|
<dialog style="margin-top: 5px;max-height: 95vh;
|
||||||
overflow-y: auto;overscroll-behavior:contain" id="attribution-dialog">
|
overflow-y: auto;overscroll-behavior:contain" id="attribution-dialog">
|
||||||
@@ -225,7 +215,9 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
|
|||||||
<?php } else {?>
|
<?php } else {?>
|
||||||
<hr><br>
|
<hr><br>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<form action="views.php" method="GET">
|
||||||
|
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
||||||
|
<input type="hidden" name="view" value="Species Stats">
|
||||||
<table>
|
<table>
|
||||||
<?php
|
<?php
|
||||||
$excludelines = [];
|
$excludelines = [];
|
||||||
@@ -239,9 +231,7 @@ array_push($excludelines, $results['Date']."/".$comname."/".$results['File_Name'
|
|||||||
array_push($excludelines, $results['Date']."/".$comname."/".$results['File_Name'].".png");
|
array_push($excludelines, $results['Date']."/".$comname."/".$results['File_Name'].".png");
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<form action="" method="GET">
|
<td class="relative"><a target="_blank" href="index.php?filename=<?php echo $results['File_Name']; ?>"><img title="Open in new tab" class="copyimage" width=25 src="images/copy.png"></a>
|
||||||
<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>">
|
|
||||||
<td class="relative"><a target="_blank" href="index.php?filename=<?php echo $results['File_Name']; ?>"><img title="Open in new tab" class="copyimage" width=25 src="images/copy.png"></a><input type="hidden" name="view" value="Species Stats">
|
|
||||||
<button type="submit" name="species" value="<?php echo $results['Com_Name'];?>"><?php echo $results['Com_Name'];?></button><br><b>Occurrences:</b> <?php echo $results['COUNT(*)'];?><br>
|
<button type="submit" name="species" value="<?php echo $results['Com_Name'];?>"><?php echo $results['Com_Name'];?></button><br><b>Occurrences:</b> <?php echo $results['COUNT(*)'];?><br>
|
||||||
<b>Max Confidence:</b> <?php echo $percent = round((float)round($results['MAX(Confidence)'],2) * 100 ) . '%';?><br>
|
<b>Max Confidence:</b> <?php echo $percent = round((float)round($results['MAX(Confidence)'],2) * 100 ) . '%';?><br>
|
||||||
<b>Best Recording:</b> <?php echo $results['Date']." ".$results['Time'];?><br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source src="<?php echo $filename;?>" type="audio/mp3"></video></td>
|
<b>Best Recording:</b> <?php echo $results['Date']." ".$results['Time'];?><br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source src="<?php echo $filename;?>" type="audio/mp3"></video></td>
|
||||||
@@ -253,8 +243,10 @@ $file = file_get_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt");
|
|||||||
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start"."\n".implode("\n",$excludelines)."\n".substr($file, strpos($file, "##end")));
|
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start"."\n".implode("\n",$excludelines)."\n".substr($file, strpos($file, "##end")));
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
<?php
|
||||||
</html>
|
if (get_included_files()[0] === __FILE__) {
|
||||||
|
echo '</body></html>';
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user