<!--#include file="Setup.asp"-->
<!--#include file="Pet/PetSetup.asp"-->
<!--#include file="Pet/Inc/Class_PetPurchase.asp"-->
<%
Call Top
if CookieUserName=empty then error("<li>您还未<a href=login.asp>登录</a>社区")

if request("action") = "buy" then

Set PetPurchase=New PetPurchaseClass
With PetPurchase
.PurchaseType="BuyPet"
.Purchase
end with
Set PetPurchase=Nothing    

End if                   

ShowPetTop("宠物商店")

response.write "<form action='PetShop.asp' name='petname' mtehod='post'>"
response.write "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>"
response.write "<tr><td width='74%'>"
response.write "<table width='96%' border='0' align='center' cellpadding='3' cellspacing='1' class='a2'>"
response.write "<tr class=a3>"
response.write "<td width='25%' align='center'>宠物名称</td>"
response.write "<td width='63%' align='center'>宠物介绍</td>"
response.write "<td width='12%' align='center'>购买宠物</td>"
response.write "</tr>"

PetSortSql="SELECT * FROM [PetSort] Order By PetID asc"
Set RsPetSort=ConnPet.Execute(PetSortSql)
Do while not RsPetSort.EOF
PetID=RsPetSort(0)
PetName=RsPetSort(1)
PetFolder=RsPetSort(2)
PetDepartment=RsPetSort(3)
PetAttribute=RsPetSort(4)
PetDescription=RsPetSort(5)
PetDefaultAtk=RsPetSort(6)
PetDefaultDef=RsPetSort(7)
PetPrice=RsPetSort(8)

If PetDefaultAtk=0 then PetDefaultAtk="随机"
If PetDefaultDef=0 then PetDefaultDef="随机"

response.write "<tr class=a3><td align='center'>"
response.write "<img src='Pet/Images/Sort/"&PetFolder&"/"&PetFolder&".gif' width='45' height='45'>"
response.write "<br>"&PetName&"("&PetDepartment&")</td>"
response.write "<td><font color=green>"&PetDescription&"</font>"
response.write "<br>宠物属性:"&PetAttribute
response.write " 攻击力:"&PetDefaultAtk&" 防御力:"&PetDefaultDef
response.write "<br><font color='#FF0000'>出售价格:"&PetPrice&DEF_PointsName&"</font>"
response.write "</td><td align='center'>"
response.write "<input type='radio' name='PetSort' value="&PetID&">选择</td></tr>"
RsPetSort.MoveNext
Loop
response.write "<tr class=a3><td colspan='3' align='right'>"
response.write "<input type='hidden' name='action' value='buy'>"
response.write "<input name='submit' type='submit' value='购买您所选择的宠物'>"
response.write "</td></tr></table></td></tr></table>"
response.write "</form>"

Set RsPetSort=Nothing
ShowPetBottom
htmlend
%>

