diff --git a/public/home/last-uploaded-file.php b/public/home/last-uploaded-file.php
index 0431c97..39449df 100755
--- a/public/home/last-uploaded-file.php
+++ b/public/home/last-uploaded-file.php
@@ -13,7 +13,7 @@ try {
die("Error : ".$e->getMessage());
}
-$req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` ORDER BY `entry_timestamp` DESC LIMIT 1');
+$req = $db->prepare('SELECT * FROM `records` ORDER BY `entry_timestamp` DESC LIMIT 1');
$req->execute();
if ($data = $req->fetch())
{
@@ -22,17 +22,12 @@ if ($data = $req->fetch())
=$data['file_name']?>
=$data['species']?>
=_('Recorded on')?> =$data['date']?> at =$data['time']?>
-
- " alt="bat sound spectrogram">
-
=$data['license']?> =$data['recordist_name']?>
+
getMessage());
}
-
-$req = $db->prepare('SELECT taxon_species FROM `taxa`');
+$q = $_REQUEST['q'];
+$req = $db->prepare("SELECT taxon_species FROM `taxa`
+WHERE (id LIKE '%$q%'
+OR lower(taxon_phylum) LIKE '%$q%'
+OR lower(taxon_kingdom) LIKE '%$q%'
+OR lower(taxon_class) LIKE '%$q%'
+OR lower(taxon_order) LIKE '%$q%'
+OR lower(taxon_family) LIKE '%$q%'
+OR lower(taxon_subfamily) LIKE '%$q%'
+OR lower(taxon_tribu) LIKE '%$q%'
+OR lower(taxon_genus) LIKE '%$q%'
+OR lower(taxon_species) LIKE '%$q%')");
$req->execute();
$result = $req->fetchAll();
-
+// print_r($result);
$species = array();
foreach ($result as $row) {
$species[] = $row['taxon_species'];
}
-
-$q = $_REQUEST['q'];
-
-$hint = array();
// print_r($species);
-if ($q !== "") {
- $q = strtolower($q);
- $len = strlen($q);
- foreach($species as $sp) {
- if (stristr($q, substr($sp, 0, $len))) {
- $hint[] = $sp;
- }
- }
-}
-
// Output "no suggestion" if no hint was found or output correct values
?>
-