<!--#include file="../conn.asp" -->
<%
if session("username")="" then
response.Redirect("merr.asp?action=err")
response.End()
else
username=session("username")
userid=session("userid")
end if
%>
<%
userid=session("userid")
if request("a")="tranfer" then
did=replace(request("did")," ","")
if did="" then response.Write("<script language=JavaScript>alert('请勾选要转移分类的日记.');history.back()</script>")
dids=split(did,",")
for i=0 to UBound(dids)
  sql="update diary set typeid="&request("zylist")&" where diaryid="&dids(i)
  conn.execute(sql)
next
end if

set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diaryuser where userid="&userid&""
Rs.Open Sql2,conn,1,1
IF Not Rs.Eof Then
money=rs("money")
fenmian=rs("fenmian")
shuyu=rs("shuyu")
name=rs("username")
bookname=rs("bookname")
gongao=rs("gongao")
amount=rs("amount")
showinfo=rs("showinfo")
showbook=rs("showbook")
Musicyesno=rs("musicyesno")
rs.close
sql2="select * from diary where userid="&userid&""
select case request("ms")
case "2"
sql2=sql2&" and display=0"
case "1"
sql2=sql2&" and display=1"
case else
sql2=sql2
end select
if request("list")="qb" or request("list")="" then
sql2=sql2&" order by diaryid desc"
else
sql2=sql2&" and typeid="&request("list")&" order by diaryid desc"
end if
%>
<html>
<head>
<title>我的日记管理列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<link href="../diary/css.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0"  style="background-color=transparent">

<table width="284" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="370" width="284" align="right">
      <table border="0" width="278" id="table8" cellspacing="0" cellpadding="0" height="370">
        <tr> 
          <td height="19" colspan="3">　</td>
        </tr>
        <tr> 
          <td height="25" width="16">　</td>
          <td width="200"><form name="form2" method="post" action="?a=ss" style="margin:0px;">
分类:<select name="list" style="width:80px;height:10px;" onChange="form2.submit()">
<option value="qb" <%if request("list")="qb" or request("list")="" then response.write "selected"%>>全部日记</option>
<%
set rs1=server.CreateObject("adodb.Recordset")
sql22="select * from diarytype where userid="&userid&" order by id"
Rs1.Open Sql22,conn,1,1
do while not rs1.eof
%>
<option value="<%=rs1("id")%>" <%if request("list")=cstr(rs1("id")) then response.write "selected"%>><%=rs1("type")%></option>
<%
rs1.movenext
loop
rs1.close
set rs1=nothing
set sql22=nothing
%>
</select>
<select name="ms" style="width:80px;height:10px;" onChange="form2.submit()">
<option value="0" <%if request("ms")=0 then response.write "selected"%>>全部日记</option>
<option value="1" <%if request("ms")=1 then response.write "selected"%>>分享日记</option>
<option value="2" <%if request("ms")=2 then response.write "selected"%>>私人日记</option>
</select></form>
		  </td>
          <td width="62" align="left">
          </td>
        </tr>
        <tr> 
          <td background="<%=alltubg%>linebg2.gif" colspan="3" height="1"><img border="0" src="<%=alltubg%>linebg2.gif" width="4" height="1"></td>
        </tr>
        <tr valign="top"> 
          <td colspan="3"> 
            <table border="0" width="100%" id="table9" cellspacing="0" cellpadding="0">
              <tr> 
                <td> 
<form name="form1" method="post" action="?a=tranfer" style="margin:0px;">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" id="table10">
                    <tr> 
                      <td align="center" style="font-size: 9pt; font-family: Verdana; color: #000000; letter-spacing: 1pt; word-break: break-all" background="img/bg_line.gif"> 
                        <%
Rs.Open Sql2,conn,3,1
IF Rs.Eof and rs.bof Then
response.Write("<br><font color=FF6600>还没有任何日记！<a href=add.asp target=_parent>填写</a></font><br><br><br><br><br><br>")
else


rs.pagesize=showdiary
maxpage=rs.pagecount
page=clng(request("page"))


if page="" or page=0 then
   page=1
end if
if page>maxpage then
    page=maxpage
end if

rs.absolutepage = page
n=0
do while not rs.eof
xq=rs("xq")
Set rx = Server.CreateObject("ADODB.Recordset")
  sql="select * from xqlist where xqorder="&CInt(xq)
   rx.open sql,conn,3,2
   xq=rx("xqcontent")
   rx.update
   rx.close
%>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0"  id="table11">
                          <tr bordercolor="DDE7AB"> 
                            <td width="2"><input type="checkbox" name="did" value="<%=rs("diaryid")%>">
</td>
                            <td width="45">
			  <%if rs("display")=1 then
			  mi="<font color=#0099CC>开</font>"
			  else
			  mi="<font color=#FF6666>秘</font>"
			  end if%>
							<%=xq%></td>
                            <td width="180"><a target="_blank" href="<%if ishtml="yes" then%><%=diarydir%><%=htmldir%>/riji<%=rs("diaryid")%>.htm<%else%><%=diarydir%>u/play.asp?id=<%=rs("diaryid")%><%end if%>" title="<%= rs("title") %>"> 
                              <font color="#800000"><%= gotTopic(rs("title"),24) %></font></a></td>
							  <td width="10"><%=mi%></td>
                            <td width="20"><img src="<%=alltubg%><%=rs("tq")%>" border="0" align="middle"></td>
                              <td width="30"><a href="edit.asp?diaryid=<%=rs("diaryid")%>" target="_parent"> 
                                <font color="#51300C">改</font></a>&nbsp;<a href="ok.asp?action=del&diaryid=<%=rs("diaryid")%>" onClick="{if(confirm('您真的要删除此日记吗?此操作不可恢复!')){return true;}return false;}" target="_self"><font color="#51300C">删</font></a> 
                              </td>
                          </tr>
                        </table>
                        <%
n=n+1
rs.movenext
if n>=rs.pagesize then exit do    
loop
%>
                        <table width="98%" border="0" cellspacing="0" cellpadding="0" id="table13">
                          <tr> 
                            <td> 
                              <p align="center">
<a href="#" onclick="document.all.zy.style.display='block';">转移</a> <span id="zy" style="display:none;position:absolute;width:200px;left:40px;background:#eee;padding:5px;">

<select name="zylist" style="width:80px;height:10px;">
<%
set rs11=server.CreateObject("adodb.Recordset")
sql222="select * from diarytype where userid="&userid&" order by id"
Rs11.Open Sql222,conn,1,1
do while not rs11.eof
%>	
<option value="<%=rs11("id")%>"><%=rs11("type")%></option>	  
<%
rs11.movenext
loop
rs11.close
set rs11=nothing
set sql222=nothing
%>
</select><input type="submit" name="Submit" value="转移"><input type="button" name="Submit" value="取消" onclick="document.all.zy.style.display='none';">

</span>
                                <%
if cstr(page)=1 then
Response.Write("<font color=#808080>首页&nbsp;上页&nbsp;</font>")
else
if page>1 and page=maxpage then%>
                                <a href="mdiary.asp?page=1"> <font color="#5690BE">首页</font></a> 
                                <a href="mdiary.asp?page=<%=page-1%>"> <font color="#5690BE">上页</font></a> 
                                <%end if%>
                                <% if page<>1 and page<>maxpage then%>
                                <a href="mdiary.asp?page=1"> <font color="#5690BE">首页</font></a><a href="mdiary.asp?page=<%=page-1%>"> 
                                <font color="#5690BE">上页</font></a> 
                                <%end if
end if


if cstr(page)=cstr(rs.pagecount) then%>
                                <font color="#808080">下页</font> <font color="#808080">尾页</font> 
                                <%else%>
                                <%
			if cstr(page)=1 and cstr(page)<>cstr(rs.pagecount) and cstr(rs.pagecount)<>0 then%>
                                <a href="mdiary.asp?page=<%=page+1%>"><font color="#5690BE">下页</font></a> 
                                <a href="mdiary.asp?page=<%=maxpage%>"><font color="#5690BE">尾页</font></a> 
                                <%end if%>
                                <%
			if cstr(page)<>1 and cstr(page)<>cstr(rs.pagecount) and cstr(rs.pagecount)<>0 then%>
                                <a href="mdiary.asp?page=<%=page+1%>" > <font color="#5690BE">下页</font></a> 
                                <a href="mdiary.asp?page=<%=maxpage%>"> <font color="#5690BE">尾页</font></a> 
                                <%end if%>
                                <%end if%>
                                <font color="#5690BE"> 页次:<%=page%>/<%=maxpage%>&nbsp; 
                                &nbsp; </font> 
                            </td>
                          </tr>
                        </table>
                        <%
Rs.Close
Set Rs=Nothing
End IF
else%>
                        <table width="98%" border="0" cellspacing="0" cellpadding="0" id="table14">
                          <tr> 
                            <td align="center" style="font-size: 9pt; font-family: Verdana; color: #000000; letter-spacing: 1pt; word-break: break-all">　</td>
                          </tr>
                        </table>
                        <%
end if
%>
                      </td>
                    </tr>
                  </table></form>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>



