春节义务帮人写了一个《求签在线查询》(ASP)

来源:互联网 发布:传教士第一季 知乎 编辑:程序博客网 时间:2024/04/29 06:14

点击:http://webds.sz800.cn/wg2009.asp看效果

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>《王公灵签在线查询》(Ver 2009.02.07)</title>
<style type="text/css">
body{margin:0px;background:brown;font-size:12px;}
#welcome{position:absolute;width:660px;height:440px;background:url(wgimage/welcome.jpg);
         top:50%;left:50%;margin-top:-220px;margin-left:-330px;}
#inputdiv{margin-left:300px;margin-top:100px;color:gray;font-size:12px}

#inputdiv hr{width:200px;text-align:left;}
#inputdiv input{border:0px;border-bottom:1px solid gray;font-size:5em;
          color:red;width:64px;margin-bottom:-20px;}
#inputdiv span{font-size:3em;}
#inputdiv a {color:red;}
#inputdiv input.button { border:1px solid gray;font-size:12px;
                         border-right:1px solid black;border-bottom:1px solid black;
                         padding:2px;}
#big {position:absolute;padding-left:54px;top:14px;}
#left {background:url(wgimage/l.gif); repeat:none;width:13px;height:548px;float:left;}
#mid {background:url(wgimage/m.gif);background-repeat:repeat-x;
      width:740px;height:548px;
      white-space:nowrap; display:block;
      color:black;font-family:楷体;
      font-size:17px;
      padding-top:44px;
      float:left;
      }
#mid span{color:red;font-weight:bold;}
#mid span.t1{font-size:30px;color:maroon;font-weight:bold;}
#right{background:url(wgimage/r.gif);width:96px;height:548px;}
.ret{border:1px solid white;font-size:12px;
                         border-right:1px solid black;border-bottom:1px solid black;
                         padding:2px;background:orange;color:brown;}
p{
writing-mode: tb-rl; padding:0px;margin:0px;
}
</style>
</head>
<%
'自定义函数部分
dim oConn,oRS,islogin,totalcount,todatcount
dim thisYear,allYear,allAbout
zdm=split("签号|卦类|签诗|诗曰|家宅|岁君|求财|移居|月令|谋事|六甲|婚姻|合夥|山坟|官讼|占病|失物|行人|海水|田蚕|功名|出外|遇风|六畜|子息","|")
islogin = False
Sub DBOpen(dbname)
 Set oConn = Server.CreateObject("ADODB.Connection")
 oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= '" & Server.MapPath(".") & dbname & "'"
 Set oRs = Server.CreateObject( "ADODB.Recordset" )
End Sub
Sub DBClose()

 On Error Resume Next
 oRs.Close
 Set oRs = Nothing
 oConn.Close
 Set oConn = Nothing
End Sub

function getzw(n)
 zw=split("一|二|三|四|五|六|七|八|九|拾","|")
 if n<=10 then
  getzw = zw(n-1)
 end if  
 
 if n>10 and n<20 then
   a = int(n/10)
   b = n - a*10
   getzw = "十"+zw(b-1)
 end if
 
 if n>=20 then
   a = int(n/10)
   b = n - a*10
   if b<>0 then
   getzw =zw(a-1)+"十"+zw(b-1)
   else
   getzw =zw(a-1)+"十"
   end if
 end if
 
end function
Dbopen("/TEST.mdb")
oRS.open "SELECT * FROM ncount",oConn,1,3
if Session("nowvisit")<>"Y" then
   Session("nowvisit")="Y"
   oRS("统计")=oRS("统计")+1
   oRS("今日统计")=oRS("今日统计")+1
   if date > oRS("日期") then
       oRS("日期") = date
       oRS("今日统计")=0
   end if
   oRS.update
end if
   totalcount=oRS("统计")
   todaycount=oRS("今日统计")
dbclose
xs=request.form("xs")
%>
<body>
<% if request.form("xs")<>"显示" then %>
<div id="welcome">
  <div id="inputdiv">
  鸣谢:对以下帮助录入的网友:<br>
        成诚、花友友、WESLEE、<br>
        赞赞就是我、梅川内酷、<br>
        haitan138等表示衷心感谢! <br>
  <br>
  <hr>
  请输入你要查询的签号(1-51):<br>
  <form name="sc" METHOD="POST" action="wg2009.asp">
  <span>第</span>
  <input type="text" value="34" name="qh" maxlength="2"
   onfocus="this.select()"
   onkeyup='if(this.value!="")
            {re=//d/g;if(!re.test(this.value)){alert("只能输入1-51中的数字!");this.value="";}}
            if(parseInt(this.value)>51||parseInt(this.value)<1)
   {alert("只能输入1-51中的数字!");this.value="";}'>
  <span>签</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="hidden" value="显示" name="xs">
  <input type="submit" value="点击查询" class="button">
  <br><br><br><br><br>
  统计:<font color=red><%=totalcount%></font>&nbsp;今日:<font color=red><%=todaycount%></font>
  (<%=date%>)
  </form>
  </div>
 <% end if
    if request.form("xs")="显示" then
     if request.form("qh")="" then %>
   <script language="javascript">alert("请输入1-51中的数字!");history.go(-1);</script>
  <% end if
  %>
</div>
   <div id="big">
   <div id="left"></div>
   <div id="mid">
<p>
   <%
   if request.form("qh")<>"" then
      Dbopen("/TEST.mdb")
      oRS.open "SELECT * FROM content where 签号='"&request.form("qh")&"'",oConn,1,3
     if not oRS.eof then
   %><span class="t1">第<%=getzw(oRS("签号"))%>签&nbsp;
    <% if oRS("签诗")<>"第五十一签" then %>
    <%=oRS("签诗")%>
    <% end if %>
    </span>
    &nbsp;&nbsp<button class="ret" onclick="history.go(-1);">继续查询</button><br><br><br>
    <span>卦类&nbsp;</span>&nbsp;<%=oRS("卦类")%><br>
    <span>诗曰&nbsp;</span>
     <% if len(ors("诗曰"))>18 then %>
    <%=left(ors("诗曰"),12)%><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <%=mid(ors("诗曰"),13,len(ors("诗曰"))-12)%><br>
    <%else%>
    <%=ors("诗曰")%><br>
    <%end if%>
    <br>
    <% for i=4 to Ubound(zdm) %>
    <span><%=zdm(i)%>&nbsp;</span>
    <% if len(oRS(zdm(i)))>17 then %>
    <%=left(oRS(zdm(i)),18)%><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <%=mid(oRS(zdm(i)),19,len(oRS(zdm(i)))-18)%><br>
    <%else%>
    <%=oRS(zdm(i))%><br>
    <%end if%>
    <% next %>
   </div>
   <div id="right"> </div>
 </p>
 </div>
<%    dbclose()
     end if
    end if
   end if %>
   </body>
</html>

原创粉丝点击