{include file='public/meta'}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	类别管理
	<span class="c-gray en">&gt;</span>
	产品分类
	<a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
	<div class="text-l">
		产品分类,允许多级,一般约定不超过3级
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
		<!-- <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> -->
		<a class="btn btn-primary size-S radius" onclick="publish('添加','{:url('admin/category/publish',['pid'=>0,'type'=>$type])}','700','480')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加</a>
		</span>
		
	</div>
	<form  id="frm"  method='post'  action="<?php echo url('admin/category/orders');?>">
	<div class="mt-20">
		<table class="table table-border table-bordered table-hover table-bg">
			<thead>
				<tr class="text-c">
					<th>排序</th>
			        <th>编号</th>
			        <th class='text-l'>名称</th>
			        <th>图标</th>
			        <th>操作</th>
		        </tr> 
			</thead>
			<tbody>
				 {volist name="rows" id="vo"}
				<tr class="text-c">
					<td><input type="text" name="sort[]" value="{$vo.sort}" class="input-text size-MINI" style="width: 30px;height:20px"><input type="hidden" name="id[]" value="{$vo.id}"></td>
			        <td>{$vo.id}</td>
			        <td class='text-l'><span style="font-weight:500;"><?php echo $vo['new_title'];?></td>
			        <td><img src="{:get_url($vo.icon)}" style='width:50px' ></td>
					<td class="f-14" >
						<?php if(1==$mullevels){?>
						<a  href="javascript:;" class='btn size-MINI' onclick="publish('增加子类别','<?php echo url('admin/category/publish',['pid'=>$vo['id'],'type'=>$type]);?>','700','480')" >增加子类别</a>
						<?php }?>
			        	<a  href="javascript:;" class='btn size-MINI' onclick="publish('编辑','{:url('admin/category/publish',['id'=>$vo.id,'type'=>$type])}','700','480')" style="text-decoration:none">编辑</a>
						<a  href="javascript:;" class='btn size-MINI' onclick="del(this,'{$vo.id}')" class="ml-5" >删除</a>
			        </td>
		        </tr>
				{/volist}
			</tbody>
		</table>
		 <input type='hidden'  name='type'  value="<?php echo $type;?>" />
		<input class="btn btn-primary radius size-S" type="submit" value="&nbsp;&nbsp;更新排序&nbsp;&nbsp;">
	</div>
	</form>
</div>
{include file='public/footer'}

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript" src="__LIB__/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
/*系统-栏目-删除*/
function del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.post(
			"<?php echo url('admin/category/delete');?>",
			{"id":id,type:"{:$type}" },
			function(data){
				layer.msg(data.msg,{icon:1,time:1000});
				if(0==data.error){
					$(obj).parents("tr").remove();
				}
			},'json'
		)
	});
}
</script>
</body>
</html>