📄 xhxx.asp
字号:
<%
const MaxPerPage=3
dim totalPut
dim CurrentPage
dim TotalPages
dim i
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
sql="select * from quoted where gsid="+cstr(id)+" order by h_ID desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<SCRIPT language=JavaScript>alert('该公司还没有发布行情信息!');"
response.write"this.location.href='company.asp?id="&id&"'</SCRIPT>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
else
currentPage=1
showContent
end if
end if
end if
myrs.close
set myrs=nothing
conn.close
set conn=nothing
sub showContent
%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgcolor=#ffffff>
<TBODY>
<TR>
<TD height=483 valign=top bgcolor="#FFFFFF" align=center><BR>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
<TBODY>
<TR>
<TD class=M><B><IMG align=absMiddle src="images/i.gif" width=18>所有行情信息</B>
</TD>
<TD align=right><%showpage totalput,MaxPerPage,"qouted.asp"%></TD>
</TR>
</TBODY>
</TABLE>
<%do while not rs.eof%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
<TR><TD height="20" colspan="2" background="images/line_gr.gif"></TD></TR>
</TABLE>
<table width="600" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="62" height="20"><font color="navy">产品名称:</font></td>
<td width="140"><font color="red"><b><%=rs("h_name")%></b></font></td>
<td width="62"><font color="navy">商 标:</font></td>
<td width="140"><%if rs("h_shangbiao")<>"" then%><font color="red"><%=rs("h_shangbiao")%></font><%else%>---<%end if%></td>
</tr>
<tr>
<td height="20"><font color="navy">规格型号:</font></td>
<td><%=rs("h_guige")%></td>
<td><font color="navy">参考报价:</font></td>
<td><%if rs("h_price")<>"" then%><font color="red"><%=rs("h_price")%></font><%else%>---<%end if%> <b><font color="navy">元(人民币)</font></b>
</td>
</tr>
<tr>
<td height="20"><font color="navy">产品产地:</font></td>
<td><%=rs("h_chandi")%></td>
<td><font color="navy">产品用途:</font></td>
<td><%if rs("h_yongtu")<>"" then%><%=rs("h_yongtu")%><%else%>---<%end if%></td>
</tr>
<tr>
<td height="20"><font color="navy">点 击 率:</font></td>
<td><font color="#666666"><%=rs("counter")%></font></td>
<td><font color="navy">报价日期:</font></td>
<td><font color="#666666"><%=rs("h_date")%></font> </td>
</tr>
<tr>
<td height="20" valign="top"><font color="navy">产品备注:</font></td>
<td colspan="3" valign="top"><%=rs("h_contect")%></td>
</tr>
</table>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
set rs=nothing
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
<TR><TD colspan="2"><%showpage totalput,MaxPerPage,""%></TD></TR>
</table></TD></TR></TABLE>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
if CurrentPage<2 then
response.write "<table border=0 width=100% cellspacing=0 cellpadding=0>"
response.write "<tr height=20><td colspan=2></td></tr>"
response.write "<tr height=20>"
response.write "<td align=left valign=top>"
response.write "<font color=red><b>共"&n&"页 第"&CurrentPage&"页 "
response.write "共查询到"&totalnumber&" 行情信息</b></font>"
response.write "</td>"
response.write "<td VALIGN=middle align=right >"
response.write "【最前页】【上一页】"
else
response.write "<table border=0 width=100% cellspacing=0 cellpadding=0>"
response.write "<tr height=20><td colspan=2></td></tr>"
response.write "<tr height=25>"
response.write "<td align=left VALIGN=top>"
response.write "<font color=red><b>共"&n&"页 第"&CurrentPage&"页 "
response.write "共查询到"&totalnumber&" 行情信息</b></font>"
response.write "</td>"
response.write "<td VALIGN=center align=right >"
response.write "【<a href="&filename&"?page=1&id="&gsid&">最前页</a>】"
response.write "【<a href="&filename&"?page="&CurrentPage-1&"&id="&gsid&">上一页</a>】"
end if
if n-currentpage<1 then
response.write "【下一页】【最后页】"
else
response.write "【<a href="&filename&"?page="&(CurrentPage+1)&"&id="&gsid&">"
response.write "下一页</a>】【 <a href="&filename&"?page="&n&"&id="&gsid&">最后页</a>】"
end if
response.write "</form>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -