Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

WLJ

com calendário...

Recommended Posts

E ai pessoal tudo beleza... é o seguinte.... tô aqui sofrendo lendo esse código que peguei aqui mesmo no fórum mas naum entendo men a pau... será que dá pra alguém fazer alguns comentários no código pra ver se eu acho uma luz no fim do túnel... ou melhor código...<% Sub DisplayCalendar(mMonth, yYear) dim sToday, nextMonth, pastMonth, dataBrasil BgColor = "#efefef" Title = MonthName(mMonth) & " / " & yYear dDay = DateSerial(yYear,mMonth,1) mMonth = Month(dDay) yYear = Year(dDay) texto = Mid(Title, 1, 1) Title = UCase(texto) & Mid(Title ,2) FirstDayOfMonth = Weekday(dDay) pastMonth = (DateAdd("m",-1,dDay)) nextMonth = (DateAdd("m",+1,dDay)) Response.Write "<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>" & vbCrlf Response.Write "<TR>" & vbCrlf Response.Write "<TD>" & vbCrlf Response.Write "<p align='center'><font face='Arial' size='2'><b>" & Title & "</b></font></TD>" & vbCrlf Response.Write "</TR>" & vbCrlf Response.Write "</TABLE>" & vbCrlf Response.Write "<p align='center' style='margin-top: 0; margin-bottom: 0'>" & vbCrlf Response.Write " <br>" & vbCrlf Response.Write "<Table width=140 Border=0 BgColor=" & BgColor & ">" & vbCrlf Response.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlf For i = vbSunday To vbSaturday Response.Write "<TD Width='15%' bgcolor='#98CC48'><Font Face='Arial' Size='1' Color='#FFFFFF'><b>" & Ucase(left(WeekDayName(i), 1)) & "</b></Font></TD>" & vbCrlf Next Response.Write "</TR>" & vbCrlf dDay = DateSerial(yYear,mMonth,1) For j=1 to 5 Response.Write "<TR>" & vbCrlf For i = vbSunday to vbSaturday CellStr=" " CellColor = "#FDFDFD" If WeekDay(dDay) = i and Month(dDay) = mMonth then sToday = dDay dataBrasil = day(dDay) & "/" & month(dDay) & "/" & year(dDay) if Cdate(dDay) > cDate(now) then CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay)& "</a></center>" else If (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then CellColor="#98CC48" CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" else CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" end if end if dDay = DateAdd("d",1,dDay) End If Response.Write "<TD BgColor=" & CellColor & "><Font Face=Arial size=1>" & CellStr & "</Font></TD>" & vbCrlf Next Response.Write "</TR>" & vbCrlf Next Response.Write "</Table>" & vbCrlf End Sub mMonth = request.form("month") yYear = request.form("year") if mMonth = "" then mMonth= Month(now) if yYear = "" then yYear = Year(now) %> <% Call DisplayCalendar(mMonth, yYear) %> Valew.... ;)

Compartilhar este post


Link para o post
Compartilhar em outros sites

<% 'iniciar sub-função do CalendárioSub DisplayCalendar(mMonth, yYear) dim sToday, nextMonth, pastMonth, dataBrasil BgColor = "#efefef" Title = MonthName(mMonth) & " / " & yYear dDay = DateSerial(yYear,mMonth,1) mMonth = Month(dDay) yYear = Year(dDay) texto = Mid(Title, 1, 1) Title = UCase(texto) & Mid(Title ,2) FirstDayOfMonth = Weekday(dDay) pastMonth = (DateAdd("m",-1,dDay)) nextMonth = (DateAdd("m",+1,dDay)) 'aqui começa a printar a tabelaResponse.Write "<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>" & vbCrlf Response.Write "<TR>" & vbCrlf Response.Write "<TD>" & vbCrlf Response.Write "<p align='center'><font face='Arial' size='2'><b>" & Title & "</b></font></TD>" & vbCrlf Response.Write "</TR>" & vbCrlf Response.Write "</TABLE>" & vbCrlf Response.Write "<p align='center' style='margin-top: 0; margin-bottom: 0'>" & vbCrlf Response.Write " <br>" & vbCrlf Response.Write "<Table width=140 Border=0 BgColor=" & BgColor & ">" & vbCrlf Response.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlf 'aqui irá printar os dias da semana Ex: Domingo(D), Segunda(S)For i = vbSunday To vbSaturday Response.Write "<TD Width='15%' bgcolor='#98CC48'><Font Face='Arial' Size='1' Color='#FFFFFF'><b>" & Ucase(left(WeekDayName(i), 1)) & "</b></Font></TD>" & vbCrlf Next 'parou aqui....Response.Write "</TR>" & vbCrlf dDay = DateSerial(yYear,mMonth,1) 'aqui ele irá printar as 5 linhas da tabelaFor j=1 to 5 Response.Write "<TR>" & vbCrlf 'e aqui irá começar a printar os dias do Mês Ex: 1,2,3,4...31For i = vbSunday to vbSaturday CellStr=" " CellColor = "#FDFDFD" If WeekDay(dDay) = i and Month(dDay) = mMonth then sToday = dDay dataBrasil = day(dDay) & "/" & month(dDay) & "/" & year(dDay) if Cdate(dDay) > cDate(now) then CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay)& "</a></center>" else If (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then CellColor="#98CC48" CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" else CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" end if end if dDay = DateAdd("d",1,dDay) End If Response.Write "<TD BgColor=" & CellColor & "><Font Face=Arial size=1>" & CellStr & "</Font></TD>" & vbCrlf Next 'final dos dias do mes...Response.Write "</TR>" & vbCrlf Next 'final das linhas..........Response.Write "</Table>" & vbCrlf End Sub 'aqui ele irá recuperar as QueryStringsmMonth = request.form("month") yYear = request.form("year") if mMonth = "" then mMonth= Month(now) if yYear = "" then yYear = Year(now) %> <% 'aqui ele chama a sub-função....Call DisplayCalendar(mMonth, yYear) %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá sou novo por aqui e gostaria de saber como faço isso no vb com mysql pois estou tendo que criar uma lista de chamada da seguinte forma:SEG|TER|QUA|QUI|---|SEG|TER|QUA|QUI|---| DIAS DA SEMANA05 06 07 08 09 12 13 14 15 16 -DIAS DO MESNo caso de : 05fevereiro de 2007à 16/fevereiro de 2007 sempre vou ter q gerar assim de duas em duas semanasdesde já agradeço

<% 'iniciar sub-função do CalendárioSub DisplayCalendar(mMonth, yYear) dim sToday, nextMonth, pastMonth, dataBrasil BgColor = "#efefef" Title = MonthName(mMonth) & " / " & yYear dDay = DateSerial(yYear,mMonth,1) mMonth = Month(dDay) yYear = Year(dDay) texto = Mid(Title, 1, 1) Title = UCase(texto) & Mid(Title ,2) FirstDayOfMonth = Weekday(dDay) pastMonth = (DateAdd("m",-1,dDay)) nextMonth = (DateAdd("m",+1,dDay)) 'aqui começa a printar a tabelaResponse.Write "<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>" & vbCrlf Response.Write "<TR>" & vbCrlf Response.Write "<TD>" & vbCrlf Response.Write "<p align='center'><font face='Arial' size='2'><b>" & Title & "</b></font></TD>" & vbCrlf Response.Write "</TR>" & vbCrlf Response.Write "</TABLE>" & vbCrlf Response.Write "<p align='center' style='margin-top: 0; margin-bottom: 0'>" & vbCrlf Response.Write " <br>" & vbCrlf Response.Write "<Table width=140 Border=0 BgColor=" & BgColor & ">" & vbCrlf Response.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlf 'aqui irá printar os dias da semana Ex: Domingo(D), Segunda(S)For i = vbSunday To vbSaturday Response.Write "<TD Width='15%' bgcolor='#98CC48'><Font Face='Arial' Size='1' Color='#FFFFFF'><b>" & Ucase(left(WeekDayName(i), 1)) & "</b></Font></TD>" & vbCrlf Next 'parou aqui....Response.Write "</TR>" & vbCrlf dDay = DateSerial(yYear,mMonth,1) 'aqui ele irá printar as 5 linhas da tabelaFor j=1 to 5 Response.Write "<TR>" & vbCrlf 'e aqui irá começar a printar os dias do Mês Ex: 1,2,3,4...31For i = vbSunday to vbSaturday CellStr=" " CellColor = "#FDFDFD" If WeekDay(dDay) = i and Month(dDay) = mMonth then sToday = dDay dataBrasil = day(dDay) & "/" & month(dDay) & "/" & year(dDay) if Cdate(dDay) > cDate(now) then CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay)& "</a></center>" else If (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then CellColor="#98CC48" CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" else CellStr = "<center><a href='mostraevento.asp?data=" & Day(dDay) & "/" & month(dDay) & "/" & year(dDay) & "' title='" & formatdatetime((Day(dDay) & "/" & Month(dDay) & "/" & Year(dDay)),vblongdate) & "'>" & Day(dDay) &"</a></center>" end if end if dDay = DateAdd("d",1,dDay) End If Response.Write "<TD BgColor=" & CellColor & "><Font Face=Arial size=1>" & CellStr & "</Font></TD>" & vbCrlf Next 'final dos dias do mes...Response.Write "</TR>" & vbCrlf Next 'final das linhas..........Response.Write "</Table>" & vbCrlf End Sub 'aqui ele irá recuperar as QueryStringsmMonth = request.form("month") yYear = request.form("year") if mMonth = "" then mMonth= Month(now) if yYear = "" then yYear = Year(now) %> <% 'aqui ele chama a sub-função....Call DisplayCalendar(mMonth, yYear) %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.