// missing method
This commit is contained in:
@@ -244,4 +244,35 @@ class AdminStatesControllerCore extends AdminController
|
|||||||
if (!count($this->errors))
|
if (!count($this->errors))
|
||||||
parent::postProcess();
|
parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function displayAjaxStates()
|
||||||
|
{
|
||||||
|
if ($this->tabAccess['view'] === '1')
|
||||||
|
{
|
||||||
|
$states = Db::getInstance()->executeS('
|
||||||
|
SELECT s.id_state, s.name
|
||||||
|
FROM '._DB_PREFIX_.'state s
|
||||||
|
LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`)
|
||||||
|
WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1
|
||||||
|
ORDER BY s.`name` ASC');
|
||||||
|
|
||||||
|
if (is_array($states) AND !empty($states))
|
||||||
|
{
|
||||||
|
$list = '';
|
||||||
|
if (Tools::getValue('no_empty') != true)
|
||||||
|
{
|
||||||
|
$empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------';
|
||||||
|
$list = '<option value="0">'.Tools::htmlentitiesUTF8($empty_value).'</option>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($states AS $state)
|
||||||
|
$list .= '<option value="'.(int)($state['id_state']).'"'.((isset($_GET['id_state']) AND $_GET['id_state'] == $state['id_state']) ? ' selected="selected"' : '').'>'.$state['name'].'</option>'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$list = 'false';
|
||||||
|
|
||||||
|
die($list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user