<!--#include file="conn.asp"-->
<!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=gb2312" />
<title>易卡搜搜索吧_香车美女</title>
<link href="css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/comm.js"></script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #FFFFFF; font-weight: bold; }
-->
</style>
</head>

<body>
<div class="bodyDiv">
	<!--#include file="model_top.asp"-->
	
	<!--#include file="model_daohang.asp"-->
	
    <p><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
          
          <tr>
            <td><%
	sql="select * from class"
	set rs2=conn.execute(sql)
	if not rs2.bof then
	Do While Not rs2.eof
	  if rs2("id")=id then
	     Response.Write("<font color=white size=2>" & rs2("class_name") & "</font> ")
	  else
	     Response.Write("&nbsp;<font size=2 color=white>|&nbsp;<a href=list_girls.asp?classid=" & rs2("id") & ">" &rs2("class_name") & " ")
 	     Response.Write("</a></font>")
	  end if
	  i=i+1
	  rs2.MoveNext
	  Loop
	end if
	rs2.close
	%></td>
          </tr>
          <tr height="5">
            <td height="5"></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td valign="top"><table width="96%" height="205" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr class="font"> 
                                  <td width="514" align="center" valign="top"><table width="100%" height="74" border=0 cellpadding=0 cellspacing=0>
                                    <tbody>
                                      <tr>
                                        <%
Set rs=Server.CreateObject("ADODB.RecordSet")
'判断classid开始
classid=request("classid")
If classid <> "" then
classid = cint(classid)
if err.number <> 0 then 
err.clear
classid = 1
end if
if classid < 1 then 
classid = 1
end if 
else
classid = 1
End if
'判断classid结束
if Request("classid")<>"" then
sql="Select * from pic where picclass=" & classid & " order by id Desc"
else
sql="Select * from pic order by id Desc"
end if


rs.open sql,conn,1,1
rs.pagesize=24  '每页显示数目
num=rs.recordcount
pagenum=rs.pagecount
page=request("page")

if rs.eof and rs.bof then
response.Write("<font size=2>此分类没有作品</font>")
else

'判断页码开始
If page <> "" then
page = cint(page)
if err.number <> 0 then 
err.clear
page = 1
end if
if page < 1 then 
page = 1
end if 

else
page = 1
End if
if page*rs.pagesize > num and not((page-1)*rs.pagesize < num)then 
page=1
end if
'判断页码结束

rs.absolutepage = page 'absolutepage：设置指针指向某页开头
if page<>pagenum then
for i=1 to rs.pagesize
%>
                                        <td colspan="2" align="center" valign=top><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                          <%
	'i=1
	do while not (rs.eof or err)
	if (i mod 6)=1 then
%>
                                          <%				
					response.write "<tr>"
				end if
%>
  <td width=200 height=250 align="center"><table align=left border=0 cellpadding=0 cellspacing=0>
    <tbody>
      <tr>
        <td valign=top><table width="150" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="200" align="center"><table width="136" height="186" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
              <tr>
                <td align="center" valign="middle" bgcolor="#FFFFFF"><table width="130" height="180" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td align="center" valign="middle" bgcolor="C9D0C9"><a target=_blank href="cargirls/picshow.asp?id=<%=rs("id")%>"><img border=0 src="cargirls/uppic/2/<%=rs("picaddress")%>" 
                      width=115 height=165></a></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><div align="center"><font color=#999999><font color="#333333" size=2><%=rs("picname")%></font></font></div></td>
          </tr>
        </table></td>
      </tr>
      <tr> </tr>
    </tbody>
  </table></td>
      <%


				i=i+1

				if i>rs.pagesize then exit do
				rs.moveNext
			loop
			k=(i-1) mod 6

			if not (k=0) then
				response.write "<td colspan="&(6-k)&" width="&(cint(100/6)*(6-k))&">&nbsp;</td>"
				response.write "</tr>"
			end if
							
%>
                                        </table></td>
                                      </tr>
                                      <%
'rs.movenext
next
else
for i=1 to num-(page-1)*rs.pagesize
%>
                                      <tr>
                                        <td valign=top><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <%
	j=1
	do while not (rs.eof or err)
	if (j mod 6)=1 then
%>
                                            <%				
					response.write "<tr>"
				end if
%>
                                          <td width=200 height=250><table width="150" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                              <td height="200" align="center"><table width="136" height="186" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                                                <tr>
                                                  <td align="center" valign="middle" bgcolor="#FFFFFF"><table width="130" height="180" border="0" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                      <td align="center" valign="middle" bgcolor="C9D0C9"><a target=_blank href="cargirls/picshow.asp?id=<%=rs("id")%>"><img border=0 src="cargirls/uppic/2/<%=rs("picaddress")%>" 
                      width=115 height=165></a></td>
                                                    </tr>
                                                  </table></td>
                                                </tr>
                                              </table></td>
                                            </tr>
                                            <tr>
                                              <td><div align="center"><font color=#999999><font color="#333333" size=2><%=rs("picname")%></font></font></div></td>
                                            </tr>
                                          </table></td>
              <%


				j=j+1
				rs.moveNext
				if j>24 then exit do
				'
			loop
			k=(j-1) mod 6

			if not (k=0) then
				response.write "<td colspan="&(4-k)&" width="&(cint(100/4)*(4-k))&">&nbsp;</td>"
				response.write "</tr>"
			end if
%>
                                                                            </table></td>
                                      </tr>
                                      <%
'rs.movenext
next
end if
end if
rs.close
Set rs=nothing
%>
                                    </tbody>
                                  </table></td>
                                </tr>
                                <tr> 
                                  <td valign=top> <table width=96% border=0 align="center" cellpadding=0 cellspacing=0>
                                      <tbody>
                                        <tr> 
                                          <td width=1>&nbsp; </td>
                                          <td align="left"><br>
                                            <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" height="19">
                                              <tr> 
                                                <td> <div align="left" class="font">
                                                  <div align="center"><font color="#333333" size="2">共有 
                                                    <%=num%> 个图片 | <a href=index.asp?page=1&classid=<%=request("classid")%> class="link2">首页</a> 
                                                    | 
                                                    <%if page>1 then%>
                                                    <a href=index.asp?page=<%=page-1%>&classid=<%=request("classid")%> class="link2"> 
                                                    <%end if%>
                                                    上一页</a> | 
                                                    <%if page<pagenum then%>
                                                    <a href=index.asp?page=<%=page+1%>&classid=<%=request("classid")%> class="link2"> 
                                                    <%end if%>
                                                    下一页</a> | <a href=index.asp?page=<%if pagenum=0 then%>1<%else%><%=pagenum%><%end if%>&classid=<%=request("classid")%> class="link2">尾页</a> 
                                                    | 页次：<%=page%>/<%=pagenum%>页 | 共<%=pagenum%>页</font></div>
                                                </div></td>
                                              </tr>
                                            </table>
                                            <br>
                                            <br>                                          </td>
                                        </tr>
                                      </tbody>
                                    </table></td>
                                </tr>
                              </table></td>
                          </tr>
                </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr></table></p>
    <!--#include file="model_bottom.asp"-->
</div>


</body>
</html>
