📄 pro_class.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
'产品类别管理。
Dim iCount,Action
If GetUserGPower<>9999 then '省级用户
Call Msg("您没有权限",1,"")
End if
Action=Trim(request("Action"))
%>
<html>
<head>
<title>产品类别管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = form.chkAll.checked;
}
}
function CheckAdd()
{
if(document.form1.T1.value=="")
{
alert("请填写产品类别名称");
document.form1.T1.focus();
return false;
}
if (document.form1.Purview[1].checked==true){
GetClassPurview();
}
}
function CheckModifyPurview()
{
if (document.form1.Purview[1].checked==true){
GetClassPurview();
}
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>组 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="Pro_Class.asp">产品类别管理</a> | <a href="Pro_Class.asp?Action=Add">添加新类别</a></td>
</tr>
</table>
<%
if Action="Add" then
call AddAdmin()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="ModifyPwd" then
call ModifyPwd()
elseif Action="SaveModifyPwd" then
call SaveModifyPwd()
elseif Action="Del" then
call DelAdmin()
else
call main()
end if
Call CONN_End(Conn)
sub main()
Sql="select * from T_Product_Class Order By Pro_Class_ID"
Call sql_open(Rs,Sql,Conn,1,1)
iCount=Rs.recordcount
%>
<br>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<form name="myform" method="Post" action="Pro_Class.asp" onsubmit="return confirm('确定要删除选中的类别吗?');">
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr align="center" class="title">
<td width="30"><strong>选中</strong></td>
<td width="60" height="22"><strong> 类别名</strong></td>
<td><strong>说明</strong></td>
<td width="150" height="22"><strong> 操 作</strong></td>
</tr>
<%Do While Not Rs.EOF %>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="30"><input name="ID" type="checkbox" id="ID" value="<%=rs("Pro_Class_ID")%>" onclick="unselectall()"></td>
<td><%=Rs("Pro_Class_Name")%></td>
<td><%=Rs("Pro_Class_Info")%></td>
<td width="150">
<%
Response.write "<a href='Pro_Class.asp?Action=ModifyPwd&ID=" & rs("Pro_Class_ID") & "'>修改</a> "
Response.write "<a href='Pro_Class.asp?Action=Del&ID=" & rs("Pro_Class_ID") & "' onClick=""return confirm('确定要删除此类别吗?');"">删除</a>"
%> </td>
</tr>
<%
Rs.MoveNext
loop
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有类别</td>
<td><input name="Action" type="hidden" id="Action" value="Del">
<input name="Submit" type="submit" id="Submit" value="删除选中的产品类别"></td>
</tr>
</table>
</td>
</form></tr></table>
<%
Call Rs_End(Rs)
end sub
sub AddAdmin()
%>
<form method="post" action="Pro_Class.asp" name="form1" onsubmit="javascript:return CheckAdd();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="title">
<td height="22" colspan="2"> <div align="center"><strong>新增产品类别</strong></div></td>
</tr>
<tr class="tdbg">
<td class="tdbg"><strong>类别名: </strong></td>
<td class="tdbg"><input name="Pro_Class_Name" type="text" id="Pro_Class_Name"></td>
</tr>
<tr class="tdbg">
<td width="35%" class="tdbg"><strong>说明:</strong></td>
<td width="65%" class="tdbg"><textarea name="Pro_Class_Info" id="Pro_Class_Info"></textarea></td>
</tr>
<tr>
<td height="40" colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveAdd">
<input type="submit" name="Submit" value=" 添 加 " style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Pro_Class.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%
end sub
sub ModifyPwd()
dim Pro_Class_ID
Pro_Class_ID=trim(Request("ID"))
if Pro_Class_ID="" then
Call Msg("请指定要修改的类别", 1,"")
exit sub
else
Pro_Class_ID=Clng(Pro_Class_ID)
end if
Sql="Select * from T_Product_Class where Pro_Class_ID=" & Pro_Class_ID
Call sql_open(Rs,Sql,Conn,1,3)
If Rs.Bof And Rs.EOF Then
Call Msg("不存在此产品类别", 1,"")
Else
%>
<form method="post" action="Pro_Class.asp" name="form1" onsubmit="javascript:return CheckModifyPwd();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="title">
<td height="22" colspan="2"> <div align="center"><strong>修改产品类别</strong></div></td>
</tr>
<tr>
<td class="tdbg"><strong>类别名: </strong></td>
<td class="tdbg"><input name="Pro_Class_Name" type="text" id="Pro_Class_Name" value="<%=Rs("Pro_Class_Name")%>"></td>
</tr>
<tr class="tdbg">
<td width="35%" class="tdbg"><strong>说明:</strong></td>
<td width="65%" class="tdbg"><textarea name="Pro_Class_Info" id="Pro_Class_Info"><%=Rs("Pro_Class_Info")%></textarea></td>
</tr>
<tr>
<td colspan="2" align="center" class="tdbg"><input name="Pro_Class_ID" type="hidden" id="Pro_Class_ID" value="<%=Rs("Pro_Class_ID")%>">
<input name="Action" type="hidden" id="Action" value="SaveModifyPwd">
<input type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Pro_Class.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%
End If
Call Rs_End(Rs)
End Sub
%>
</body>
</html>
<%
'增加新组
Sub SaveAdd()
dim Pro_Class_Name,Pro_Class_Info
Pro_Class_Name=trim(Request("Pro_Class_Name"))
Pro_Class_Info=Request("Pro_Class_Info")
if Pro_Class_Name="" then
Call Msg("类别名不能为空", 1,"")
end if
Sql="Select * from T_Product_Class where Pro_Class_Name='"&Pro_Class_Name&"'"
Call sql_open(Rs,Sql,Conn,1,3)
if not (rs.bof and rs.EOF) then
Call Msg("数据库中已经存在此类别", 1,"")
Call Rs_End(Rs)
exit sub
end if
rs.addnew
rs("Pro_Class_Name")=Pro_Class_Name
rs("Pro_Class_Info")=Pro_Class_Info
rs.update
Call Rs_End(Rs)
Call main()
end sub
'修改组
sub SaveModifyPwd()
dim Pro_Class_ID,Pro_Class_Name,Pro_Class_Info
Pro_Class_ID=trim(Request("Pro_Class_ID"))
Pro_Class_Name=trim(Request("Pro_Class_Name"))
Pro_Class_Info=Request("Pro_Class_Info")
if Pro_Class_ID="" then
Call Msg("请指定要修改的类别", 1,"")
else
Pro_Class_ID=Clng(Pro_Class_ID)
end if
Sql="Select * from T_Product_Class where Pro_Class_ID=" & Pro_Class_ID
Call sql_open(Rs,Sql,Conn,1,3)
if rs.Bof and rs.EOF then
Call Msg("不存在此类别", 1,"")
Call Rs_End(Rs)
exit sub
end if
rs("Pro_Class_Name")=Pro_Class_Name
rs("Pro_Class_Info")=Pro_Class_Info
rs.update
rs.Close
set rs=Nothing
call main()
end sub
'删除组
sub DelAdmin()
dim Pro_Class_ID
Pro_Class_ID=trim(Request("ID"))
if Pro_Class_ID="" then
Call Msg("请指定类别", 1,"")
exit sub
end if
if instr(Pro_Class_ID,",")>0 then
Pro_Class_ID=replace(Pro_Class_ID," ","")
sql="Select * from T_Product_Class where Pro_Class_ID in (" & Pro_Class_ID & ")"
else
Pro_Class_ID=clng(Pro_Class_ID)
sql="select * from T_Product_Class where Pro_Class_ID=" & Pro_Class_ID
end if
Call sql_open(Rs,Sql,Conn,1,3)
do while not rs.eof
rs.delete
rs.update
rs.movenext
loop
Call Rs_End(Rs)
call main()
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -