会员等级处理函数

/**
 * 会员等级处理函数
 * by hkshadow
 * 2011-03-14
 * Enter description here ...
 */
function scoress($int){
	global $dsql;
	$sql = "SELECT * FROM `##_scores`";
	$dsql->query('me',$sql);
	while ($row = $dsql->GetArray()) {
		$rows [] = $row;
	}
	if ($int > 0 && $int < $rows['1']['integral']) {
		$pic = array ('0'=>'star.gif');
	}else if ($int > 1000 && $int < $rows['2']['integral']) {
		$pic = array ('0'=>'star.gif','1'=>'star.gif');
	}else if ($int > 2000 && $int < $rows['3']['integral']) {
		$pic = array ('0'=>'star.gif','1'=>'star.gif','2'=>'star.gif');
	}else if ($int > 3000 && $int < $rows['4']['integral']) {
		$pic = array ('0'=>'moon.gif');
	}else if ($int > 4000 && $int < $rows['5']['integral']) {
		$pic = array ('0'=>'moon.gif','1'=>'star.gif');
	}else if ($int > 5000 && $int < $rows['6']['integral']) {
		$pic = array ('0'=>'moon.gif','1'=>'star.gif','2'=>'star.gif');
	}else if ($int > 6000 && $int < 7000) {
		$pic = array ('0'=>'moon.gif','1'=>'star.gif','2'=>'star.gif','3'=>'star.gif');
	}else if ($int > 7000 && $int < 8000) {
		$pic = array ('0'=>'moon.gif','1'=>'moon.gif');
	}else if ($int > 8000 && $int < 9000) {
		$pic = array ('0'=>'moon.gif','1'=>'moon.gif','2'=>'moon.gif');
	}else if ($int > 9000 && $int < 10000) {
		$pic = array ('0'=>'sun.gif');
	}else if ($int > 10000 && $int < 12000) {
		$pic = array ('0'=>'sun.gif','1'=>'sun.gif');
	}else if ($int > 12000 && $int < 15000) {
		$pic = array ('0'=>'sun.gif','1'=>'sun.gif','2'=>'sun.gif');
	}else if ($int > 15000 && $int < 17000) {
		$pic = array ('0'=>'guan.gif');
	}else if ($int > 20000 && $int < $rows['10']['integral']) {
		$pic = array ('0'=>'guan.gif','1'=>'guan.gif');
	}else if ($int > $rows['10']['integral']) {
		$pic = array ('0'=>'guan.gif','1'=>'guan.gif','2'=>'guan.gif');
	}
	return $pic;
//	echo $rows['1']['integral'];
}