<?php include mayi_tpl('owenjq');?>
<style>
a.letter{margin:1px 5px; font-weight:bold; font-size:14px; text-decoration:underline}
</style>
<script language=javascript>
function chkform(){
	if(document.form.areaname.value==""){
		alert('请输入地区名称，多个地区以 | 隔开！');
		document.form.areaname.focus();
		return false;
	}
}

function getpinyin(t){
	if(t != ''){
		url='include/get_pinyin.php?t='+t;
		target='iframe_t';
		document.getElementById('form_t').action=url;
		document.getElementById('form_t').target=target;
		document.getElementById('form_t').submit();
	}
}

function getpinyinhead(t){
	if(t != ''){
		url='include/get_pinyin.php?ishead=1&t='+t;
		target='iframe_t';
		document.getElementById('form_t').action=url;
		document.getElementById('form_t').target=target;
		document.getElementById('form_t').submit();
	}
}
</script>
<script type="text/javascript" src="js/vbm.js"></script>
<div id="h0">
<?php if(empty($cityid) && empty($areaid)){?>

<?php } elseif($areaid) {?>
<div>
当前位置：<span><a href="?cityid=1">地区列表</a> &rsaquo; <?php echo $currentname; ?></span>
</div>
<div class="clear"></div>
<form action="?" method="post">
<input name="areaid" value="<?php echo $areaid; ?>" type="hidden">
<input name="cityname" value="<?php echo $cityname; ?>" type="hidden" />
<input name="cityid" value="<?php echo $cityid; ?>" type="hidden" />
<div id="<?=MPS_SOFTNAME?>">
	<table border="0" cellspacing="0" cellpadding="0" class="vbm">
        <tr class="firstr">
          <td width="80"><label><input name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)" class="checkbox"/>删?</label></td>
          <td width="55%">二级地区名</td>
          <td>排序</td>
        </tr>
    <?php 
    if($list){
    foreach($list AS $area)
    {
    ?>
        <tr bgcolor="#ffffff">
        <td width="40"><label><input type='checkbox' name='deletestreetid[]' value='<?=$area[streetid]?>' class='checkbox'></label></td>
          <td align="left"><input name="updatestreet_streetname[<?=$area[streetid]?>]" value="<?=$area[streetname]?>" class="txt" style="width:100px"> </td>
          <td><input name="updatestreet_displayorder[<?=$area[streetid]?>]" value="<?=$area[displayorder]?>" class="txt" type="text"/></td>
        </tr>
    <?php
    }
    } else {
    ?>
        <tr bgcolor="#ffffff">
          <td colspan="5" bgcolor="#ffffff"><div class="nodata">地区 <span><?php echo $currentname; ?></span>尚未添加隶属二级地区<br />
<br />返回<a href="?cityid=<?=$cityid?>">上一级</a></div></td>
        </tr>
    <?php }?>
    </table>
</div>
<center><input name="<?=CURSCRIPT?>_submit" type="submit" value="提交" class="mymps large" onClick="if(!confirm('删除操作将同步删除隶属该区域的街道路段，您确定您要继续吗？'))return false;"/></center>
</form>
<div class="clear10"></div>
<div class="clear10"></div>
<form method="post" name="form" action="?">
<input name="newstreet[areaid]" value="<?=$areaid?>" type="hidden">
<input name="cityname" value="<?php echo $cityname; ?>" type="hidden" />
<input name="cityid" value="<?php echo $cityid; ?>" type="hidden" />
<div id="<?=MPS_SOFTNAME?>">
<table border="0" cellspacing="0" cellpadding="0" class="vbm">
<tr class="firstr">
  <td colspan="2" align="left">增加 <span><?=$currentname?></span>下的二级地区</td>
</tr>
<tr bgcolor="#ffffff">
  <td width="8%">地区名称： </td>
  <td>
  <textarea rows="3" name="newstreet[streetname]" cols="50" placeholder="支持地区批量添加，多个地区以空格隔开"></textarea><br />
<div style="margin-top:3px">
<font color="red">范例：地区1 地区2 地区3 地区4 地区5</font></div></td>
</tr>
<tr bgcolor="#ffffff">
  <td >地区排序： </td>
  <td><input name="newstreet[displayorder]" class="txt" type="text" value="0"></td>
</tr>
</table>
</div>
<center>
<input type="submit" name="<?=CURSCRIPT?>_submit" value="提交" class="mymps large"/>
&nbsp;&nbsp;
</center>
</form>
<?php } elseif($cityid) {?>
<form action="?" method="post">
<input name="cityid" value="<?=$cityid?>" type="hidden">
<div id="<?=MPS_SOFTNAME?>">
<table border="0" cellspacing="0" cellpadding="0" class="vbm">
        <tr class="firstr">
          <td width="50"><label><input name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)" class="checkbox"/>删?</label></td>
          <td>名称</td>
          <td>排序</td>
          <td>操作</td>
        </tr>
    <?php 
    if($list){
    foreach($list AS $area)
    {
    ?>
        <tr bgcolor="#ffffff">
        <td><label><input type='checkbox' name='deleteareaid[]' value='<?=$area[areaid]?>' class='checkbox'></label></td>
          <td align="left"><input name="updatearea_areaname[<?=$area[areaid]?>]" value="<?=$area[areaname]?>" class="txt" style="width:100px"> </td>
          <td><input name="updatearea_displayorder[<?=$area[areaid]?>]" value="<?=$area[displayorder]?>" class="txt" type="text"/></td>
       	  <td><a href="?part=list&areaid=<?=$area[areaid]?>&cityid=<?=$cityid?>&cityname=<?=$currentname?>">下属二级地区</a></td>
        </tr>
    <?php
    }
    } else {
    ?>
        <tr bgcolor="#ffffff">
          <td colspan="5" bgcolor="#ffffff"><div class="nodata"> <span><?php echo $currentname; ?></span>尚未添加隶属地区<br />
<br />返回<a href="area.php">上一级</a></div></td>
        </tr>
    <?php }?>
    </table>
</div>
<center><input name="<?=CURSCRIPT?>_submit" type="submit" value="提交" class="mymps large"/></center>
</form>
<div class="clear" style="margin-top:5px"></div>
<?php }?>
</div>

<?php include mayi_tpl('owenbt');?>