Ejemplo n.º 1
0
		GROUP BY c.id_category
		ORDER BY c.`position`
		LIMIT ' . (int) $limit);
    if ($results) {
        foreach ($results as $result) {
            echo trim($result['name']) . '|' . (int) $result['id_category'] . "\n";
        }
    }
}
if (Tools::isSubmit('getParentCategoriesId') && ($id_category = Tools::getValue('id_category'))) {
    $category = new Category((int) $id_category);
    $results = Db::getInstance()->executeS('SELECT `id_category` FROM `' . _DB_PREFIX_ . 'category` c WHERE c.`nleft` < ' . (int) $category->nleft . ' AND c.`nright` > ' . (int) $category->nright . '');
    $output = array();
    foreach ($results as $result) {
        $output[] = $result;
    }
    die(json_encode($output));
}
if (Tools::isSubmit('getZones')) {
    $html = '<select id="zone_to_affect" name="zone_to_affect">';
    foreach (Zone::getZones() as $z) {
        $html .= '<option value="' . $z['id_zone'] . '">' . $z['name'] . '</option>';
    }
    $html .= '</select>';
    $array = array('hasError' => false, 'errors' => '', 'data' => $html);
    die(json_encode($array));
}
if (Tools::isSubmit('getEmailHTML') && ($email = Tools::getValue('email'))) {
    $email_html = AdminTranslationsController::getEmailHTML($email);
    die($email_html);
}