<!--#include file="../Include/Conno.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="IsLogin.asp" -->
<%
m_UserID = Session("CurUserID")
m_Sql="select * from RJ_Diary where F_UserID="&m_UserID
Set rs = conn.Execute(m_Sql)
if rs.Eof then
  CloseDataBase()
  Response.Redirect("RJ_AddNew.asp")
  Response.end
else
  m_DiaryName = rs("F_DiaryName")
  m_DiaryContent = rs("F_DiaryContent")
end if

If Request.ServerVariables("REQUEST_METHOD")="POST" then
    m_Delete=request.form("hidDelete")
		for each m_DeleteID in Request.form("box")
	      mSql = "Delete from RJ_DiaryList where F_ID=" & m_DeleteID
	      'response.write mSql
		  conn.execute(mSql)
	    next
	    response.redirect "RJ_DiaryList.asp"
End if
%>

<HTML><HEAD><TITLE>会员俱乐部我的日记</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link href="../css/member.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../Include/function.js"></script>
<script language="javascript">
<!--
function CheckAll()
{     
  for (var k=0;k<document.form2.elements.length;k++)
    {
      var e = document.form2.elements[k];
      if (e.name != 'allbox')
	e.checked = document.form2.allbox.checked;
    }
}

function PerDelete(){
var tmptotal = 0;
  for(var i=0;i<document.form2.elements.length;i++)
  {
    var e=document.form2.elements[i];
    if(e.name=='box') 
    {
      if(e.checked==true){tmptotal++;
    }
  }
}
if( tmptotal > 0 ) {
if((confirm("确定要永久删除这 "+tmptotal+" 条记录吗?"))==true) {
document.form2.hidDelete.value="删除";
document.form2.submit();
}
} else {
alert( "你还没有选择任何记录!" );
}
}


//-->
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!--#include file="../include/top.asp" -->
<!--#include file="../include/member_top.asp" --><!--#include file="club_top.asp" -->
<!--#include file="Top.asp" -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="183" height="400" align="center" valign="top">
      <!--#include file="left.asp" -->
    </td>
    <td width="597" align="center" valign="top"><table width="96%"  border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="100%" height="40" align="right"><img src="../Images/member/hy_c_6.gif" width="185" height="80"></td>
        </tr>
        <tr> 
          <td height="1" bgcolor="#c7c7c7"></td>
        </tr>
      </table>

      <table width="96%" border=0 align="center" cellpadding=0 cellspacing=0>
        <tbody>
          <tr> 
            <td height="109"> <form name="form2" action="RJ_DiaryList.asp" method="POST">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td width="58%" height="24" align="right"><strong><font color="#FF6633">【<%=m_DiaryName%>】</font></strong></td>
                    <td width="42%" align="right"> <a href="RJ_Update.asp">日记本配置</a>&nbsp; 
                    </td>
                  </tr>
                </table>
                <table width="99%" border="0" align="center" cellspacing="1" bgcolor="#333333">
                  <tr bgcolor="f2f2f2"> 
                    <td width="5%" align="center"><img src="../Images/member/write.gif" width="18" height="17" align="absbottom"> 
                    </td>
                    <td width="37%">日记标题</td>
                    <td width="8%" align="center">天气</td>
                    <td width="22%" align="center">发表日期</td>
                    <td width="5%" align="center">投票</td>
                    <td width="6%" align="center">点击</td>
                    <td width="7%" align="center">操作</td>
                  </tr>
                  <%  
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=16  
    mSql="select * from RJ_DiaryList where F_UserID="&m_UserID&" order by F_ID desc"
	rs.open mSql,conn,1,1
	if rs.eof then
	   'response.write "<br><span align='center'><font color=666666><B>你好像还有发表第一篇呢！先来一篇吧.</B></font></p>"
    else
    rs.pagesize=pmcount
    mpage=rs.pagecount
    if pageno="" then pageno=1
    if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
    rs.absolutepage=pageno

 Dim rc,re
 rc=rs.pagesize
 re=1
 do while not rs.eof and rc>0
 mBgColor=Request.Querystring("BgColor")
%>
                  <tr> 
                    <td width="5%" align="center" bgcolor="#FFFFFF"> <input type="checkbox" name="box" value="<%=rs("F_ID")%>"> 
                    </td>
                    <td bgcolor="#FFFFFF"> <span style="cursor:hand" onClick="window.open('../Diary/RJ_DiaryShow.asp?action=read&ID=<%=rs("F_ID")%>','test','height=445,width=488,top=25,left=280,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no, status=no')"> 
                      &nbsp;<%= rs("F_Title") %></span> <font color=D669A5> [<%=rs("F_CanTo")%>]</font> <%if rs("F_IsLock") = false then response.write "<span class='en'><font color=#FF6633><b>Locked</b></font></span>"%> </td>
                    <td align="center" bgcolor="#FFFFFF"><%= rs("F_Weather") %></td>
                    <td align="center" bgcolor="#FFFFFF"><%= formatdatetime(rs("F_Addtime"),1) %>&nbsp;<%= formatdatetime(rs("F_Addtime"),3) %> </td>
                    <td align="center" bgcolor="#FFFFFF"><%=rs("F_PollNumber")%></td>
                    <td align="center" bgcolor="#FFFFFF"><%=rs("F_Hits")%></td>
                    <td align="center" bgcolor="#FFFFFF"> <span style="cursor:hand" onClick="window.open('RJ_DiaryUpdate.asp?action=read&ID=<%=rs("F_ID")%>','test','height=400,width=508,top=25,left=280,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no')"><img src="../Images/member/edit.gif" alt="修改" width="18" height="13"></span></td>
                  </tr>
                  <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
                </table>
                <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FFFFFF">
                  <tr> 
                    <td width="40%" height="22"> &nbsp;共 <font color=red><strong> 
                      <% = rs.recordcount%>
                      </strong></font> 条记录 当前第 <font color=red><strong> 
                      <% = Trim(pageno)%>
                      </strong></font>页/共 <font color=red><strong> 
                      <% = Trim(mpage)%>
                      </strong></font>页 </td>
                    <td width="60%" align="right"> 
                      <%
if pageno>1 then
   response.write "<a href='RJ_DiaryList.asp'> <img alt='首页' src='../Images/inc/PageHome.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='../Images/inc/PageHome.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='RJ_DiaryList.asp?pageno="&pageno-1&"'><img alt='上一页' src='../Images/inc/PageUp.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='../Images/inc/PageUp.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='RJ_DiaryList.asp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='RJ_DiaryList.asp?pageno="&pageno+1&"'><img alt='下一页' src='../Images/inc/PageDown.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='../Images/inc/PageDown.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='RJ_DiaryList.asp?pageno="&mpage&"'><img alt='末页' src='../Images/inc/PageEnd.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='../Images/inc/PageEnd.gif' border=0 width='15' height='14'>"
end if
Response.write "&nbsp;&nbsp;"
%>
                    </td>
                  </tr>
                </table>
                <table width="99%" border="0" align="center">
                  <tr> 
                    <td width="62%" align="right"><a href=JavaScript:openScript('RJ_DiaryAddNew.asp',524,404)> 
                      <img src="../Images/member/collect.gif" width="10" height="12" border="0" align="absmiddle">今天你写日记了吗？ 
                      </a></td>
                    <td width="38%" align="right"> <input type="hidden" name="hidDelete"> 
                      <input type="checkbox" name="allbox" value="Check All" onClick="CheckAll();">
                      选中所有的记录 
                      <input onClick="javascript:PerDelete();" type="button"  value="删除" name="btnDelete1" style="width:50;height:18;border:1 solid #9a9999; font-size:9pt; background-color:#f8f8f8"> 
                    </td>
                  </tr>
                </table>
              </form></td>
          </tr>
        </tbody>
      </table></td>
  </tr>
</table>
<!--#include file="../include/bottom.asp" -->
</BODY></HTML>
