<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_popfun.asp -->
<!-- #include file=pet_conn.asp -->
<!--#include file=pet_config.asp-->
<%
DEF_BBS_HomeUrl = "../../"
dim menu,savem,rsbank,rssql,chentitle,chenbackasp,stats,errmsg,founderr

chentitle="宠物中心"
chenbackasp="petcenter.asp"
stats="社区宠物中心"
BBS_SiteHead DEF_SiteNameString&" "&DEF_BBS_Name,GBL_board_ID,"&nbsp;>>&nbsp;" & chentitle

if GBL_CHK_User="" then
	AlarmErrmsg
else
    dim allpetpeople,mypetname,mypet,levelpic,mypetlevel,username
    Dim Rs,SQL
    SQL = "SELECT username,mypet,mypetlevel,mypetname FROM mypetdata ORDER BY mypetexp DESC"
    set rs = connpet.execute(SQL)
    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,connpet,1,3
    allpetpeople = rs(0)
    rs.close
    
%>
<% If GBL_TableHeadString <> "" Then %><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableHeadString%></td></tr></table><% End If %>
<table width="<%=DEF_BBS_ScreenWidth%>" 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="../../User/LookUserinfo.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>
<% If GBL_TableBottomString <> "" Then %><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><% End If %>
<%    
end if

SiteBottom 
If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString
%>