<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>我的文档-会员中心-<?php echo $cfg_webname;?></title>
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="<?php echo $cfg_cmsurl;?>/static/web/css/style.css">
		<script src="<?php echo $cfg_cmsurl;?>/static/web/js/jquery.min.js"></script>
	</head>
	<body class="body-bg">
		<?php pasterTempletDiy('top.htm');?>
		<main class="container py-3">
			<div class="row">
				<?php
				$_menu_conex = true;
				?>
				<?php include(DEDEMEMBER."/templets/menu.htm");?>
				<div class="col-md-9">
					<div class="pannel-main-container shadow-sm rounded">
						<nav class="navbar navbar-expand-lg p-0">
							<ul class="navbar-nav mr-auto">
								<li class="nav-item"><a class="nav-link <?php echo ($arcrank=='')? 'active' : '';?>" href="content_list.php?channelid=<?php echo $channelid;?>">全部</a></li>
								<li class="nav-item"><a class="nav-link<?php echo ($arcrank=='1')? ' active' : '';?>" href="content_list.php?channelid=<?php echo $channelid;?>&arcrank=1">已审核</a></li>
								<li class="nav-item"><a class="nav-link<?php echo ($arcrank=='-1')? ' active' : '';?>" href="content_list.php?channelid=<?php echo $channelid;?>&arcrank=-1">未审核</a></li>
							</ul>
							<span class="navbar-text"><a class="btn btn-success btn-sm" href="archives_do.php?dopost=addArc&channelid=<?php echo $channelid;?>">发布</a></span>
						</nav>
						<div class="table-responsive">
							<table class="table">
								<thead>
									<tr>
										<th width="26%">文档标题</th>
										<th width="16%">栏目</th>
										<th width="12%">状态</th>
										<th width="16%">时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									{dede:datalist}
									<tr>
										<td><a href="<?php echo $cfg_phpurl;?>/view.php?aid=<?php echo $fields['id'];?>" target="_blank"><?php echo $fields['title'];?><?php echo IsPicArchives($fields['flag']);?></a></td>
										<td><?php echo $fields['typename'];?></td>
										<td>
											<?php
											if ($fields['arcrank']>=0) echo '<span class="btn btn-outline-success btn-sm">已审核</span>';
											else if ($fields['arcrank']==-2) echo '<span class="btn btn-outline-danger btn-sm">审核失败</span>';
											else echo '<span class="btn btn-outline-danger btn-sm">未审核</span>';
											?>
										</td>
										<td><?php echo GetDateMk($fields['senddate']);?></td>
										<td>
											<a href="javascript:viewArc(<?php echo $fields['id'];?>);" class="btn btn-success btn-sm">预览</a>
											<?php
											if ($fields['arcrank']<0 || $dtime - $fields['senddate'] < $maxtime)
											{
											?>
											<a href="javascript:editArc(<?php echo $fields['id']?>,<?php echo $fields['channel']?>);" class="btn btn-success btn-sm">修改</a>
											<a href="javascript:delArc(<?php echo $fields['id']?>);" class="btn btn-danger btn-sm">删除</a>
											<?php
											}
											?>
										</td>
									</tr>
									{/dede:datalist}
								</tbody>
							</table>
						</div>
						{dede:pagelist listitem='info,index,end,pre,next,pageno' listsize='1'/}
					</div>
				</div>
			</div>
		</main>
		<?php pasterTempletDiy('foot.htm');?>
		<script>
			function viewArc(aid) {
				window.open("{dede:global.cfg_phpurl/}/view.php?aid=" + aid);
			}
			function editArc(aid, channelid) {
				location = "archives_do.php?dopost=edit&channelid=" + channelid + "&aid=" + aid;
			}
			function delArc(aid) {
				DedeConfirm("您确定要删除这篇文档吗").then((v)=>{
					location = "archives_do.php?aid=" + aid + "&dopost=delArc";
				}).catch((e)=>{
					console.log(e)
				});
			}
		</script>
	</body>
</html>