<{include file="index/header.html"}>
<div class="nav"><span>地区管理</span></div>
<div class="main"> 
	<div class="menu"> 
		<label>
			<span>省份：</span>
			<label><select name="province" id="province">
				<option value="0">--请选择--</option> 
			<{foreach item=p from=$provinceData}>
					<option value="<{$p.id}>" <{if $smarty.get.prov == $p.id}>selected="selected"<{/if}>><{$p.name}></option>
			<{/foreach}> 
			</select></label>
		</label>
		<label>
			<span>市区：</span>
			<label><select name="city" id="city">
				<option value="0">--请选择--</option>
			<{if $data}> 
				<{foreach item=c from=$cityData}>
					<option value="<{$c.id}>" <{if $smarty.get.pid == $c.id}>selected="selected"<{/if}>><{$c.name}></option>
				<{/foreach}> 
			<{/if}>
			</select> </label>
		</label>
	</div>
	<table width="100%" class="ltable">
	  	<thead>
		  	<tr> 
				<th width="300">地区名</td> 
				<th width="100">首字母</th> 
				<th width="100">首字母</th> 
				<th width="150">操作</th>
				<th></th> 
		  	</tr>
	  	</thead>
		<tbody>
	<{if $data}>
		<{foreach item=i from=$data}>
		<tr> 
			<td><{$i.name}></td> 
			<td><{if $i.letter == ''}><{else}><{$i.letter}><{/if}></td> 
			<td><{if $i.status == '1'}>正常<{else}>关闭<{$i.status}><{/if}></td> 
			<td>
				<a href="javascript:;" onClick="update_menu('地区设置','?m=area&a=edit&id=<{$i.id}>');" class="edit">修改</a> 
				<a href="?m=district&a=del&id=<{$i.id}>" class="del">删除</a>
			</td> 
			<td></td>
		</tr>
		<{/foreach}>
	<{else}>
	  	<tr>
			<td colspan="5">暂时无地区</td>
	  	</tr>
	<{/if}>
		</tbody>  
	</table> 
</div>
<{include file="index/footer.html"}>
<script type="text/javascript">
function add_menu(name,url){  
	parent.dialog(name,url); 
}
function update_menu(name,url){
	parent.dialog(name,url,400); 
}
function syn_weixin(url){
	parent.ajax_alert(url);
}
$(function(){
	$("#chk_cs").change(function(){
		var as = $(this).val(); 
		location.href="?m=area&a=index&cid="+as; 
	});
});
function delete_submit(){
	if(confirm("确定要删除吗?"))
	return true;
	else
	return false;
} 
$(function(){
	$("#province").change(function(){ 
		var pid=$(this).children('option:selected').val();
		location.href="?m=area&a=index&prov="+pid+"&pid="+pid;
	});
	$("#city").change(function(){ 
		var city=$(this).children('option:selected').val();
		location.href="?m=area&a=index&prov=<{$smarty.get.prov}>&city="+city+"&pid="+city;
	});
});
</script> 