Esempio n. 1
0
    public function ajaxProcessProductManufacturers()
    {
        if (!Module::isInstalled('agilemultipleseller') || !$this->is_seller) {
            parent::ajaxProcessProductManufacturers();
            return;
        }
        $sql = 'SELECT id_manufacturer,name 
				FROM ' . _DB_PREFIX_ . 'manufacturer m
					LEFT JOIN ' . _DB_PREFIX_ . 'object_owner oo ON (m.id_manufacturer = oo.id_object AND oo.entity=\'manufacturer\') 
				WHERE IFNULL(oo.id_owner,0) IN (0,' . (int) $this->context->cookie->id_employee . ')
				';
        $manufacturers = Db::getInstance()->ExecuteS($sql);
        $jsonArray = array();
        if ($manufacturers) {
            foreach ($manufacturers as $manufacturer) {
                $jsonArray[] = '{"optionValue": "' . (int) $manufacturer['id_manufacturer'] . '", "optionDisplay": "' . htmlspecialchars(trim($manufacturer['name'])) . '"}';
            }
        }
        die('[' . implode(',', $jsonArray) . ']');
    }