% dim sql, rs, i, PlayServerID, Day1, ServerList(), DateList(), Hp, DateNum dim HpSwitch, HpID PlayServerID = ReqNum(Request("SID")) Day1 = Request("Day1") HpID = ReqNum(Request("HID")) Hp = "portgoto.asp" '----共用此程式的Link設定 HpSwitch = array("","portrait.asp","diary.asp") '----初值 if PlayServerID = "" then PlayServerID = "1" if Day1 = "" then Day1 = CStr(DatePart("yyyy",now())) & "/" & Right("0" & CStr(DatePart("m",now())),2) if HpID = "" then HpID = "1" '----撈出現有已開放Server sql = "select ServerID from TOP_NowServer where ServerOP='Y' order by autoid" Set rs = GetRecordset( sql ) if not(rs.BOF and rs.EOF) then Redim ServerList(rs.recordcount) for i = 1 to UBound(ServerList) ServerList(i) = rs(0).value rs.movenext next end if rs.close set rs = nothing '----撈出年月分組 sql = "select convert(char(7),AddTime,111) as DateList from ST_Portrait where G_Playserver='" & ServerList(PlayServerID) & "' and G_Op='Y' " &_ "group by convert(char(7),AddTime,111) " &_ "order by convert(char(7),AddTime,111) desc" Set rs = GetRecordset( sql ) DateNum = 0 if not(rs.BOF and rs.EOF) then Redim DateList(rs.recordcount) for i = 1 to UBound(DateList) DateList(i) = rs(0).value DateNum = DateNum + 1 ' 計算分組數量,避免當沒資料時發生例外錯誤 rs.movenext next end if rs.close set rs = nothing %>
|