⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hover_class_add_small.asp

📁 后台默认管理账号密码:admin 后台主要功能如下:一、系统管理:管理员管理
💻 ASP
字号:
<!--#include file="toptable.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
'=================================
'   良精科技企业管理系统
'   QQ在线客服:65961930 82993936
'   咨询定购Tel:010-81991660
'      asp3721@hotmail.com 
'        www.liangjing.net
'  copyright(c)2001-2008 HoverCms 2007特别版
'=================================
%>
<%
dim Action,BigClassName,SmallClassName,rs,FoundErr,ErrMsg
Action=trim(Request("Action"))
BigClassName=trim(request("BigClassName"))
SmallClassName=trim(request("SmallClassName"))
Smallorder=trim(request("Smallorder"))

sqlBig="select * from Hover_BigClass where BigClassName='" & BigClassName & "'"
Set rsBig= Server.CreateObject("ADODB.Recordset")
rsBig.open sqlBig,conn,1,1
BigClassName=rsBig("BigClassName")
rsBig.close

if Action="Add" then
	if BigClassName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>产品大类名不能为空!</li>"
	end if
	if SmallClassName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>产品小类名不能为空!</li>"
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * from Hover_SmallClass Where BigClassName='" & BigClassName & "' AND SmallClassName='" & SmallClassName & "'",conn,1,3
		if not rs.EOF then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>“" & BigClassName & "”中已经存在产品小类“" & SmallClassName & "”!</li>"
		else
     		rs.addnew
			rs("BigClassName")=BigClassName
    	 	rs("SmallClassName")=SmallClassName
    	 	rs("Smallorder")=Smallorder
     		rs.update
	     	rs.Close
    	 	set rs=Nothing
     		call CloseConn()
			Response.Redirect "Hover_Class.asp"  
		end if
	end if
end if
if FoundErr=True then
	call WriteErrMsg()
else
%>
<script language="JavaScript" type="text/JavaScript">
function checkSmall()
{
  if (document.form2.BigClassName.value=="")
  {
    alert("请先添加大类名称!");
	document.form1.BigClassName.focus();
	return false;
  }

  if (document.form2.SmallClassName.value=="")
  {
    alert("小类名称不能为空!");
	document.form2.SmallClassName.focus();
	return false;
  }
}
</script>
<!-- #include file="Inc/Head.asp" -->
<BR>
			<table width="97%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
				<form name="form2" method="post" action="Hover_Class_Add_Small.asp" onSubmit="return checkSmall()">
					<tr>
		<td class="title" height="25" align="center" colspan="2"><strong>产 品 类 别 设 置</strong></td>
	</tr>
		<tr bgcolor="#999999" class="title"> 
					<td height="25" colspan="2" class="title2">选择您需要更改的产品类别。</td>
				</tr>
	<tr bgcolor="#999999" class="title"> 
					<td height="25" colspan="2" align="center" class="items">添加小类</td>
				</tr>
				<tr class="tdbg"> 
					<td width="466" height="22" align=right bgcolor="#C0C0C0" class="table">所属大类:</td>
					<td width="504" bgcolor="#E3E3E3" class="table"> 
<select name="BigClassName">
<%
dim rsBigClass
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * from Hover_BigClass",conn,1,1
if rsBigClass.bof and rsBigClass.bof then
	response.write "<option>请先添加产品大类</option>"
else
	do while not rsBigClass.eof
		if rsBigClass("BigClassName")=BigClassName then
			response.write "<option value='"& rsBigClass("BigClassName") & "' selected>" & rsBigClass("BigClassName") & "</option>"
		else
			response.write "<option value='"& rsBigClass("BigClassName") & "'>" & rsBigClass("BigClassName") & "</option>"
		end if
		rsBigClass.movenext
	loop
end if
rsBigClass.close
set rsBigClass=nothing
%>
</select>					</td>
				</tr>
				<tr class="tdbg"> 
					<td width="466" height="22" align=right bgcolor="#C0C0C0" class="table">小类名称:</td>
				  <td bgcolor="#E3E3E3" class="table"><input name="SmallClassName" type="text" size="20" maxlength="30" class="input"></td>
				</tr>
				<tr class="tdbg"> 
					<td width="466" height="22" align=right bgcolor="#C0C0C0" class="table">顺序:</td>
				  <td bgcolor="#E3E3E3" class="table"><input name="Smallorder" type="text" class="input" id="Smallorder" size="5" maxlength="5"></td>
				</tr>
				<tr class="tdbg"> 
					<td height="22"  colspan="2" align="center" bgcolor="#E3E3E3" class="table"> <input name="Action" type="hidden" id="Action3" value="Add"><input name="Add" type="submit" class="btn" value=" 添 加 "> </td>
				</tr>
			</form>
</table>

<BR>
<%htmlend%>
<%
end if
call CloseConn()
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -