<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/



 if(!defined('IN_SITETEAM')) {exit('Access Denied');}?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SiteTeam Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="admin/images/admincp.css" type="text/css" media="all" />
<link rel="stylesheet" href="admin/images/form.css" type="text/css" media="all" />
<script src="admin/js/common.js" type="text/javascript"></script>
</head>
<body>
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='开始&nbsp;&raquo;&nbsp;文章管理<?php if(!empty($category)){?>&nbsp;&raquo;&nbsp;<?=$article_category[$category]['name']?><?php }?>';</script>
<div class="container" id="cpcontainer">
  <div class="itemtitle">
    <h3>文章列表</h3>
    <?php if(!empty($category)){?>
	<ul class="tab1">
      <li><a href="admin.php?action=article&operation=edit&category=<?=$category?>"><span>添加文章</span></a></li>
	  <li><a onClick="return confirm('此操作需要几分钟或更长时间，确定要进行吗？')"  href="admin.php?action=article&operation=update_index&category=<?=$category?>"><span>更新该栏索引</span></a></li>
    </ul>
	<?php } else {?>
	<ul class="tab1">
      <li><a>请先从左边导航选择栏目，然后添加文章</a></li>
      <li><a onClick="return confirm('此操作需要几分钟或更长时间，确定要进行吗？')"  href="admin.php?action=article&operation=update_all_index"><span>更新所有栏索引</span></a></li>
    </ul>
	<?php }?>
  </div>
	<table width="700" class="tb tb2 ">
	  <tr>
	    <td><h4>标题</h4></td>
	    <td width="100"><h4>时间</h4></td>
		<td width="100"><h4>推广状态</h4></td>
		<td width="50"><h4>编辑</h4></td>
		<td width="50"><h4>删除</h4></td>
	  </tr>
	  <?php if (is_array($list) && count($list) > 0) foreach ($list as $k => $v) {?>
	  <tr>
	    <td><?php if(empty($category)){?>[<?=$article_category[$v['category']]['name']?>]<?php }?> <a target="_blank" href="http://<?=$site_url?><?=SITE_PATH?>/?<?=$v['category']?>/<?=$v['key']?>.html"><?=str_sub($v['body_name'], 40, "…")?></a><?php if($v['is_first'] == 8){?><strong><font color="#FF0000">已设为栏目首页</font></strong> <?php }?></td>
	    <td><?=date("Y-m-d", $v['key'])?></td>
		<td><?php if($v['status'] == 8){?><strong><font color="#FF0000">首页推广</font></strong> <?php } elseif($v['status'] == 3){?><strong>栏目推广</strong><?php } else {?>无<?php }?></td>
		<td><a href="admin.php?action=article&operation=edit&category=<?=$v['category']?>&key=<?=$v['key']?>">编辑</a></td>
		<td><a onClick="return confirm('确定删除？');" href="admin.php?action=article&operation=del&category=<?=$v['category']?>&key=<?=$v['key']?>">删除</a></td>
	  </tr>
	  <?php  } else {?>
	  <tr>
	    <td colspan="5">还没有发布文章呢，现在添加吧！</td>
		</tr>
	  <?php }?>
  </table>

<?php $m = $multipage;?>
<?php if($m['total_row'] > $limit) {?>
<div class="pages_btns">
	<div class="pages" style="margin-left: 5px;margin-top: 5px;">
		<em>&nbsp;<?=$m['total_row']?>&nbsp;</em>
		<a href="admin.php?action=article&operation=list&category=<?=$category?>&page=1" class="first">1 ...</a>
		<a href="admin.php?action=article&operation=list&category=<?=$category?>&page=<?=$m['up_page']?>" class="prev">&lsaquo;&lsaquo;</a>
		<?php if(count($m['link']))foreach($m['link'] as $k => $n) {?>
			<?php if ($n != $m['current_page']){?>
				<a href="admin.php?action=article&operation=list&category=<?=$category?>&page=<?=$n?>"> <?=$n?> </a>
			<?php }else{ ?>
				<strong> <?=$n?> </strong>
			<?php } ?>
		<?php } ?>
		<a href="admin.php?action=article&operation=list&category=<?=$category?>&page=<?=$m['next_page']?>" class="next">&rsaquo;&rsaquo;</a>
		<a href="admin.php?action=article&operation=list&category=<?=$category?>&page=<?=$m['total_page']?>" class="last">... <?=$m['total_page']?></a>
		<kbd>
  			<input type="text" name="custompage" size="3" onKeyDown="if(event.keyCode==13) {window.location='admin.php?action=product&operation=list&category=<?=$category?>&page='+this.value; return false;}" />
  		</kbd>
	</div>
</div>
<?php } ?>

</div>



</body>
</html>
