<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>刀客建站系统   管理中心  - 文章列表 </title>
<%{include file="header.html"}%>
</head>
<body>

<h1>
<span class="action-span"><a href="index.php?act=article.addarticle">添加新文章</a></span>
<span class="action-span1"><a href="index.php?act=index.default">刀客建站系统   管理中心 </a>  - 文章列表 </span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1>
	<div class="form-div">
	<form action="" method='GET' name="searchForm">
	<input type='hidden' name='act' value='<%{$smarty.get.act}%>'>
	  <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    
	  <select name="cat_id" id='cat_id'>
	 	<option value="0">所有分类</option>
		<%{foreach from=$out.category_res item=c_v key=c_k}%>
			<option value="<%{$c_v.parent.cat_id}%>" <%{if $smarty.get.cat_id==$c_v.parent.cat_id}%>selected=true<%{/if}%> ><%{$c_v.parent.cat_name|escape:html}%></option>
			<%{foreach from=$c_v.children item=c_v_c key=c_k_c}%>			
				<option value="<%{$c_v_c.cat_id}%>"  <%{if $smarty.get.cat_id==$c_v_c.cat_id}%>selected=true<%{/if}%> >&nbsp;&nbsp;&nbsp;&nbsp;<%{$c_v_c.cat_name|escape:html}%></option>
			<%{/foreach}%>
		<%{/foreach}%>
		</select>
	
		&nbsp;&nbsp;文章频道显示<input type='checkbox' name='is_article'  value=1 <%{if $smarty.get.is_article}%>checked=true<%{/if}%> >
		Support 频道显示<input type='checkbox' name='is_support'   value=1 <%{if $smarty.get.is_support}%>checked=true<%{/if}%> >
		News 栏目显示<input type='checkbox' name='is_news' value=1 <%{if $smarty.get.is_news}%>checked=true<%{/if}%> >
		&nbsp;&nbsp;	

    文章名<input type="text" name="title" id="title_id" value='<%{$smarty.get.title|escape:html}%>' />
    <input type="submit" value=" Search " class="button" />
  </form>
</div>

<form method="POST" action="index.php?act=article.batch_handle" name="listForm">
<!-- start cat list -->
<div class="list-div" id="listDiv">
<%{if $out.article_res}%>
<table  id='list-table'>
  <tr>
    <th><input id='all_check_box' type="checkbox">

    <a href="javascript:listTable.sort('article_id'); ">ID</a><img src="images/sort_desc.gif"/></th>
    <th><a href="javascript:listTable.sort('title'); ">文章名</a></th>
    <th><a href="javascript:listTable.sort('cat_id'); ">文章分类</a></th>
    <th><a href="javascript:listTable.sort('add_time'); ">添加日期</a></th>

    <th>操作</th>
  </tr>
	<%{foreach from=$out.article_res item=v key=k}%>
  	<tr >
    <td><span><input name="checkboxes[]" type="checkbox" value="<%{$v.article_id}%>" /><%{$v.article_id}%></span></td>
    <td class="first-cell"><%{$v.title|escape:html}%></td>
    <td align="left"><span><%{$v.cat_name|escape:html}%></span></td>
    <td align="center"><span><%{$v.add_time|date_format:"%Y-%m-%d %H:%I:%S"}%></span></td>
    <td align="center" nowrap="true"><span>
      <a href="<%{$out.glo_domain_directory}%>article.php?article_id=<%{$v.article_id}%>" target="_blank" title="查看"><img src="images/icon_view.gif" border="0" height="16" width="16" /></a>&nbsp;
      <a href="index.php?act=article.updatearticle&article_id=<%{$v.article_id}%>" title="修改"><img src="images/icon_edit.gif" border="0" height="16" width="16" /></a>&nbsp;
     
    </td>
   </tr>  
	<%{/foreach}%>


     <tr>
    <td colspan="2"><input type="submit" class="button" onclick='if(!window.confirm("Confirmation of deleting?")){return false;}' id="btnSubmit" value="批量删除" disabled="true" /></td>
	<input type='hidden' name='handle' value='is_del'>
	 <td align="right" nowrap="true" colspan="8" >
          <!-- $Id: page.htm 14216 2008-03-10 02:27:21Z testyang $ -->
            <div id="turn-page">
        总计<span id="totalRecords"><%{$out.page_arr.total}%></span>篇文章 
        <span id="page-link">
		  <%{foreach from=$out.page_arr.thepage item=v key=k}%>	
				<%{if $k==$out.page_arr.page}%>	
					<b><%{$k}%></b>			
				<%{else}%>
				<a href="<%{$v}%>"><%{$k}%></a>			
				<%{/if}%>
			<%{/foreach}%>	
		  </span>
      </div>

    </td>
  </tr>
</table>
<%{else}%>
<div align='center'>暂无任何文章</div>
<%{/if}%>
</div>
<script>
var check_num	=	0;

$(document).ready(function(){
	$("#all_check_box").click(
		function(){
			var _this	=	this;
			$(":checkbox").each(function(i){
				if(this.name.match('checkboxes')){
					if(_this.checked&&(!this.checked)){
						this.checked	=true;
						check_num++;
					}else if(!(_this.checked)&&this.checked){
						this.checked	=false;
						check_num--;
					}
				}
			});
		if(check_num){
			$("#btnSubmit")[0].disabled	=	false;	
		}else{
			$("#btnSubmit")[0].disabled	=	true;	
		}	
	});
});

$(":checkbox").each(function(i){
	if(!this.name.match('checkboxes')){
		return;
	}
	$(this).click(function(){
		if(this.checked){
			check_num++;
		}else{
			check_num--;
		}
		if(check_num){
			$("#btnSubmit")[0].disabled	=	false;	
		}else{
			$("#btnSubmit")[0].disabled	=	true;	
		}
		
	});
});
</script>


</body>
</html>

