%
'---------------------确定是否具有管理价格的权利-------------------------------
dim cls
if session("admin")="" then
Response.Redirect("index.asp?err=4")
else
if session("flag")<>"0" then
cls = Instr(session("flag"), "prod")
if cls <= 0 then
%>
<%
end if
end if
end if
'---------------------确定是否具有管理价格的权利-------------------------------
%>
<%
action=request("action")
if action = "" then
%>
';" value="加价格">
<%
'----------------------------用于点击价格标题栏进行排序的 start-----------------
if Request("Sortname")<>"" then
session("sortname")=Request("Sortname")
else
session("sortname")=session("sortname")
end if
if Request("Sorttype")<>"" then
if Request("Sorttype")="desc" then
session("sorttype")="asc"
else
session("sorttype")="desc"
end if
else
if session("sorttype")<>"" then
session("sorttype")=session("sorttype")
else
session("sorttype")="desc"
end if
end if
'------------------------------------end -----------------------------------
'默认显示价格列
dim rs,msg_per_page
dim sql
msg_per_page = 40 '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
sql = "select * from ProdMain_store where gb='"&gb&"' and ProdId is not null"
'----------------接收价格搜索栏内的值----------------------------
if request("type")<>"" then sql = sql + " and "&trim(request("type"))&" like '%"&trim(request("keyword"))&"%' "
if request("online")<>"" then sql = sql + " and online="&request("online")
'if request("keyword")<>"" then sql= sql+ " and ProdID like '%"&trim(request("keyword"))&"%' or Model like '%"&trim(request("keyword"))&"%'"
if request("remark")="1" then sql = sql+" and remark='1' "
if session("sortname")<>"" then
sql= sql+" order by "&session("sortname")&" "&session("sorttype")
else
sql= sql+" order by prodNum desc" '按照添加日期显示
end if
rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
rs.pagesize = msg_per_page '定义分页记录集每页显示记录?
rs.open sql,conn,1,1
%>
<%
call listPages()
else
end if
'删除价格
if action="del" then
delid=replace(request("id"),"'","")
call proddel()
end if
'单个关闭价格
if action="close" then
ProdNum=replace(request("id")," ","")
call prodclose()
end if
'单个打开价格
if action="open" then
ProdNum=replace(request("id")," ","")
call prodopen()
end if
'修改资料
if action="修改资料" then
call prodadd()
end if
if action="关闭" then
ProdNum=replace(request("id")," ","")
call prodclose()
end if
if action="打开" then
ProdNum=replace(request("id")," ","")
call prodopen()
end if
if action="删除" then
delid=replace(request("id")," ","")
call proddel()
end if
%>
"
else
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from ProdMain_store where ProdNum in ("&ProdNum&")"
rs.open sql,conn,1,3
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if rs.eof and rs.bof then
response.write ""
else
Do while not rs.eof
rs("online")=false
rs.update
rs.movenext
loop
end if
response.write ""
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
end if
end sub
'-------------------------------单个关闭价格结束----------------------------------
%>
<%
'-------------------------------单个打开价格开始----------------------------------
sub prodopen()
if ProdNum="" or isnull(ProdNum) then
Response.write "
"
else
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from ProdMain_store where ProdNum in ("&ProdNum&")"
rs.open sql,conn,1,3
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if rs.eof and rs.bof then
response.write ""
else
Do while not rs.eof
rs("online")=true
rs.update
rs.movenext
loop
end if
response.write ""
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
end if
end sub
'-------------------------------单个打开价格结束----------------------------------
%>
<%function invert(str)
invert=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13)," ")," "," ")
invert=replace(replace(replace(replace(invert,"[img]",""),"[red]",""),"[blue]","")
invert=replace(replace(replace(replace(invert,"[/img]",">"),"[/b]",""),"[/red]",""),"[/blue]","")
end function
%>
<%
'-------------------------------修改价格资料开始----------------------------------
sub prodadd()
'--------------------这些参数是为了修改成功后返回到指定的分类页面-------------------------
page=request("page")
reid=request("reid")
gb=request("gb")
ptype=request("type")
keyword=request("keyword")
if request("add") ="ok" then
if request("xuhao")="" then
response.write ""
response.end
end if
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from ProdMain_store where ProdNum="&reid&""
rs.open sql,conn,1,3
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
rs("ProdId")=Trim(request.form("ProdId"))
rs("ProdName")=Trim(request.form("ProdName"))
rs("Model")=Trim(request.form("Model"))
rs("PriceList")=Trim(request.form("PriceList"))
rs("ProdDisc")=Trim(request.form("ProdDisc"))
rs("ProdLong")=Trim(request.form("ProdLong"))
rs("ProdHeight")=Trim(request.form("ProdHeight"))
rs("ImgPrev")=Trim(request.form("photo"))
rs("gbcode")=trim(request.form("gbcode"))
'rs("LarCode")=larcode
'rs("MidCode")=midcode
'rs("larseq")=LarSeq
'rs("midseq")=MidSeq
rs("ProdWidth")=Trim(request.form("pic2"))
rs("priceorigin")=trim(request.Form("priceorigin"))
rs("ImgPrevWidth")=Trim(request.form("ImgPrevWidth"))
rs("ImgPrevHeight")=Trim(request.form("ImgPrevHeight"))
rs("ProdHeight")=Trim(request.form("ProdHeight"))
rs("ImgFullHeight")=Trim(request.form("ImgFullHeight"))
rs("ImgFull")=Trim(request.form("ImgFull"))
rs("ImgFullWidth")=Trim(request.form("ImgFullWidth"))
rs("MemoSpec")=request.form("content1")
rs("searchtype")=request.Form("searchtype")
rs("Remark")=request.form("Remark")
rs("xuhao")=request.form("xuhao")
rs("ProduceArea")=request.Form("ProduceArea")
rs("quantity")=request.form("quantity")
rs("FileOther")=0
rs("adddate")=date()
rs.update
rs.close
conn.close
set rs=nothing
set conn=nothing
' Response.Redirect"admin_prod_store.asp?action=detail&id="&request.form("ProdId")
if gb="英文版" then
response.write ""
else
response.write ""
end if
end if
else
yuyan=request.form("yuyan")
reid=request("reid")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from ProdMain_store where ProdNum="&reid&" order by ProdNum asc"
rs.open sql,conn,1,3
%>
<%
end if
end sub
'-------------------------------修改价格资料结束----------------------------------
%>
<%
'-------------------------------删除价格资料开始----------------------------------
sub proddel()
if delid="" or isnull(delid) then
Response.write "
"
else
conn.execute("delete from ProdMain_store where ProdNum in ("&delid&")")
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
conn.close
set conn=nothing
Response.write "