diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php index eb18512..46c576f 100644 --- a/scripts/todays_detections.php +++ b/scripts/todays_detections.php @@ -3,13 +3,21 @@ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); +if(isset($_POST['display_limit'])) { + if(is_numeric($_POST['display_limit'])) { + $display_limit = $_POST['display_limit'] + 40; + } +} else { + $display_limit = 40; +} + $db = new SQLite3('./scripts/birds.db', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE); if($db == False){ echo "Database is busy"; header("refresh: 0;"); } -$statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC'); +$statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC LIMIT '.$display_limit.''); if($statement0 == False){ echo "Database is busy"; header("refresh: 0;"); @@ -63,8 +71,6 @@ if($statement6 == False){ } $result6 = $statement6->execute(); $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC); - - ?> @@ -101,23 +107,40 @@ $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC); +

Today's Detections

fetchArray(SQLITE3_ASSOC)) { + $iterations++; + $comname = preg_replace('/ /', '_', $todaytable['Com_Name']); $comname = preg_replace('/\'/', '_', $comname); $filename = "/By_Date/".date('Y-m-d')."/".$comname."/".$todaytable['File_Name']; $sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']); ?> - + + +



Confidence:
- ">
+ +
+ +
+
+ + +
+
+