<?php
$obj_tab_order=new cls_tab_pay_order();

$arr_state=$obj_tab_order->state;

$int_pagesize=10;
(!isset($get_page))? $get_page=1 : $get_page=(int)$get_page;

$str_where=" where order_user_id=".$obj_ctl_user->id;
$obj_rs  = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."pay_order".$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($int_total, $get_page, $int_pagesize);
$int_offset = $int_pagesize*($get_page-1);
$str_limit = " limit ".$int_offset.",".$int_pagesize;
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."pay_order".$str_where.$str_limit);
$arr_order=array();
while($obj_rs = $obj_db->fetch_array($obj_result))
{
	$obj_rs["addtime"]=date("Y-m-d H:i:s",$obj_rs["order_addtime"]);
	$obj_rs["state"]=array_search($obj_rs["order_state"],$arr_state);
	if($obj_rs["order_state"]<=0){
		$obj_rs["state"]="<font color='#ff0000'>".$obj_rs["state"]."</font>";
	}
	$arr_order[]=$obj_rs;
}
?>