<!--#include file="0.asp"--><!--#include file="../../conn/zkconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center"><br>
  <%if request("x")="add" and nohack(request("userlb"))<>"" then
conn.execute("Insert into user_lb(userlb,userid)values('"&nohack(request("userlb"))&"',"&cint(request("userid"))&")")
Response.Write("<script>alert(""添加类别成功"");location.href=""lb.asp"";</script>")
end if 
if request("x")="x" then
         set rs = conn.execute("select id from user_name where name='"&session("www.loogoo.com")&"'")
		userid=rs("id")
	    rs.close
		set rs = conn.execute("select userid from user_lb where id="&Request("id")&"")
		userid2=rs("userid")
	    rs.close
    if userid=userid2 then
         conn.execute("Update user_lb set userlb = '"&nohack(request("userlb"))&"' where id="&cint(request("id"))&"")
         Response.Write("<script>alert(""修改类别成功"");location.href=""lb.asp"";</script>")
    else
		Response.Write("对不起，您不能修改该条类别信息。如有疑问请与网站管理员联系。")
	 end if
end if 
if request("x")="del" then
         set rs = conn.execute("select id from user_name where name='"&session("www.loogoo.com")&"'")
		userid=rs("id")
	    rs.close
		set rs = conn.execute("select userid from user_lb where id="&cint(Request("id"))&"")
		userid2=rs("userid")
	    rs.close
    if userid=userid2 then
         conn.execute("Delete user_lb where id="&cint(request("id"))&"")
         Response.Write("<script>alert(""删除类别成功"");location.href=""lb.asp"";</script>")
    else
		Response.Write("对不起，您不能删除该条类别信息。如有疑问请与网站管理员联系。")
	 end if
end if 
 %>
  <font color="#FF3300" size="3"><strong>&gt;&gt;添加网店产品类别</strong></font> （<font color="#0000ff">注：不要输入空格、单引号等非法字符）</font></p>
<form action="?x=add" method="post" name="form" id="form">
  <div align="center">
    <input name="userlb" type="text" class="wenbenkuang" id="userlb" size="30" maxlength="50">
    <input name="Submit" type="submit" class="go-wenbenkuang" value="添加">
    <% set rs = conn.execute("select id from user_name where name='"&session("www.loogoo.com")&"'")
	 Response.Write "<input type=hidden name=userid value="&rs("id")&">"
	 rs.close%>
  </div>
</form>
<table width="354" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr align="center" valign="middle" bgcolor="#f1f1f1"> 
    <td width="250" height="22">网店产品类别名称</td>
    <td width="50" height="22">修改</td>
    <td width="50" height="22">删除</td>
  </tr>
  <% set rs = conn.execute("select * from user_lb where userid in(select id from user_name where name='"&session("www.loogoo.com")&"') order by id desc")
do while not rs.eof%><form name="form1" method="post" action=?x=x>
  <tr align="center" valign="middle" bgcolor="#FFFFFF"> 
    <td width="250" height="22">
        <input name="userlb" type="text" class="wenbenkuang" id="userlb" value="<%=rs("userlb")%>" size="30" maxlength="50">
        <input name="id" type="hidden" id="id" value="<%=rs("id")%>"> </td>
    <td width="50" height="22">
        <input name="Submit" type="submit" class="go-wenbenkuang" value="修改">
        </td>
    <td width="50" height="22"><a href="?x=del&id=<%=rs("id")%>">删除</a></td>
  </tr></form>
  <%rs.movenext
loop
rs.close
set rs=nothing%>
</table>
</body>
</html>
