function WebContent(DataFrom,ID,SortPath)
dim rs,sql
dim HideSort
set rs = server.createobject("adodb.recordset")
if ID="" then
SortPath="0,"
elseif not IsNumeric(ID) then
response.write "<center>暂无相关信息</center>"
exit function
elseif conn.execute("select * from "&DataFrom&" Where ViewFlag and ID="&ID).eof then
response.write "<center>暂无相关信息</center>"
exit function
else
SortPath=conn.execute("select * from "&DataFrom&" Where ViewFlag and ID="&ID)("SortPath")
conn.execute("update "&DataFrom&" set ClickNumber=ClickNumber+1 Where ID="&ID)
end if
sql="select * from "&DataFrom&" Where not(ViewFlag) and Instr(SortPath,'"&SortPath&"')>0"
rs.open sql,conn,1,1
while not rs.eof
HideSort="and not(Instr(SortPath,'"&rs("SortPath")&"')>0) "&HideSort
rs.movenext
wend
rs.close
dim idCount
dim pages
pages=ProInfo
dim pagec
dim page
page=clng(request("Page"))
dim pagenc
pagenc=3
dim pagenmax
dim pagenmin
dim pageprevious
dim pagenext
datafrom="ew80_Products"
dim datawhere
datawhere="where ViewFlag and Instr(SortPath,'"&SortPath&"')>0 "&HideSort& " "
dim sqlid
dim Myself,PATH_INFO,QUERY_STRING
PATH_INFO = request.servervariables("PATH_INFO")
QUERY_STRING = request.ServerVariables("QUERY_STRING")'
if QUERY_STRING = "" then
Myself = PATH_INFO & "?"
elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
Myself= PATH_INFO & "?" & QUERY_STRING & "&"
else
Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
end if
dim taxis
taxis="order by ProductNo "
dim i
sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
idCount=rs("idCount")
if(idcount>0) then
if(idcount mod pages=0)then
pagec=int(idcount/pages)
else
pagec=int(idcount/pages)+1
end if
sql="select id from ["& datafrom &"] " & datawhere & taxis
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
rs.pagesize = pages
if page < 1 then page = 1
if page > pagec then page = pagec
if pagec > 0 then rs.absolutepage = page
for i=1 to rs.pagesize
if rs.eof then exit for
if(i=1)then
sqlid=rs("id")
else
sqlid=sqlid &","&rs("id")
end if
rs.movenext
next
end if
if(idcount>0 and sqlid<>"") then
sql="select * from ["& datafrom &"] where id in("& sqlid &") order by ProductNo "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
dim tr,td
dim ProductName,SmallPicPath,Content
Response.Write "<table border=""0"" cellpadding=""0"" cellspacing=""0"">"&VbCrLf
for tr=1 to 8
Response.Write " <tr>"&VbCrLf
for td=1 to 2
if StrLen(rs("ProductName"))<=18 then
ProductName=rs("ProductName")
else
ProductName=StrLeft(rs("ProductName"),16)
end If
If ISHTML = 1 Then
AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "ProductView.asp?ID="&rs("ID")&""
End If
SmallPicPath=HtmlSmallPic(rs("GroupID"),rs("SmallPic"),rs("Exclusive"))
Response.Write " <td width=""25""></td>"&VbCrLf
Response.Write " <td ><table cellpadding=""2"" cellspacing=""0"" >"&VbCrLf
Response.Write " <tr>"&VbCrLf
Response.Write " <td bgcolor=""#ffffff"" border: 1px solid #ccc; width:350px; height:250px; text-align:center;""><a href="""&AutoLink&""" title="""&rs("ProductName")&"""><img src="""&SmallPicPath&""" onload=""javascript:DrawImage(this,350,250);"" "&rs("ProductName")&""" border=""0"" /></a></td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
Response.Write " <tr>"&VbCrLf
Response.Write " <td height:28px; text-align:center""><a href="""&AutoLink&""" title="""&rs("ProductName")&""">"&ProductName&"</a></td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
Response.Write " <tr>"&VbCrLf
Response.Write " <td height:28px; text-align:center""><a href="""&AutoLink&""" title="""&rs("ProductName")&""">规格:"&rs("ProductModel")&"</a></td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
Response.Write " </table></td>"&VbCrLf
rs.movenext
if rs.eof then exit for
next
Response.Write " </tr>"&VbCrLf
if rs.eof then exit for
next
Response.Write "</table>"&VbCrLf
else
response.write "<center>暂无相关信息</center>"
exit function
end if
Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
Response.Write " <tr height=""35"">"&VbCrLf
Response.Write " <td align=""center"">"&VbCrLf
Response.Write "共<strong color:red"">"&idcount&"</strong>条记录 页次:<strong color:red"">"&page&"</strong>/"&pagec&" 每页:<strong color:red"">"&pages&"</strong>条记录" & vbCrLf
pagenmin=page-pagenc
pagenmax=page+pagenc
if(pagenmin<1) then pagenmin=1
If ISHTML = 1 Then
If ID = "" Then
if(page>1) then response.write ("<a href="""&ProSortName&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
Else
if(page>1) then response.write ("<a href="""&ProSortName&""&Separated&""&ID&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
End If
Else
if(page>1) then response.write ("<a href="""& myself &"Page=1"" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
End If
if page-(pagenc*1+1)<=0 then
pageprevious=1
else
pageprevious=page-(pagenc*1+1)
end If
If ISHTML = 1 Then
If ID = "" Then
if(pagenmin>1) then response.write ("<a href="""&ProSortName&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
Else
if(pagenmin>1) then response.write ("<a href="""&ProSortName&""&Separated&""&ID&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
End If
Else
if(pagenmin>1) then response.write ("<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
End If
if(pagenmax>pagec) then pagenmax=pagec
for i = pagenmin to pagenmax
if(i=page) then
response.write (" <strong color:red"">"& i &"</strong> ")
Else
If ISHTML = 1 Then
If ID = "" Then
response.write ("[<a href="""&ProSortName&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
Else
response.write ("[<a href="""&ProSortName&""&Separated&""&ID&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
End If
Else
response.write ("[<a href="""& myself &"Page="&i&""">"& i &"</a>]")
End If
end if
next
if page+(pagenc*1+1)>=pagec then
pagenext=pagec
else
pagenext=page+(pagenc*1+1)
end If
If ISHTML = 1 Then
If ID = "" Then
if(pagenmax<pagec) then response.write (" <a href="""&ProSortName&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
if(page<pagec) then response.write (" <a href="""&ProSortName&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
Else
if(pagenmax<pagec) then response.write (" <a href="""&ProSortName&""&Separated&""&ID&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
if(page<pagec) then response.write (" <a href="""&ProSortName&""&Separated&""&ID&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
End If
Else
if(pagenmax<pagec) then response.write (" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
if(page<pagec) then response.write (" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
End If
Response.Write " </td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
Response.Write "</table>"&VbCrLf
rs.close
set rs=nothing
end function
%>