{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">
	<!--search -->
	<form  method='get'  action="<?php echo $search_url;?>"  > 
		<div class="text-c"> 日期范围：
			<input type="text" onclick="laydate({ istime: true, format: 'YYYY-MM-DD','min':laydate.now() })" name="start" class="input-text Wdate" style="width:120px;" value="<?php echo input('param.start/s');?>">
			-
			<input type="text" onclick="laydate({ istime: true, format: 'YYYY-MM-DD','min':laydate.now() })" name="end" class="input-text Wdate" style="width:120px;" value="<?php echo input('param.end/s');?>" >
			<input type="text" class="input-text" style="width:250px" placeholder="关键字" name="keywords" value="<?php echo input('param.keywords/s');?>" >
			<button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</div>
	</form>
	<!-- end search -->
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
			<a class="btn btn-primary size-S radius" href="<?php echo url('admin/news/publish');?>">发布</a>
			<a class="btn btn-danger size-S radius" onclick="delmul()" href="javascript:;">批量删除</a>
		</span>
		
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-hover table-bg">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" class='checkbox' ></th>
					<th>ID</th>
					<th>标题</th>
					<th>分类</th>
					<th>时间</th>
					<th>来源</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{volist name="rows" id="value"}
				<tr class="text-c">
					<td><input type="checkbox" value="<?php echo $value['id'];?>" name="ids"></td>
					<td><?php echo $value['id'];?></td>
					<td><?php echo $value['title'];?></td>
					<td><?php echo $value['fullcategoryname'];?></td>
					<td><?php echo date('Y-m-d H:i',$value['ctime']);?></td>
					<td><?php echo $value['from'];?></td>
					<td class="f-14" >
			        	<a title="编辑" href="<?php echo url('admin/news/publish',['id'=>$value['id']]);?>" class='btn size-MINI' style="text-decoration:none">编辑</a>
						<a title="删除" href="javascript:;" class='btn size-MINI' onclick="del(this,'<?php echo $value['id'];?>')" class="ml-5" style="text-decoration:none">删除</a>
			        </td>
				</tr>
				{/volist}
			</tbody>
		</table>
		<div><?php echo $rows->render();?></div>
	</div>
</div>
{include file='public/footer'}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/laydate/laydate.js"></script>
<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/news/delete');?>",
			{"id":id},
			function(data){
				layer.msg(data.msg,{icon:1,time:1000});
				if(0==data.error){
					$(obj).parents("tr").remove();
				}
			},'json'
		)
	});
}


function delmul(obj,id){
	var vals= getCheckVals('ids');
	if(vals.length==0){
		layer.msg('请选择数据');
		return false;
	}
	layer.confirm('确认要删除吗？',function(index){
		$.post(
			"<?php echo url('admin/news/deletemul');?>",
			{"ids":vals},
			function(data){
				layer.msg(data.msg,{icon:1,time:1000});
				if(0==data.error){
					setTimeout(function(){
						location.reload();
					},1000)
				}
			},'json'
		)
	});
}

</script>
</body>
</html>