📄 indexcls.asp
字号:
<!--#include file="../com/SqlStr.asp"-->
<!--#include file="../com/ComCls.asp"-->
<!--#include file="../com/md5.asp"-->
<%
Set AdoCn=Server.CreateObject("Adodb.Connection")
Set AdoRs=Server.CreateObject("Adodb.RecordSet")
Set FunCls=New FunctionClass
Dim SQL,Page,jgary(4),jgbgary(4)
jgary(1)="<IMG src=""images/wait.gif"" border=""0"">"
jgary(2)="<IMG src=""images/win.gif"" border=""0"">"
jgary(3)="<IMG src=""images/lost.gif"" border=""0"">"
jgary(4)="<IMG src=""images/ping.gif"" border=""0"">"
jgbgary(1)="wait"
jgbgary(2)="win"
jgbgary(3)="lose"
jgbgary(4)="equal"
'-------------------------------------------------------
Class IndexCls
Public Sub Class_Initialize()
'On Error Resume Next
AdoCn.Open AdoSQL
If Err.Number<>0 Then
FunCls.ErrMessage Err.Description
End If
End Sub
Public Sub RsClose()
If AdoRs.State=1 Then
AdoRs.Close
End If
End Sub
'------------------------------------------------------------------------
'------------------------------------------------------------------------
public sub tipsindex2(typeid,topnum) '首页推荐信息 总部直供
typeid=funcls.sift_str(typeid,1)
if typeid="" or typeid=0 then
typeid=1
end if
sql="select top "&topnum&" id,sdate,sdate2,st1,xt1,tj,bf,jg,pk,xx FROM ztsm_tips where typeid="&typeid&" order by sdate desc"
set adors=adocn.execute(sql)
if not adors.eof and not adors.bof then
AdoRsAry=AdoRs.getrows()
RsCount=ubound(AdoRsAry,2)
for k=0 to RsCount
if typeid=2 then
tj=adorsary(5,k)
else
if adorsary(2,k)<now() or session("memberusername")<>"" then
tj=adorsary(5,k)
else
tj="开赛公布"
end if
end if
datestr=adorsary(1,k)
sp=adorsary(3,k)
xp=adorsary(4,k)
sp=adorsary(3,k)
pk=adorsary(8,k)
xx=adorsary(9,k)
bf=adorsary(6,k)
m_tj=infoary(3)
if instr(m_tj,"target=_blank")=0 then
m_tj=replace(m_tj,"<A ","<A target=_blank ")
end if
if bf="" then
bf=" "
end if
jg=jgary(adorsary(7,k))
body=body & tips_s(datestr,sp,pk,xp,tj,bf,jg,xx,m_tj)
next
end if
rsclose
response.write body
end sub
'--------------------------------------------------------------------------
'--------------------------------------------------------------------------
public function tips_s(datestr,sp,pk,xp,tj,bf,jg,xx,m_tj)'单个推荐
t=t&"<table class=""table1"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
t=t&"<tr>"&vbcrlf
t=t&"<td class=""red"" style=""text-align:left;"" height=""34"" colspan=""5""><strong style=""padding-left:60px;"">"&m_tj&"</strong></td>"&vbcrlf
t=t&"</tr>"&vbcrlf
t=t&"<tr>"&vbcrlf
t=t&"<td width=""122"">上盘 [UP PLANT] </td>"&vbcrlf
t=t&"<td width=""122"">让 球 [LET] </td>"&vbcrlf
t=t&"<td width=""140"">下盘 [DOWN PLANT]</td>"&vbcrlf
t=t&"<td> </td>"&vbcrlf
t=t&"<td width=""70"" rowspan=""3"">"&jg&"</td>"&vbcrlf
t=t&"</tr>"&vbcrlf
t=t&"<tr>"&vbcrlf
t=t&"<td>"&sp&"</td>"&vbcrlf
t=t&"<td>"&pk&"</td>"&vbcrlf
t=t&"<td>"&xp&"</td>"&vbcrlf
t=t&"<td rowspan=""2"" class=""td1"">赛前公布·"&tj&"</td>"&vbcrlf
t=t&"</tr>"&vbcrlf
t=t&"<tr>"&vbcrlf
t=t&"<td>比分:"&bf&"</td>"&vbcrlf
t=t&"<td>"&datestr&"</td>"&vbcrlf
t=t&"<td>推荐指数:"
for j=0 to xx
t=t&"★"
next
t=t&"</td>"&vbcrlf
't=t&"<td class=""red"" style=""padding-top:5px;""><strong>"&m_tj&"</strong></td>"&vbcrlf
t=t&"</tr>"&vbcrlf
t=t&"<tr>"&vbcrlf
t=t&"<td height=""16""></td>"&vbcrlf
t=t&"<td></td>"&vbcrlf
t=t&"<td></td>"&vbcrlf
t=t&"<td></td>"&vbcrlf
t=t&"<td></td>"&vbcrlf
t=t&"</tr>"&vbcrlf
t=t&"</table>"&vbcrlf
tips_s=t
end function
'--------------------------------------------------------------------------
public function infoshow()
sql="select id,infobody1,infobody2,infobody3,infobody4 from ztsm_info "
set adors=adocn.execute(sql)
if not adors.eof and not adors.bof then
body=adors(1)&"{}"&adors(2)&"{}"&adors(3)&"{}"&adors(4)
end if
rsclose
infoshow=body
end function
'------------------------------------------------------------------
public sub tipslist(page,typeid)'推荐显示
page=funcls.sift_Str(page,1)
if page="" or page=0 then
page=1
end if
if typeid="" then
typeid=1
end if
sql="select id,sdate,sdate2,st1,xt1,tj,bf,jg,pk,xx FROM ztsm_tips where typeid="&typeid&" order by sdate desc"
page=FunCls.Sift_Str(page,1)
AdoRs.Open SQL,AdoCn,1,1
if not AdoRs.eof then
FunCls.divpage 10,page
if typeid=1 then
pagestr=FunCls.Showpageindex
else
pagestr=FunCls.Showpageindex2
end if
Do While Not AdoRs.Eof and RowCount>0
if typeid=2 then
tj=adors(5)
else
if adors(2)<now() or session("memberusername")<>"" then
tj=adors(5)
else
tj="开赛公布"
end if
end if
datestr=adors(1)
sp=adors(3)
xp=adors(4)
sp=adors(3)
pk=adors(8)
xx=adors(9)
m_tj=infoary(3)
if instr(m_tj,"target=_blank")=0 then
m_tj=replace(m_tj,"<A ","<A target=_blank ")
end if
bf=adors(6)
if bf="" then
bf=" "
end if
jg=jgary(adors(7))
body=body & tips_s(datestr,sp,pk,xp,tj,bf,jg,xx,m_tj)
adors.movenext
RowCount=RowCount-1
loop
body=body&"<div class=""page"">"&pagestr&"</div>"&vbcrlf
else
end if
Rsclose
response.write body
end sub
'--------------------------------------------------------------------------
public sub addtel(tel)
if request("submit")<>"" then
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
Else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
clientIp = Trim(Mid(strIPAddr, 1, 30))
tel=funcls.sift_str(tel,1)
'response.write clientip
'response.end
if tel="" or len(tel)<5 or (Not IsNumeric(tel)) or len(tel)>12 then
response.write "<script language=""javascript"">alert('对不起,你输入的手机号有误,请重新输入,谢谢.');window.close();</script>"
response.end
else
sql="select tel from ztsm_mobile where tel='"&tel&"'"
set adors=adocn.execute(sql)
if not adors.eof and not adors.bof then
response.write "<script language=""javascript"">alert('对不起,你输入的手机号已提交,请重新输入,谢谢.');window.close();</script>"
response.end
else
sql="select * from ztsm_mobile where [ip]='"&clientIp&"' and datediff('d',now(),adddate)=0 "
set adors=adocn.execute(sql)
if not (adors.eof and adors.bof) then
response.write "<script language=""javascript"">alert('对不起,一个ip只能登记一个号码,谢谢.');window.close();</script>"
else
sql="insert into ztsm_mobile(tel,[ip]) values('"&tel&"','"&clientIp&"')"
adocn.execute(sql)
response.write "<script language=""javascript"">alert('谢谢.你输入手机号现已录入,请等待我们重料一场');window.close();</script>"
end if
response.end
end if
end if
end if
end sub
'==========================================================================
public sub login(username,password)'用户登录
if request("status")="loginsubmit" then
username=funcls.sift_str(username,2)
password=md5(funcls.sift_Str(password,2),1)
SQL="SELECT username,startdate,useday FROM ztsm_user where username='"&username&"' and password='"&password&"' and allowuse=1"
set AdoRs=AdoCn.execute(SQL)
if not AdoRs.eof and not AdoRs.bof then
if dateadd("d",adors("useday"),AdoRs("startdate"))>now then
session("memberusername")=AdoRs(0)
response.Redirect "index.asp"
else
response.write "<script language=""javascript"">alert('对不起,此用户已过期');history.go(-1);</script>"
end if
else
response.write "<script language=""javascript"">alert('对不起,用户或者密码错误,请重新输入');history.go(-1);</script>"
end if
RsClose
end if
end sub
'-------------------------------------------------------
Public Sub Class_Terminate()
If AdoRs.State=1 Then
AdoRs.Close
End If
If Not AdoRs Is Nothing Then
Set AdoRs=Nothing
End If
If AdoCn.State=1 Then
Adocn.Close
End If
If Not AdoCn Is Nothing Then
Set AdoCn=Nothing
End If
Set FunCls=Nothing
End Sub
End Class
'-------------------------------------------------------
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -