1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 17:44:37 +02:00

typeahead support for $frm->text();

This commit is contained in:
Cameron
2013-01-31 19:11:41 -08:00
parent a33c5c70ae
commit 3002cee260
2 changed files with 40 additions and 2 deletions

View File

@@ -21,6 +21,28 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
global $user;
$user['user_id'] = USERID;
if(e_AJAX_REQUEST)
{
if(vartrue($_GET['q']))
{
$q = filter_var($_GET['q'], FILTER_SANITIZE_STRING);
if($sql->select("user", "user_name", "user_name LIKE '". $q."%' ORDER BY user_name LIMIT 15"))
{
while($row = $sql->db_Fetch())
{
$data[] = $row['user_name'];
}
if(count($data))
{
echo json_encode($data);
}
}
}
exit;
}
// require_once(e_CORE."shortcodes/batch/user_shortcodes.php");
require_once(e_HANDLER."form_handler.php");