📄 admin_smallclass.asp
字号:
<!--
版本:草原二手市场V1.1
本程序作者:mysql QQ:54016224 TEL:13036133798
-->
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="include/access.asp"-->
<%
NSubIndexNO = request("NSubIndexNO")
subname0 = request("subname0")
action = request("action")
BigIndexNO = request("Oselect")
NBigIndexNO = request("NBigIndexNO")
SubIndexNO = request("SubIndexNO")
SubName = request("SubName")
SubNote = request("SubNote")
if action = "add" and subname0 <> ""then
action = "add"
if trim(SubIndexNO) = "" or trim(SubName) = "" or trim(SubNote) = "" then
response.write "<script>alert('请检查 小类编号,小类名,备注是否为空!');history.go(-1);</script>"
response.end
end if
sql = "select * from SubClass where SubIndexNO = '"&SubIndexNO&"'"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.eof then
response.write "<script>alert('小类编号不能重复');</script>"
else
sql = "insert into SubClass (SubIndexNO,BigIndexNO,SubName,SubNote) values ('"&SubIndexNO&"','"&BigIndexNO&"','"&SubName&"','"&SubNote&"')"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
response.write "<script>alert('加入类成功');</script>"
end if
end if
if request("action") = "add" then
action = "add"
submittext = "添加"
else
action = "add"
submittext = "添加"
end if
if request("action") = "delete" then
action = "add"
submittext = "添加"
sql = "select * from SubClass where SubIndexNO = '"&NSubIndexNO&"'"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof or rs.bof then
response.write "<script>alert('该小类编号不存在');</script>"
else
sql = "delete * from SubClass where SubIndexNO = '"&NSubIndexNO&"'"
conn.execute(sql)
response.write "<script>alert('删除成功');</script>"
end if
end if
if request("action") = "edit" and subname0 <> "" then
if trim(SubIndexNO) = "" or trim(SubName) = "" or trim(SubNote) = "" then
response.write "<script>alert('请检查 小类编号,小类名,备注是否为空!');history.go(-1);</script>"
response.end
end if
sql = "select * from SubClass where SubIndexNO = '"&SubIndexNO&"'"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof then
response.write "<script>alert('该小类编号不存在');</script>"
else
sql = "update SubClass set SubIndexNO = '"&SubIndexNO&"',BigIndexNO = '"&BigIndexNO&"',SubName = '"&SubName&"',SubNote = '"&SubNote&"' where SubIndexNO = '"&NSubIndexNO&"'"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
response.write "<script>alert('编辑成功');</script>"
end if
end if
if request("action") = "edit" then
action = "edit"
submittext = "编辑"
else
action = "add"
submittext = "添加"
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=MSThemeCompatible content=Yes>
<LINK href="images/css.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.0" name=GENERATOR>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<BR>
<TABLE cellSpacing=0 cellPadding=1 width=650 align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
<TBODY>
<TR class=m_title>
<TD align=center>小类编号</TD>
<TD align=center>小类名</TD>
<TD align=center>所属大类</TD>
<TD align=center>备注</TD>
<TD align=center>操作</TD>
</TR>
<%
sql = "select * from SubClass order by SubIndexNO asc"
set rs =server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
do while not rs.eof and not rs.bof
if action = "edit" then
if SubIndexNO = rs("SubIndexNO") then
OSubIndexNO = rs("SubIndexNO")
OSubName = rs("SubName")
OSubNote = rs("SubNote")
end if
end if
sql = "select BigName,BigIndexNO from BigClass where BigIndexNO = '"&rs("BigIndexNO")&"'"
set rs0 = conn.execute(sql)
if rs0.eof then
else
BigName = rs0(0)
BigIndexNO = rs0(1)
%>
<TR class=line_1 align="center">
<TD noWrap><a href=?action=edit&SubIndexNO=<%=rs("SubIndexNO")%>><%=rs("SubIndexNO")%></a></TD>
<TD noWrap><%=rs("SubName")%></TD>
<TD noWrap><%=BigName%></TD>
<TD noWrap><%=rs("SubNote")%></TD>
<TD noWrap><a href=?action=edit&SubIndexNO=<%=rs("SubIndexNO")%>&NBigIndexNO=<%=BigIndexNO%>>编辑</a> <a href='?'>添加</a> <a href='?action=delete&NSubIndexNO=<%=rs("SubIndexNO")%>' onclick='return confirm("确认删除?")'>删除</a></TD>
</TR>
<%
end if
rs.movenext
loop
%>
<TR class=line_1>
<form method="post" action="?action=<%=action%>">
<TD align=center><input type="text" name="SubIndexNO" size="10" value="<%=OSubIndexNO%>"><input type="hidden" name="NSubIndexNO" size="10" value="<%=OSubIndexNO%>"></TD>
<TD align=center><input type="text" name="SubName" size="10" value="<%=OSubName%>"></TD>
<TD align=center>
<select name="Oselect">
<%sql = "select * from BigClass"
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
if NBigIndexNO = rs("BigIndexNO") then
%> <option value="<%=rs("BigIndexNO")%>" selected><%=rs("BigName")%></option>
<%
else
%>
<option value="<%=rs("BigIndexNO")%>"><%=rs("BigName")%></option>
<%
end if
rs.movenext
loop
%>
</select>
</TD>
<TD align=center><input type="text" name="SubNote" size="15" value="<%=OSubNote%>"></TD>
<TD align=center><input type="submit" name="subname0" value="<%=submittext%>"></TD>
</form>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<BR><BR>
<TABLE cellSpacing=1 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD align=middle>技术支持:<A
href="http://www.vvcat.com/">http://www.vvcat.com/</A>
</TD>
</TR>
</TBODY>
</TABLE>
<BR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -