Update stats.php

This commit is contained in:
Alexandre
2024-10-28 10:56:23 +01:00
committed by Nachtzuster
parent 62e98ade0b
commit 0cb609a69f
+1 -4
View File
@@ -43,6 +43,7 @@ if(isset($_GET['sort']) && $_GET['sort'] == "occurrences") {
$result2 = $statement2->execute(); $result2 = $statement2->execute();
} }
if(isset($_GET['species'])){ if(isset($_GET['species'])){
$selection = htmlspecialchars_decode($_GET['species'], ENT_QUOTES); $selection = htmlspecialchars_decode($_GET['species'], ENT_QUOTES);
$statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date, Time from detections WHERE Com_Name = \"$selection\""); $statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date, Time from detections WHERE Com_Name = \"$selection\"");
@@ -109,7 +110,6 @@ if (get_included_files()[0] === __FILE__) {
} else { } else {
$num_cols = 1; $num_cols = 1;
} }
$num_rows = ceil(count($birds) / $num_cols); $num_rows = ceil(count($birds) / $num_cols);
for ($row = 0; $row < $num_rows; $row++) { for ($row = 0; $row < $num_rows; $row++) {
@@ -135,14 +135,12 @@ if (get_included_files()[0] === __FILE__) {
</table> </table>
</form> </form>
</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">
<h1 id="modalHeading"></h1> <h1 id="modalHeading"></h1>
<p id="modalText"></p> <p id="modalText"></p>
<button onclick="hideDialog()">Close</button> <button onclick="hideDialog()">Close</button>
</dialog> </dialog>
<script src="static/dialog-polyfill.js"></script> <script src="static/dialog-polyfill.js"></script>
<script> <script>
var dialog = document.querySelector('dialog'); var dialog = document.querySelector('dialog');
@@ -162,7 +160,6 @@ function setModalText(iter, title, text, authorlink) {
showDialog(); showDialog();
} }
</script> </script>
<div class="column center"> <div class="column center">
<?php if(!isset($_GET['species'])){ <?php if(!isset($_GET['species'])){
?><p class="centered">Choose a species to load images from Flickr.</p> ?><p class="centered">Choose a species to load images from Flickr.</p>