<!--#include file="Conn.asp"--><%
Checklogin("产品管理")%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理区域</title>
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/js.js"></script>
<script type="text/javascript" src="xheditor-1.1.9/xheditor-1.1.9-zh-cn.min.js"></script>
<script>
$(document).ready(function(){

//var allPlugin={addproduct:{c:'tools_pro',t:'插入产品模板',e:function(){var _this=this;var jTest=$('<div>插入产品模块</div><div><textarea id="xheTestInput" style="width:260px;height:100px;display:none"><h1 class="p1_title"><!--产品名称--></h1><div class="p1_img"><a href="<!--图片地址-->" title="<!--产品名称-->" class="p1_showimg"><img src="<!--图片地址-->" alt="<!--产品名称-->" /></a><span>点击上图查看大图和更多...</span></div><dl class="p1_dl"><dt>型 号：</dt><dd>输入型号</dd></dl><dl class="p1_dl"><dt>品 牌：</dt><dd>输入品牌</dd></dl><dl class="p1_dl"><dt>产 地：</dt><dd>输入产地</dd></dl><dl class="p1_dl"><dt>产品简介：</dt><dd>输入简介</dd></dl><h2 class="p1_title1">产品介绍</h2><div class="p1_content">输入介绍</div><div class="p1_copyright">该<!--产品名称-->产品信息由Taber公司独家提供，严禁转载。</div></textarea></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>');var jTestInput=$('#xheTestInput',jTest),jSave=$('#xheSave',jTest);jSave.click(function(){var cptitle = document.getElementById("cptitle").value,cpimgurl=document.getElementById("cpimgurl").value;if(cptitle==''){alert('请先填写信息标题');return false;}if(cpimgurl==''){alert('请上传缩略图');return false;}_this.loadBookmark();var insertval = jTestInput.val().replace(/<!--产品名称-->/g,document.getElementById("cptitle").value).replace(/<!--图片地址-->/g,document.getElementById("cpimgurl").value);_this.pasteHTML(insertval);_this.hidePanel();return false;});_this.saveBookmark();_this.showDialog(jTest);}}}
$('.txt2').xheditor({
tools:'full',hoverExecDelay:-1,urlBase:'system/',//urlType:'root',//plugins:allPlugin,
upLinkUrl:"upload.asp",upLinkExt:"zip,rar,txt,pdf",
upImgUrl:"upload.asp",upImgExt:"jpg,jpeg,gif,png",
upFlashUrl:"upload.asp",upFlashExt:"swf",
upMediaUrl:"upload.asp",upMediaExt:"wmv,avi,wma,mp3,mid",loadCSS:'css/edit.css'
});
});
</script>
<style>
ul{margin:0;padding:0}ul li{line-height:18px;padding:0;margin:0 0 0 30px}#showhylist{padding:10px 0;height:330px;overflow:auto}
</style>
</head>

<body>
<div id="man_zone">
<%
Act = Request.QueryString("act")

If act = "save" Then



Set reg=New Regexp
reg.Ignorecase=True
reg.Global=True

function sitelink_replace(byval t0,byval t1,byval t2,byval t3)
	If t0="" Or IsNull(t0) Then Exit Function
	dim t4:t4=t0

	reg.pattern="(\<a[^<>]+\>.+?\<\/a\>)|(\<img[^<>]+\>)|(\<h[1-6]+[\s]*\>.+?\<\/h[1-6]+\>)"
	set matches=reg.execute(t4)
	dim i:i=0
	dim myarray()
	if matches.count>0 then
		for each match in matches
			redim preserve myarray(i)
			myarray(i)=mid(match.value,1,len(match.value))
			t4=replace(t4,match.value,"["&i&"]",1,t3)
			i=i+1
		next
	end if
	if i=0 Then
		t0=replace(t0,t1,t2,1,t3)
		sitelink_replace=t0
		'Set reg=Nothing
		exit function
	end if
	t4=replace(t4,t1,t2,1,t3)
	for i=0 to ubound(myarray)
		t4=replace(t4,"["&i&"]",myarray(i),1,t3)
	next
	sitelink_replace=t4
end function


	Set Rs = Server.CreateObject("ADODB.RecordSet")
	setlinkname=""
	setlinktemplate=""
	setlinkreplace=""
	Rs.Open "Select sname,stitle,surl,sreplace,starget From setlink Where sstate>0 Order By sord Desc,id Desc",Conn,1,1
	Do While Not Rs.Bof And Not Rs.Eof
		sname=Rs("sname"):stitle=Rs("stitle"):surl=Rs("surl"):sreplace=Rs("sreplace"):starget=Rs("starget")
		setlinkname=setlinkname & sname &"<|>"
		If starget=0 Then
			setlinktemplate = setlinktemplate & "<a href="""&surl&""" title="""&stitle&""">"&sname&"</a>" & "<|>"
		Else
			setlinktemplate = setlinktemplate & "<a href="""&surl&""" title="""&stitle&""" target=""_blank"">"&sname&"</a>" & "<|>"
		End If
		If sreplace<=0 Then
			setlinkreplace=setlinkreplace & "-1<|>"
		Else
			setlinkreplace=setlinkreplace & sreplace &"<|>"
		End If
	Rs.MoveNext
	Loop	
	Rs.Close

	setlinknameArr=split(setlinkname,"<|>")
	setlinktemplateArr=split(setlinktemplate,"<|>")
	setlinkreplaceArr=split(setlinkreplace,"<|>")



isedit = False
id = Request.Form("id")
If id<>"" And IsNumeric(id) Then isedit = True
cpmc = TextEnCode(Request.Form("cpmc"))
cpxh = TextEnCode(Request.Form("cpxh"))
bzqgg = TextEnCode(Request.Form("bzqgg"))
cptd = TextEnCode(Request.Form("cptd"))
cpkeywords = TextEnCode(Request.Form("cpkeywords"))
cpdescription = TextEnCode(Request.Form("cpdescription"))
gjid = Request.Form("gjid")
ppid = Request.Form("ppid")
yyid = Request.Form("yyid")

hyid = ","
for i=1 to Request.Form("hyid").Count
hyid = hyid & Request.Form("hyid")(i) & ","
Next

cpyd = Request.Form("cpyd")
cpord = Request.Form("cpord")
syxs = Request.Form("syxs")
sypx = Request.Form("sypx")
cpslt = TextEnCode(Request.Form("cpslt"))
qjurl = TextEnCode(Request.Form("qjurl"))
sp = TextEnCode(Request.Form("sp"))
spw = Request.Form("spw")
sph = Request.Form("sph")
cpjj = HTMLEnCode(Request.Form("cpjj"))
xxjs = Request.Form("xxjs")
xxjssetlink = xxjs

	For i=0 To Ubound(setlinknameArr)-1
		xxjssetlink = sitelink_replace(xxjssetlink,setlinknameArr(i),setlinktemplateArr(i),setlinkreplaceArr(i))			
	Next
xxjssetlink=HTMLEnCode(xxjssetlink)

xxjs = HTMLEnCode(xxjs)
xhcs = HTMLEnCode(Request.Form("xhcs"))
bzpz = HTMLEnCode(Request.Form("bzpz"))
xpj = HTMLEnCode(Request.Form("xpj"))


tags = TextEnCode(Request.Form("tags"))

sptype=Request.Form("sptype")
If sptype="" Or Not IsNumeric(sptype) Then sptype=0

If isedit Then
	Rs.Open "Select * From cp Where id="&id,Conn,1,3
	If Not Rs.Bof And Not Rs.Eof Then
		Rs("gjid") = gjid
		Rs("ppid") = ppid
		Rs("yyid") = yyid
		Rs("hyid") = hyid
		Rs("cpxh") = cpxh
		Rs("bzqgg") = bzqgg
		Rs("cptd") = cptd
		Rs("cpmc") = cpmc
		If cpyd<>"" And IsNumeric(cpyd) Then Rs("cpyd") = cpyd
		Rs("cpkeywords") = cpkeywords:Rs("cpdescription") = cpdescription
		If cpord<>"" And IsNumeric(cpord) Then Rs("cpord") = cpord
		Rs("cpslt") = cpslt
		Rs("qjurl") = qjurl
		Rs("sp") = sp
		If spw<>"" And IsNumeric(spw) Then Rs("spw") = spw
		If sph<>"" And IsNumeric(sph) Then Rs("sph") = sph
		Rs("cpjj") = cpjj
		Rs("xxjs") = xxjs
		Rs("xxjssetlink") = xxjssetlink
		Rs("xhcs") = xhcs
		Rs("bzpz") = bzpz
		Rs("xpj") = xpj
		If syxs<>"" And IsNumeric(syxs) Then Rs("syxs") = syxs
		If sypx<>"" And IsNumeric(sypx) Then Rs("sypx") = sypx
		Rs("sptype") = sptype

		Rs("tags") = tags

	Else
		Rs.AddNew
		Rs("gjid") = gjid
		Rs("ppid") = ppid
		Rs("yyid") = yyid
		Rs("hyid") = hyid
		Rs("cpxh") = cpxh
		Rs("bzqgg") = bzqgg
		Rs("cptd") = cptd
		If cpyd<>"" And IsNumeric(cpyd) Then Rs("cpyd") = cpyd Else Rs("cpyd") = 0
		Rs("cpmc") = cpmc:Rs("cpkeywords") = cpkeywords:Rs("cpdescription") = cpdescription
		If cpord<>"" And IsNumeric(cpord) Then Rs("cpord") = cpord
		Rs("cpslt") = cpslt
		Rs("qjurl") = qjurl
		Rs("sp") = sp
		If spw<>"" And IsNumeric(spw) Then Rs("spw") = spw
		If sph<>"" And IsNumeric(sph) Then Rs("sph") = sph
		Rs("cpjj") = cpjj
		Rs("xxjs") = xxjs
		Rs("xxjssetlink") = xxjssetlink
		Rs("xhcs") = xhcs
		Rs("bzpz") = bzpz
		Rs("xpj") = xpj
		Rs("cpstate") = 1
		If syxs="" Or Not IsNumeric(syxs) Then Rs("syxs") = 0
		If sypx="" Or Not IsNumeric(sypx) Then Rs("sypx") = 0
		Rs("tags") = tags

		Rs("sptype") = sptype

	End If
	Rs.Update:Rs.Close:Set Rs=Nothing:Conn.Close:Set Conn=Nothing
	Page = Request.QueryString("Page")
	Keys=Server.UrlEnCode(Request.QueryString("Keys"))
	Ord=Server.UrlEnCode(Request.QueryString("Ord"))
	Response.Redirect "?keys="&Keys&"&Ord="&Ord&"&Page="&Page
Else
	If cpyd = "" Or Not IsNumeric(cpyd) Then cpyd = 0
	If cpord="" Or Not IsNumeric(cpord) Then cpord = 0
	If syxs="" Or Not IsNumeric(syxs) Then syxs = 0
	If sypx="" Or Not IsNumeric(sypx) Then sypx = 0
	If spw="" Or Not IsNumeric(spw) Then spw = 0
	If sph="" Or Not IsNumeric(sph) Then sph = 0

	Conn.Execute("Insert into cp(gjid,ppid,yyid,hyid,cpxh,bzqgg,cptd,cpmc,cpkeywords,cpdescription,cpslt,qjurl,sp,cpjj,xxjs,xxjssetlink,xhcs,bzpz,xpj,cpstate,cpord,cpyd,syxs,sypx,spw,sph,tags,sptype) values("&gjid&","&ppid&","&yyid&",'"&hyid&"','"&cpxh&"','"&bzqgg&"','"&cptd&"','"&cpmc&"','"&cpkeywords&"','"&cpdescription&"','"&cpslt&"','"&qjurl&"','"&sp&"','"&cpjj&"','"&xxjs&"','"& xxjssetlink &"','"&xhcs&"','"&bzpz&"','"&xpj&"',1,"&cpord&","&cpyd&","&syxs&","&sypx&","&spw&","&sph&",'"& tags &"',"& sptype &")")
	Conn.Close:Set Conn=Nothing:Response.Redirect "?"
End If
Conn.Close:Set Conn=Nothing

Response.End
End If 'end save


If Act = "add" Or Act = "edit" Then
id = Request.QueryString("id")
isedit = False
If id<>"" And IsNumeric(id) Then isedit=True
If isedit Then
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Rs.Open "Select * From cp Where id="&id,Conn,1,1
	If Not Rs.Bof And Not Rs.Eof Then
		cp_id=Rs("id")
		cpmc=Rs("cpmc"):cpkeywords=Rs("cpkeywords"):cpdescription=Rs("cpdescription")

		gjid=Rs("gjid")
		ppid=Rs("ppid")
		yyid=Rs("yyid")
		hyid=Rs("hyid")
		cpxh=Rs("cpxh")
		bzqgg=Rs("bzqgg")
		cptd=Rs("cptd")
		cpslt=Rs("cpslt")
		qjurl=Rs("qjurl")
		sp=Rs("sp")
		spw=Rs("spw")
		sph=Rs("sph")
		cpjj=Rs("cpjj")
		xxjs=Rs("xxjs")
		xhcs=Rs("xhcs")
		bzpz=Rs("bzpz")
		xpj=Rs("xpj")
		cpstate=Rs("cpstate")
		cpord=Rs("cpord")
		cpyd=Rs("cpyd")
		syxs=Rs("syxs")
		sypx=Rs("sypx")
		tags=Rs("tags")
		sptype = Rs("sptype")
	Else
		isedit = False
	End If
	Rs.Close:Set Rs=Nothing
End If

Page = Request.QueryString("Page")
Keys=Server.UrlEnCode(Request.QueryString("Keys"))
Ord=Server.UrlEnCode(Request.QueryString("Ord"))
hrefstr = "?keys="&Keys&"&Ord="&Ord&"&Page="&Page
%>
	<form name="form1" method="post" action="<%=hrefstr%>&act=save">
	<table width="100%" border="0" cellpadding="3" cellspacing="1" class="table1">
		<tbody>
			<tr>
				<th width="8%">产品名称</th>
				<td><input type="text" id="cpmc" name="cpmc" value="<%=cpmc%>" class="txt1" /><input type="hidden" name="id" value="<%=id%>" /></td>
			</tr>			<tr>
				<th width="8%">产地</th>
				<td>
					<select name="gjid">
						<option value="0">请选择国家</option>
<%
Set Rs1=Server.CreateObject("ADODB.RecordSet")
Set Rs2=Server.CreateObject("ADODB.RecordSet")
Set Rs3=Server.CreateObject("ADODB.RecordSet")

Rs1.Open "Select id,gjmc From gj Order By id Desc",Conn,1,1
Do While Not Rs1.Bof And Not Rs1.Eof
%>
						<option value="<%=Rs1(0)%>" <%If gjid=Rs1(0) Then Response.Write "Selected=""Selected"""%>><%=Rs1(1)%></option>
<%
Rs1.MoveNext
Loop
Rs1.Close
%>

					</select>
				</td>
			</tr>
			<tr>
				<th width="8%">产品品牌</th>
				<td>
					<select name="ppid">
						<option value="0">请选择产品品牌</option>
<%
Rs1.Open "Select id,ppmc From pp Order By ppord Desc,id Desc",Conn,1,1
Do While Not Rs1.Bof And Not Rs1.Eof
%>
						<option value="<%=Rs1(0)%>" <%If ppid=Rs1(0) Then Response.Write "Selected=""Selected"""%>><%=Rs1(1)%></option>
<%
Rs1.MoveNext
Loop
Rs1.Close
%>

					</select>
				</td>
			</tr>
			<tr>
				<th width="8%">产品应用</th>
				<td>
					<select name="yyid">
						<option value="0">请选择应用</option>
<%
Rs1.Open "Select id,yymc From cpyy  Order By yyord Desc,id Desc",Conn,1,1
Do While Not Rs1.Bof And Not Rs1.Eof
%>
						<option value="<%=Rs1(0)%>" <%If yyid=Rs1(0) Then Response.Write "Selected=""Selected"""%>><%=Rs1(1)%></option><%
Rs1.MoveNext
Loop
Rs1.Close

%>

					</select>
				</td>
			</tr>
			<tr>
				<th width="8%">产品行业</th>
				<td><%
Response.Write "<div id=""showhylist""><ul>"
Rs1.Open "Select id,mc From hy Where js=0 Order By hyord Desc,id",conn,1,1
	Do While Not Rs1.Bof And Not Rs1.Eof
	id=Rs1("id"):mc=Rs1("mc")
%>
	<li><label><input type="checkbox" name="hyid" value="<%=id%>"<%If Instr(hyid,","&id&",")>0 Then Response.Write " checked=""checked"""%> /><%=mc%></label>
<%
		Response.Write "<ul>"
		Rs2.Open "Select id,mc From hy Where js=1 And fid="&id&" Order By hyord Desc,id",conn,1,1
			Do While Not Rs2.Bof And Not Rs2.Eof
			id1=Rs2("id"):mc1=Rs2("mc")
%>
			<li><label><input type="checkbox" name="hyid" value="<%=id1%>"<%If Instr(hyid,","&id1&",")>0 Then Response.Write " checked=""checked"""%> /><%=mc1%></label>
<%
				Response.Write "<ul>"
				Rs3.Open "Select id,mc From hy Where js=2 And fid="&id1&" Order By hyord Desc,id",conn,1,1
					Do While Not Rs3.Bof And Not Rs3.Eof
					id2=Rs3("id"):mc2=Rs3("mc")
%>
					<li><label><input type="checkbox" name="hyid" value="<%=id2%>"<%If Instr(hyid,","&id2&",")>0 Then Response.Write " checked=""checked"""%> /><%=mc2%></label></li>
<%
				Rs3.MoveNext
				Loop
				Rs3.Close
				Response.Write "</ul>"

			Response.Write "</li>"
		Rs2.MoveNext
		Loop
		Rs2.Close
		Response.Write "</ul>"
	Response.Write "</li>"
Rs1.MoveNext
Loop

Rs1.Close

Response.Write "</ul></div>"

Set Rs1=Nothing
Set Rs2=Nothing
Set Rs3=Nothing

Conn.Close:Set Conn=Nothing
%></td>
			</tr>
			<tr>
				<th width="8%">产品型号</th>
				<td><input type="text" id="cpxh" name="cpxh" value="<%=cpxh%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">外形尺寸</th>
				<td><input type="text" id="cpxh" name="bzqgg" value="<%=bzqgg%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">广告语</th>
				<td><input type="text" id="cpxh" name="cptd" value="<%=cptd%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">关键词</th>
				<td><input type="text" id="cpkeywords" name="cpkeywords" value="<%=cpkeywords%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">描述</th>
				<td><input type="text" id="cpdescription" name="cpdescription" value="<%=cpdescription%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">阅读次数</th>
				<td><input type="text" id="cpyd" name="cpyd" value="<%=cpyd%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">排序</th>
				<td><input type="text" id="cpord" name="cpord" value="<%=cpord%>" class="txt1" /></td>
			</tr>
			<tr>
				<th width="8%">缩略图</th>
				<td><input type="text" id="infoimgurl" name="cpslt" value="<%=cpslt%>" class="txt1" style="width:390<%'If isedit Then Response.Write "330" Else Response.Write "390"%>px;float:left;" />
<input type="button" value="上传" class="btn1" onClick="window.open('uploadpic.asp','uploadpic','scroll=no,resizable=no,status=0,width=780,height=400')" style="float:left;margin-left:10px" />
<!--<iframe src="uploadfile.asp" frameborder="0" scrolling="no" style="width:400px;height:22px;float:left;margin-left:10px;"></iframe>-->

<%If isedit Then%><input type="button" value="图组" class="btn1" onClick="location.href='pic1.asp<%=hrefstr%>&cpid=<%=cp_id%>'" style="float:left;margin-left:10px" /><%End If%>
				</td>
			</tr>
			<tr>
				<th width="8%">视频地址</th>
				<td>
<input type="radio" id="sptype1" name="sptype" value="0"<%If sptype<>1 Then Response.Write " checked=""checked"""%> /><label for="sptype1">站内</label> 
<input type="radio" id="sptype2" name="sptype" value="1"<%If sptype=1 Then Response.Write " checked=""checked"""%> /><label for="sptype2">站外链接</label><br />
视频地址：<input type="text" id="sp" name="sp" value="<%=sp%>" class="txt1" style="width:480px" /><br />
视频宽度：<input type="text" id="spw" name="spw" value="<%=spw%>" class="txt1" style="width:80px" /> 视频高度：<input type="text" id="sph" name="sph" value="<%=sph%>" class="txt1" style="width:80px" /></td>
			</tr>
			<tr>
				<th width="8%">首页显示</th>
				<td><label><input type="radio" id="syxs" name="syxs" value="0"<%If syxs<>1 Then Response.Write "checked=""checked"""%> />不显示</label> <label><input type="radio" id="syxs" name="syxs" value="1"<%If syxs=1 Then Response.Write "checked=""checked"""%> />显示</label></td>
			</tr>
			<tr>
				<th width="8%">首页排序</th>
				<td><input type="text" id="sypx" name="sypx" value="<%=sypx%>" class="txt1" /></td>
			</tr>
			<tr>
				<th>标签(|分隔)</th>
				<td><input type="text" id="tags" name="tags" value="<%=tags%>" class="txt1" /></td>
			</tr>
			<tr>
				<th>产品特点</th>
				<td><textarea id="cpjj" name="cpjj" class="txt2"><%=cpjj%></textarea></td>
			</tr>
			<tr>
				<th>详细介绍</th>
				<td><textarea id="xxjs" name="xxjs" class="txt2"><%=xxjs%></textarea></td>
			</tr>
			<tr>
				<th></th>
				<td><input type="submit" name="save" id="save" value="确定" class="btn1" /> <input type="reset" name="save" id="save" value="重置" class="btn1" /> <input type="button" value="返回" class="btn1" onClick="location.href='<%=hrefstr%>'" /></td>
			</tr>
		</tbody>
	</table>
	</form>
</div>
</body>
</html>
<%
Response.End
End If 'End add


If Act="postchk" Then

Keys = Server.UrlEnCode(Request.QueryString("Keys"))
Ord = Server.UrlEnCode(Request.QueryString("Ord"))
Page = Request.QueryString("Page")
chkact = Request.Form("chkact")
SqlStr = ""
For i = 1 To Request.Form("chkbox").Count
	If SqlStr<>"" Then
		SqlStr = SqlStr & " Or id="&Request.Form("chkbox")(i)
	Else
		SqlStr = " Where id="&Request.Form("chkbox")(i)
	End If
Next

Select Case chkact
Case "0":SqlStr = "Update cp Set cpstate="&chkact&SqlStr
Case "1":SqlStr = "Update cp Set cpstate="&chkact&SqlStr
Case Else:SqlStr = "Delete From cp"&SqlStr
End Select

Conn.Execute(SqlStr):Conn.Close:Set Conn=Nothing
Response.Redirect "?Keys="&Keys&"&Ord="&Ord&"&Page="&Page
Response.End
End If	'End postchk


Keys=Request.QueryString("Keys")
Keyscode=TextEnCode(Keys)
Ord=Request.QueryString("Ord")
Page = Request.QueryString("Page")
If Ord="cpmc" Or Ord="cpmc Desc" Or Ord="ppid" Or Ord="ppid Desc" Or Ord="cpslt" Or Ord="cpslt Desc" Or Ord="cpstate" Or Ord="cpstate Desc" Or Ord="cpord" Or Ord="cpord Desc" Then
	OrdStr=Ord&","
Else
	OrdStr=""
End If
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open "Select * From cp Where cpmc like '%"&Keyscode&"%' Order By "&OrdStr&"Id Desc",Conn,1,1
Keys=Server.UrlEnCode(Keys)
Ord=Server.UrlEnCode(Ord)
hrefstr = "?keys="&Keys
%>	
	<form id="form1" method="post" action="?act=postchk&Keys=<%=keys%>&Ord=<%=Ord%>&Page=<%=Page%>" onSubmit="return false" />
	<table width="100%" border="0" cellpadding="3" cellspacing="1" class="table1">
		<thead>
			<tr>
				<th width="4%"><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></th>
				<th width="6%">序号</th>
				<th width="15%"><a href="<%=hrefstr%><%If ord="ppid" Then Response.Write "&ord=ppid+Desc" Else Response.Write "&ord=ppid"%>">品牌名称<%If Ord="ppid" Then Response.Write "↓" Else If Ord="ppid+Desc" Then Response.Write "↑"%></a></th>
				<th width="30%"><a href="<%=hrefstr%><%If ord="cpmc" Then Response.Write "&ord=cpmc+Desc" Else Response.Write "&ord=cpmc"%>">产品名称<%If Ord="cpmc" Then Response.Write "↓" Else If Ord="cpmc+Desc" Then Response.Write "↑"%></a></th>
				<th width="16%">缩略图</th>
				<th width="8%"><a href="<%=hrefstr%><%If ord="cpstate" Then Response.Write "&ord=cpstate+Desc" Else Response.Write "&ord=cpstate"%>">状态<%If Ord="cpstate" Then Response.Write "↓" Else If Ord="cpstate+Desc" Then Response.Write "↑"%></a></th>
				<th width="8%"><a href="<%=hrefstr%><%If ord="cpord" Then Response.Write "&ord=cpord+Desc" Else Response.Write "&ord=cpord"%>">排序<%If Ord="cpord" Then Response.Write "↓" Else If Ord="cpord+Desc" Then Response.Write "↑"%></a></th>
				<th width="13%">操作</th>
			</tr>
		</thead>
		<tbody>

<%
If Not Rs.Bof And Not Rs.Eof Then
	Rs.PageSize = 5
	If Page = "" Then Page = 1
	If Page = "end" Then Page = Rs.PageCount
	If Not IsNumeric(Page) Or Page < 1 Then Page = 1
	Page = Cint(Page)
	If Page > Rs.PageCount Then Page = Rs.PageCount
	Rs.AbsolutePage = Page
	TempNum = Rs.PageSize * (Page - 1)
	
	Set Rs1=Server.CreateObject("ADODB.RecordSet")

	For i=1 To Rs.PageSize
		If Rs.Bof Or Rs.Eof Then Exit For
		TempNum=TempNum+1
%>
			<tr onMouseOver="this.style.background='#F7FCFF'" onMouseOut="this.style.background='#FFFFFF'">
				<td align="center"><input type="checkbox" name="chkbox" value="<%=Rs(0)%>" /></td>
				<td align="center"><%=TempNum%></td>
				<td align="center"><%
Rs1.Open "Select ppmc From pp Where id="&Rs("ppid"),Conn,1,1
If Rs1.Bof Or Rs1.Eof Then
Response.Write "未选择"
Else
Response.Write Rs1(0)
End If
Rs1.Close
%></td>
				<td><%=Rs("cpmc")%></td>
				<td align="center"><%If Rs("cpslt")<>"" Then Response.Write "<img src="""&Rs("cpslt")&""" width=""80"" />" Else Response.Write "暂无"%></td>
				<td align="center"><%If Rs("cpstate")=1 Then Response.Write "显示" Else Response.Write "隐藏" End If%></td>
				<td align="center"><%=Rs("cpord")%></td>
				<td align="center"><a href="?Keys=<%=keys%>&Ord=<%=Ord%>&Page=<%=Page%>&act=edit&id=<%=Rs(0)%>" class="ico_edit">修改</a>
<a href="da1.asp?Keys=<%=keys%>&Ord=<%=Ord%>&Page=<%=Page%>&id=<%=Rs(0)%>&cp=1" class="ico_da">档案</a><!--<br />
<a href="da2.asp?Keys=<%=keys%>&Ord=<%=Ord%>&Page=<%=Page%>&id=<%=Rs(0)%>&cp=1" class="ico_da">相关文献</a>--></td>
			</tr>
<%
		Rs.MoveNext
	Next
Else
	If Keys="" Then
%>
			<tr>
				<td align="center" colspan="8">Sorry，当前暂无产品</td>
			</tr>

<%
	Else
%>
			<tr>
				<td align="center" colspan="8"><a href="?">Sorry，没有找到“<%=Keyscode%>”相关的产品，点击返回</a></td>
			</tr>
<%
	End If
End If
%>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="8">
					<div class="showpagebox">
<%
If Rs.PageCount > 1 Then
	PageName="?Keys="&Keys&"&Ord="&Ord&"&"
	Pagelen=3
	If Page>1 Then
		Response.Write "<a href="""&PageName&"Page=1"">首页</a>"
		Response.Write "<a href="""&PageName&"Page="&Page-1&""">上一页</a>"
	End If

	If Pagelen*2+1 >= Rs.PageCount Then
		StartPage=1:EndPage=Rs.PageCount
	Else
		If Page<=Pagelen+1 Then
			StartPage=1
			EndPage=Pagelen*2+1
		Else
			StartPage=Page-Pagelen
			EndPage=Page+Pagelen
		End If
		If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
	End If

	For i = StartPage To EndPage
		If i = Page Then
			Response.Write "<a class=""current"">"&i&"</a>"
		Else
			Response.Write "<a href="""&PageName&"Page="&i&""">"&i&"</a>"
		End If
	Next

	If Page<Rs.PageCount Then
		If Rs.PageCount - Page > Pagelen Then Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
		Response.Write "<a href="""&PageName&"Page="&Page+1&""">下一页</a>"
		Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">尾页</a>"
	End If

	Response.Write "<input type=""text"" id=""Pagego"" value="""&Page&""" onFocus=""if(this.value == '"&Page&"'){this.value='';}"" onBlur=""if(this.value == ''){this.value='"&Page&"';}"" onKeyUp=""this.value=this.value.replace(/\D/g,'')"" onKeyDown=""if(event.keyCode==13){location.href='"&PageName&"Page='+document.getElementById('Pagego').value}"" />"
End If
%>					</div>
					<div class="searchbox"><input type="text" id="keys" value="<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>" onFocus="if(this.value == '<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>'){this.value='';}" onBlur="if(this.value == ''){this.value='<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>';}" onKeyDown="if(event.keyCode==13){location.href='?Keys='+escape(document.getElementById('keys').value)}" /><input type="button" id="searchgo" value="go" onClick="location.href='?Keys='+escape(document.getElementById('keys').value)" /></div>
					<div class="postchkbox">
						<select id="chkact" name="chkact">
							<option value="1">显示</option>
							<option value="0">隐藏</option>
							<option value="-1">删除</option>
						</select>
						<input type="button" value="执行" onClick="postchk(1)" class="btn1" />
						<input type="button" value="新增" onClick="location.href='?act=add'" class="btn1" />
					</div>
				</td>
			</tr>
		</tfoor>
	</table>
	</form>
<%Rs.Close:Set Rs=Nothing:Set Rs1=Nothing:Conn.Close:Set Conn=Nothing%>
</div>
</body>
</html>
