%
displayHeader()
Dim dDate ' Date we're displaying calendar for
Dim iDIM ' Days In Month
Dim iDOW ' Day Of Week that month starts on
Dim iCurrent ' Variable we use to hold current day of month as we write table
Dim iPosition ' Variable we use to hold current position in table
If IsDate(Request.QueryString("date")) Then
dDate = CDate(Request.QueryString("date"))
Else
If IsDate(Request.QueryString("month") & "-1-" & Request.QueryString("year")) Then
dDate = CDate(Request.QueryString("month") & "-1-" & Request.QueryString("year"))
Else
dDate = Date()
' The annoyingly bad solution for those of you running IIS3
If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
Response.Write "The date you picked was not a valid date. The calendar was set to today's date.
"
End If
' The elegant solution for those of you running IIS4
'If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not a valid date. The calendar was set to today's date.
"
End If
End If
groupString = groupString & " and ("
groupList = split(CONST_calendarGroupList, ",")
for i = 0 to ubound(groupList)
groupString = groupString & " job.group_id=" & groupList(i)
if i < ubound(groupList) then
groupString = groupString & " or"
end if
next
groupString = groupString & ") "
'groupString2 = " and (job.group_id="&CONST_publicGroupId&" or job.group_id="&CONST_myArchiveGroup&")"
sqlString = "Select job.* from job where MONTH(job.Bid_Date)=" & Month(dDate) & " and year(job.Bid_Date)=" & year(dDate) & groupString & " order by job.bid_date"
set bidRS = objConn.Execute(sqlString)
sqlString = "Select job.* from job where MONTH(job.PreBid_Date)=" & Month(dDate) & " and year(job.Bid_Date)=" & year(dDate) & groupString & " order by job.prebid_date"
set prebidRS = objConn.Execute(sqlString)
sqlString = "Select job.job, job.id, job_addendums.date, job_addendums.description "
sqlString = sqlString & "from job, job_addendums "
sqlString = sqlString & "where job.id=job_addendums.job_id and MONTH(job_addendums.date) = " & Month(dDate) & " and year(job_addendums.date)=" & year(dDate) & groupString & " order by job_addendums.date"
set addRS = objConn.Execute(sqlString)
'Now we've got the date. Now get Days in the choosen month and the day of the week it starts on.
iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)
%>
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|
| Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
|||
| " & vbCrLf iPosition = iPosition + 1 Loop End If ' Write days of month in proper day slots iCurrent = 1 iPosition = iDOW Do While iCurrent <= iDIM ' If we're at the begginning of a row then write TR If iPosition = 1 Then Response.Write vbTab & " | |||||||||
| " & iCurrent & " " &vbcrlf cellEmpty=true continue=true do while not bidRS.EOF and continue if day(cdate(bidRS("bid_date"))) = iCurrent then response.Write(" "&bidRS("job")&" [Bid Date] "&vbcrlf) cellEmpty=false bidRS.MoveNext else continue=false end if loop continue=true do while not prebidRS.EOF and continue if day(cdate(prebidRS("prebid_date"))) = iCurrent then response.Write(" "&prebidRS("job")&" [PreBid Date] "&vbcrlf) cellEmpty=false prebidRS.MoveNext else continue=false end if loop continue=true do while not addRS.EOF and continue if day(cdate(addRS("date"))) = iCurrent then response.Write(" "&addRS("job")&" [Addendum] "&vbcrlf) cellEmpty=false addRS.MoveNext else continue=false end if loop if cellEmpty then response.Write(" ") end if response.Write " | " & vbCrLf
' If we're at the endof a row then write /TR
If iPosition = 7 Then
Response.Write vbTab & "" & vbCrLf iPosition = iPosition + 1 Loop Response.Write vbTab & "" & vbCrLf End If %> | ||||||||