<!--#include file="Top.asp" -->
<%
GetErrInfo=" 【提示：这里可以收藏你的网址!除了后台管理员和您之外，不会有第三者看到您所收藏的网址！】"
Dim url,Title,id
IF Request.Form("add")="ok" Then
	Url=trim(Replace(Request.form("Url"),"'",""))
	Title=trim(Replace(request.form("Title"),"'",""))
	SET RS=CONN.EXECUTE("Select ID From [Tb_Favorites] Where User_ID="&Session("UserID")&" And Url='"& Url &"'")
	IF Rs.Eof Then
		If Url="" or Title="" then
			GetErrInfo=" <div class=""err""> 【操作失败提示:对不起,网址,标题不能为空!】</div>"
		ELSE
			Conn.Execute("INSERT INTO [Tb_Favorites] ( [User_ID],[Title],[Url]) VALUES ("&Session("UserID")&",'"&Title&"','"&Url&"')")
			GetErrInfo=" <div class=""doen""> 【操作成功提示:收藏网址成功!】</div>"
		END IF
	Else
		GetErrInfo=" <div class=""err""> 【操作失败提示:此网址你已藏!】</div>"
	End IF
	Rs.Close:Set Rs=Nothing
End If
IF request.form("del")="ok" then
	ID=REPLACE(REQUEST.FORM("ID"),"'","")
	CONN.EXECUTE("Delete from tb_Favorites where User_ID="&Session("UserID")&" AND id in("&ID&")")
	GetErrInfo=" <div class=""doen""> 【操作成功提示:删除网址成功!】</div>"
End if
%>
<script language="javascript" src="../inc/js.js"></script>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr> 
    <td height="30" bgcolor="#FFFFFF" class="h1"><img src="img/GuestBook.gif" width="23" height="21"> 
      网址收藏 
      <hr size="0"></td>
  </tr>
  <tr> 
    <td valign="top" bgcolor="#FFFFFF" class="h1"> <table width="100%" border="0" cellspacing="0" cellpadding="10">
        <tr> 
          <td class="box"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="2%" valign="middle"><img src="img/3.gif" width="16" height="16"></td>
                <td width="98%" valign="middle"><%=GetErrInfo%></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <form name="form" method="post" action="Url_Favorites.asp">
        <table width="100%" border="0" cellpadding="6" cellspacing="0" class="box2">
          <tr class="boxx"> 
            <td width="16%"> <div align="center">网址:</div></td>
            <td width="84%" height="26" colspan="4"> <div align="left"> 
                <input name="Url" type="text" id="Url" value="<%=request.QueryString("url")%>" size="60">
              </div></td>
          </tr>
          <tr class="boxx"> 
            <td> <div align="center">标题:</div></td>
            <td height="26" colspan="4"> <div align="left"> 
                <input name="Title" type="text" id="Title" value="<%=request.QueryString("title")%>" size="60" maxlength="50">
              </div></td>
          </tr>
          <tr class="boxx"> 
            <td>&nbsp;</td>
            <td height="26" colspan="4"> <input name="Submit2" type="submit" id="Submit2" value="收藏"> 
              <input name="add" type="hidden" id="add2" value="ok"></td>
          </tr>
        </table>
      </form>
      <table width="100%" border="0" cellpadding="2" cellspacing="1" class="box2">
        <tr bgcolor="#CCCCCC"> 
          <td width="42" height="20"><img src="img/page.gif" width="20" height="20"></td>
          <td width="104"><strong>标题</strong></td>
          <td width="719"><strong>网址</strong></td>
        </tr>
        <form name="form1" method="post" action="Url_Favorites.asp">
          <%
dim wherestr,Blog_Class,sqlstr,pages,sql,rscount,Blog_List
wherestr="where User_ID="&Session("UserID")
sqlstr="select ID,ClassCode,Title,Url from Tb_Favorites "&wherestr&" order by id desc"
Set rs = Server.CreateObject("Adodb.RecordSet")
rs.open sqlstr,Conn, 1, 1

If rs.eof Then
	response.write("<tr><td height=25 colspan=3><div align=center>对不起,您还没有收藏任何网址!!</div></td></tr>")
	RsCount=0
	MaxP=1
	Rs.Close:Set Rs=nothing
Else
	Rs.PageSize = 15
	MaxP=rs.PageCount
	rs.AbsolutePage=CblogObj.QueryPage
	RsCount=Rs.RecordCount
	Blog_List = Rs.GetRows(15)
	Rs.Close:Set Rs=nothing
for iii=0 to Ubound(Blog_List,2)
%>
          <tr class="tr2" onmouseover="this.className='tr1'" onmouseout="this.className='tr2'"> 
            <td><input name="ID" type="checkbox" id="ID" value="<%=Blog_List(0,iii)%>"></td>
            <td><strong><a href="<%=Blog_List(3,iii)%>" target="_blank"><%=Blog_List(2,iii)%></a></strong></td>
            <td> <strong><a href="<%=Blog_List(3,iii)%>" target="_blank"><%=Blog_List(3,iii)%></a></strong></td>
          </tr>
          <%
Next
End IF
%>
          <tr class="tr2"> 
            <td height="30" colspan="3"><div align="center"> 
                <INPUT name="all" type="button" onclick="CheckAll(this.form)" value="全选">
                <INPUT name="sall" type="button" onclick="CheckOthers(this.form)" value="反选">
                <input name="Submit" type="reset" value="重选">
                <INPUT name="subimt" type="submit" onClick="return ConfirmDel();" value="删除">
                <input name="del" type="hidden" id="del2" value="ok">
              </div></td>
          </tr>
        </form>
        <tr class="tr2"> 
          <td height="30" colspan="3"> 
            <%CblogObj.PageList RsCount,CblogObj.QueryPage,15,20,false%>
          </td>
        </tr>
      </table>
	  
	  
	  
    </td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr bgcolor="#0066CC" height="2"> 
    <td height="2"></td>
  </tr>
</table>


<!--#include file="Foot.asp" -->
