Beispiel #1
0
 public static function getSelect($lang, $id = 0)
 {
     $colors = Db_Product::getFieldById('p_color', $id);
     $colors = !empty($colors) ? explode(',', $colors) : array(0);
     self::getDB()->query("\n            SELECT *, c.id, ct_title AS title\n            FROM ?f AS c\n            LEFT JOIN ?f AS ct ON ct.ct_color_id = c.id\n            WHERE ct.ct_lang_id = ?d\n            ORDER BY c.c_priority ASC\n        ", TAB_COLOR, TAB_COLOR_TRANS, $lang);
     $items = array();
     if (self::getDB()->numRows() > 0) {
         while ($row = self::getDB()->fetchArray(MYSQL_ASSOC)) {
             $row['status'] = in_array($row['id'], $colors) ? 'selected' : '';
             $items[] = $row;
         }
     }
     return $items;
 }
Beispiel #2
0
 public static function getSelect($product_id = 0)
 {
     $categories = Db_Product::getFieldById('p_category_id', $product_id);
     $categories = !empty($categories) ? explode(',', $categories) : array(0);
     self::getDB()->query("\n            SELECT\n                   ct.ct_title AS title\n                 , c.id\n              FROM ?f AS c\n        INNER JOIN ?f AS ct ON ct.ct_category_id = c.id\n             WHERE c.c_published = 1\n               AND ct.ct_lang_id = ?i\n          ORDER BY c.c_priority ASC\n        ", TAB_CATEGORY, TAB_CATEGORY_TRANS, self::getLangId());
     $items = array();
     if (self::getDB()->numRows() > 0) {
         while ($row = self::getDB()->fetchArray(MYSQL_ASSOC)) {
             $row['status'] = in_array($row['id'], $categories) ? 'selected' : '';
             $items[] = $row;
         }
     }
     return $items;
 }