diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php index 94002bf..2f25575 100644 --- a/scripts/todays_detections.php +++ b/scripts/todays_detections.php @@ -57,8 +57,13 @@ if($statement6 == False){ $result6 = $statement6->execute(); $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC); -if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isset($_GET['display_limit']) && is_numeric($_GET['display_limit']) ) { - $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC LIMIT '.(intval($_GET['display_limit'])-40).',40'); +if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { + if(isset($_GET['display_limit']) && is_numeric($_GET['display_limit'])){ + $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC LIMIT '.(intval($_GET['display_limit'])-40).',40'); + } else { + // legacy mode + $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') ORDER BY Time DESC '); + } if($statement0 == False){ echo "Database is busy"; header("refresh: 0;"); @@ -77,20 +82,30 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse $filename = "/By_Date/".date('Y-m-d')."/".$comname."/".$todaytable['File_Name']; $sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']); ?> - -
-
-
- Confidence:
- - + + +
+
+
+ Confidence:
+ + + + +
+
+
+ Confidence:
+