assign(array( 'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__, 'token' => $token, 'id_customer' => $id_customer, 'sponsor' => (Validate::isLoadedObject($sponsor)) ? $sponsor : false, )); echo $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/invite/ajax_sponsor.tpl') ? '../../themes/'._THEME_NAME_.'/modules/invite/ajax_sponsor.tpl' : 'ajax_sponsor.tpl', __FILE__); exit; } // Search customer by email elseif (Tools::getvalue('action') == 'search') { $q = Tools::getValue('term'); $sql = 'SELECT `id_customer` AS id, CONCAT_WS(" ", `lastname`, `firstname`, CONCAT("(", `email`, ")")) AS value FROM `'._DB_PREFIX_.'customer` WHERE `email` LIKE "'.pSQL($q).'%"'; $result = Db::getInstance()->executeS($sql); echo Tools::jsonEncode($result); exit; }