calender problem

M

max

Hi, i have an apointment booking form from ourline.com
The problem is in admin, whereit should display thw days of the
month.it is only showing as many days asthe number of the month.eg; jan
shows 1 day, feb shows 2 days, up to december, which whows all 31 days.
it also shows the day. eg shows the 6th september as a saturday.
here is the code if anyone can help would be great,
Thanks.

<%
response.expires=0
Dim CurMonth
Dim CurDay
Dim CurYear
Dim NumOfDays
Dim CurCell
Dim onDay
Dim FoundFirst
CurMonth = request.querystring("cmonth")
CurYear = request.querystring("cyear")
CurDay = request.querystring("cday")
if CurMonth = "" Then curMonth = month(date)
if CurYear = "" Then CurYear = year(date)
if CurDay = "" Then CurDay = day(date)
FirstDay = weekday(CurMonth & "/01/" & CurYear)
cmonth = CurMonth
cyear = CurYear
NumOfDays = getlastday(cmonth,cyear)
FoundFirst = False
curcell = 1
onDay = 0
function GetLastDay( tmonth, tyear )
tmonth = tmonth + 1
if tmonth > 12 Then
tmonth = tmonth - 12
tyear = tyear + 1
End if
Dim x
x = DateAdd("d", -1, tmonth & "/01/" & tyear)
GetLastDay = Day( x )
End function

rows = 6


function DayOf()
if foundFirst Then
onDay = OnDay + 1
if onDay > NumofDays Then
DayOf = ""
Else
DayOf = onDay
End if

Else
if curcell = Firstday or firstday = 1 Then foundfirst = True

if foundFirst Then
onDay = OnDay + 1
if onDay > NumofDays Then
DayOf = ""

Else
DayOf = onDay

End if
Else
DayOf = ""
End if

End if
curcell = curcell + 1
if (OnDay + 1) = int(CurDay) and int(CurMonth) = int(month(date))
and int(CurYear) = year(date) Then
bgcolor = "yellow"
Else
bgcolor = "grey"
End if
End function
%>
<!-- #INCLUDE FILE="setup.htt" -->
<HTML>
<HEAD>
<TITLE><%=sitename%></TITLE>

<SCRIPT language="VBScript">
Sub cmonth_onchange
frm.submit
End Sub
Sub cyear_onchange
frm.submit
End Sub
</SCRIPT>
<link rel="stylesheet" type="text/css" href="test.css">
</HEAD>
<BODY>

<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="2"
style="border-collapse: collapse" bordercolor="#0000FF" width="400"
id="AutoNumber1">
<tr>
<td width="100%"><TABLE width="350" border="1"
cellspacing="0" cellpadding="2">
<p><b><%=sitename%></b></p><p>Select the date you want to
administer.</p>
<FORM name=frm method=get action=calendar.asp>
<TR>
<TD width="37"></TD>
<TD width="137"></TD>
<TD width="144"></TD>
<TD width="32"></TD>
</TR>
<TR>
<TD width="37"></TD>
<TD width="137">
<Select name="cmonth">
<% For i = 1 To 12 %>
<OPTION value="<%=i%>" <%if int(curmonth) = i Then
response.write("Selected")%>><%=monthname(i)%></OPTION>
<% Next %>
</Select> </TD>
<TD width="144">
<Select name="cyear">
<% For i = 2050 To 1980 step -1 %>
<OPTION value="<%=i%>" <%if int(curyear) = i Then
response.write("Selected")%>><%=i%></OPTION>
<% Next %>
</Select> </TD>
<TD width="32"></TD>
</TR>
<TR>
<TD width="37"></TD>
<TD width="137"></TD>
<TD width="144"></TD>
<TD width="32"></TD>
</TR>
</FORM>
</TABLE><TABLE width="350" border="1" cellspacing="0"
cellpadding="2">
<TR bgcolor="#666666">
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">S</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">M</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">T</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">W</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">T</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">F</FONT></B></FONT></DIV>
</TD>
<TD bgcolor="#0000FF">
<DIV align="center"><FONT face="Arial, Helvetica,
sans-serif"><B><FONT color="#FFFFFF">S</FONT></B></FONT></DIV>
</TD>
</TR>
<% For i = 1 To rows %>
<TR>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
<TD bgcolor="<%=bgcolor%>">
<DIV align="center"><FONT face="Arial, Helvetica, sans-serif"
size="2"><%
td=DayOf
response.write "<a href='view.asp?d=" & td & "&m=" & curmonth &
"&y=" & curyear & "'>" & td & "</a>"%></FONT></DIV>
</TD>
</TR>

<% Next %>
</TABLE>

<!-- #INCLUDE FILE="menu.htt" -->
</td>
</tr>
</table>
</center>
</div>

</BODY>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top