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

📄 product_class_list.asp

📁 多多网店系统v3.01 完全免费可用版-功能简介: 支持多模板皮肤色切换[8套] 支持按商品特性[推荐商品/特价商品/新品分类]浏览 支持按商品类别浏览 支持单件商品用支付宝交易按钮直接支付订
💻 ASP
字号:
<!--#include file="admin_check.asp"-->
<%dim dbpath
dbpath="../"
%>
<!--#include file="../Conn.asp"-->
<!--#include file="../include/MyRequest.asp"-->
<!--#include file="../include/pages.asp"-->
<%
action=my_request("action",0)
select case action
    case "modi"
        call modi()
    case "del"
        call del()
end select

sub modi()
    product_class_name=my_request("product_class_name",0)
    cid      =my_request("nowcid",1)
    
    ErrMsg=""
    if cid="" then
    	FoundErr=True
	    ErrMsg=ErrMsg & "<li>商品类别ID不能为空!</li>"
    end if
    if product_class_name="" then
    	FoundErr=True
	    ErrMsg=ErrMsg & "<li>商品类别名称不能为空!</li>"
    end if
    
    if FoundErr<>True then
        conn.execute ("update product_class set product_class_name='"&product_class_name&"' where cid="&cid)
        call ok("您已成功修改了一条商品类别!","product_class_list.asp")
    else
        call WriteErrMsg(ErrMsg)
    end if
end sub

sub del()
    cid=my_request("cid",1)
    sql = "delete from product_class where cid="&cid
    conn.execute(sql)
    call ok("您已成功删除一条商品类别信息!","product_class_list.asp")
end sub

%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品类别管理</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script language = "JavaScript">   
//全选操作    
function CheckAll(form) {
 for (var i=0;i<form.elements.length;i++) {
 var e = form.elements[i];
 if (e.name != 'chkall') e.checked = form.chkall.checked; 
 }
 }

</script>
<%
action=my_request("action",0)
if action="删除" then
    call del()
end if

//过程:批量删除
sub del()
    cid=my_request("cid",0)
    if cid<>"" then
        pp=ubound(split(cid,","))+1 '判断数组id中共有几维
        for v=1 to pp
            id=request("cid")(v)     
            conn.execute ("delete from [product_class] where cid="&id)
        next
        call ok("所选信息已成功删除!","product_class_list.asp")
    end if
end sub
%>
</head>

<body>
<table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
<tbody class="altbg2">
	<tr>
		<td class="title" width="794" colspan="3">商品类别管理</td>
	</tr>
	<tr>
		<td class="altbg1" width="519">商品类别名称</td>
		<td class="altbg1" width="166">修改提交</td>
		<td class="altbg1" width="109">删除</td>
	</tr>
	<%
    set rs=server.createobject("adodb.recordset")
    sql="select cid,product_class_name from product_class order by cid desc"
    rs.open sql,conn,1,1
    if rs.eof then 
        response.write "<tr><td colspan=3 align=center>目前暂无商品类别信息,<a href=product_class_add.asp>请添加新商品类别!</a></td></tr>"
    else
        rs.PageSize =20 '每页记录条数
        iCount=rs.RecordCount '记录总数
        iPageSize=rs.PageSize
        maxpage=rs.PageCount 
        page=request("page")  
        if Not IsNumeric(page) or page="" then
            page=1
        else
            page=cint(page)
        end if    
        if page<1 then
            page=1
        elseif  page>maxpage then
            page=maxpage
        end if   
        rs.AbsolutePage=Page
        if page=maxpage then
	        x=iCount-(maxpage-1)*iPageSize
        else
	        x=iPageSize
        end if
        i=1
        set cid=rs(0)
        set product_class_name=rs(1)
        while not rs.eof and i<=rs.pagesize
    %>
    <form action="product_class_list.asp" method="post" name="form1">
	<input type="hidden" name="action" value="modi">
	<input type="hidden" name="nowcid" value="<%=cid%>">
   	<tr>
		<td width="519">
		<input type="text" name="product_class_name" size="20" value="<%=product_class_name%>"></td>
		<td width="166"><input type="submit" value="修改保存" name="B6"></td>
		<td width="109"><input type="button" onclick="javascript:location.href='product_class_list.asp?cid=<%=cid%>&action=del';" value="删除" name="B5"></td>
	</tr>
	</form>
	<%
        rs.movenext
        wend
        call PageControl(iCount,maxpage,page)
    end if
    rs.close
    set rs=nothing
    %>
</tbody>
</table>

<p><input type="button" value="商品类别-添加" name="action1" onclick="window.location='Product_Class_Add.asp'"></p>

</body>

</html>

⌨️ 快捷键说明

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