<%
giorno = request.queryString("giorno")
mese = request.queryString("mese")
anno = request.queryString("anno")
giorno = Day(now())
mese = Month(now())
anno = Year(now())
if giorno < 10 then
giorno = "0"& giorno
end if
if mese < 10 then
mese = "0" & mese
end if
oggi = giorno &"/"& mese &"/"&anno
if len(giorno) = 0 or not isNumeric(giorno) then giorno = datePart("d",date())
if len(mese) = 0 or not isNumeric(mese) then mese = datePart("m",date())
if len(anno) = 0 or not isNumeric(anno) then anno = datePart("yyyy",date())
dataCorrente = giorno & "/" & mese & "/" & anno
if not isDate(dataCorrente) then dataCorrente = formatDateTime(date(),vbGeneralDate)
giorno = datePart("d",dataCorrente)
mese = datePart("m",dataCorrente)
anno = datePart("yyyy",dataCorrente)
primoGiornoMese = cDate("01" & "/" & mese & "/" & anno)
primoGiornoSettimanaMese = datePart("w",primoGiornoMese)
%>
<table border="1" bgcolor="#FFFFFF" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC" class="table">
<tr>
<td colspan="7" bgcolor="#EEEEEE" align="center"><%=uCase(monthName(mese))%>-<%=anno%></td>
</tr>
<tr bgcolor="#FFFFCC">
<td>D</td>
<td>L</td>
<td>M</td>
<td>M</td>
<td>G</td>
<td>V</td>
<td>S</td>
</tr>
<tr>
<%
for i = 1 to (primoGiornoSettimanaMese - 1)
%>
<td></td>
<%
next
for giorno = 1 to 31
if giorno = Day(Date()) then
cella ="#FFCCCC"
else
cella ="#ffffff"
end if
tmpDate = giorno & "/" & mese & "/" & anno
if isDate(tmpDate) then
%>
<td bgcolor="<%=cella%>"><a href="prova.asp?data=<%=oggi%>"><%=giorno%></a></td>
<%
if datePart("w",tmpDate) = 7 then
response.write " </tr>" & vbCrLf
response.write " <tr>" & vbCrLf
end if
ultimoGiornoSettimanaMese = datePart("w",tmpDate)
end if
next
for i = (ultimoGiornoSettimanaMese + 1) to 7
%>
<td></td>
<%
next
%>
</tr>
</table>