<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_right.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站后台管理</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#province").val('<?php echo $province;?>');
$("#city").val('<?php echo $city;?>');
$("#district").val('<?php echo $district;?>');
});
</script>
</head>

<body>
	<div class="top-tips">
		<div class="tips-wrap">
			<div class="title"><?php echo $action=='top'?'顶部导航':'横向导航';?>设置</div>
			<font style="color:#ff0000">注：本操作是针对前台导航而非后台的！</font>添加，编辑或删除操作后需要点击“提交”按钮才生效。<a href="<?php echo IN_SYS;?>" target="_blank" style="color:#FF0000">获取帮助</a>
		</div>
	</div>
	<div class="manage-tips">
	<a href="javascript:void(0);" onclick="$('#addchild').append($('#addhtml').html())" class="add">添加导航</a>
	</div>
	<form action="" method="post" name="myform" enctype="multipart/form-data">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="parentid" value="<?php echo $parentid;?>" />
	<input type="hidden" name="m" value="<?php echo $parentid?$areaobj->m($parentid)+1:$m;?>" />
	<table class="table-list" cellpadding="1" cellspacing="1">
		<tr>
			<th>顺序</th>
			<th>名称</th>
			<th>URL</th>
			<th>颜色</th>
			<th>类型</th>
			<th>操作</th>
		</tr>
		<?php if($datalist){?>
		<?php foreach($datalist as $no => $r){?>
			<input type="hidden" name="id[]" value="<?php echo $r['id'];?>" />
		<tr id="tr_<?php echo $r['id'];?>" <?php echo ($no%2)?'':'class="light"';?>>
			<td><input type="text" class="input-txt" name="old_orderby[<?php echo $r['id'];?>]" value="<?php echo $r['orderby'];?>" size="3" /></a></td>
			<td><input type="text" class="input-txt" name="old_name[<?php echo $r['id'];?>]" value="<?php echo $r['name'];?>" size="24" /> （ID：<?php echo $r['id'];?>）</td>
			<td><input type="text" class="input-txt" name="old_url[<?php echo $r['id'];?>]" value="<?php echo $r['url'];?>" size="36" /></td>
			<td><input type="text" class="input-txt" name="old_color[<?php echo $r['id'];?>]" value="<?php echo strtoupper($r['color']);?>" size="6" /></a></td>
			<td><?php echo $r['typeid']==1?'顶部导航':'横向导航';?></td>
			<td><?php if(!$r['parentid']){?><a href="<?php echo $LA['admin_file'];?>?mod=<?php echo $mod;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&parentid=<?php echo $r['id'];?>">下级子导航</a> | <?php }?><a href="javascript:void(0);" onclick="$('#tr_<?php echo $r['id'];?>').remove();">删除</a></td>
		</tr>
		<?php }?>
		<?php }else{echo '<tr class="light"><td colspan="6">暂无'.($action=='top'?'顶部导航':'横向导航').'数据</td></tr>';}?>
		<tbody id="addchild"></tbody>
		<tr class="light">
			<td colspan="6" class="save-td" ><input type="submit" class="save-btn-small" value="提交" /></td>
		</tr>
		</form>
		<tbody style="display:none" id="addhtml">
		<tr class="light">
			<td><input type="text" class="input-txt" name="orderby[]" size="4" /></td>
			<td><input type="text" class="input-txt" name="name[]" size="24" /></td>
			<td><input type="text" class="input-txt" name="url[]" size="36" /></td>
			<td><input type="text" class="input-txt" name="color[]" size="6" /></td>
			<td><?php echo $action=='top'?'顶部导航':'横向导航';?></td>
			<td>-</td>
		</tr>
		</tbody>
	</table>
</body>
</html>
