%@LANGUAGE="VBSCRIPT"%>
<%
function getColorByDataAssignments(tmprs)
if (tmprs.eof) then
getColorByDataAssignments="0"
else
getColorByDataAssignments = "B0BECC"
end if
end function
dim Conn, strSql, rs, strMessage
set Conn = server.createobject("ADODB.Connection")
Conn.open strConn
%>
| |
<%
' first determine the months to display
if request("m") <> "" and request("y") <> "" then
if cint(request("m")) mod 2 = 0 then
currentMonth = cint(request("m")-1)
else
currentMonth = cint(request("m"))
end if
currentYear = cint(request("y"))
else
' show default month
if month(date) mod 2 = 0 then
currentMonth = month(date) - 1
else
currentMonth = month(date)
end if
currentYear = year(date)
end if
%>
|
|
<%
strSql = "select *, day(theDate) as theDay, month(theDate) as theMonth from tblEvent where month(theDate) in (" & currentMonth & "," & currentMonth+1 & ") and year(theDate) = " & currentYear
rs.open strSql, Conn
'currentDate = CDate(cstr(currentMonth) + "/" + "01" + "/" + cstr(currentyear))
'for each month in the year
for i=currentMonth to currentMonth + 1
currentDate = CDate(cstr(i) + "/" + "01" + "/" + cstr(currentyear))
currentMonth=month(currentDate)
currentWeekDay = weekday(currentDate)
%>
|
|
<%
next
rs.close : set rs = nothing
%>
|
|
| |
<%
if request("d") <> "" then
%>
| |
<%= formatdatetime(request("m") + "/" + request("d") + "/" + request("y"), vbLongDate) %> |
|
| |
<%
set rs = server.createobject("ADODB.Recordset")
strSql = "select * from tblEvent where theDate = #" & PadZero(request("m"),2) & "/" & PadZero(request("d"),2) & "/" + request("y") & "# order by AMPM, theTime;"
rs.CursorLocation=3
rs.open strSql, Conn
if rs.recordcount = 1 then 'show detail if there's only one event for the day
ID_FK = rs("Event_ID_PK")
%>
| <%= left(rs("theTime"),2) + ":" + right(rs("theTime"),2) + " " + rs("AMPM") %> |
| <%= AddBrToCrLf(rs("theText"))%>
|
|
<%
rs.close
%>
|
<%
else
do while not rs.eof
%>
| <%= left(rs("theTime"),2) + ":" + right(rs("theTime"),2) + " " + rs("AMPM") %> |
|
"><%= trim(rs("Title")) %> |
<%
rs.movenext
loop
end if
%>
<%
end if
%>
|
 |
<%
' upcoming events
set rs2 = server.createobject("adodb.recordset")
strSql = "select top 4 tblEvent.*, tblIcon.ImgFile FROM tblEvent LEFT JOIN tblIcon ON tblEvent.Icon_ID_FK = tblIcon.Icon_ID_PK where tblEvent.theDate >=date() order by tblEvent.theDate"
rs2.open strSql, Conn
%>
<%
If Not rs2.EOF Then
%>
" width="89" height="52"> |
 |
<%
'If Len(rs2("theText")) > 80 Then dot = ".." Else dot = ""
response.write formatdatetime(rs2("theDate"), vbShortDate)
response.write " "
response.write rs2("title")
rs2.MoveNext
%>
|
<%
End If
If Not rs2.EOF Then
%>
" width="89" height="52"> |
|
<%
response.write formatdatetime(rs2("theDate"), vbShortDate)
response.write " "
response.write rs2("title")
rs2.MoveNext
%>
|
<%
End If
If Not rs2.EOF Then
%>
" width="89" height="52"> |
|
<%
response.write formatdatetime(rs2("theDate"), vbShortDate)
response.write " "
response.write rs2("title")
rs2.MoveNext
%>
|
<%
End If
If Not rs2.EOF Then
%>
" width="89" height="52"> |
|
<%
response.write formatdatetime(rs2("theDate"), vbShortDate)
response.write " "
response.write rs2("title")
rs2.MoveNext
%>
|
<%
End If
rs2.close : set rs2=nothing
%>
|
|
<%
set rs = nothing
Conn.close : set Conn = nothing
Function AddBrToCrLf(strInput)
AddBrToCrLf = Replace(strInput, vbCrLf, "
" & vbCrLf)
End Function
%>
| |
6355 Corte Del Abeto C-100 Carlsbad, CA 92009
Phone: 760.603.9777 © 2005,
All rights reserved. Calvary Chapel Carlsbad
|
|