Products Search " style="border:1px solid #FFFFFF; height:10px; line-height:10px; width:130px;"/>
Latest News
<%set rs=Server.CreateObject("adodb.recordset") sql="select smallclassname,smallclassid from smallclass_new where bigclassname='Latest news' order by orderid asc,smallclassid asc" sql,conn,1,1 while not rs.eof %> <%rs.movenext wend rs.close set rs=nothing %>
<% dim rs,id,sql1,SmallClassName,keyword id=cInt(Request.QueryString("id")) keyword=CheckStr(SafeRequest("keyword",0)) if id<=0 then sql1="select id,SmallClassName,title,nr from News where BigClassName='latest news' and (Title like '%"&keyword&"%' or Content like '%"&keyword&"%') order by ID desc" smallclassname="Latest news" else dim rs2,sql2 set rs2=Server.CreateObject("adodb.Recordset") sql2="select top 1 SmallClassName from SmallClass_New where SmallClassId="&id sql2,conn,1,1 if rs2.recordcount>0 then smallclassname1=rs2("SmallClassName") SmallClassName=Replace(rs2("SmallClassName"),"'","''") end if rs2.close set rs2=nothing sql1="select id,SmallClassName,title,nr from News where SmallClassName='"&SmallClassName1&"' and (Title like '%"&keyword&"%' or Content like '%"&keyword&"%') order by id desc" end if %>
<% Const MaxPerPage=6 dim totalPut dim CurrentPage dim TotalPages dim j if Not isempty(Request("page")) then currentPage=Cint(Request("page")) else currentPage=1 end if set rs=server.createobject("adodb.recordset") sql1,conn,1,1 if err.number<>0 then response.write "
No records!" end if if rs.eof or rs.bof then Response.Write "

No records!

" 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 showpage totalput,MaxPerPage,"news.asp?keyword="&keyword&"&id="&id&"&" else if (currentPage-1)*MaxPerPage
">
<%i=i+1 if i>=MaxPerPage then Exit Do rs.movenext loop rs.close set rs=nothing %> <%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 if n>1 then Response.Write "
" Response.Write "

" If CurrentPage<2 Then Response.Write " First  Prev  " Else Response.Write " First  " Response.Write " Prev  " End If If n-currentpage<1 Then Response.Write " Next   Last  " Else Response.Write "" Response.Write " Next    Last  " End If Response.Write " Page:"&CurrentPage&"/"&n&" " Response.Write " Total:"&totalnumber&" " Response.Write "  " Response.Write " " end if End Function %>