Example #1
0
    public static function getOne($id)
    {
        $data = array();
        $sql = '
			SELECT * FROM {{translator}}
			WHERE id=' . $id . '
		';
        $item = DB::getRow($sql);
        $sql = '
			SELECT * FROM {{translator}}
			WHERE parent=' . $item['id'] . '
		';
        $rows = DB::getALL($sql);
        foreach (Translator::getLanguage() as $ii => $lang) {
            if ($ii == 0) {
                $data[$item['lang']] = $item;
            } else {
                foreach ($rows as $row) {
                    if ($row['lang'] == $lang['value']) {
                        $data[$row['lang']] = $row;
                    }
                }
            }
        }
        return $data;
    }
 public static function getConsList($id, $visible = false)
 {
     $vis = $visible ? ' AND visible = 1' : '';
     $sql = 'SELECT * FROM {{dealers_consignee}} WHERE dealer = ' . $id . $vis;
     return DB::getALL($sql);
 }