WHERE-Klausel für suche nach Tags hinzugefügt

This commit is contained in:
Werner Masik
2016-11-30 13:01:42 +01:00
parent caf69b4d0b
commit 60a4a64943
+9 -2
View File
@@ -55,9 +55,16 @@ class tags extends basis_db
*
* Gibt alle Tags zurück
*/
public function getAll()
public function getAll($tag_search = null)
{
$qry = "SELECT * FROM public.tbl_tag; ";
$matchcode=mb_strtoupper(str_replace(array('<','>',' ',';','*','_','-',',',"'",'"'),"%",$tag_search));
$qry = "SELECT * FROM public.tbl_tag ";
if (!empty($tag_search))
{
$qry.="WHERE UPPER(trim(public.tbl_tag.tag)) like '%".$this->db_escape($matchcode)."%' ";
}
$qry.="ORDER BY UPPER(trim(public.tbl_tag.tag)) ";
if($this->db_query($qry))
{