<?php include_once(mvc::$cfg['PATH_TPL'].'public/topSeller.php');?>
<div class="maintb">
<?php include_once(mvc::$cfg['PATH_TPL'].'seller/leftMenu.php');?>
	<div class="main_middle shop-base-box">
		 <div class="navrow">
            <ul class="navrow_ul">
                <li <?php if($order =='category'){ echo  "class='active'";}?>>
                    <a href="/seller/shopCategoty">分类管理</a>
                </li>
                <li <?php if($order =='artInfo'){ echo  "class='active'";}?>>
                    <a href="/seller/shopArticle">文章管理</a>
                </li>
            </ul>
        </div>
        <div class="mod-main-nav-box " id="my_mod-main-nav-box">
			<a href="/seller/shopAddArticle"><button type="button" class="btn btn-default">新增文章</button></a>
		</div>
		<table class="table table-bordered martb10">
			<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="50px;">排序</th>
				</tr>
			</thead>
			<tbody class="pdtTbody">
			<?php if(!empty($lists)){?>
			 <?php foreach ($lists as $k=>$v){?>
				<tr>
					<td>
						<a class="a_blue marr5" href="/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>
<!-- 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/footAll.php');?>
<script type='text/javascript'>
var delArt=function(id){
	$.post('/seller/delShopArt?isAjax=1',{"artId":id},function(res){
		if(MESSAGE.ajaxError(res)){
			MESSAGE.alert('删除成功，请刷新后查看');
		}
	},'json');
}
$(document).ready(function() 
{
	GZH.initImg();
	VERIFICATION.check();
	$('.art_del').on('click',function(){
		var id=$(this).data('id');
		if(id==undefined) return;
		MESSAGE.confirm('确定要删除该文章吗?','delArt('+id+')');
	})
});
</script>