<?php
$obj_tab_account=new cls_tab_sys_account;
$int_pagesize=10;
(isset($get_step))? $get_step=intval($get_step) : $get_step=1;
(isset($get_page))? $get_page=intval($get_page) : $get_page=1;

$this_account_gold=$obj_ctl_user->get_gold();
$this_account_score=$obj_ctl_user->get_score();
switch($get_step){
	case 1:
		$arr_score_type=$obj_tab_account->score_type;
		$arr_score=array();
		$str_where=" where score_user_id=".$obj_ctl_user->id;
		$arr_admin=array();
		$obj_rs   = $obj_db->get_one("SELECT count(1) as num FROM ".DB_PRE."sys_account_score".$str_where);
		$int_total=$obj_rs["num"];
		$int_pages= ceil($int_total/$int_pagesize);
		$get_page = min($int_pages, $get_page);
		$get_page = max($get_page, 1);
		$page_split_page=get_pages_html($int_total, $get_page, $int_pagesize,format_url_query(array('page'=>'')));
		$int_offset = $int_pagesize*($get_page-1);
		$str_limit = " limit ".$int_offset.",".$int_pagesize;
		$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."sys_account_score".$str_where." order by score_id desc".$str_limit);
		while($obj_rs = $obj_db->fetch_array($obj_result)){
			$obj_rs["addtime"]=date("Y-m-d H:i:s",$obj_rs["score_addtime"]);
			$obj_rs["type"]=array_search($obj_rs["score_type"],$arr_score_type);
			$arr_score[]=$obj_rs;
		}
		break;
	case 2:
		$arr_score_type=$obj_tab_account->gold_type;
		$arr_gold=array();
		$str_where=" where gold_user_id=".$obj_ctl_user->id;
		$arr_admin=array();
		$obj_rs   = $obj_db->get_one("SELECT count(1) as num FROM ".DB_PRE."sys_account_gold".$str_where);
		$int_total=$obj_rs["num"];
		$int_pages= ceil($int_total/$int_pagesize);
		$get_page = min($int_pages, $get_page);
		$get_page = max($get_page, 1);
		$page_split_page=get_pages_html($int_total, $get_page, $int_pagesize,format_url_query(array('page'=>'')));
		$int_offset = $int_pagesize*($get_page-1);
		$str_limit = " limit ".$int_offset.",".$int_pagesize;
		$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."sys_account_gold".$str_where." order by gold_id desc".$str_limit);
		while($obj_rs = $obj_db->fetch_array($obj_result)){
			$obj_rs["addtime"]=date("Y-m-d H:i:s",$obj_rs["gold_addtime"]);
			$obj_rs["type"]=array_search($obj_rs["gold_type"],$arr_score_type);
			$arr_gold[]=$obj_rs;
		}
		break;
}
?>