<?php
	!defined('DIRCMS_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>
<title>类别管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">类别管理</a></li>
			<li><a href="?file=type&action=add">添加类别</a></li>			
		</ul>
	</div>
	<div class="main">
		<fieldset>
		<legend>操作提示</legend>
		如需对类别进行操作，别忘了选择该类别。
		</fieldset>
		<table cellspacing="0" class="datalist" id="list">
		<tr>
			<th width="40" class="firstcol">反选</th>
			<th width="80">排序</th>
			<th width="80">唯一标识</th>
			<th width="120">类别名称</th>
			<th width="100">状态</th>
			<th width="60">操作</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($result){foreach($result as $val){?>
		<tr>
			<td width="40" align="center"><input type="checkbox" name="id[]" value="<?php echo $val['id'];?>" class="checkbox" /></td>
			<td width="80" align="center"><input type="text" size="6" name="orderby[<?php echo $val['id'];?>]" value="<?php echo $val['orderby'];?>"/></td>
			<td width="80" align="center"><?php echo $val['id'];?></td>
			<td width="120" align="center"><input type="text" size="25" name="name[<?php echo $val['id'];?>]" value="<?php echo $val['name'];?>" /></td>
			<td width="100" align="center"><?php echo $val['islocked']?'已禁用 <a href="'.ADMIN_FILE.'?file=type&action=lock&islocked=0&id='.$val['id'].'"><u>启用</u></a>':'已启用 <a href="'.ADMIN_FILE.'?file=type&action=lock&islocked=1&id='.$val['id'].'"><u>禁用</u></a>';?></td>
			<td width="60" align="center"><a href="<?php echo ADMIN_FILE;?>?file=type&action=delete&id=<?php echo $val['id'];?>"><u>删除</u></a></td>
		</tr>
		<?php }?>
		<tr>
			<td width="40" align="center">
			<input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="5" align="left">
			<input type="radio" name="do" value="edit" class="radio" checked="checked" /><label for="delete">修改</label>
			<input type="radio" name="do" value="delete" class="radio" /><label for="delete">删除</label>
			<input type="radio" name="do"  value="lock" class="radio" /><label for="newstatus">禁用</label> 
			<input type="radio" name="do"  value="unlock" class="radio" /><label for="newstatus">启用</label>
			<input type="button" onclick="this.form.submit();" class="submit" value="执行操作" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="6">目前尚未添加任何类别...</td></tr>	
		<?php }?>
		</table>
	</div>
</div>
</body>
</html>