?? product_class_list.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 '判斷數(shù)組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>請?zhí)砑有律唐奉悇e!</a></td></tr>"
else
rs.PageSize =20 '每頁記錄條數(shù)
iCount=rs.RecordCount '記錄總數(shù)
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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -