⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checksheep.asp

📁 宁波娱乐在线城市,丰富的内容版块
💻 ASP
字号:
<!--#include file="../inc/conn2.asp"-->
<% 
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
		Response.Write("对不起,您不是社区用户,请先注册!")
        Response.End
end if

Response.Buffer=True 
response.expires = 0 
response.expiresabsolute = now() - 1
response.addHeader "pragma","no-cache" 
response.addHeader "cache-control","private" 
Response.cachecontrol = "no-cache"
%>
<%
sql="Select * from [sheep] where NC='"&Request.Cookies("NC")&"'"  
set rs=conn.Execute(sql)
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="Vbscript">
msgbox"你还没有饲养宠物或你的宠物已经死亡!",0,"提示"
history.back
</script>
<%end if%>

<%
sheepname=rs("sheepname")
if sheepname="" or len(sheepname)="" then
rs.close
set rs=nothing
%>
<script language="Vbscript">
msgbox"宠物的名字填写不正确!",0,"提示"
history.back
</script>
<%end if%>

<%
sql="select * from [sheep] where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"  
set rs=conn.Execute(sql)
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="Vbscript">
msgbox"您不是这只宠物的主人!",0,"提示"
history.back
</script>
<%end if%>

<%
sql="select * from [rules]"  
set rs=conn.Execute(sql)
dellifeday=rs("dellifeday")
rs.close
set rs=nothing


sql="select * from [sheep] where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"  
set rs=conn.Execute(sql)
logintoday=rs("logintoday")
feeddate=rs("feeddate")
life=rs("life")
hungry=rs("hungry")
clean=rs("clean")
sheephappy=rs("sheephappy")
sheephealth=rs("sheephealth")
rs.close
set rs=nothing
if datediff("d",logintoday,date)<>0 then
tempdatetoday=date
conn.execute"update [sheep] set logintoday='"&tempdatetoday&"' where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"
temptime=datediff("d",feeddate,date)

templife=life-dellifeday*temptime/2
if templife<0 then
templife=0
end if
temphungry=hungry-dellifeday*temptime/2
if temphungry<0 then
temphungry=0
end if
tempclean=clean-dellifeday*temptime/2
if tempclean<0 then
tempclean=0
end if
tempsheephappy=sheephappy-dellifeday*temptime/2
if tempsheephappy<0 then
tempsheephappy=0
end if
tempsheephealth=sheephealth-dellifeday*temptime/2
if tempsheephealth<0 then
tempsheephealth=0
end if

'conn.execute"update sheep set clean='"&tempclean&"',sheephappy='"&tempsheephappy&"',sheephealth='"&tempsheephealth&"',hungry='"&temphungry&"' where sheepname='"&sheepname&"' and id="&tempid&" and username='"&membername&"'"
conn.execute"update [sheep] set life='"&templife&"',hungry='"&temphungry&"',clean='"&tempclean&"',sheephappy='"&tempsheephappy&"',sheephealth='"&tempsheephealth&"' where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"
end if

sql="select * from [sheep] where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"
set rs=conn.Execute(sql)
if rs("life")<=0 or rs("clean")<=0 or rs("sheephappy")<=0 or rs("sheephealth")<=0 or rs("hungry")<=0 then
conn.execute"delete * from [sheep] where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'"
conn.close
set conn=nothing
%>
<script language="vbscript">
msgbox"由于您没有精心照顾宠物!您的宠物已经死了,重新再养一只吧。",0,"flush"
history.back
</script>
<%
else
sql="select * from [sheep] where sheepname='"&sheepname&"' and NC='"&Request.Cookies("NC")&"'" 
set rs=conn.Execute(sql)
%>

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>饲养宠物</title>
<link rel="stylesheet" type="text/css" href="keker.css">
<style type="text/css">
<!--
td {  font-family: "宋体"; font-size: 14px}
body {  font-family: "宋体"; font-size: 14px}
.p9 {  font-family: "宋体"; font-size: 14px}
.pt9 {  font-family: "宋体"; font-size: 9pt;TEXT-DECORATION: underline}
.p10 {  font-family: "宋体"; font-size: 12px;COLOR:#999999}
.14{ line-height:22px;font-size:14px}
.TButton {  font-family: "宋体"; font-size: 12px;cursor:hand;HEIGHT: 20px; WIDTH: 20px}
A:link{font-size:14px;COLOR:black;TEXT-DECORATION: none}
A:visited {font-size:14px;COLOR:black;TEXT-DECORATION: none}
A:hover {font-size:14px;COLOR: red; TEXT-DECORATION: underline}
-->
</style>
</head>

<body background="siba.gif">

<table border="0" cellPadding="0" cellSpacing="0" width="549" height="347">
  <tr>
    <td height="347" width="549">
    <table align="left" background="tupian/siba.gif" border="0" cellPadding="0" cellSpacing="0">
      <tr>
        <td background="tupian/siba1.gif">
        <table border="0" cellPadding="0" cellSpacing="4" width="100%" background="siba.gif" style="border-collapse: collapse" bordercolor="#111111" height="96">
          <tr>
            <td height="92">
            <table width="100%" border="0" cellPadding="0" cellSpacing="3" bordercolor="#111111" background="siba.gif" style="border-collapse: collapse">
              
                <input name="val1" type="hidden" value="27">
                <input name="val2" type="hidden" value="22">
                <input name="val3" type="hidden" value="23">
                <input name="val4" type="hidden" value="24">
                <input name="val5" type="hidden" value="29">
                <input name="val6" type="hidden" value="28">
                <tr>
                  <td noWrap>
                  <div align="center" class="whet">
                    <table border="0" cellPadding="0" cellSpacing="0" width="600">
                      <tr>
                        <td nowrap>
                        <div align="left"> <strong>名字:<font color=red><%=rs("sheepname")%></font></strong></div>
                        </td>
                              <td nowrap><strong>今天是您第<font color=red><%=rs("feedsheepday")%></font>天养宠物</strong></td>
                        <td nowrap>
                        <div align="right"> <strong>上次养宠物日期:<font color=red><%=rs("feeddate")%></font></strong></div>
                        </td>
                      </tr>
                    </table>
                  </div>
                  </td>
                </tr>
                <tr>
                  <td noWrap>
                  <img height="1" src="tupian/black_point.gif" width="100%"></td>
                </tr>
                <tr>
                  <td noWrap>
                  <table border="0" cellPadding="0" cellSpacing="0" width="530" height="71">
                    <tr>
                      <td height="71" width="371">
                      <div align="center" style="width: 371; height: 237">
                        <table align="center" border="0" cellPadding="0" cellSpacing="0" height="245" width="528">
                          <tr>
                            <td height="59" width="127">
<form method="POST" action="sheepeat.asp"><p align="center">
<input class=input class=input type="submit" value="食物" name="B1" style="font-family: 宋体; font-size: 12px"><font color="#000000">成长+10</font><input class=input class=input type="hidden" name="num" value="<%=tempid%>"><input class=input class=input type="hidden" name="sheepname" value="<%=sheepname%>"><font color="#000000">
</font></form>  
</td>
                            <td height="59"></td>
                            <td height="59" nowrap>
                            <p align="left">成长:</td>
                            <td height="59" width="105">
                           <%=rs("hungry")%>%<TABLE border=0 cellPadding=0 cellSpacing=0 width=110>
<TR><TD height=13 width=3><IMG height=13 src="../images/img_left.gif" width=3></TD>
<TD align=left background="../images/img_backing.gif" height=13 width=104><IMG height=13 src="../images/img_hungry.gif" 
width="<%=rs("hungry")%>%"></TD><TD height=13 width=3><IMG height=13 src="../images/img_right.gif" width=3></TD></TR></TABLE><br></td>
                          </tr>
                          <tr>
                            <td height="56" width="127">
 <form method="POST" action="sheepclean.asp"><p align="center"> 
<input class=input class=input type="submit" value="洗澡" name="B1" style="font-family: 宋体; font-size: 12px"><font color="#000000">友好+10</font><input class=input class=input type="hidden" name="num" value="<%=tempid%>"><input class=input class=input type="hidden" name="sheepname" value="<%=sheepname%>"><font color="#000000">
</font> </form>
</td>
                            <td height="56" width="262">
                             </td>
                            <td height="56" nowrap>
                            <p align="left">友好:</td>
                            <td height="56">
<%=rs("clean")%>%<TABLE border=0 cellPadding=0 cellSpacing=0 width=110>
<TR><TD height=13 width=3><IMG height=13 src="../images/img_left.gif" width=3></TD>
<TD align=left background="../images/img_backing.gif" height=13 width=104><IMG height=13 src="../images/img_clean.gif" 
width="<%=rs("clean")%>%"></TD><TD height=13 width=3><IMG height=13 src="../images/img_right.gif" width=3></TD></TR></TABLE><br></td>
                          </tr>
                          <tr>
                            <td height="55" width="127">
<form method="POST" action="sheepsun.asp"><p align="center"> 
 <input class=input class=input type="submit" value="阳光" name="B1" style="font-family: 宋体; font-size: 12px"><font color="#000000">健康+10</font><input class=input class=input type="hidden" name="num" value="<%=tempid%>"><input class=input class=input type="hidden" name="sheepname" value="<%=sheepname%>"><font color="#000000">
</font> </form></td>
                            <td height="55" width="262">
                             </td>
                            <td height="55" nowrap>
                            <p align="left">健康:</td>
                            <td height="55">
<%=rs("sheephealth")%>%<TABLE border=0 cellPadding=0 cellSpacing=0 width=110>
<TR><TD height=13 width=3><IMG height=13 src="../images/img_left.gif" width=3></TD>
<TD align=left background="../images/img_backing.gif" height=13 width=104><IMG height=13 src="../images/img_health.gif" 
width="<%=rs("sheephealth")%>%"></TD><TD height=13 width=3><IMG height=13 src="../images/img_right.gif" width=3></TD></TR></TABLE><br></td>
                          </tr>
                          <tr>
                            <td height="69" width="127">
                            <div align="left">
<form method="POST" action="sheeppei.asp"><p align="center" style="margin-top: 0; margin-bottom: 0"> 
<input class=input class=input type="submit" value="陪伴" name="B1" style="font-family: 宋体; font-size: 12px"><font color="#000000">快乐+10</font><input class=input class=input type="hidden" name="num" value="<%=tempid%>"><input class=input class=input type="hidden" name="sheepname" value="<%=sheepname%>"><font color="#000000">
</font></form></div>
                            </td>
                            <td height="69" width="262">
                            </td>
                            <td height="69" nowrap>
                            <p align="left">快乐:</td>
                            <td height="69"><div align="left">
<%=rs("sheephappy")%>%<TABLE border=0 cellPadding=0 cellSpacing=0 width=110>
<TR><TD height=13 width=3><IMG height=13 src="../images/img_left.gif" width=3></TD>
<TD align=left background="../images/img_backing.gif" height=13 width=104><IMG height=13 src="../images/img_happy.gif" 
width="<%=rs("sheephappy")%>%"></TD><TD height=13 width=3><IMG height=13 src="../images/img_right.gif" width=3></TD></TR></TABLE><br></td>
                          </tr>
                          </table>
                        <table border="0" cellPadding="0" cellSpacing="2">
                          <tr>
                            <td nowrap>
<p align="center">照顾宠物需要<font color="RED"> 100</font>NG 一天可以照顾三次  一项数值为零则死亡 <a href="javascript:window.close();" target="_self"><img border="0" src="nn/miti4.gif"></a></td></tr></table> </td>
                          </tr>
                        </table>
                      </div>
                      </td>
                    </tr>
                    </table>
                  </td>
                </tr>
              
            </table>
            </td>
          </tr>
        </table>
        </td>
      </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="1" width="549">
        </td>
  </tr>
</table>
<div id="div20" style="clip: rect(0px 150px 150px 0px); left: 240px; position: absolute; top: 100px; visibility: visible; z-index: 20">
  <img src="images/<%=rs("sheepface")%>.gif">&nbsp;
</div>
<% 
if rs("feedsheepday")<>0 then
if rs("milk")>0 then
tempmod=rs("feedsheepday") mod 5 
if tempmod=0 then 
%> 
<div align="left"> 
 
          <table border="0" cellspacing="1" cellpadding="0" height="1" width="72%">
            <tr> 
<form method="POST" action="sellmilk.asp"><td class=p3 width="100%" height="1"> 
恭喜!您的小<span lang="zh-cn">宠物</span>终于<span lang="zh-cn">生仔</span>了,这次的数量为<%=rs("milk")%>只想卖出多少只呢?<input class=input class=input type="text" name="milk" size="9" style="font-family: 宋体; font-size: 12px"><span lang="zh-cn">&nbsp;
</span>
<input class=input class=input type="submit" value="卖仔啦" name="B1" style="font-family: 宋体; font-size: 12px"> 
<input class=input class=input type="hidden" name="id" value="<%=tempid%>"><input class=input class=input type="hidden" name="sheepname" value="<%=sheepname%>"> 
</td> 
</form></tr> 
</table> 
</center> 
</div> 
<%else%>
目前您共有 <%=rs("milk")%> 只小仔,但还未到能卖仔的日子,请耐心等待吧。
<%end if%>
<%else%>
<span  style="font-family: 宋体; font-size: 12px">&nbsp;&nbsp;目前没有生仔</span>
<%end if%>

        <table border="0" width="100%" cellspacing="1" cellpadding="0" height="20">
          <tr> 
</tr> 
</table> 
</body>

</html>
<% 
end if 
end if 
rs.close
set rs=nothing
conn.close
set conn=nothing%>
















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -