<!--#include file="connection.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/plus_check.asp"-->
<!-- #include file="pet_conn.asp" -->
<%

dim menu,savem,rsbank,rssql,chentitle,chenbackasp,stats,errmsg,founderr

chentitle="宠物中心"
Dv_plus.name="petcenter"
Dv_plus.checklogin()
Dvbbs.LoadTemplates("")
Dvbbs.Stats="社区宠物中心"
Dvbbs.Nav()
Dvbbs.Head_var 0,"","宠物中心","petcenter.asp"

if DvBBS.UserId = 0 then

	call AlarmErrmsg
else
    dim allpetpeople,mypetname,mypet,levelpic,mypetlevel,username
    Dim Rs,SQL
	set rs=server.CreateObject("adodb.recordset")
    SQL = "SELECT username,mypet,mypetlevel,mypetname FROM mypetdata ORDER BY mypetexp DESC"
    rs.open sql,conn
    if rs.eof then
        call showmessage("社区还没有宠物啊，抢先去买一个吧~","petshop.asp")
    else
        username = rs("username")
        mypet = rs("mypet")
        mypetlevel = rs("mypetlevel")
        mypetname = rs("mypetname")
        
        levelpic = int(mypetlevel/10)
        if levelpic>10 then levelpic=11 end if
    end if
    rs.close
    
    SQL = "SELECT COUNT(mypetexp) FROM mypetdata "
    rs.open SQL,conn,1,3
    allpetpeople = rs(0)
    rs.close
    
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorder1">
  <tr> 
    <th height="25">&nbsp;</th>
  </tr>
  <tr> 
    <td height="200" valign="top" class=TableBody1>
<table width="98%" border="0" cellspacing="1" cellpadding="5" align="center" class=TBone>
        <tr> 
          <td height=27 align="center" class=tbhead2><b><font class=HeadFont><%=stats%></font></b></td>
        </tr>
        <tr> 
          <td class=tbbg1> 
            <table width="90%"  border="0" align="center" cellpadding="4" cellspacing="4">
              <tr> 
                <td width="34%"> 
                  <div align="center"> 本社区共有 <%=allpetpeople%> 只宠物宝宝<br>
                    <br>
                  </div>
                  <!-- #include file=petnav.asp -->
                </td>
                <td width="66%"> 
                  <div align="center"></div>
                  <div align="center"><font color="#FF0000">&nbsp; </font> 
                    <table width='100%' border='0' cellspacing='2' cellpadding='0'>
                      <tr> 
                        <td colspan='2'> 
                          <div align='center'>宠物明星</div>
                        </td>
                      </tr>
                      <tr> 
                        <td width='41%' rowspan='3'> 
                          <div align='center'><img src='images/pet/<%=mypetname%>/<%=mypetname%><%=levelpic%>.gif'></div>
                        </td>
                        <td width='59%'>宠物名字：<%=mypet%></td>
                      </tr>
                      <tr> 
                        <td>宠物等级：<%=mypetlevel%></td>
                      </tr>
                      <tr> 
                        <td>宠物主人：<a href="dispuser.asp?name=<%=username%>"><%=username%></a></td>
                      </tr>
                    </table>
                    <font color="#FF0000"> </font></div>
                  <div align="center"></div>
                  <div align="center"></div>
                  <div align="center"></div>
                  <div align="center"></div>
                  <div align="center"></div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<% End If :  Set Dv_plus=Nothing : Dvbbs.Footer%>
