<!--#include file="d_pass.asp" -->
<%
if request("a")="c" then
conn.execute("insert into [style](title,px)values('"&request("title")&"',"&request("px")&")")
response.Redirect("style.asp")
end if 
if request("a")="b" then
sql="update [style] set title='"&request("title")&"',px="&request("px")&" where id="&request("id")
'response.Write(sql)
'response.end 
conn.execute(sql)
response.Redirect("style.asp")
end if 
if request("del")<>"" then
conn.execute("delete from style whre id="&request("del"))
response.Redirect("style.asp")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>风格设置</title>
<link href="images/main.css" rel="stylesheet" type="text/css" />
</head>

<body>

<table width="616" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
    <td colspan="5" align="center"><strong>自定义风格管理</strong></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
  sql="select  * from [style] order by px asc"
  rs.open sql,conn,1
  if rs.eof or rs.bof then 
   response.Write("<tr><td colspan=5 align=center>没有记录</td></tr>")
  end if 
  while not rs.eof 
  %>
  <form name="form1" method="post" action="?a=b">
  <tr>
    <td width="96" height="32" align="center" class="td1"><%=rs("id")%></td>
    <td width="258" align="center" class="td1"><input type="hidden" name="id" value="<%=rs("id")%>" id="id">
      <input type="text" name="title"  value="<%=rs("title")%>" id="title"></td>
    <td width="93" align="center" class="td1"><input name="px" value="<%=rs("px")%>" type="text" id="px" size="8"></td>
    <td width="82" align="center" class="td1"><input name="button" type="submit" class="button" id="button" value="修 改"></td>
    <td width="81" align="center" class="td1"><input name="button2" type="button" class="button" id="button2" value="删 除"></td>
  </tr>
  </form>
    <%
  rs.movenext
  wend 
    px=rs.RecordCount
	px=px+1
  rs.close
  set rs=nothing 
  %>
</table>
<br>
<form name="form2" method="post" action="?a=c">
  <table width="616" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      <td colspan="5" align="center" class="td1"><strong>风格添加</strong></td>
    </tr>
说明：
自定义图标对应文件夹：images\kflogo</br>
在线图标和离线图标格式为：gif</br>
在线图标名为：h1 离线图标名为：h2</br>
    <tr>
      <td width="76" align="center" class="td1">名称：</td>
      <td width="224" align="center" class="td1"><input type="text" name="title" id="title"></td>
      <td width="67" align="center" class="td1">排序</td>
      <td width="121" align="center" class="td1"><input name="px" type="text" id="px" value="<%=px%>" size="8"></td>
      <td width="122" align="center" class="td1"><input name="button3" type="submit" class="button" id="button3" value="添 加"></td>
    </tr>
  </table>
</form>
</body>
</html>

