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

📄 admincategorysmalllist.asp

📁 一个不错的个人商务网站的源码
💻 ASP
字号:
<%dim nowplace
nowplace="category"
dim dbpath
dbpath="../"
%>
<!--#include file="chk.asp"-->
<!--#include file="../db_conn.asp" -->
<!--#include file="../comm/my_request.asp" -->
<!--#include file="../comm/my_lib.asp" -->
<html>
<%
action=my_request("action",0)
bid=my_request("bid",1)
sid=my_request("sid",1)

select case action
case "modisave"
call savemodi()
case "del"
call del()
case "save"
call save()
case else
end select

%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品小类管理</title>
<link href=AdminStyle.css rel=stylesheet type=text/css>
</head>
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from small_class order by addtime desc"
rs.open sql,conn,1,1
%>
<SCRIPT LANGUAGE="JavaScript">
<!--

function checkinfo(){

	if (confirm("确定删除吗?")) {
		    //return true;
    flag=document.form1.sid.value
    window.location="AdminCategorySmallList.asp?action=del&sid="+flag
	} 
    else{
      return false;
	}
}

//-->
</SCRIPT>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("txt_small_class"))%>","<%= trim(rs("iid"))%>","<%= trim(rs("id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form1.sid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form1.sid.options[document.form1.sid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<SCRIPT language="javascript">
<!--
function checksubmit()
{
 if (document.form2.bid.value == "")        
  {        
    window.alert("请选择大类别!");        
    document.form2.bid.focus();        
    return (false);} 
 if (document.form2.smallclass.value == "")        
  {        
    window.alert("请输入小类名称!");        
    document.form2.smallclass.focus();        
    return (false);}
    document.form2.B1.disabled=true
    document.form2.B1.value="正在保存数据……" 
    }
  //--></SCRIPT>
<body>
<table border="0" width="100%" id="table4" height="40" cellpadding="4" style="border-collapse: collapse">
	<tr>
		<td height="30"><b><a href="AdminCategoryList.asp">大类管理</a></b> | <b>
		<a href="AdminCategorySmallList.asp">小类管理</a></b></td>
	</tr>
</table>
<table border="0" width="100%" id="table5" cellpadding="4" style="border:1px solid #183789; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="44" cellspacing="1">
	<tr>
		<td width="100%" colspan="2" background="Image/admin_bg_1.gif" height="25">
		<font color="#FFFFFF"><b>添加新小类:</b></font></td>
	</tr><form action=AdminCategorySmallList.asp method=post name=form2 onsubmit="return checksubmit();">
	<tr>
		<td width="116">所属大类选择:</td>
		<td width="709"><select size="1" name="bid">
		<option>请选择大类名称</option>
		<%sql="select id,txt_big_class from big_class order by addtime"
		set rs=conn.execute (sql)
		do while not rs.eof
		%>
		<option value="<%=rs("id")%>"><%=rs("txt_big_class")%></option>
		<%rs.movenext
		loop
		%>
		
		</select></td>
	</tr>
	<tr>
		<td width="116">新小类名称:</td>
		<td width="709"><input type="text" name="smallclass" size="27"><input type="hidden" name="action" value="save"></td>
	</tr>
	<tr>
		<td width="116"> </td>
		<td width="709">
		<input type="submit" value="提交" name="B1"></td>
	</tr></form>
</table>
<table border="0" width="100%" id="table7" cellspacing="0" cellpadding="0">
	<tr>
		<td height=5></td>
	</tr>
</table>
<table border="0" width="100%" id="table6" cellpadding="4" style="border:1px solid #183789; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" cellspacing="1">
	<tr>
		<td bgcolor="#EEEEEE" background="Image/admin_bg_1.gif" height="25">
		<font color="#FFFFFF"><b>编辑/删除大类:</b></font></td>
	</tr><%if action="modi" then
	set rsb=conn.execute ("select txt_big_class from big_class where id="&bid)
	txt_big_class=rsb(0)
	rsb.close
	set rsb=nothing
	
	set rss=conn.execute ("select txt_small_class from small_class where id="&sid)
	txt_small_class=rss(0)
	rss.close
	set rss=nothing
    %>
	<form action=AdminCategorySmallList.asp method=post>
	<tr>
		<td width="841">大类:<font color="#FF0000"><%=txt_big_class%> </font>小类:<input type="text" name="smallclass" size="27" value="<%=txt_small_class%>" style="color: #FF0000; background-color: #EEEEEE"><input type=hidden name=bid value=<%=bid%>><input name=sid type=hidden value=<%=sid%>><input type=hidden name=action value=modisave>
		<input type="submit" value="修改" name="B4"></td>
	</tr></form><%end if%>
	<form action="AdminCategorySmallList.asp" name="form1" method=post>
	<tr>
		<td width="841"><select size="1" name="bid" onChange="changelocation(document.form1.bid.options[document.form1.bid.selectedIndex].value)">
		<option>≡≡请选择大类≡≡</option>
		<%sql="select id,txt_big_class from big_class order by addtime"
		set rs=conn.execute (sql)
		set id=rs("id")
		set big_class=rs("txt_big_class")
		do while not rs.eof
		%>
		<option value="<%=id%>"><%=big_class%></option>
		<%rs.movenext
		loop
		rs.close
		set rs=nothing
		%>
		
		</select><select name="sid" onChange="change(document.form1.sid.options[document.form1.sid.selectedIndex].value)" style='padding:0; width:147;background-color:#EEEEEE;font-size:12;color:#000000; height:18' size="1"> 
<option selected>≡≡请选择小类≡≡</option></select><input type=hidden name=action value=modi>
		<input type="submit" value="修改选中的小类" name="B2"> 
		<input type="button" value="删除选中的小类" name="B3" onclick="checkinfo();" onFocus="this.blur()"></td>
	</tr></form>
	</table>

</body>

</html>
<%
sub save()
smallclass=my_request("smallclass",0)
conn.execute ("insert into small_class (iid,txt_small_class) values ("&bid&",'"&smallclass&"')")
response.redirect "AdminCategorySmallList.asp"
end sub

sub savemodi()
smallclass=my_request("smallclass",0)
conn.execute ("update small_class set txt_small_class='"&smallclass&"' where id="&sid)
response.redirect "AdminCategorySmallList.asp"
end sub

sub del()
conn.execute ("delete from small_class where id="&sid)
response.redirect "AdminCategorySmallList.asp"
end sub

%>

⌨️ 快捷键说明

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