<?php include_once(mvc::$cfg['PATH_TPL'].'seller/publicHead.php');?>
<div class="maintb">
	<div class="main_middle shop-base-box">
		 <div class="layui-tab layui-tab-card">
            <div class="layui-tab-conten" style="padding: 10px">
		        <div class="mod-main-nav-box " id="my_mod-main-nav-box">
					<a lay-href="<?php echo mvc::$cfg['SELF_URL'];?>seller/shopAddArticle"><button type="button" class="layui-btn">新增文章</button></a>
				</div>
				<table class="layui-table">
					<thead>
						<tr>
							<th width="85px">操作</th>
							<th width="100px">分类名称</th>
							<th>标题</th>
							<th width="100px">添加人</th>
							<th width="120px">添加时间</th>
							<th width="120px">修改时间</th>
							<th width="80px;">排序</th>
						</tr>
					</thead>
					<tbody class="pdtTbody">
					<?php if(!empty($lists)){?>
					 <?php foreach ($lists as $k=>$v){?>
						<tr>
							<td>
								<a class="a_blue marr5" lay-href="<?php echo mvc::$cfg['SELF_URL'];?>seller/shopAddArticle?artId=<?php echo $v['art_id'];?>" >编辑</a>
								<?php if(!empty($v['art_can_delete'])){?>
								<a href="javascript:;" data-id="<?php echo $v['art_id'];?>" class="red art_del">删除</a>
								<?php }?>
							</td>
							<td><?php echo $cate[$v['art_cat_id']]['cat_name'];?></td>
							<td><?php echo $v['art_name'];?></td>
							<td><?php echo $uArr[$v['art_add_uid']];?></td>
							<td><?php echo date('Y-m-d H:i',$v['art_atime']);?></td>
							<td><?php echo date('Y-m-d H:i',$v['art_etime']);?></td>
							<td><?php echo $v['art_seq'];?></td>
						</tr>
					 <?php }?>
					<?php }else{?>
						<tr>
							<td colspan="7" class="center">还没有文章分类</td>
						</tr>
					<?php }?>
					</tbody>
				</table>
				<?php echo $Page;?>
            </div>
        </div>
	</div>
</div>
<!-- Modal -->
<div class="modal" id="layer_box" tabindex="-1" role="dialog" aria-labelledby="layer_box">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content"></div>
	</div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script type='text/javascript'>
var delArt=function(id){
	$.post(SELF_URI+'seller/delShopArt?isAjax=1',{"artId":id},function(res){
		if(AJAX.checkData(res)){
			layer.msg('删除成功',function(){
				location.reload();
			});
		}
	},'json');
}
$(document).ready(function() 
{
	GZH.initImg();
	VERIFICATION.check();
	$('.art_del').on('click',function(){
		var id=$(this).data('id');
		if(id==undefined) return;
		layer.confirm('确定要删除该文章吗?',function(){
			delArt(id)
		})
	})
});
</script>