<{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 class="ltable">
	  	<thead>
		  	<tr> 
				<th width="100">操作</th>
				<th width="200">地区名</td> 
				<th width="100">首字母</th> 
				<th></th> 
		  	</tr>
	  	</thead>
		<tbody>
			<{if $data}>
				<{foreach item=i from=$data}>
					<tr>
						<td>
							<a href="javascript:;" data-id="<{$i.id}>" class="del">删除</a>
							<a href="javascript:;" onClick="update_menu('地区设置', '<{$__ADMIN__}>area/edit?id=<{$i.id}>');" class="edit">编辑</a>
						</td> 
						<td><{$i.name}></td> 
						<td><{if $i.letter == ''}><{else}><{$i.letter}><{/if}></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">
_delete("<{$__ADMIN__}>area/del");
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=ADMIN+"area/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=ADMIN+"area/index?prov="+pid+"&pid="+pid;
	});
	$("#city").change(function(){ 
		var city=$(this).children('option:selected').val();
		location.href=ADMIN+"area/index?prov=<{$smarty.get.prov}>&city="+city+"&pid="+city;
	});
});
</script> 