📄 addprolei.asp
字号:
<!--#include file="cn.asp"-->
<%
if session("admin")="" or request.cookies("timesshop")("admin")="" then
response.Write "<script language='javascript'>alert('请先登录!');window.location.replace('login.asp');</script>"
response.End
end if%>
<html >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
.STYLE1 {
color: #0000FF;
font-weight: bold;
font-size: 18px;
}
.STYLE2 {
font-size: 14px;
font-weight: bold;
}
body,td,th {
font-size: 12px;
}
-->
</style>
</head>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<body>
<%
leis =request.QueryString("leis")
select case leis
case 1
%>
<%ch= request.QueryString("ch")
cname= request.form("name1")
id=request.QueryString("id")
if ch="yes" then
set rs=server.CreateObject("adodb.recordset")
sql="select name from protyp where id ="&id
rs.open sql,cn,1,3
rs("name")=cname
rs.update
rs.close
set rs=nothing
end if
%>
<script language="javascript">
function check()
{
if(document.form1.name.value=='')
{
alert("名称不能为空!")
return false
}
}
</script>
<table width="802" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<Tr>
<td width="798" height="109" valign="top">
<form name="form1" action="addprolei.asp?leis=1" method="post" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="59" colspan="4" align="center" valign="middle"><span class="STYLE1">产品分类添加</span></td>
</tr>
<tr>
<td width="114" height="19" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="219" align="right" valign="top">分类名称:</td>
<td width="204" valign="top"><input name="name" type="text" id="name"></td>
<td width="263" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="21" colspan="4" align="center" valign="top"><input type="submit" name="Submit" value="发布" onClick="return check()">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
<%
cname=trim(request.Form("name"))
if cname <>"" then
set rs1=server.CreateObject("adodb.recordset")
sql1= "select * from protyp "
rs1.open sql1,cn,1,3
rs1.addnew
rs1("name")=cname
rs1.update
rs1.close
set rs1=nothing
end if
%>
<tr>
<td height="44" colspan="4" align="center" valign="bottom"><p class="STYLE2">现有分类</p></td>
</tr>
<tr>
<td height="42" colspan="4" valign="top">
<table width="560" border="1" cellpadding="2" align="center" cellspacing="0">
<!--DWLayoutTable-->
<%
set rs=server.CreateObject("adodb.recordset")
sql= "select name,id from protyp "
rs.open sql,cn,1,1
do while not rs.eof %>
<tr>
<%for i =1 to 8%>
<td width="70" height="18" align="center" valign="top" bgcolor="#EBE9ED">
<a href="changelei.asp?id=<%=rs("id")%>&name=<%=rs("name")%>&leis=1"><%=rs("name")%></a></td>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
<%loop
rs.close
set rs=nothing
%>
</table></td></tr>
</table>
</form> </td> </Tr>
</table>
<%
case 2
ch= request.QueryString("ch")
cname= request.form("name1")
id=request.QueryString("id")
if ch="yes" then
set rs=server.CreateObject("adodb.recordset")
sql="select name from inftyp where id ="&id
rs.open sql,cn,1,3
rs("name")=cname
rs.update
rs.close
set rs=nothing
end if
%>
<script language="javascript">
function check()
{
if(document.form1.name.value=='')
{
alert("名称不能为空!")
return false
}
}
</script>
<body>
<table width="802" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<Tr>
<td width="798" height="109" valign="top">
<form name="form1" action="addprolei.asp?leis=2" method="post" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="59" colspan="4" align="center" valign="middle"><span class="STYLE1">常识信息分类添加</span></td>
</tr>
<tr>
<td width="114" height="26" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="219" align="right" valign="top">分类名称:</td>
<td width="204" valign="top"><input name="name" type="text" id="name"></td>
<td width="263" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="21" colspan="4" align="center" valign="top"><input type="submit" name="Submit" value="发布" onClick="return check()">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
<%dim rs1
cname=trim(request.Form("name"))
if cname <>"" then
set rs1=server.CreateObject("adodb.recordset")
sql1= "select * from inftyp "
rs1.open sql1,cn,1,3
rs1.addnew
rs1("name")=cname
rs1.update
rs1.close
set rs1=nothing
end if
%>
<tr>
<td height="44" colspan="4" align="center" valign="bottom"><p class="STYLE2">现有分类</p></td>
</tr>
<tr>
<td height="42" colspan="4" valign="top">
<table width="560" border="1" cellpadding="2" align="center" cellspacing="0">
<!--DWLayoutTable-->
<%dim rs
set rs=server.CreateObject("adodb.recordset")
sql= "select name,id from inftyp "
rs.open sql,cn,1,1
do while not rs.eof %>
<tr>
<%for i =1 to 8%>
<td width="70" height="18" align="center" valign="top" bgcolor="#EBE9ED">
<a href="changelei.asp?id=<%=rs("id")%>&name=<%=rs("name")%>&leis=2"><%=rs("name")%></a></td>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
<%loop
rs.close
set rs=nothing
%>
</table></td></tr>
</table>
</form> </td> </Tr>
</table>
<%
case 3
ch= request.QueryString("ch")
cname= request.form("name1")
id=request.QueryString("id")
if ch="yes" then
set rs=server.CreateObject("adodb.recordset")
sql="select name from inf1typ where id ="&id
rs.open sql,cn,1,3
rs("name")=cname
rs.update
rs.close
set rs=nothing
end if
%>
<script language="javascript">
function check()
{
if(document.form1.name.value=='')
{
alert("名称不能为空!")
return false
}
}
</script>
<body>
<table width="802" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<Tr>
<td width="798" height="109" valign="top">
<form name="form1" action="addprolei.asp?leis=2" method="post" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="59" colspan="4" align="center" valign="middle"><span class="STYLE1">选购常识分类添加</span></td>
</tr>
<tr>
<td width="114" height="26" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="219" align="right" valign="top">分类名称:</td>
<td width="204" valign="top"><input name="name" type="text" id="name"></td>
<td width="263" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="21" colspan="4" align="center" valign="top"><input type="submit" name="Submit" value="发布" onClick="return check()">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
<%
cname=trim(request.Form("name"))
if cname <>"" then
set rs1=server.CreateObject("adodb.recordset")
sql1= "select * from inf1typ "
rs1.open sql1,cn,1,3
rs1.addnew
rs1("name")=cname
rs1.update
rs1.close
set rs1=nothing
end if
%>
<tr>
<td height="44" colspan="4" align="center" valign="bottom"><p class="STYLE2">现有分类</p></td>
</tr>
<tr>
<td height="42" colspan="4" valign="top">
<table width="560" border="1" cellpadding="2" align="center" cellspacing="0">
<!--DWLayoutTable-->
<%
set rs=server.CreateObject("adodb.recordset")
sql= "select name,id from inf1typ "
rs.open sql,cn,1,1
do while not rs.eof %>
<tr>
<%for i =1 to 8%>
<td width="70" height="18" align="center" valign="top" bgcolor="#EBE9ED">
<a href="changelei.asp?id=<%=rs("id")%>&name=<%=rs("name")%>&leis=2"><%=rs("name")%></a></td>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
<%loop
rs.close
set rs=nothing
%>
</table></td></tr>
</table>
</form> </td> </Tr>
</table>
<%end select%>
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -