public function render_product_additionally_grid() { $this->load->model("sys/madmins"); $cat_perm = $this->madmins->get_cat_perm(); $this->load->library('grid'); $this->grid->_init_grid('products_additionally_grid'); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`new`, A.`bestseller`, A.`sale`, A.`action`, A.`different_colors`, A.`super_price`, A.`restricted_party`, A.`customised_product`")->from("`" . self::PR . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` && B.`" . self::ID_LANGS . "` = " . $this->id_langs, "LEFT")->where("A.`" . self::ID_USERS . "`", $this->id_users); if ($cat_perm) { $cat = implode(', ', $cat_perm); $this->grid->db->where("A.`" . self::ID_PR . "` IN (SELECT `id_m_c_products` FROM m_c_productsNcategories WHERE `id_m_c_categories` IN (" . $cat . ") GROUP BY `id_m_c_products`)", NULL, FALSE); } $this->load->helper('catalogue/products_helper'); helper_products_additionally_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('new', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('bestseller', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('sale', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('action', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('different_colors', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('super_price', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('restricted_party', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('customised_product', array('0' => 'Нет', '1' => 'Да')); $this->grid->render_grid(); }
public function render_pr_additionally_grid() { $this->load->library('grid'); $this->grid->_init_grid('products_additionally_grid'); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`new`, A.`bestseller`, A.`sale`")->from("`" . self::PR . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` && B.`" . self::ID_LANGS . "` = " . $this->id_langs, "LEFT")->where("A.`" . self::ID_USERS . "`", $this->id_users); $this->load->helper('catalogue/products_helper'); helper_products_additionally_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('new', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('bestseller', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('sale', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); $this->grid->render_grid(); }