mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-27 14:23:00 +00:00
new Component Dropdown Nations
implemented in StudVW Tabs Details, Contact/Adress, Prestudent and Mobility
This commit is contained in:
@@ -11,4 +11,39 @@ class Nation_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_nation';
|
||||
$this->pk = 'nation_code';
|
||||
}
|
||||
|
||||
public function searchNations($filter=null)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
if ($filter)
|
||||
{
|
||||
if (preg_match('/%[0-9A-Fa-f]{2}/', $filter)) {
|
||||
$filter = urldecode($filter);
|
||||
}
|
||||
$filter = mb_strtolower($filter, 'UTF-8'); //for umlaute
|
||||
}
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
n.nation_code, n.langtext as label, n.kurztext, n.sperre
|
||||
FROM
|
||||
bis.tbl_nation n";
|
||||
|
||||
if ($filter)
|
||||
{
|
||||
$escapedFilter = $this->db->escape('%' . $filter . '%');
|
||||
|
||||
$qry .= "
|
||||
WHERE
|
||||
n.kurztext ILIKE $escapedFilter
|
||||
OR n.engltext ILIKE $escapedFilter
|
||||
OR n.nation_code ILIKE $escapedFilter
|
||||
";
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY n.kontinent IS NULL DESC, n.kurztext ASC";
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user