<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/transport.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/listtable.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<body>
<h1>
<span class="action-span"><a href="?ctl=content&act=content_add"><?php  echo $article_add; ?><!--添加内容--></a></span>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><?php  echo $common_admin_index; ?><!--管理首页--></a> >> <?php  echo $article_list; ?><!--文章列表--></span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
  <form action="index.php" name="searchForm" method="get">
  <input type="hidden" name="ctl" value="content" />
  <input type="hidden" name="act" value="content_list" />
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    &nbsp;&nbsp;
    <?php  echo $class_select; ?>
	&nbsp;&nbsp;
	<?php  echo $article_list_keywords; ?><!--关键字--> 
    <input type="text" name="keyword" size="15" />
    <input type="submit" value="<?php  echo $article_list_search; ?>" class="button" />
  </form>
</div>
<form method="post" action="index.php?ctl=content&act=change_action" name="listForm" onSubmit="return validate();">
<div class="list-div" id="listDiv">

<table width="100%" cellspacing="1" cellpadding="2" id="list-table">
  <tr>
    <th><input type="checkbox" onClick='listTable.selectAll(this, "art_id")' /></th>
    <th><?php  echo $article_list_title; ?><!--文章标题--></th>
    <th><?php  echo $article_list_class; ?><!--所在频道--></th>
    <th><?php  echo $article_list_click; ?><!--浏览数量--></th>
	<th><?php  echo $article_list_time; ?><!--添加时间--></th>
    <th><?php  echo $article_list_author; ?><!--文章作者--></th>
	<th><?php  echo $article_list_state; ?><!--状态--></th>
	<th><?php  echo $article_list_oper; ?><!--相关操作--></th>
  </tr>
  <?php  foreach ( $article_array as $val) { ?>
  <tr align="center">
    <td align="left" width="1%">
	<input type="checkbox" name="art_id[]" value="<?php  echo $val['article_id']; ?>" />
    </td>
    <td width="20%" align="left"><a href="index.php?ctl=content&act=content_add&content_id=<?php  echo $val['article_id']; ?>"><?php  echo $val['article_title']; ?></a><?php  if ( $val['article_commend']==1) { ?>&nbsp;[<font color="#FF0000"><?php  echo $article_list_commend; ?></font>]<?php } ?></td>
	<td width="10%"><?php  echo $val['class_name']; ?></td>
	<td width="5%"><?php  echo $val['article_click']; ?></td>
    <td width="8%"><?php  echo date("Y-m-d",$val['article_time']); ?></td>
    <td width="10%"><?php  echo $val['article_author']; ?></td>
	<td width="5%"><img src="images/<?php  if ( $val['article_state'] == 1) { ?>yes<?php  } else { ?>no<?php } ?>.gif" /></td>
    <td width="15%" align="center">
		<a href="index.php?ctl=content&act=content_add&content_id=<?php  echo $val['article_id']; ?>" title="<?php  echo $article_list_edit; ?>"><img src="images/icon_edit.gif" width="16" height="16" border="0" /><?php  echo $article_list_edit; ?><!--编辑--></a>
		<a href="../index.php?ctl=article&act=front_article_content&article_id=<?php  echo $val['article_id']; ?>" target="_blank" title="<?php  echo $article_list_show; ?>"><img src="images/icon_view.gif" width="16" height="16" border="0" /><?php  echo $article_list_show; ?><!--查看--></a>
		<a href="index.php?ctl=content&act=content_del&content_id=<?php  echo $val['article_id']; ?>" title="<?php  echo $article_list_del; ?>" onClick="return confirm('<?php  echo $article_list_del_conf; ?>');"><img src="images/icon_trash.gif" width="16" height="16" border="0" /><?php  echo $article_list_del; ?><!--删除--></a>
    </td>
  </tr>
  <?php } ?>
</table>
<!-- 分页 -->
<table id="page-table" cellspacing="0">
  <tr>
  <td height="30">
  &nbsp;
  <select name="type" id="selAction" onChange="changeAction()">
    <option value=""><?php  echo $article_list_select; ?><!--==选择==--></option>
    <option value="commend"><?php  echo $article_action_commend; ?><!--==推荐==--></option>
    <option value="cancel"><?php  echo $article_action_cancel; ?><!--==取消==--></option>
    <option value="move_to"><?php  echo $article_action_move_to; ?><!--==移动==--></option>
    <option value="delete"><?php  echo $article_action_delete; ?><!--==删除==--></option>
    <option value="update"><?php  echo $article_action_update; ?><!--==更新==--></option>
  </select>
  <?php  echo $class_move_select; ?>
  <input type="submit" value="<?php  echo $article_list_confirm; ?>" id="btnSubmit" name="btnSubmit" class="button" disabled="true" />
  </td>
    <td align="right" nowrap="true">
      <div id="turn-page">
		<?php  echo $show_page; ?>
      </div>
    </td>
  </tr>
</table>
</div>
</form>
<div id="footer">
<?php  echo $common_copyright; ?>
</div>
<script type="text/javascript">
  /**
   * 检查输入的内容
   */
  function validate()
  {
    var validator = new Validator('listForm');
    validator.required('type','<?php  echo $article_list_select_error; ?>');
    return validator.passed();
  }
  
  function changeAction()
  {
      var frm = document.forms['listForm'];

      // 切换分类列表的显示
      frm.elements['move_class_id'].style.display = frm.elements['type'].value == 'move_to' ? '' : 'none';

  }
</script>
</body>