<?php
require "inc.php";
$tab_sys_area =DB_PRE."sys_area";
(isset($get_pid))? $get_pid=intval($get_pid):$get_pid=0;
$str_where=" where area_pid='".$get_pid."'";
$str_sql="SELECT * FROM ".$tab_sys_area .$str_where." order by area_sort,area_id desc";
$obj_result = $obj_db->query($str_sql);
$arr_items=array();
$str_sp=0;
while($obj_rs = $obj_db->fetch_array($obj_result))
{
	if($str_sp==0){
		$str_x=$obj_rs["area_pids"];
		$arr_x=explode(",",$str_x);
		$str_sp=count($arr_x);
	}
	$arr_items[] = $obj_rs;
}
if(count($arr_items)<1) exit;
$str_path=me_area_path($get_pid);
function me_area_path($msg_pid)
{
	global $obj_db,$tab_sys_area;
	$str_sql="select area_id,area_name,area_pid from ".$tab_sys_area." where area_id='".$msg_pid."'";
	$obj_result = $obj_db->query($str_sql);
	$str_val="";
	if($obj_rs = $obj_db->fetch_array($obj_result))
	{
		$str_val=$obj_rs['area_name'];
		$str_valx=me_area_path($obj_rs['area_pid']);
		if($str_valx!="") $str_val=$str_valx." ".$str_val;
	}
	return $str_val;

}
?>
<hr color="#ff6600">
<div style="float:left">
<li><b><a href="javascript:me_get_next_area(-1,-1,'<?php echo $str_path;?>');">ȫѡ</a></b></li>
<?php
foreach($arr_items as $item){ 
		echo "<li><a href=\"javascript:me_get_next_area(".$item["area_id"].",".$str_sp.",'".$str_path." ".$item["area_name"]."');\">".$item["area_name"]."</a></li>";
}?>
</div>
<div class="me_area_list_next a_4" id="id_area_next_<?php echo $str_sp;?>">
</div>
