I am a real beginnner in ASP. Due to increasing demands on dynamic website, I've been working on ASP website now. I use a ready to use CMS program and right now I've been trying to combine a calendar module into my CMS.
The calendar works fine except that if I click on the date or the month earlier or later, the page always goes back to the first page which is first opened. You can take a look at this address: http://www.dewaterlely.nl/ontvangst/trouwen/
Try the link: ">>" or click on any date on the calendar. It returns the basic URL of the website, not the new generated page that I've made with CMS. The page itself is made of few frames in one page. I've tried few things (Click on "<<")
I got "type Mismatch " CInt"
I don't know what I should do. Can anyone help?
Follows is de script of the calendar:
<%
'**************************************
' Name: ECDesigns Event Calender
' Description:Simple ASP Events Calender
' By: Craig G SMith.
'
' This code is copyrighted and has
' limited warranties. Visit
' http://www.ecddesigns.co.za
' for details.
'**************************************
%>
<!--#include virtual="/ontvangst/calendar/db.asp"-->
<!--#include virtual="/ontvangst/calendar/functions.asp"-->
<%
If IsDate(Request.QueryString("date")) Then
dDate = CDate(Request.QueryString("date"))
Else
If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then
dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year"))
Else
dDate = Date()
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 "Wrong date.<BR><BR>"
End If
End If
End If
iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)
mnth = MaandNaam(Month(dDate))
%>
<link rel="stylesheet" href="../styles/style.css" type="text/css">
<TABLE width="100%" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0 class="ruta">
<TR>
<TD><TABLE width="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD ALIGN="left" COLSPAN=7>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD ALIGN="right"><div align="left"><A HREF="default2.asp?active_page_id=<%=active_page_i d%>?date=<%= SubtractOneMonth(dDate) %>"><<</A></div></TD>
<TD ALIGN="center"><font size="1"><B><%= mnth & " <br> " & Year(dDate) %></B></font></TD>
<TD ALIGN="left"><div align="right"><A HREF="<%=request.servervariables("url")%>?date=<%= AddOneMonth(dDate) %>">>></A></div></TD>
</TR>
</TABLE></TD>
</TR>
<TR>
<TD ALIGN="center"><strong>M</strong></TD>
<TD ALIGN="center"><strong>D</strong></TD>
<TD ALIGN="center"><B>W</B></TD>
<TD ALIGN="center"><strong>D</strong></TD>
<TD ALIGN="center"><B>V</B></TD>
<TD ALIGN="center"><B>Z</B></TD>
<TD ALIGN="center"><B>Z</B></TD>
</TR>
<%
If iDOW <> 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
iPosition = 1
Do While iPosition < iDOW
Response.Write vbTab & vbTab & "<TD> </TD>" & vbCrLf
iPosition = iPosition + 1
Loop
End If
iCurrent = 1
iPosition = iDOW
Do While iCurrent <= iDIM
If iPosition = 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
End If
If iCurrent = Day(dDate) Then
Response.Write vbTab & vbTab & "<TD align=center class=""inmatning""><b><font size=4><font color=#F49100>" & iCurrent & "</font></font></b></TD>" & vbCrLf
Else
'Response.Write vbTab & vbTab & "<TD align=center><font size=2>" & iCurrent & "</font></TD>" & vbCrLf
Response.Write vbTab & vbTab & "<TD align=center><A HREF=""" & request.servervariables("url") & "?date=" & Year(dDate) & "-" & Month(dDate) & "-" & iCurrent & """>" & iCurrent & "</A></TD>" & vbCrLf
End If
If iPosition = 7 Then
Response.Write vbTab & "</TR>" & vbCrLf
iPosition = 0
End If
iCurrent = iCurrent + 1
iPosition = iPosition + 1
Loop
If iPosition <> 1 Then
Do While iPosition <= 7
Response.Write vbTab & vbTab & "<TD> </TD>" & vbCrLf
iPosition = iPosition + 1
Loop
Response.Write vbTab & "</TR>" & vbCrLf
End If
%>
</TABLE></TD>
</TR>
<tr>
<td><hr></td>
</tr>
<tr>
<td><p><b>Evenementen:</b></p>
<p class="Highlight"><B>Vandaag: </B></p></td>
</tr>
<%
set getoday = dbconn.execute("Select * from events where eventyear = '" & year(ddate) & "' and eventmonth = '" & month(ddate) & "' and eventday= " & day(ddate) & " ")
while not getoday.bof and not getoday.eof%>
<tr>
<td> <%=getoday("eventhead")%><br>
<%=getoday("eventdesc")%><br>
<a href="<%=getoday("eventlink")%>" target="_parent">URL</a>
<hr></td>
</tr>
<% getoday.movenext
wend%>
<tr class="HighlightCopy">
<td><b>Volgende :</b></td>
</tr>
<%dtdt = cInt(day(ddate))%>
<% set getnext = dbconn.execute("Select * from events where eventyear = '" & year(ddate) & "' and eventmonth = '" & month(ddate) & "' and eventday > " & dtdt & " ")
while not getnext.bof and not getnext.eof%>
<tr>
<td> <%=getnext("eventhead")%><br>
<%=getnext("eventdesc")%><br>
<a href="<%=getnext("eventlink")%>" target="_parent">URL</a>
<hr></td>
</tr>
<% getnext.movenext
wend%>
<% if month(ddate) < 12 then
nyear = year(ddate)
nmonth =month(ddate) + 1
else
nyear = year(ddate) + 1
nmonth = 1
end if%>
<% set getnext = dbconn.execute("Select * from events where eventyear = '" & nyear & "' and eventmonth = '" & nmonth & "' ")
while not getnext.bof and not getnext.eof%>
<tr>
<td> <%=getnext("eventhead")%><br>
<%=getnext("eventdesc")%><br>
<a href="<%=getnext("eventlink")%>" target="_parent">URL</a>
<hr></td>
</tr>
<% getnext.movenext
wend%>
<tr class="HighlightCopy2">
<td><b>Vorige :</b></td>
</tr>
<%dtdt = cInt(day(ddate))%>
<% set getnext = dbconn.execute("Select * from events where eventyear = '" & year(ddate) & "' and eventmonth = '" & month(ddate) & "' and eventday < " & dtdt & " ")
while not getnext.bof and not getnext.eof%>
<tr>
<td> <%=getnext("eventhead")%><br>
<%=getnext("eventdesc")%><br>
<a href="<%=getnext("eventlink")%>" target="_parent">URL</a>
<hr></td>
</tr>
<% getnext.movenext
wend%>
<% if month(ddate) > 1 then
nyear = year(ddate)
nmonth =month(ddate) - 1
else
nyear = year(ddate) - 1
nmonth = 12
end if%>
<% set getnext = dbconn.execute("Select * from events where eventyear = '" & nyear & "' and eventmonth = '" & nmonth & "' ")
while not getnext.bof and not getnext.eof%>
<tr>
<td><%=getnext("eventhead")%><br>
<%=getnext("eventdesc")%><br>
<a href="<%=getnext("eventlink")%>" target="_parent">URL</a>
<hr></td>
</tr>
<% getnext.movenext
wend%>
<tr>
<td>
<a href="http://www.ecddesigns.co.za" target="_Blank"><small>Events Calander door
ECDesigns</small></a>
</tr></td>
</table>