<%
Dim calendarDate
Dim lastDay
If Request.QueryString("manad") <> "" Then
calendarDate = DateSerial(Year(Date),(Request.QueryString("manad")+1),(1-1))
Else
calendarDate = DateSerial(Year(Date),(Month(Date)+1),(1-1))
End If
lastDay = Day(calendarDate)
Dim calendarMonth
calendarMonth = Month(calendarDate)
%>
<% Response.Write(MonthName(calendarMonth,False) & " " & Year(calendarDate)) %>
<%
Dim firstDayOfMonth
firstDayOfMonth = DateSerial(Year(calendarDate),Month(calendarDate),1)
firstDayOfMonth = Weekday(firstDayOfMonth) - 1
If firstDayOfMonth = 0 Then
firstDayOfMonth = 7
End If
Dim numberOfFillers
numberOfFillers = firstDayOfMonth - 1
Dim fillers
fillers = 0
Do Until fillers = numberOfFillers
%>
<%
fillers = fillers + 1
Loop
Dim firstDay
firstDay = 1
Dim SQL
Do Until firstDay > lastDay
SQL = "SELECT ID,typ,lag,datum,rubrik FROM lag_handelser WHERE datum = '" & DateSerial(Year(calendarDate),Month(calendarDate),firstDay) & "' ORDER BY typ ASC, lag DESC LIMIT 1"
Set handelseRS = Server.CreateObject("ADODB.Recordset")
handelseRS.Open SQL, ifkskovdeConn, 3, 3
If firstDay = Day(Date) AND Month(Date) = calendarMonth AND Year(Date) = Year(calendarDate) Then
If handelseRS.EOF Then
%>
<%
Else
If handelseRS("typ") = 1 Then
%>
<%
ElseIf handelseRS("typ") = 2 Then
%>
<%
Else
%>
<%
End If
End If
Else
If handelseRS.EOF Then
%>
<%
Else
If handelseRS("typ") = 1 Then
%>
<%
ElseIf handelseRS("typ") = 2 Then
%>
<%
Else
%>
<%
End If
End If
End If
handelseRS.Close
Set handelseRS = Nothing
firstDay = firstDay + 1
Loop
If Request.QueryString("manad") <> "" Then
%>
<%
Else
%>
<%
End If
ifkskovdeConn.Close
Set ifkskovdeConn = Nothing
%>