public function render_product_grid() { $this->load->library('grid'); $this->grid->_init_grid('products_grid'); $this->grid->db->select("DISTINCT A.`" . self::ID_PR . "` AS ID, PR.`sku`, B.`name`,\n (SELECT COUNT(" . self::ID_PR . ") FROM `" . self::PR_WAIT . "`) as count")->from("`" . self::PR_WAIT . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` AND B.`" . self::ID_LANGS . "` = " . $this->id_langs, "LEFT")->join("`" . self::PR . "` AS PR", "PR.`" . self::ID_PR . "` = A.`" . self::ID_PR . "`", "LEFT")->where("PR.`" . self::ID_USERS . "`", $this->id_users); $this->load->helper('catalogue/products_waitlist_helper'); helper_products_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->render_grid(); }
public function render_pr_grid() { $this->load->library('grid'); $this->grid->_init_grid('products_grid'); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`create_date`, A.`update_date`")->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_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); $this->grid->render_grid(); }
public function render_product_grid() { $this->load->library('grid'); $this->grid->_init_grid('products_grid_excel', array('url' => setUrl('*/*/get_ajax_products_grid'))); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`create_date`, A.`update_date`")->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); //->where("A.`".self::ID_PR."` IN (SELECT DISTINCT `".self::ID_PR."` FROM `".self::PR_COMM."` WHERE `".self::ID_USERS."` = '".$this->id_users."' && `new_comment` = 1)", NULL, FALSE); $this->load->helper('catalogue/products_excel_export_helper'); helper_products_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); return $this->grid->render_grid(TRUE); }
public function render_product_grid() { $this->load->model("sys/madmins"); $cat_perm = $this->madmins->get_cat_perm(); $this->load->library('grid'); $this->grid->_init_grid('products_grid'); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`create_date`, A.`update_date`")->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_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); $this->grid->render_grid(); }
public function render_product_grid() { $this->load->library('grid'); $this->grid->_init_grid('products_grid'); if ($extra_search = $this->grid->get_options('search')) { if (isset($extra_search['new_comment'])) { $temp_extra_search = $extra_search; unset($temp_extra_search['new_comment']); $this->grid->set_options('search', $temp_extra_search); $update_select_types = $extra_search['new_comment']; } } $this->load->model("sys/madmins"); $cat_perm = $this->madmins->get_cat_perm(); $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`, A.`create_date`, A.`update_date`,\n (SELECT COUNT(*) FROM `" . self::PR_COMM . "` AS K WHERE K.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` AND K.`new_comment` = 1) AS new_comment")->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); } //->where("A.`".self::ID_PR."` IN (SELECT DISTINCT `".self::ID_PR."` FROM `".self::PR_COMM."` WHERE `".self::ID_USERS."` = '".$this->id_users."' && `new_comment` = 1)", NULL, FALSE); if (isset($update_select_types)) { $update_select_types = intval($update_select_types); if ($update_select_types > 0) { $this->grid->db->where("A.`" . self::ID_PR . "` IN (SELECT DISTINCT `" . self::ID_PR . "` FROM `" . self::PR_COMM . "` WHERE `" . self::ID_USERS . "` = '" . $this->id_users . "' && `new_comment` = 1)", NULL, FALSE); } } $this->load->helper('catalogue/products_comments_helper'); helper_products_grid_build($this->grid); $this->grid->create_grid_data(); $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да')); $this->grid->update_grid_data('new_comment', array('0' => 'Нет новых')); if (isset($update_select_types)) { $extra_search = $this->grid->get_options('search'); $extra_search['new_comment'] = $update_select_types; $this->grid->set_search_manualy('new_comment', $update_select_types); $this->grid->set_options('search', $extra_search); } $this->grid->render_grid(); }