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

if request("action")="save" then
cpsort=trim(request("cpsort"))

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

rs.addnew
rs("dlxf_collection_sort")=cpsort
rs("dlxf_yp_id")=session("id")
rs.update
rs.close
set rs=nothing
response.redirect"my_collection_sort.asp"

'==============================================
elseif request("action")="edit" then

cpsort=trim(request("cpsort"))
if cpsort="" then
errstyle="·对不起，产品分类不能为空"
scripterr
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection_sort where dlxf_id="&request("id")&" and dlxf_yp_id="&session("id")
rs.open sql,conn,1,3

if userflag9=0 then
errstyle="·对不起，此功能已对"&vipshow&"关闭！"
scripterr
end if

rs("dlxf_collection_sort")=cpsort
rs.update
rs.close
set rs=nothing
response.redirect"my_collection_sort.asp"

elseif request("action")="px" then
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_collection_sort 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_sort.asp"

elseif request("action")="del" then
conn.execute("delete From dlxf_collection Where dlxf_sortid="&request("id")&" and dlxf_yp_id="&session("id"))
conn.execute("delete From dlxf_collection_sort Where dlxf_ID="&request("id")&" and dlxf_yp_id="&session("id"))
response.redirect"my_collection_sort.asp"
end if%>

<script language="JavaScript">
<!--
function checkdata() {
if( addform.cpsort.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="90%" border="0" cellspacing="0" cellpadding="0" align=center>
<form name="addform" method="post" action="my_collection_sort.asp?action=save" onSubmit="return checkdata()">
  <tr>
    <td width="30%" align=center height=30>分类名称</td>
	<td width="34%"><input name="cpsort" type="text" size="20" maxlength="20"></td>
	<td width="36%"><input type="submit" name="Submit" value="添 加" class="input1">　<a href=my_collection.asp class=red>添加收藏</a></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 style="border:1px #6c94d1 solid">　　<font color=white>收藏分类管理</font></td>
  </tr>
  <tr>
    <td bgcolor=#ffffff height=25>
<!--======-->
<table width="64%" border="0" cellspacing="0" cellpadding="0" align=center>
<%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
if rs.eof then
response.write"<tr align=center><td height=30>暂无分类</td></tr>"
else
do while not rs.eof%>
<form name="addform1" method="post" action="my_collection_sort.asp?action=edit">
<input name="id" type="hidden" value="<%=rs("dlxf_id")%>">
  <tr align=center>
	<td width="62%" height=30><input name="cpsort" type="text" size="20" maxlength="20" value="<%=rs("dlxf_collection_sort")%>"></td>
	<td width="38%"><input type="submit" name="Submit" value="修 改" class="input1">　<a href=my_collection_sort.asp?id=<%=rs("dlxf_id")%>&action=px>排序</a>　<a href=my_collection_sort.asp?id=<%=rs("dlxf_id")%>&action=del>删除</a></td>
  </tr>
</form>
<%rs.movenext
loop
end if
rs.close
set rs=nothing%>
</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>