?? admin_prod.asp
字號(hào):
<!--#include file="../Comm/subconn.asp"-->
<%
dim cls
if session("admin")="" then
Response.Redirect("admin.asp")
else
if session("flag")<>"0" then
cls = Instr(session("flag"), "prod")
if cls <= 0 then
%>
<script language="javascript">
if (confirm("您的權(quán)限不夠"))
location.href="admin.asp";
else
location.href="quit.asp";
</script>
<%
end if
end if
end if
%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="admin.css" type="text/css">
<title>產(chǎn)品發(fā)布管理</title>
<style type="text/css"><!--
a:link {color: #FFFFFF;text-decoration: none;}
a:visited {color: #FFFFFF;text-decoration: none;}
a:hover {color: #FFFF99;text-decoration: underline;}
.b{color:#cccc99;font-size:10pt;border:dotted 1px}
--></style>
<script language="JavaScript" type="text/JavaScript">
function JM_wu(ob){
ob.style.display="none";
}
function JM_you(ob){
ob.style.display="";
}
function uppic(model,frmname) {
id=document.prodtable.ProdId.value;
if (id=='') {
alert("請(qǐng)先填寫(xiě)編號(hào)");
document.prodtable.ProdId.focus();
return false;}
window.open("upload.asp?uppath=digi&ProdId="+id+model+"&frmname="+frmname,"upload", "left=12, top=12, width=500, height=550, resizable=1,menubar=1,scrollbars=1")
}
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>
<SCRIPT language=javascript src="/jsroot/hugpic.js"></SCRIPT>
</head>
<body topmargin="0" bgcolor="#336699" text=#ffffff>
<!--#include file="top.asp"-->
<table border="0" cellpadding="2" cellspacing="5" style="border-collapse: collapse" bordercolor="#222222" width="772" height="150" bgcolor="#336699" align="center">
<tr><td width=125 valign="top">
<!--#include file="admin_left.asp"-->
</td><td valign="top" width=647>
<table border="1" cellpadding="2" cellspacing="4" style="border-collapse: collapse" bordercolor="#222222" width="100%">
<tr><td>當(dāng)前位置: <a href="admin.asp">網(wǎng)站管理中心</a>--產(chǎn)品管理</td></tr>
<tr><td width="100%" colspan=1>
<%
action = request("action")
if request("search") = "ok" then
if request("online") <> "" then
session("online") = request("online")
else
session("online") = ""
end if
if request("keyword") <> "" then
session("keyword") = request("keyword")
else
session("keyword") = ""
end if
if request("midclass")<>"" then
session("midclass")= request("midclass")
else
session("midclass") = ""
end if
else
end if
if action="" then
%>
<br>
<table width=100% border=0 cellpadding=2 cellspacing=2>
<form action="admin_prod.asp" name="search" method=get><tr><td>類(lèi)別 <select name="midclass">
<option value="" selected>---所有類(lèi)別---</option>
<% Dim a,b,c
'顯示產(chǎn)品類(lèi)別表
set rscls=server.createobject("adodb.recordset")
sqllar="select distinct LarCode,LarSeq,MidCode,midSeq from ProdClass order by LarSeq,MIdSeq "
rscls.Open sqllar,conn,1,1
if rscls.bof and rscls.eof then
response.write "<option selected>-暫無(wú)分類(lèi)-</option>"
else
Do While Not rscls.eof
response.write "<option value='"&rscls("MidCode")&"'>"&rscls("LarCode")&"-"&rscls("MidCode")&"</option>"
rscls.movenext
if rscls.eof then
exit do
end if
loop
end if
rscls.close
set rscls=nothing
%>
</select></td>
<td>關(guān)鍵字 <input type="text" name="keyword" size="10" maxlength="20"></td>
<td><input type="radio" name="online" value="false">離線(xiàn)
<input type="radio" name="online" value="true">在線(xiàn)
<input type="radio" name="online" value="" checked>全部
</td><input type="hidden" name="search" value="ok">
<td><input type="submit" value="搜索"></td></tr>
</form></table>
<hr width="100%" size="1" noshade color=white><br>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkdel(delid){
if(confirm('刪除選定的產(chǎn)品'))
{location.href="admin_prod.asp?action=del&id="+delid;}
}
//-->
</SCRIPT>
<table border="1" style="border-collapse: collapse;border:dotted 1px" bordercolor="#333333" cellpadding=3 width=100%>
<form name=Prodlist action=admin_prod.asp method=post><tr bgcolor="#003366">
<td width=1>選</td>
<td nowrap>編號(hào)(編輯)</td>
<td nowrap>名稱(chēng)(預(yù)覽)</td>
<td nowrap>產(chǎn)品型號(hào)</td>
<td nowrap>大類(lèi)</td>
<td nowrap>中類(lèi)</td>
<td nowrap>上線(xiàn)日期</td>
<td width=16>刪</td>
<td width=16>關(guān)</td></tr>
<%'默認(rèn)顯示產(chǎn)品列表
midclass = session("midclass")
keyword = session("keyword")
online = session("online")
dim rs,msg_per_page
dim sql
msg_per_page = 20 '定義每頁(yè)顯示記錄條數(shù)
set rs = server.createobject("adodb.recordset")
sql = "select * from ProdMain where ProdId is not null"
if online<>"" then sql = sql + " and online="&online
if midclass<>"" then sql = sql + " and MidCode='"&midclass&"'"
if keyword<>"" then sql= sql+ " and ProdName like '%"&keyword&"%' or Model like '%"&keyword&"%'"
sql= sql+" order by AddDate desc" '按照添加日期顯示
rs.cursorlocation = 3 '使用客戶(hù)端游標(biāo),可以使效率提高
rs.pagesize = msg_per_page '定義分頁(yè)記錄集每頁(yè)顯示記錄數(shù)
rs.open sql,conn,1,1
if err.number<>0 then '錯(cuò)誤處理
response.write "<br><br><br>數(shù)據(jù)庫(kù)操作失敗:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '檢測(cè)記錄集是否為空
totalrec = RS.RecordCount 'totalrec:總記錄條數(shù)
if rs.recordcount mod msg_per_page = 0 then '計(jì)算總頁(yè)數(shù),recordcount:數(shù)據(jù)的總記錄數(shù)
n = rs.recordcount\msg_per_page 'n:總頁(yè)數(shù)
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'currentpage:當(dāng)前頁(yè)
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:設(shè)置指針指向某頁(yè)開(kāi)頭
rowcount = rs.pagesize 'pagesize:設(shè)置每一頁(yè)的數(shù)據(jù)記錄數(shù)
dim i
dim k
%>
<%
do while not rs.eof and rowcount>0
response.write "<tr><td class=b><input type='checkbox' value='"&rs("ProdNum")&"' name=id></td><td class=b><a href=""admin_prod.asp?action=detail&id="&rs("ProdId")&""">"&_
rs("ProdId")&"</a></td><td class=b><a href='../prodshow.asp?ProdId="&rs("ProdId")&"' target='blank_'>"&rs("ProdName")&"</a></td><td class=b>"&_
rs("Model")&"</td><td class=b>"&rs("LarCode")&"</td><td class=b>"&rs("MidCode")&"</td><td class=b>"&rs("AddDate")&_
"</td><td class=b align=center>"&_
"<a href=javascript:checkdel('"&rs("ProdNum")&"')>刪</a></td>"
if rs("online")=true then
response.write "<td class=b align=center><a href='admin_prod.asp?action=close&id="&rs("ProdNum")&"'>關(guān)</a></td></tr>"
else
response.write "<td class=b align=center><a href='admin_prod.asp?action=open&id="&rs("ProdNum")&"'><font color=yellow>開(kāi)</font></a></td></tr>"
end if
rowcount=rowcount-1
rs.movenext
loop
else
response.write "<tr><td colspan=9 align=center class=b><BR>無(wú)滿(mǎn)足條件商品<BR><BR></td></tr>"
end if
end if
rs.close
conn.close
set rs=nothing
set coon=nothing
%>
<tr><td colspan=7 class=b>
<input type='checkbox' name=chkall onclick='CheckAll(this.form)'>全選
<input type="submit" name="action" value="刪除" onclick="{if(confirm('該操作不可恢復(fù)!\n\n確定刪除選定的產(chǎn)品?')){this.document.Prodlist.submit();return true;}return false;}">
<input type="submit" name="action" value="關(guān)閉" onclick="{if(confirm('確定關(guān)閉選定的產(chǎn)品在線(xiàn)?')){this.document.Prodlist.submit();return true;}return false;}"> <input type="submit" name="action" value="打開(kāi)" onclick="{if(confirm('確定打開(kāi)選定的產(chǎn)品在線(xiàn)?')){this.document.Prodlist.submit();return true;}return false;}">
</td><td class=b colspan=3>
<input type="button" name="action" onclick="javascript:location.href='admin_prod.asp?action=加商品';" value="加商品">
</td></tr></form></table>
<%call listPages()
else
end if
if action="cls" then
'類(lèi)別管理
call manageclass()
end if
if action="detail" then
'產(chǎn)品詳細(xì)資料
id=request("id")
call proddetail()
end if
if action="del" then
'刪除產(chǎn)品
delid=replace(request("id"),"'","")
call proddel()
end if
if action="close" then
'關(guān)閉產(chǎn)品
ProdNum=replace(request("id")," ","")
call prodclose()
end if
if action="open" then
'打開(kāi)產(chǎn)品
ProdNum=replace(request("id")," ","")
call prodopen()
end if
if action="editclass" then
'編輯類(lèi)別名字
call editclass()
end if
if action="delMidclass" then
'刪除中類(lèi)
call delmidclass()
end if
if action="addMidclass" then
'增加中類(lèi)
call addmidclass()
end if
if action="addLarclass" then
'增加大類(lèi)
call addlarclass()
end if
if action="delLarclass" then
'刪除大類(lèi)
call dellarclass()
end if
if action="加商品" then
call prodadd()
end if
if action="關(guān)閉" then
ProdNum=replace(request("id")," ","")
call prodclose()
end if
if action="打開(kāi)" then
ProdNum=replace(request("id")," ","")
call prodopen()
end if
if action="刪除" then
delid=replace(request("id")," ","")
call proddel()
end if
if action="delother" then
call delother()
end if
if action="SearchType" then
call SearchType()
end if
if action="searchtypedel" then
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -