ciao sapreste dirmi come mai da quando ho inserito questo script le date di tutti i database me le stampa mese/giono/anno
ad esempio 1/16/2009
???
codice:
<%
'************************************************
'***** Written By Don Lasseigne *****************
'***** dlasseigne@yahoo.com *********************
'************************************************
TableWidth = 500
BgColor = "#ffffff"
CellColor = "#ffffff"
dbName = "mdb-database/calendar.mdb"
Conn= "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath(dbName)
ViewDayImage = "images/goto.gif"
'# UserName: admin
'# Password: admin
'# You can manually change this in the database
Session.LCID = 1033
%>
<%
'************************************************
'***** FUNCTIONS *********
'************************************************
Sub DisplayCalendar(mMonth, yYear)
dDay = DateSerial(yYear,mMonth,1)
mMonth = Month(dDay)
yYear = Year(dDay)
FirstDayOfMonth = Weekday(dDay)
'## Display the Top of Calendar ##
CALL DisplayCalendarTop(dDay)
'## Start Displaying the Actual Calendar ##
Response.Write "<Table Align=center width=" & TableWidth & " CellPadding=3 CellSpacing=1 Border=1 BgColor=" & BgColor & ">" & vbCrlf
Response.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlf
Response.Write "<TD>Dom</TD>" & vbCrlf
Response.Write "<TD>Lun</TD>" & vbCrlf
Response.Write "<TD>Mar</TD>" & vbCrlf
Response.Write "<TD>Mer</TD>" & vbCrlf
Response.Write "<TD>Gio</TD>" & vbCrlf
Response.Write "<TD>Ven</TD>" & vbCrlf
Response.Write "<TD>Sab</TD>" & vbCrlf
Response.Write "</TR>" & vbCrlf
'## Set dDay to the First day of the month ##
dDay = DateSerial(yYear,mMonth,1)
FOR j=1 to 6
Response.Write "<TR>" & vbCrlf
FOR i=vbSunday to vbSaturday
CellStr=""
Color=cellcolor
If WeekDay(dDay) = i and Month(dDay) = mMonth then
'## Set Color to Yellow if Current Day
if (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="#85b31f"
CellStr = Day(dDay) & "
"
'## Get the Memo Field out of Database for current Date
Memo = GetCellData(dDay)
IF Memo <> "" then
'## Format Cell String if there is a Memo ##
CellStr =Day(dDay) & "
" & "<a href=#" & dDay & ">[img] & ViewDayImage & [/img]</a>"
'## Save Calendar Details to Print After the Calendar is Displayed ##
Details = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlf
Details = Details & "<TR>" & vbCrlf
Details = Details & " <TD width=" & TableWidth-10 & " bgcolor='" & Bgcolor & "'>" & vbCrlf
if WeekDayName(weekday(dDay)) = "Mondey" then
giorno="Lunedi"
end if
if WeekDayName(weekday(dDay)) = "Tuesday" then
giorno="Martedi"
end if
if WeekDayName(weekday(dDay)) = "Wednesday" then
giorno="Mercoledi"
end if
if WeekDayName(weekday(dDay)) = "Thursday" then
giorno="Giovedi"
end if
if WeekDayName(weekday(dDay)) = "Friday" then
giorno="Venerdi"
end if
if WeekDayName(weekday(dDay)) = "Saturday" then
giorno="Sabato"
end if
if WeekDayName(weekday(dDay)) = "Sunday" then
giorno="Domenica"
end if
Details = Details & " <a name='" & dDay & "'>" & giorno & " " & Day(dDay) & "" & vbCrlf
Details = Details & " </TD>" & vbCrlf
Details = Details & " <TD Align=right bgcolor='" & BgColor & "'>" & vbCrlf
Details = Details & "<a href=#top>Su</a>"
Details = Details & " </TD>" & vbCrlf
Details = Details & "</TR>" & vbCrlf
Details = Details & "</Table>" & vbCrlf
Details = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlf
Details = Details & "<TR>" & vbCrlf
Details = Details & " <TD bgcolor='" & color & "'>" & vbCrlf
Details = Details & " <PRE><span style='font-family:arial, Verdana, sans-serif'>" & Memo & "</span></PRE>" & vbCrlf
Details = Details & " </TD>" & vbCrlf
Details = Details & "</TR>" & vbCrlf
Details = Details & "</Table>" & vbCrlf
'## End Calendar Details ##
End If
'## Get the Next Day
dDay = DateAdd("d",1,dDay)
End If
Response.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlf
NEXT '## FOR i=vbSunday to vbSaturday ##
Response.Write "</TR>" & vbCrlf
NEXT '## For j=1 to 6 ##
Response.Write "</Table>" & vbCrlf
'## Display the Months at the bottom of the calendar ##
CALL DisplayMonths()
'## Display the Calendar Details ##
Response.write "
" & Details & "
"
For i=1 to 50
Response.write "
"
Next
End Sub
'************************************************
'************************************************
Sub DisplayCalendarTop(dDay)
if MonthName(month(dDay)) = "January" then
title = "Gennaio " & year(dDay)
end if
if MonthName(month(dDay)) = "February" then
title = "Febbraio " & year(dDay)
end if
if MonthName(month(dDay)) = "March" then
title = "Marzo " & year(dDay)
end if
if MonthName(month(dDay)) = "April" then
title = "Aprile " & year(dDay)
end if
if MonthName(month(dDay)) = "May" then
title = "Maggio " & year(dDay)
end if
if MonthName(month(dDay)) = "June" then
title = "Giugno " & year(dDay)
end if
if MonthName(month(dDay)) = "July" then
title = "Luglio " & year(dDay)
end if
if MonthName(month(dDay)) = "August" then
title = "Agosto " & year(dDay)
end if
if MonthName(month(dDay)) = "September" then
title = "Settembre " & year(dDay)
end if
if MonthName(month(dDay)) = "October" then
title = "Ottobre " & year(dDay)
end if
if MonthName(month(dDay)) = "November" then
title = "Novembre " & year(dDay)
end if
if MonthName(month(dDay)) = "December" then
title = "Dicembre " & year(dDay)
end if
pPREVIOUS = dateadd("m",-1, dDay)
nNEXT = dateadd("m",1,dDay)
Response.Write "<a name=top><TABLE Align=center CELLPADDING=0 CELLSPACING=0 WIDTH=" & TableWidth & " BORDER=1>" & vbCrlf
Response.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlf
Response.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlf
Response.Write "[img]images/indietro.jpg[/img]" & vbCrlf
Response.Write "</TD>" & vbCrlf
Response.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlf
Response.Write "<span style='font-size:10pt'>" & Title & "</span>" & vbCrlf
Response.Write "</TD>" & vbCrlf
Response.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlf
Response.Write "[img]images/avanti.jpg[/img]" & vbCrlf
Response.Write "</TD>" & vbCrlf
Response.Write "</TR>" & vbCrlf
Response.Write "</TABLE>" & vbCrlf
End Sub
'************************************************
'************************************************
Sub DisplayMonths()
Response.Write "<TABLE Align=center CELLPADDING=0 CELLSPACING=0 WIDTH=" & TableWidth & " BORDER=1 BORDERCOLORLIGHT=#FFFFFF>" & vbCrlf
Response.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlf
Response.Write "<TD ALIGN=center>" & vbCrlf
Response.Write "Gennaio-" & vbCrlf
Response.Write "Febbraio-" & vbCrlf
Response.Write "Marzo-" & vbCrlf
Response.Write "Aprile-" & vbCrlf
Response.Write "Maggio-" & vbCrlf
Response.Write "Giugno" & vbCrlf
Response.Write "
"
Response.Write "Luglio-" & vbCrlf
Response.Write "Agosto-" & vbCrlf
Response.Write "Settembre-" & vbCrlf
Response.Write "Ottobre-" & vbCrlf
Response.Write "Novembre-" & vbCrlf
Response.Write "Dicembre" & vbCrlf
Response.Write "</TD>" & vbCrlf
Response.Write "</TR></TABLE>" & vbCrlf & vbCrlf
End Sub
'************************************************
'************************************************
Function GetCellData(dDay)
Set rs = Server.CreateObject("ADODB.Recordset")
sSQL = "Select * from CalendarInfo where Date=#" & dDay & "#"
rs.open sSQL, Conn,3,3
GetCellData = ""
if rs.recordcount > 0 then GetCellData=rs("memo")
rs.close
Set rs = nothing
End Function
'************************************************
%>