From 9987d332f2f45b267701634ca7e98f34e04686da Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Mon, 23 May 2022 18:45:32 -0400 Subject: [PATCH] Fix searching in legacy mode --- scripts/todays_detections.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php index 35216a7..a5866cd 100644 --- a/scripts/todays_detections.php +++ b/scripts/todays_detections.php @@ -70,7 +70,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' 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\') '.$searchquery.' ORDER BY Time DESC '.$searchquery); + $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC'); } if($statement0 == False){ echo "Database is busy"; @@ -259,7 +259,11 @@ function switchViews(element) { function searchDetections(searchvalue) { document.getElementById("detections_table").innerHTML = "

Loading...

"; searchterm = searchvalue; - loadDetections(40,undefined); + if(document.getElementsByClassName('legacyview')[0].innerHTML == "Normal view") { + loadDetections(undefined,undefined); + } else { + loadDetections(40,undefined); + } } function loadDetections(detections_limit, element=undefined) { const xhttp = new XMLHttpRequest();