<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Include/Connect.asp"-->
<%
username=Checkstr(request.querystring("username"))
if username="" then
response.redirect("../default.asp")
end if
%>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../CSS/Hompy/hompy.css" type=text/css rel=stylesheet>
<title></title>
<script language="JavaScript">
<!--

function ask(msg) {
	
	if( msg=='' ) {
		msg='真的要这样做吗？';
	}

	if (confirm(msg)) {
		return true;
	} else {
		return false;
	}
}
//-->
</script>
</head>
<body  oncontextmenu="window.event.returnValue=false" onselectstart="return false">
<TABLE cellSpacing=0 cellPadding=0 width=473 border=0>
  <TBODY>
    <TR> 
      <TD height=29 align="center"><table width="97%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="86%" class="orange2_b">文章列表</td>
<%
if session("username")=username then
%>
            <td width="14%"><a href="articlewrite.asp?username=<%=request.querystring("username")%>"><img src="../Images/Hompy/w_note.gif" width="62" height="19" border="0"></a></td>
<%
end if
%>          
		  </tr>
        </table></TD>
    </TR>
    <TR> 
      <TD height=12><div align="center"> 
          <%
dim Username,SortID,i
GroupID=Request.QueryString("GroupID")
if GroupID="" then
   SQLFiltrate="select * from Show5_ALLArticle where Username='"&Username&"' order by ArticleID DESC"
else
   SQLFiltrate="select * from Show5_ALLArticle where Username='"&Username&"' and GroupID="&GroupID&" order by ArticleID DESC"
end if
if not isempty(request("page")) then        
   currentPage=cint(request("page"))        
else        
   currentPage=1        
end if
MaxPerPage=10
set rs = server.CreateObject("adodb.recordset")
sql=""&SQLFiltrate&""
rs.CursorLocation=3
rs.Open sql,cn,1,1
'i=rs.recordcount
if rs.eof or rs.bof then
%>
          <table width="97%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td style="HEIGHT: 3px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"><img src="" width="3" height="3" alt=""></td>
  </tr>
  <tr> 
    <td></td>
  </tr>
  <tr> 
              <td height="108" align="center">暂无文章！</td>
  </tr>
  <tr> 
    <td height="1" style="BORDER-BOTTOM: #cecfce 1px solid;"><img name="" src="" width="1" height="1" alt=""> </td>
  </tr>
</table>
<table width="39%" height="45" border="0" cellpadding="0" cellspacing="0">
            <tr>
    <td><TABLE width="206">
                <TBODY>
                <FORM name=form onSubmit="return false;" method=get target=_self>
                  <TR> 
                    <TD><SELECT name=selsearchType>
                        <option value="wpname">标题</option>
                        <option value="title">内容</option>
                      </SELECT> <INPUT  maxLength=35 size=15 name=searchTxt> <img src="../Images/Hompy/search_b.gif" align="absmiddle"></TD>
                  </TR>
                </FORM>
              </TABLE></td>
  </tr>
</table>
<%
response.end()
else
   totalPut=rs.recordcount
   rs.move  (currentPage-1)*MaxPerPage
   rs.pagesize=MaxPerPage '得到每页数
   mpage=rs.pagecount     '得到总页数
%>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <TR> 
      <td align="center" style="HEIGHT: 24px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"><table width="468" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td width="42" align="center">编号</td>
                    <td width="225" align="center">标题</td>
                    <td width="110" align="center">发布时间</td>
                    <td width="46" align="center">点击</td>
<%
if session("Username")=Username then
%>
                    <td width="46" align="center">操作</td>
<%
end if
%>
                  </tr>
                </table></td>
    </TR>
</table>

          <table width="468" border="0" cellspacing="0" cellpadding="0">
            <%
i=1
Do Until rs.EOF or i>MaxPerPage
%>
            <tr> 
              <td width="42" height=25 align=center><SPAN style="FONT-SIZE: 11px; COLOR: #666666"><SPAN><%=i%></span></span></td>
              <td width="225" style="PADDING-BOTTOM: 5px; PADDING-TOP: 5px" height=25><a href="articleview.asp?ArticleID=<%=rs("ArticleID")%>&Username=<%=rs("Username")%>&GroupID=<%=rs("GroupID")%>"><%=rs("Topic")%></a> <%
	if DateDiff("d",rs("Posttime"),now())<3 then
	response.write " <img src='../Images/Hompy/ico_new.gif' width='10' height='8' border='0' align='absmiddle'>"
	end if
	%> </td>
              <td width="108"><SPAN style="FONT-SIZE: 11px; COLOR: #666666"><SPAN><%=rs("Posttime")%></span></span></td>
              <td width="44" align=center><SPAN style="FONT-SIZE: 11px; COLOR: #ff6600"><SPAN><%=rs("Hit")%></span></span></td>
<%
if session("Username")=Username then
%>
			  <td width="49" align=center><a href="articleedit.asp?articleid=<%=rs("ArticleID")%>"><img src="../Images/Hompy/icon_edit.gif" width="16" height="16" border="0" alt="编辑"></a>&nbsp;<a href="javascript:if(ask('真的要删除吗？')) location.href='articledel.asp?articleid=<%=rs("ArticleID")%>';"><img src="../Images/Hompy/icon_del.gif" width="16" height="16" border="0" alt="删除"></a></td>
<%
end if
%>       
			</tr>
            <tr> 
              <td colspan="5" align="center" style="HEIGHT: 1px; BORDER-BOTTOM: #cecfce 1px dotted"><img name="" src="" width="1" height="1" alt=""></td>
            </tr>
            <%
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
%>
          </table>
          
        </div></TD>
    </TR>
	<TR>
      <td align="center" style="HEIGHT: 4px; BORDER-BOTTOM: #cecfce 1px solid; BACKGROUND-COLOR: #f7f7f7"><img src="" width="4" height="4" alt=""></td>
    </TR>
    <TR>
  <TR>
      <TD align="center"> 
        <table width="100%" height="30"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="30" align="center" style="FONT-SIZE: 11px"> 
              <%
call page()
sub page()%>
<%                                                                                                                           
    pageno=currentPage
    if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
        pageno=1
    end if
%> 
<%if cint(pageno)>1 then%><a href=articlelist.asp?username=<%=username%>&groupid=<%=groupid%>&page=<%=pageno-1%>><%end if%>
<img src="../Images/Hompy/K_play_middle_pre.gif" border="0" align="absmiddle">&nbsp;</a> <%                    
pp=cint(pageno)-3            
  if pp<1 then            
  pp=1            
  end if            
for pno=pp to mpage            
p=p+1            
if pno=cint(pageno) then%>&nbsp;<strong><font color="#FF0000"><%=pno%></font></strong>&nbsp;<%else%>&nbsp;<a href=articlelist.asp?username=<%=username%>&groupid=<%=groupid%>&page=<%=pno%>><u><%=pno%></u></a>&nbsp;<%end if%>                    
<%                    
if p>=7 then exit for            
next%>&nbsp;<%if cint(pageno)< mpage then%><a href=articlelist.asp?username=<%=username%>&groupid=<%=groupid%>&page=<%=pageno+1%>><%end if%>
<img src="../Images/Hompy/K_play_middle_next.gif" border="0" align="absmiddle"></a> <a href=articlelist.asp?username=<%=username%>&groupid=<%=groupid%>&page=<%=mpage%>>
</a> 
<%  
end sub%>
	</td>
  </tr>
</table>
        <table width="39%" border="0" cellspacing="0" cellpadding="0">
          <tr>
    <td><table width="39%" height="28" border="0" cellpadding="0" cellspacing="0">
                <tr>
    <td><TABLE width="206">
                <TBODY>
                <FORM name=form onSubmit="return false;" method=get target=_self>
                  <TR> 
                    <TD><SELECT name=selsearchType>
                        <option value="wpname">标题</option>
                        <option value="title">内容</option>
                      </SELECT> <INPUT  maxLength=35 size=15 name=searchTxt> <img src="../Images/Hompy/search_b.gif" align="absmiddle"></TD>
                  </TR>
                </FORM>
              </TABLE></td>
  </tr>
</table></td>
  </tr>
</table>

</TD></TR>
  <TR>
  </TBODY>
</TABLE>
</body>
</html>
