Add occurences Count to best recordings

This commit is contained in:
Alexandre
2024-11-07 14:49:23 +01:00
committed by Nachtzuster
parent e15229dbed
commit b451af0260
+5 -3
View File
@@ -92,7 +92,7 @@ if (get_included_files()[0] === __FILE__) {
<table> <table>
<?php <?php
$birds = array(); $birds = array();
$confidence = array(); $values = array();
while($results=$result2->fetchArray(SQLITE3_ASSOC)) while($results=$result2->fetchArray(SQLITE3_ASSOC))
{ {
@@ -101,7 +101,9 @@ if (get_included_files()[0] === __FILE__) {
$filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name']; $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];
$birds[] = $results['Com_Name']; $birds[] = $results['Com_Name'];
if ($_GET['sort'] == "confidence") { if ($_GET['sort'] == "confidence") {
$confidence[] = ' (' . round($results['MAX(Confidence)'] * 100) . '%)'; $values[] = ' (' . round($results['MAX(Confidence)'] * 100) . '%)';
} elseif ($_GET['sort'] == "occurrences") {
$values[] = ' (' . $results['COUNT(*)'] . ')';
} }
} }
@@ -121,7 +123,7 @@ if (get_included_files()[0] === __FILE__) {
if ($index < count($birds)) { if ($index < count($birds)) {
?> ?>
<td> <td>
<button type="submit" name="species" value="<?php echo $birds[$index];?>"><?php echo $birds[$index].$confidence[$index];?></button> <button type="submit" name="species" value="<?php echo $birds[$index];?>"><?php echo $birds[$index].$values[$index];?></button>
</td> </td>
<?php <?php
} else { } else {