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

📄 admincategorylist.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" -->
<%
action=my_request("action",0)
bid=my_request("bid",1)
bname=my_request("bname",0)
select case action
case "modisave"
call modisave()
case "del"
call del()
case "save"
call save()
case else
end select
%>
<html>

<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>
<SCRIPT language="javascript">
<!--
function checksubmit()
{
 if (document.form1.bname.value == "")        
  {        
    window.alert("请输入大类名称!");        
    document.form1.bname.focus();        
    return (false);}
    document.form2.B1.disabled=true
    document.form2.B1.value="正在保存数据……" 
    }
  //--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--

function checkinfo(id){

    var id;
	if (confirm("确定删除吗?")) {
		    //return true;
		    window.location='AdminCategoryList.asp?bid='+id+'&action=del'
	} 
    else{
      return false;
	}
}

//-->
</SCRIPT>
<body>
<table border="0" width="100%" id="table4" height="40" cellpadding="4" style="border-collapse: collapse">
	<tr>
		<td height="25"><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 background="Image/admin_bg_1.gif" height="25"><font color="#FFFFFF"><b>添加新大类:</b></font></td>
	</tr><form action=AdminCategoryList.asp method=post name=form1 onsubmit="return checksubmit();">
	<tr>
		<td><input type="text" name="bname" size="27"><input name=action value=save type=hidden><input type="checkbox" name="isopen" value="1">是否展开
		<input type="submit" value="提交" name="B1"></td>
	</tr></form>
	<%if action="modi" then
	isopen=my_request("isopen",1)
	%>
	<form action=AdminCategoryList.asp method=post>
	<tr>
		<td>
		<input type="text" name="bname" value="<%=bname%>" size="27" style="color: #FF0000; background-color: #EEEEEE"><input type=hidden name=action value=modisave><input type="hidden" name=bid value=<%=bid%>><input type="checkbox" name="isopen" value="1" <%if isopen=1 then response.write "checked"%>>是否展开
		<input type="submit" value="修改" name="B1"></td>
	</tr></form><%end if%>
</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" colspan="4" background="Image/admin_bg_1.gif" height="25">
		<font color="#FFFFFF"><b>编辑/删除大类:</b></font></td>
	</tr>
	<tr>
	<%
	dim sql,rs,i,bid,bname
	sql="select id,txt_big_class,isopen from big_class order by addtime desc"
    set rs=conn.execute (sql)
	if rs.eof then
	response.write "暂无任何类别"
	else
	i=1
	do while not rs.eof
	set bid=rs(0)
	set bname=rs(1)
	set isopen=rs(2)
	%>
		<td width="30%"><input type="button" onclick="window.location='AdminCategoryList.asp?bid=<%=bid%>&action=modi&bname=<%=bname%>&isopen=<%=isopen%>'" value="修改<%if isopen=1 then response.write "-" else response.write "+"%>" onFocus="this.blur()">
		<input type="button" value="删除" onclick="checkinfo(<%=bid%>);" onFocus="this.blur()"> <—<%=bname%> </td>
	<%
	if i mod 3=0 then
	response.write "</tr>"
	end if
	rs.movenext
	i=i+1
	loop
	rs.close
	set rs=nothing
	end if
	%>
	</table>

</body>

</html>
<%
sub save()
isopen=my_request("isopen",1)
if isopen="" then
isopen=0
end if
conn.execute ("insert into big_class (txt_big_class,isopen) values ('"&bname&"',"&isopen&")")
response.redirect "AdminCategoryList.asp"
end sub

sub del()
conn.execute ("delete from big_class where id="&bid)
response.redirect "AdminCategoryList.asp"
end sub

sub modisave()
isopen=my_request("isopen",1)
if isopen="" then
isopen=0
end if
conn.execute ("update big_class set txt_big_class='"&bname&"',isopen="&isopen&" where id="&bid)
response.redirect "AdminCategoryList.asp"
end sub
%>

⌨️ 快捷键说明

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