<!--#include file="top.asp"--><%usertopview%>
<%if userflag26=0 then
response.redirect"ok.asp?action=flag"
end if

if request("action")="save" then
'=============================================
dlxf_sortid=request("dlxf_sortid")
dlxf_name=request("dlxf_name")
dlxf_collection=request("dlxf_collection")

if left(dlxf_collection,7)<>"http://" or len(dlxf_collection)<10 then
errstyle="·对不起，请填写正确收藏地址！"
scripterr
end if

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection where dlxf_yp_id="& session("id")
rs.open sql,conn,1,3
if userflag22<>0 then
if rs.recordcount >= cint(userflag22) then
errstyle="·您是"&vipshow&"，只能上传最多 "&userflag22&" 个收藏地址！"
scripterr
end if
else
errstyle="·对不起，此功能已对"&vipshow&"关闭！"
scripterr
end if

rs.addnew
rs("dlxf_sortid")=dlxf_sortid
rs("dlxf_name")=dlxf_name
rs("dlxf_collection")=dlxf_collection
rs("dlxf_yp_id")=session("id")
rs.update
rs.close
set rs=nothing
response.redirect"my_collection.asp"
'==============================================
elseif request("action")="del" then
conn.execute("delete From dlxf_collection Where dlxf_id="&request("id")&" and dlxf_yp_id="&session("id"))
response.redirect"my_collection.asp?sortid="&request("sortid")&"&page="&request("page")&""
'=============================================
elseif request("action")="px" then

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection where dlxf_id="&request("id")&" and dlxf_yp_id="&session("id")
rs.open sql,conn,1,3
rs("dlxf_date")=now()
rs.update
rs.close
set rs=nothing
response.redirect"my_collection.asp?sortid="&request("sortid")&"&page="&request("page")&""

end if
%>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.dlxf_name.value =="") {
alert("\操作错误，下面是产生错误的可能原因：\n\n·请输入收藏名称")
return false;
}
if( addform.dlxf_collection.value =="") {
alert("\操作错误，下面是产生错误的可能原因：\n\n·请输入收藏地址")
return false;
}
return true;
}
// -->
</script>

<table width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="150" valign=top bgcolor=#efefef>
<!--==============-->
<!--#include file="left.asp"-->
<!--==============-->
</td>
<td width="610" valign=top>
<!--==============-->
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=25>您现在的位置是：我的公文包 > 我的收藏</td></tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor=#6C94D1>
  <tr>
    <td height=25 bgcolor=#6C94D1>　　<font color=white>新增收藏</font></td>
  </tr>
  <tr>
    <td bgcolor=#ffffff height=25>
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<form name="addform" method="post" action="my_collection.asp?action=save" onSubmit="return checkdata()">
  <tr>
    <td align=center height=30><select name="dlxf_sortid">
<option value=0 selected>不分类</option>
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection_sort where dlxf_yp_id="&session("id")&" order by dlxf_date desc"
rs.open sql,conn,1,1
do while not rs.eof%>
<option value=<%=rs("dlxf_id")%>><%=rs("dlxf_collection_sort")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing%></select> <a href=my_collection_sort.asp class=red>新分类</a> 收藏名称 <input name="dlxf_name" type="text" size="10" maxlength="50"> 地址 <input name="dlxf_collection" type="text" size="15" maxlength="50" value="http://"> <input type="submit" name="Submit" value="添加" class="input1"></td>
  </tr>
</form>
</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
  <tr>
    <td height=10></td>
  </tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="1" cellpadding="0"bgcolor=#6C94D1>
  <tr>
    <td height=25 bgcolor=#6C94D1 colspan=2 style="border:1px #6c94d1 solid">　　<font color=white>收藏管理</font></td>
  </tr>
  <tr>
    <td width="19%" valign=top bgcolor="#ffffff">
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #999999 solid"><a href=my_collection.asp class=red>全部收藏</a></td></tr>
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #999999 solid"><a href=my_collection.asp?sortid=0>未分类</a></td></tr>
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection_sort where dlxf_yp_id="&session("id")&" order by dlxf_date desc"
rs.open sql,conn,1,1
do while not rs.eof%>
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #999999 solid"><a href=my_collection.asp?sortid=<%=rs("dlxf_id")%>><%=rs("dlxf_collection_sort")%></a></td></tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
  <tr><td height=10></td></tr>
</table>
<!--======-->
	</td>
    <td width="81%" bgcolor=#ffffff valign=top>
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="5" align=center>
<%set rs=Server.CreateObject("Adodb.Recordset")
if request("sortid")<>"" then
sql="select * from dlxf_collection where dlxf_yp_id="&session("id")&" and dlxf_sortid="&request("sortid")&" order by dlxf_date desc"
else
sql="select * from dlxf_collection where dlxf_yp_id="&session("id")&" order by dlxf_date desc"
end if
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "<tr><td height=194 colspan=6 align=center bgcolor=#ffffff>暂无内容</td></tr>"
else  
'分页的实现 
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
do while not rs.eof and i<listnum%>
<tr>
<td width="80%"><a href=<%=rs("dlxf_collection")%> target=_blank><%=rs("dlxf_name")%></a></td>
<td width="10%" align=center><a href=my_collection.asp?id=<%=rs("dlxf_id")%>&action=px&sortid=<%=request("sortid")%>&page=<%=request("page")%>>排序</a></td>
<td width="10%" align=center><a href=my_collection.asp?id=<%=rs("dlxf_id")%>&action=del&sortid=<%=request("sortid")%>&page=<%=request("page")%>>删除</a></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<%filename="my_collection.asp?sortid="&request("sortid")&""%>
<tr><td colspan=3 align=right bgcolor=#efefef height=20>共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>>|<<</a>
      <a href=<%=filename%>&page=<%=page-1%>><<</a>
      <a href=<%=filename%>&page=<%=page-1%>>[<%=page-1%>]</a>
<%end if%><% if Rs.pagecount=1 then %>
<%else%>[<%=page%>]
<%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>&page=<%=page+1%>>[<%=page+1%>]</a>
      <a href=<%=filename%>&page=<%=page+1%>>>></a>
      <a href=<%=filename%>&page=<%=Rs.pagecount%>>>>|</a>
	  <%end if%></td>
<%end if%></tr>

</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--==============-->
</td>
</tr>
</table>
<!--====== bottom ========-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bottom_bg.gif">
<tr><td height=2 bgcolor=#6C94D1></td></tr>
  <tr>
    <td align="center" height=80><%=citybottom%></td>
  </tr>
</table>
</body>
</html>