<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
		If Request("Class") <> "" Then
			AA = " And Class = '" & Request("Class") & "' "		
		End if
		If Request("Zlb") <> "" Then
			BB = " And Zlb = '" & Request("Zlb") & "' "
		End if
   			SQL = "SELECT * FROM QIANBI WHERE CLASS <> ''" & AA & BB
  			RS.Open SQL,CONN,adOpenKeyset ,adLockReadOnly
					IF RS.RecordCount >0 THEN
	'判断显示的总页数
			RS.MoveLast 
			RECO=RS.RecordCount 
			AA = RECO MOD 10
			IF AA = 0 THEN
			PAGE = INT(RECO/10)
			ELSE
			PAGE = INT(RECO/10)+1
			END IF
			RS.MoveFirst 
				'定位页数
				PageNo = Request("PageNo")
				if PageNo <> "" Then
				
				else
					PageNo=1
				
				End if				
			I = 1
			RS.PageSize = 10	'每页一10条
			RS.AbsolutePage = PageNo
		RowCount = RS.PageSize
		DIM VIEW(10,10)
		FOR M = 1 TO 10
		VIEW(M,4) = "/produce/biyun-s/a-005.jpg"
		NEXT
		Do While Not RS.EOF and RowCount > 0 
			VIEW(I,0) = RS("LB")
			VIEW(I,1) = RS("NO1")
			VIEW(I,2) = RS("DW")
			VIEW(I,3) = RS("BJG")
			VIEW(I,5) = RS("JG")
			VIEW(I,4) = RS("BMTP")
			I = I + 1
			RS.MoveNext
			RowCount = RowCount - 1
			Loop
			RS.Close 

if Request("myplate") <> "" then
tmpfile="\plate\" & Request("myplate") & ".htm"
else
tmpfile="\plate\search_default.htm"	
end if

'读取页面的膜版		
	Const ForReading = 1, ForWriting = 2
	Dim fso, f ,fw
	Set fso = CreateObject("Scripting.FileSystemObject")
	MyPath=Request.ServerVariables ("APPL_PHYSICAL_PATH")
	Set f = fso.OpenTextFile(MyPath & tmpfile, ForReading)
	ReadAllTextFile =  f.ReadAll
	ReadAllTextFile= Replace(ReadAllTextFile,"%TOTAL_PAGE%",PAGE)
	ReadAllTextFile= Replace(ReadAllTextFile,"%CUR%",PageNo)
	ReadAllTextFile= Replace(ReadAllTextFile,"#MY#","sub_default.asp")
	ReadAllTextFile= Replace(ReadAllTextFile,"%zlb%",Request("zlb"))
	ReadAllTextFile= Replace(ReadAllTextFile,"%class%",Request("class"))
	IF INT(PageNo) <=INT(PAGE) AND INT(PageNo+1) <=INT(PAGE) THEN
	ReadAllTextFile= Replace(ReadAllTextFile,"#NEXT#","sub_default.asp?PageNo=" & PageNo+1 & "&search=all&class=" & request("class") & "&Zlb=" & Request("Zlb") & "&myplate=" & Request("myplate"))
	END IF
	IF INT(PageNo) >1 THEN
	ReadAllTextFile= Replace(ReadAllTextFile,"#PREV#","sub_default.asp?PageNo=" & PageNo-1 & "&search=all&class=" & request("class") & "&Zlb=" & Request("Zlb") & "&myplate=" & Request("myplate"))
	END IF
	
		'新闻部分
		FOR K = 1 TO 10
				ReadAllTextFile= Replace(ReadAllTextFile,"%IMG" & K & "%",VIEW(K,4))
				ReadAllTextFile= Replace(ReadAllTextFile,"%25IMG" & K & "%25",VIEW(K,4))
				ReadAllTextFile= Replace(ReadAllTextFile,"%LINK" & K & "%","/sales/detail.asp?id=" & VIEW(K,1) & "")
				ReadAllTextFile= Replace(ReadAllTextFile,"%25LINK" & K & "%25","/sales/detail.asp?id=" & VIEW(K,1) & "")
				ReadAllTextFile= Replace(ReadAllTextFile,"%NAME" & K & "%",VIEW(K,0))
				ReadAllTextFile= Replace(ReadAllTextFile,"%UNIT" & K & "%",VIEW(K,2))
				ReadAllTextFile= Replace(ReadAllTextFile,"%PRICE" & K & "%",VIEW(K,3))
				ReadAllTextFile= Replace(ReadAllTextFile,"%MPRICE" & K & "%",VIEW(K,5))
				ReadAllTextFile= Replace(ReadAllTextFile,"%NO" & K & "%",VIEW(K,1))
		NEXT

		

		'写文件
	
		'Set fw = fso.OpenTextFile(MyPath & "\news\default.htm", ForWriting, True)
		'fw.Write ReadAlltextFile
		'Response.Write ReadAlltextFile
	Response.Write ReadAlltextFile
	CONN.Close 
	Response.End 
			
			
  %> 
      
<%
Else
Response.Redirect ("/")
End if
%>