calendar.asp
codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim myMonth(42)
data = request.queryString("data")
if len(data) = 0 or (not isDate(data)) then data = formatDateTime(Date(),vbGeneralDate)
mese = datePart("m",data)
primoDelMese = "01" & "/" & mese & "/" & datePart("yyyy",data)
giornoDellaSettimana = weekDay(primoDelMese)
i = 1
for x = 1 to 42
if x >= giornoDellaSettimana then
if isDate(i & "/" & mese & "/" & datePart("yyyy",data)) then
myMonth(x) = i
i = i + 1
else
myMonth(x) = ""
end if
else
myMonth(x) = ""
end if
next
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Calendario</title>
<style type="text/css">
<!--
.testo {
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
color: #000000;
}
body {
background-color: #D4D0C8;
}
.table {
border: 1px solid #000000;
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
color: #000000;
}
a:link {
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
color: #0033CC;
text-decoration: none;
}
a:visited {
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
color: #0033CC;
text-decoration: none;
}
a:hover {
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
color: #FF3300;
text-decoration: underline;
}
-->
</style>
</head>
<body onLoad="window.focus();">
<table width="126" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td colspan="7" class="table"><%=uCase(monthName(mese))%><%=datePart("yyyy",data)%></td>
</tr>
<tr align="center">
<td width="18" class="table">D</td>
<td width="18" class="table">L</td>
<td width="18" class="table">M</td>
<td width="18" class="table">M</td>
<td width="18" class="table">G</td>
<td width="18" class="table">V</td>
<td width="18" class="table">S</td>
</tr>
<tr align="center">
<%
i = 1
riga = 1
for y = 1 to uBound(myMonth)
if myMonth(y) <> "" then
tempDay = myMonth(y)
if tempDay < 9 then tempDay = "0" & tempDay
tempMonth = mese
if tempMonth < 9 then tempMonth = "0" & tempMonth
tempYear = datePart("yyyy",data)
tempDate = tempDay & "/" & tempMonth & "/" & tempYear
%>
<td class="table"><%=myMonth(y)%></td>
<%
else
%>
<td class="table"><%=myMonth(y)%></td>
<%
end if
if i = 7 then
%>
</tr>
<% if riga < 6 then %>
<tr align="center">
<% end if %>
<%
i = 1
riga = riga + 1
else
i = i + 1
end if
next
%>
<tr align="center">
<td colspan="2" class="table">">«</td>
<td colspan="3" class="table"></td>
<td colspan="2" class="table">">»</td>
</tr>
</table>
</body>
</html>