public function __construct() { global $lC_Database, $lC_Language, $fInfo, $products_array; $this->_page_title = $lC_Language->get('heading_title'); $action = isset($_GET['action']) && empty($_GET['action']) === false ? preg_replace('/[^a-z\\s]/', '', $_GET['action']) : NULL; switch ($action) { case 'save': if (is_numeric($_GET[$this->_module])) { $fInfo = new lC_ObjectInfo(lC_Featured_products_Admin::get($_GET[$this->_module])); } break; } $Qproducts = $lC_Database->query('select SQL_CALC_FOUND_ROWS products_id, products_name from :table_products_description where language_id = :language_id order by products_name'); $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qproducts->bindInt(':language_id', $lC_Language->getID()); $Qproducts->execute(); $products_array = array(); $products_array[] = array('id' => '', 'text' => $lC_Language->get('text_select_product')); while ($Qproducts->next()) { $Qfeatured = $lC_Database->query('select products_id from :table_featured_products where products_id = :products_id limit 1'); $Qfeatured->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS); $Qfeatured->bindInt(':products_id', $Qproducts->value('products_id')); $Qfeatured->execute(); if ($Qfeatured->numberOfRows() < 1) { $products_array[] = array('id' => $Qproducts->value('products_id'), 'text' => $Qproducts->value('products_name')); } } }