<!--#include file="conn.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
	AlarmErrmsg
else
	if DEF_PET_close>1 then
		if dvbbs.master then
			Response.redirect "pet_config_edit.asp#bottom"
		end if
	        call showmessage("管理员正在后台修改宠物设置，请稍候访问^__^~","index.asp")


	end if
    dim allpetpeople,mypetname,mypet,levelpic,mypetlevel,username,relive
    Dim Rs,SQL
    SQL = "SELECT username,mypet,mypetlevel,mypetname,relive FROM mypetdata ORDER BY relive DESC,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")
		relive = rs("relive")
        levelpic = int(mypetlevel/10)
        if levelpic>10 then levelpic=11 end if
    end if
    rs.close
    'if mypetlevel>20 then  '大于20级打开PK
	'connpet.ExeCute("UPDATE mypetdata SET openpk=1 WHERE username='"&Dvbbs.MemberName&"'")
    'end if

    
    SQL = "SELECT COUNT(mypetexp) FROM mypetdata "
    rs.open SQL,connpet,1,3
    allpetpeople = rs(0)
    rs.close
    
%>
<table width="770" 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">  </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%><p></td>
                    </tr><tr><td>宠物等级：<%=mypetlevel%>
                    <p>宠物转生：<%=relive%><p></td>
                    </tr><tr><td>宠物主人：<a href="dispuser.asp?name=<%=username%>"><%=username%></a></td>
                    </tr></table>
		    <BR>
                    <font color="#FF0000"><b>注意，宠物超过20天不喂养，SP为0就会被饿死！</b><br><a href="petitemshop.asp">点这里购买SP药水</a></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>
<% End If :  Set Dv_plus=Nothing : Dvbbs.Footer%>





