<%
pagina = Request.ServerVariables("PATH_INFO")
data = Request.QueryString("data")
If len(data) = 0 Or Not IsDate(data) Then
data = FormatDateTime(Date(),vbGeneralDate)
Else
data = CDate(data)
End If
mese = DatePart("m",data)
anno = DatePart("yyyy",data)
oggi = DatePart("d",data)
diff_inizio = oggi - 1
cambia_mese = Request.QueryString("mese")
cambia_anno = Request.QueryString("anno")
If len(cambia_mese) > 0 And IsNumeric(cambia_mese) Then
cambia_mese= CLng(cambia_mese)
If cambia_mese > 0 And cambia_mese < 13 Then
data = DateAdd("m",-mese,data)
data = DateAdd("m",cambia_mese,data)
mese = DatePart("m",data)
End If
End If
If len(cambia_anno) > 0 And IsNumeric(cambia_anno) Then
cambia_anno= CLng(cambia_anno)
diff = cambia_anno - anno
data = DateAdd("yyyy",diff,data)
anno = DatePart("yyyy",data)
End If
inizio_mese = DateAdd("d",-diff_inizio,data)
%>
<style type="text/css">
<!--
.unnamed1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #FFFFFF;
}
a.base:active { color: #FFFFFF; text-decoration: underline}
a.base:link { color: #FFFFFF; text-decoration: none}
a.base:visited { color: #FFFFFF; text-decoration: none}
a.base:hover { color: #FF0000; text-decoration: underline}
a.classe:active { color: #FFFFFF; text-decoration: underline}
a.classe:link { color: #FFFFFF; text-decoration: none}
a.classe:visited { color: #FFFFFF; text-decoration: none}
a.classe:hover { color: #FFFF66; text-decoration: underline}
SELECT{Font-family:verdana;font-size:11;}
INPUT{Font-family:verdana;font-size:11;}
-->
</style>
<table width="145" border="1" cellpadding="0" cellspacing="1" bordercolor="#000066" bgcolor="#000066" class="unnamed1">
<tr bordercolor="#000066" bgcolor="#000066">
<td colspan="7" align="center" bgcolor="#000066" bordercolor="#000066"><font color="#FFFFFF"><%=UCase(MonthName(mese))%><%=anno%></font></td>
</tr>
<tr bordercolor="#000066">
<td width="20" align="center" bgcolor="#0099ff"><%=Left(WeekDayName(1),2)%></td>
<td width="20" align="center" bgcolor="#000066"><%=Left(WeekDayName(2),2)%></td>
<td width="20" align="center" bgcolor="#000066"><%=Left(WeekDayName(3),2)%></td>
<td width="20" align="center" bgcolor="#000066"><%=Left(WeekDayName(4),2)%></td>
<td width="20" align="center" bgcolor="#000066"><%=Left(WeekDayName(5),2)%></td>
<td width="20" align="center" bgcolor="#000066"><%=Left(WeekDayName(6),2)%></td>
<td width="20" align="center" bgcolor="#0099ff"><%=Left(WeekDayName(7),2)%></td>
</tr>
<tr bordercolor="#000066">
<%
limite = 7
ciclo = 1
For i = 30 To 27 Step -1
tempUltimo = DateAdd("d",i,inizio_mese)
If DatePart("m",tempUltimo) = mese Then
Exit For
End If
Next
ultimo_giorno = i + 1
g = 0
For x = 1 To 42
If g =< i Then
tempData = DateAdd("d",g,inizio_mese)
tempData = CDate(tempData)
tempGiornoSett = DatePart("w",inizio_mese)
If x < tempGiornoSett Then
%>
<td width="20" align="center" bgcolor="#0099ff" bordercolor="#000066"></td>
<%
Else
giorno = g+1
sfondo = "#000066"
selezionato = "#FFCC00"
prefestivo = "#0099ff"
festivo = "#0099ff"
temp = DateAdd("d",g,inizio_mese)
If DatePart("w",temp) = 1 Then
sfondo = festivo
End If
If DatePart("w",temp) = 7 Then
sfondo = prefestivo
End If
If giorno = oggi Then
sfondo = selezionato
End If
%>
<td width="20" align="center" bgcolor="<%=sfondo%>" bordercolor="#000066">
" class="base"><%=giorno%></td>
<%
g = g + 1
End If
Else
%>
<td width="20" align="center" bgcolor="#000066" bordercolor="#000066"></td>
<%
End If
If ciclo = limite And x < 42 Then
Response.Write " </tr>" & vbCrLf
Response.Write " <tr>" & vbCrLf
ciclo = 1
Else
ciclo = ciclo + 1
End If
Next
%>
</tr>
<tr bordercolor="#000066">
<td colspan="2" align="center" bgcolor="#000066" bordercolor="#000066"> " class="base"><<<</td>
<td colspan="3" align="center" bgcolor="#000066" bordercolor="#000066"> oggi</td>
<td colspan="2" align="center" bgcolor="#000066" bordercolor="#000066"> " class="base">>>></td>
</tr>
</table>

Rispondi quotando