week_game2.asp
来自「CC足球投注系统」· ASP 代码 · 共 293 行
ASP
293 行
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
Set mypage=new xdownpage
mypage.getconn=conn
mypage.getsql="select MatchName,GameTime,Team1,Team2 from Game where datepart(week,GameTime)=datepart(week,getdate()) order by GameTime DESC"
mypage.pagesize=10
set rs=mypage.getrs()
%>
<HTML><HEAD><TITLE><%= WebTitle %></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="images/mem_index_data.css" type=text/css rel=stylesheet>
</HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tab-stoke">
<tr>
<td rowspan="3"><img src="images/in11.jpg" width="125" height="66"></td>
<td rowspan="3"><img src="images/in12.jpg" width="117" height="66"></td>
<td><img src="images/in13.jpg" width="169" height="23"></td>
<td><img src="images/in14.jpg" width="163" height="23"></td>
<td><img src="images/in15.jpg" width="99" height="23"></td>
<td><img src="images/in16.jpg" width="103" height="23"></td>
</tr>
<tr>
<td height="20" colspan="3" align="left" background="images/in24b.jpg"><table width="402" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14"> </td>
<td width="53"><A href="about.asp">關於我們</A></td>
<td width="14"> </td>
<td width="53"><A href="rule.asp">規則說明</A></td>
<td width="14"> </td>
<td width="53"><A href="week_game.asp">一周賽事</A></td>
<td width="14"> </td>
<td width="53"><A href="join.asp">加入會員</A></td>
<td width="14"> </td>
<td width="53"><A href="contact.asp">聯絡我們</A></td>
<td width="14"> </td>
<td width="53"><A href="home.asp">回首頁</A></td>
</tr>
</table></td>
<td height="20"><img src="images/in26.jpg" width="103" height="20"></td>
</tr>
<tr>
<td><img src="images/in33.jpg" width="169" height="23"></td>
<td><img src="images/in34.jpg" width="163" height="23"></td>
<td><img src="images/in35.jpg" width="99" height="23"></td>
<td><img src="images/in36.jpg" width="103" height="23"></td>
</tr>
</table>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tab-stoke">
<tr>
<td rowspan="2" align="center" valign="top"><table width="585" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15"> </td>
</tr>
<%if rs.eof then%>
<tr>
<td height="15" align="center">本週沒有賽事!</td>
</tr>
<%else
%>
<tr>
<td align="center">
<% for i=1 to mypage.pagesize
if not rs.eof then %>
<table width="550" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#E6F0FA">
<td width="100" height="25" align="center"><%= WeekdayName(Weekday(rs("GameTime"))) %></td>
<td height="25" colspan="3" align="center" bgcolor="#FFCC66"><strong><%= rs("MatchName") %></strong></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="20" align="center" bgcolor="#F5F5F5"><%= FormatDateTime(rs("GameTime"),2) %></td>
<td width="200" rowspan="2" align="center" bgcolor="#FFFFFF"> <%= rs("Team1") %>(<font color=red>主</font>)</td>
<td width="50" rowspan="2" align="center" bgcolor="#F5F5F5">VS</td>
<td width="200" rowspan="2" align="center" bgcolor="#FFFFFF"> <%= rs("Team2") %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="20" align="center" bgcolor="#F5F5F5"><%= FormatDateTime(rs("GameTime"),4) %></td>
</tr>
</table><br>
<% rs.movenext
else
exit for
end if
next
%> <table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="right"><% mypage.showpage()%></td>
</tr>
</table><br>
</td>
</tr>
<% end if %>
</table></td>
<td width="164" valign="top" background="images/bg.jpg"><img src="images/in45.jpg" width="164" height="201"></td>
</tr>
<tr>
<td width="164" background="images/bg.jpg"> </td>
</tr>
<tr align="center" bgcolor="#ff8700">
<td height="25" colspan="2">©<%=year(now())%> 版權所有:<%= WebName %></td>
</tr>
</table>
</BODY>
</HTML>
<%
Const Btn_First="首頁"
Const Btn_Prev="上頁"
Const Btn_Next="下頁"
Const Btn_Last="尾頁"
Const XD_Align="Center"
Const XD_Width="100%"
Class Xdownpage
Private XD_PageCount,XD_Conn,XD_Rs,XD_SQL,XD_PageSize,Str_errors,int_curpage,str_URL,int_totalPage,int_totalRecord
Public Property Let PageSize(int_PageSize)
If IsNumeric(Int_Pagesize) Then
XD_PageSize=CLng(int_PageSize)
Else
str_error=str_error & "PageSize的參數不正確"
ShowError()
End If
End Property
Public Property Get PageSize
If XD_PageSize="" or (not(IsNumeric(XD_PageSize))) Then
PageSize=10
Else
PageSize=XD_PageSize
End If
End Property
Public Property Get GetRs()
Set XD_Rs=Server.createobject("adodb.recordset")
XD_Rs.PageSize=PageSize
XD_Rs.Open XD_SQL,XD_Conn,1,1
If not(XD_Rs.eof and XD_RS.BOF) Then
If int_curpage>XD_RS.PageCount Then
int_curpage=XD_RS.PageCount
End If
XD_Rs.AbsolutePage=int_curpage
End If
Set GetRs=XD_RS
End Property
Public Property Let GetConn(obj_Conn)
Set XD_Conn=obj_Conn
End Property
Public Property Let GetSQL(str_sql)
XD_SQL=str_sql
End Property
Private Sub Class_Initialize
XD_PageSize=10
If request("page")="" Then
int_curpage=1
ElseIf not(IsNumeric(request("page"))) Then
int_curpage=1
ElseIf CInt(Trim(request("page")))<1 Then
int_curpage=1
Else
Int_curpage=CInt(Trim(request("page")))
End If
End Sub
Public Sub ShowPage()
Dim str_tmp
int_totalRecord=XD_RS.RecordCount
If int_totalRecord<=0 Then
str_error=str_error & "總記錄數爲零"
Call ShowError()
End If
If int_totalRecord=1 then
int_TotalPage=1
Else
int_TotalPage=XD_RS.PageCount
End If
If Int_curpage>int_Totalpage Then
int_curpage=int_TotalPage
End If
response.write ""
str_tmp=ShowFirstPrv
response.write str_tmp
'str_tmp=showNumBtn
'response.write str_tmp
str_tmp=ShowNextLast
response.write str_tmp
str_tmp=ShowPageInfo
response.write str_tmp
response.write ""
End Sub
Private Function ShowFirstPrv()
Dim Str_tmp,int_prvpage
If int_curpage=1 Then
str_tmp=""
Else
int_prvpage=int_curpage-1
str_tmp="<a href='" & geturl & "1" & "'><font color=#000000>"&Btn_First&"</font></a> <a href='" & geturl & int_prvpage & "'><font color=#000000>" & Btn_Prev&"</font></a> "
End If
ShowFirstPrv=str_tmp
End Function
Private Function ShowNextLast()
Dim str_tmp,int_Nextpage
If Int_curpage>=int_totalpage Then
str_tmp=""
'str_tmp=Btn_Next & Btn_Last
Else
Int_NextPage=int_curpage+1
str_tmp="<a href='" & geturl & int_NextPage & "'><font color=#000000>" & Btn_Next & "</font></a> <a href='" & geturl & int_TotalPage & "'><font color=#000000>" & Btn_Last&"</font></a> "
End If
ShowNextLast=str_tmp
End Function
Private Function showNumBtn()
Dim i,str_tmp
For i=1 to int_totalpage-1
str_tmp=str_tmp & "<a href='" & geturl & i & "'>["&i&"]</a>"
Next
showNumBtn=str_tmp
End Function
Private Function ShowPageInfo()
Dim str_tmp
str_tmp="頁次:"&int_curpage&"/"&int_totalpage&"頁 共"&int_totalrecord&"條記錄 "&XD_PageSize&"條/每頁"
ShowPageInfo=str_tmp
End Function
Private Function GetURL()
Dim strurl,str_url,i,j,search_str,result_url
search_str="page="
strurl=Request.ServerVariables("URL")
Strurl=split(strurl,"/")
i=UBound(strurl,1)
str_url=strurl(i)
str_params=Request.ServerVariables("QUERY_STRING")
If str_params="" Then
result_url=str_url & "?page="
Else
If InstrRev(str_params,search_str)=0 Then
result_url=str_url & "?" & str_params &"&page="
Else
j=InstrRev(str_params,search_str)-2
If j=-1 Then
result_url=str_url & "?page="
Else
str_params=Left(str_params,j)
result_url=str_url & "?" & str_params &"&page="
End If
End If
End If
GetURL=result_url
End Function
Private Sub Class_Terminate
XD_RS.close
Set XD_RS=nothing
End Sub
Private Sub ShowError()
If str_Error <> "" Then
Response.Write("" & SW_Error & "")
Response.End
End If
End Sub
End class
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?