<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/function.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>收藏夹</title>
<style type="text/css">
BODY {
	scrollbar-face-color:#DDDDDD;
	scrollbar-highlight-color: #cccccc;
	scrollbar-shadow-color: #CCCCCC;
	scrollbar-3dlight-color: #F5F5F5;
	scrollbar-darkshadow-color: #F5F5F5;
	scrollbar-track-color: #F0F0F0;
	scrollbar-arrow-color: #FFFFFF;
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
</style>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled==false)
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;
	 
}

</SCRIPT>
<link href="new/css.CSS" rel="stylesheet" type="text/css" />
</head>
<body>
<%
userid=request("userid")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where userid="&userid&" order by userid desc"
rs.open sql,Conn_User,1,1

username=rs("username")
rs.close
set rs=nothing
%>
<%
myPagesize=10
set rs=server.createobject("adodb.recordset")
rs.open "select * from v where username='"&username&"' order by vid desc",conn_user,1,1 
call myPages(rs,myPagesize)
%>
<%if rs.recordcount=0 then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="25" align="center" bgcolor="f6f6f6"><strong>--- 我的收藏 --- </strong></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
</table>
<table width="100%" height="10"  border="0" cellpadding="5" cellspacing="1" bgcolor="#bcbcbc">
  <tr>
    <td align="center" bgcolor="#FFFFFF"><table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
    </table>
      <font color="#000000">暂时还没有任何收藏</font>
<table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
    </table></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="25" align="center" bgcolor="fafafa"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
</table>
<table width="100%" height="6"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<%else%>
<%line=myPagesize
do while not rs.eof and line>0
%>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="28" align="left" bgcolor="#FFFFFF"><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="50" align="center"><font style='FONT-SIZE: 10px' color="#ff6600">NO.<%=rs("vid")%></font></td>
        <td><font style='FONT-SIZE: 12px' color='<%=rs("titlefontcolor")%>'><%=rs("title")%></font>&nbsp;
		  </td>
        <td align="right">
          <%
	  userid=request("userid")
	
	  if CheckUserLogined()=true then
	  UserNamed=Request.Cookies("asp163")("UserName")
	 
	 set userq=server.createobject("adodb.recordset")
sql="select * from [user] where UserName='"&UserNamed&"' order by userid desc"
userq.open sql,Conn_User,1,1

	  
	  userw=userq("userid")
	 
	  If cint(userw)=cint(userid) then
	  
	  %>
          <a href=vsdel.asp?vid=<%=rs("vid")%>&userid=<%=userid%> onClick="return ConfirmDel();"><img src=user/del.gif border="0"></a>&nbsp;<a href=vmodify.asp?vid=<%=rs("vid")%>&userid=<%=userid%>><img src=user/mody.gif width="27" height="14" border="0"></a>
          <%else
	  end if%>
          <%
	  else
	  end if
	  %></td>
        </tr>
    </table></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
      <td width="1" height="1" bgcolor="#BCBCBC"></td>
 <td height="1" background="user/li_x_02.gif"></td>
      <td width="1" height="1" bgcolor="#BCBCBC"></td>
    </tr>
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="28" align="left" bgcolor="#FFFFFF"><table width="100%" height="10"  border="0" cellpadding="8" cellspacing="0" bgcolor="#bcbcbc">
      <tr>
        <td height="40" bgcolor="#FFFFFF"><a href=<%=rs("content")%> target="_blank"><font style='FONT-SIZE: 12px' color='#003366'><%=rs("content")%></font></a></td>
      </tr>
    </table></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
  	<tr>
      <td width="1" height="1" bgcolor="#BCBCBC"></td>
 <td height="1" background="user/li_x_02.gif"></td>
      <td width="1" height="1" bgcolor="#BCBCBC"></td>
    </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="28" align="center" bgcolor="f6f6f6"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
      <tr>
        <td><font style='FONT-SIZE: 11px' color='#666666'><%=rs("intor")%>......</font></td>
        </tr>
    </table></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
</table>
<table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
 <%rs.movenext
   line=line-1
loop
  end if
  %>
  
<center><%call listpages(mycondition)%></center>
<%

rs.close
set rs=nothing%>

<%sub listpages(mycondition)
	response.write "<table height=22  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		response.write " href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>&nbsp;&nbsp;" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>&nbsp;&nbsp;"
	end if
	'-----------------------------------------------上下页导航
	response.write "&nbsp;</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%><strong></strong>
</body>
</html>
