db_query($sql); while ($record = mysql_fetch_array($result)) { $user_type = $record[admin_type]; $admin_id = $record[admin_id]; $admin_code = $record[pre_code]; $name = $record[admin_name]; } return array($user_type,$admin_id,$admin_code,$name); } public function fetch_article($status) { if($status !='') { $cont = ' WHERE post_status ="'.$status.'" '; } $sql = 'SELECT * FROM '._TB_PREFIX_.'articles '.$cont.' ORDER by Id desc '; $result = $this->db_query($sql); $i = 0; while ($rec = mysql_fetch_array($result)) { $data[$i] = $rec; $i++; } return $data; } public function fetch_article_th() { $sql = 'SELECT * FROM '._TB_PREFIX_.'articles WHERE post_status ="1" and topic_th !="" ORDER by content_date '; $result = $this->db_query($sql); $i = 0; while ($rec = mysql_fetch_array($result)) { $data[$i] = $rec; $i++; } return $data; } public function view_article($id) { $sql = ' SELECT * FROM '._TB_PREFIX_.'articles where Id = "'.$id.'"'; $result = $this->db_query($sql); $i = 0; while ($rec = mysql_fetch_array($result)) { $data = $rec; } return $data; } public function fetch_article_front($page_first,$page_num) { $sql = 'SELECT * FROM '._TB_PREFIX_.'articles WHERE post_status ="1" ORDER by Id desc LIMIT '.$page_first.','.$page_num; $result = $this->db_query($sql); $i = 0; while ($rec = mysql_fetch_array($result)) { $data[$i] = $rec; $i++; } return $data; } public function fetch_article_front_th($page_first,$page_num) { $sql = 'SELECT * FROM '._TB_PREFIX_.'articles WHERE post_status ="1" AND topic_th !="" ORDER by content_date desc LIMIT '.$page_first.','.$page_num; $result = $this->db_query($sql); $i = 0; while ($rec = mysql_fetch_array($result)) { $data[$i] = $rec; $i++; } return $data; } } ?> '; } } return $buffer; } function number_format_zero($i) { if ($i < 10) { return '0'.$i; } else { return $i; } } ?>