eccolo... però occhio che ha qlk problema il tuo calendario... marzo 2006 mi parte da lunedi invece dovrebbe partire mercoledì
edit: ok qui
codice:
if indice=Datepart("w",corrente,2) then
metti <> e non =
codice:
<style type="text/css">
span {font: bold 8pt Verdana,Arial;}
select {font: 8px Verdana,Arial;}
td {font: 7pt Verdana,Arial; width:12px; height:12px; padding: 0px; }
.giorni { font: bold; color:#ffffff; background: #660000; text-align:center}
.normale {color: #990000; background: #fff9f9;}
.oggi { font: bold; color: #990000; background: #ffffff; border: 1px solid #660000}
.attivo { font: bold; color: #ffffff; background: #990000; }
.presente { font: bold; color: #ffffff; background: #c1c1c1; }
.vuoto { background: #ffffff; }
a {color: #990000; text-decoration:none;}
</style>
<%
nomi_mesi=",Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre"
array_mesi=split(nomi_mesi,",")
nomi_giorni=",Lu,Ma,Me,Gi,Ve,Sa,Do"
array_giorni=split(nomi_giorni,",")
giorno_ora = day(date)
mese_ora = month(date)
anno_ora = year(date)
%>
<%
giorno_attivo = request("gg")
if giorno_attivo <>"" then
giorno_attivo = cInt(request("gg"))
end if
mese_attivo = request("mm")
if mese_attivo ="" then
mese_attivo = cInt(mese_ora)
else
mese_attivo = cInt(request("mm"))
end if
anno_attivo = request("aaaa")
if anno_attivo ="" then
anno_attivo = cInt(anno_ora)
else
anno_attivo = cInt(request("aaaa"))
end if
'creo la data iniziale del mese
corrente= "01/"& mese_attivo &"/"& anno_attivo
'corrente= mese_attivo & "/01/" & anno_attivo
%>
<span>
<%=array_mesi(mese_attivo)%> <%=anno_attivo%>
</span>
<%
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("z.mdb")
Conn.Open strConn
%>
<table cellpadding="1" cellspacing="0" bgcolor="#ffffff"> <%
Response.Write("<tr>")
for i = 1 to 7
Response.Write "<td class='giorni'>"&array_giorni(i)&"</td>"
next
Response.Write("</tr>")
conta_gg = 1
for settimana=1 to 6
Response.Write("<tr>")
for indice = 1 to 7
if indice<>Datepart("w",corrente,2) then
Response.Write("<td class='vuoto'> </td>")
else
if mese_attivo=Month(corrente) then
if conta_gg=giorno_ora and mese_attivo=mese_ora and anno_attivo=anno_ora then %>
<td class='oggi'><%=conta_gg%><%=esistente%></td> <%
elseif conta_gg = giorno_attivo then %>
<td class='attivo'><%=conta_gg%><%=esistente%></td> <%
else %>
<%
sql="SELECT * FROM new WHERE DAY(data)="& conta_gg & " AND MONTH(Data)="& mese_attivo & " AND YEAR(Data)="& anno_attivo
rs.open sql,strConn,3,3
if not rs.eof then
%>
<td class="presente">&gg=<%=conta_gg%>&mm=<%=mese_attivo%>&aaaa=<%=anno_attivo%>"><%=conta_gg%></td>
<%
else
%>
<td class="normale"><%=conta_gg%></td>
<%
end if
rs.close
%>
<%
end if
corrente=dateadd("d",1,corrente)
conta_gg=conta_gg+1
else
settimana=6
end if
end if
next
Response.Write("</tr>")
next %>
</table>