Ir para conteúdo

POWERED BY:

Arquivado

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

valdo

Calendário mostra apenas algumas datas

Recommended Posts

Amigos, preciso de uma ajuda.Adaptei um calendário e no padrão brasileiro ele mostra um número x de registros e no padrão americano outro número, e nunca todos os registros que estão num banco access.Será que alguém pode desvendar esse mistério?

Compartilhar este post


Link para o post
Compartilhar em outros sites

você setou a session.lcid pra o padrão brasileiro?tem que ver como estão sendo feitas as consultas e comparar as datas que tem no db com a data setada no session.lcid. Provavelmente você tenha que criar uma pequena função para consultar e gravar no padrão americano e deixar o lcid como brasileiro

Compartilhar este post


Link para o post
Compartilhar em outros sites

você setou a session.lcid pra o padrão brasileiro?tem que ver como estão sendo feitas as consultas e comparar as datas que tem no db com a data setada no session.lcid. Provavelmente você tenha que criar uma pequena função para consultar e gravar no padrão americano e deixar o lcid como brasileiro

Olá jonathandj,Agradeço sua resposta. Estou mesmo gravando no padrão brasileiro e também fazendo a consulta no mesmo padrão.Se for possível me dê mais detalhes de como seria essa função para gravar em americano e e mostrar a consulta do padrão brasileiro.Grato

Compartilhar este post


Link para o post
Compartilhar em outros sites

TODAS as datas estão gravadas como DD/MM/AAAA??se estão coloque no inicio das páginas:session.lcid=1046qual o Db que está usando?na instrução sql mande imprimir antes de executar pra ver como está sendo montada a consulta:response.write(sql)response.end()

Compartilhar este post


Link para o post
Compartilhar em outros sites

TODAS as datas estão gravadas como DD/MM/AAAA??se estão coloque no inicio das páginas:session.lcid=1046qual o Db que está usando?na instrução sql mande imprimir antes de executar pra ver como está sendo montada a consulta:response.write(sql)response.end()

Estou Usando access...E as todas as páginas estão com session.lcid=1046.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pode ser que tenha um contador (FOR) que vai do primeiro dia do mês ao último. Pra montar o calandário.

 

Se lá não funciona, dá uma olhadinha pra ver se a função que pega o último dia do mês está relmente trazendo o último dia, se não tiver, o contador vai fazer apenas algumas voltas, te mostrando o calandário incompleto.

 

Pra pegar o ultimo dia do mês use a função

 

qtdDiasMes = DAY(DateAdd("d",-1,DateAdd("m",1,CDate("1/"&Month(now)&"/"&Year(now)))))

Neste caso está D/M/YYYY

 

Pra trazer no padrão americano, use:

 

qtdDiasMes = DAY(DateAdd("d",-1,DateAdd("m",1,CDate(Month(now)&"/1/"&Year(now)))))

Qualquer coisa, posta aí.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pode ser que tenha um contador (FOR) que vai do primeiro dia do mês ao último. Pra montar o calandário.Se lá não funciona, dá uma olhadinha pra ver se a função que pega o último dia do mês está relmente trazendo o último dia, se não tiver, o contador vai fazer apenas algumas voltas, te mostrando o calandário incompleto.Pra pegar o ultimo dia do mês use a função

qtdDiasMes = DAY(DateAdd("d",-1,DateAdd("m",1,CDate("1/"&Month(now)&"/"&Year(now)))))
Neste caso está D/M/YYYYPra trazer no padrão americano, use:
qtdDiasMes = DAY(DateAdd("d",-1,DateAdd("m",1,CDate(Month(now)&"/1/"&Year(now)))))
Qualquer coisa, posta aí.
Olá, agradeço muito sua dica.Estou fora de minha máquina neste momento e isso está realmente me tirando o sossêgo, se você puder me dar uma ajuda eu lhe agradeço muitíssimo.Será que devo lhe postar o código pra você dar uma olhada?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aí vai...

<%TableWidth = 500BgColor = "#B75A75"CellColor = "#E9DEE2"'dbName = "calendar.mdb"Conn= "DBQ=********************************.mdb;Driver={Microsoft Access Driver (*.mdb)};"ViewDayImage = "goto.gif"EditImage = "<font face=WingDings>" & chr(50) & "</font>"DeleteImage = "<font face=WingDings>" & chr(251) & "</font>"ToTopImage = "<font face=WingDings>" & chr(241) & "</font>"'*ToTopimage = "<img border=0 src=up.gif>"Session.LCID = 1046 %><%'************************************************'***** 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=0 BgColor=" & BgColor & ">" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font color=white Size='-2'><b>" & left(WeekDayName(i), 3) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font color=white size=-3> </Font>" Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="#ffffff"CellStr = "<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</a><BR>"'## Get the Memo Field out of Database for current DateMemo = GetCellData(dDay)IF Memo <> "" then '## Format Cell String if there is a Memo ## CellStr ="<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</Font></a>" & "<a href=#" & dDay & "><img alt='Visualizar evento' border=0 src=" & ViewDayImage & "></a>"'## Save Calendar Details to Print After the Calendar is Displayed ##Details = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD width=" & TableWidth-10 & " bgcolor='" & Bgcolor & "'>" & vbCrlfDetails = Details & " <a class=fonte-bca-data name='" & dDay & "'><Font Size=-2>" & Ucase(WeekDayName(weekday(dDay))) & " " & Ucase(MonthName(Month(dDay))) & " " & Day(dDay) & " , " & Year(dDay) & "</Font>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & " <TD Align=right bgcolor='" & BgColor & "'>" & vbCrlfDetails = Details & "<a href='#?d=" & dDay & "'>" & EditImage & "</a> " Details = Details & "<a href='#?d=" & dDay & "'>" & DeleteImage & "</a> " Details = Details & "<a href=#top>" & ToTopImage & "</a>" Details = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlfDetails = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD bgcolor='" & color & "'>" & vbCrlfDetails = Details & " <a class=fonte-cinza>" & Memo & "</a>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlf'## End Calendar Details ##End If'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## 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 "<BR>" & Details & "<BR>"For i=1 to 50Response.write "<BR>"NextEnd Sub'************************************************'************************************************Sub DisplayCalendarTop(dDay)Title = MonthName(month(dDay)) & " " & year(dDay)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=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(pPREVIOUS) & "&year=" & year(pPREVIOUS) & "'1><font FACE=WingDings color=white>" & chr(239) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<B>" & "<Font color=white>" & Title & "</font></B>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(nNEXT) & "&year=" & year(nNEXT) & "'><font FACE=WingDings color=white>" & chr(240) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlfEnd Sub'************************************************'************************************************Sub DisplayMonths()Response.Write "<TABLE Align=center CELLPADDING=0 CELLSPACING=0 WIDTH=" & TableWidth & ">" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & "#D3BEC3" & "' ALIGN=center>" & vbCrlfResponse.write "<Font color=white size=-2>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=1&year=" & year(now) & "'>Jan</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=2&year=" & year(now) & "'>Fev</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=3&year=" & year(now) & "'>Mar</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=4&year=" & year(now) & "'>Abr</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=5&year=" & year(now) & "'>Mai</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=6&year=" & year(now) & "'>Jun</a>  " & vbCrlfResponse.Write "<BR>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=7&year=" & year(now) & "'>Jul</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=8&year=" & year(now) & "'>Ago</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=9&year=" & year(now) & "'>Set</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=10&year=" & year(now) & "'>Out</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=11&year=" & year(now) & "'>Nov</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=12&year=" & year(now) & "'>Dez</a>  " & vbCrlfResponse.Write "</Font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR></TABLE>" & vbCrlf & vbCrlfEnd Sub'************************************************'************************************************Function GetCellData(dDay)Set rs = Server.CreateObject("ADODB.Recordset")sSQL = "Select * from CalendarInfo where Date=#" & dDay & "#"rs.open sSQL, Conn,3,3GetCellData = ""if rs.recordcount > 0 then GetCellData=rs("memo")rs.closeSet rs = nothingEnd Function'************************************************'************************************************Sub DisplaySmallCalendar(mMonth, yYear)Title = "<a href=calendar.asp?month=" & mMonth & "&year=" & yYear & ">" & MonthName(mMonth) & " " & yYear & "</a>"dDay = DateSerial(yYear,mMonth,1)mMonth = Month(dDay)yYear = Year(dDay)FirstDayOfMonth = Weekday(dDay)Response.Write "<TABLE Align=center width=150 CELLPADDING=0 CELLSPACING=0 BORDER=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<font size=-2>" & Title & "</font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlf'## Start Displaying the Actual Calendar ##Response.Write "<Table width=150 Align=center CellPadding=3 CellSpacing=1 Border=0 BgColor='" & BgColor & "'>" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor='" & bgcolor & "'>" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font Size='-3'><b>" & left(WeekDayName(i), 1) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font size=-3> </Font>"Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="Yellow"CellStr = "<Font size=-3>" & Day(dDay) & "</Font>"'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## For j=1 to 6 ##Response.Write "</Table>" & vbCrlfEnd Sub%>

Manda ...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aí vai...

<%TableWidth = 500BgColor = "#B75A75"CellColor = "#E9DEE2"'dbName = "calendar.mdb"Conn= "DBQ=********************************.mdb;Driver={Microsoft Access Driver (*.mdb)};"ViewDayImage = "goto.gif"EditImage = "<font face=WingDings>" & chr(50) & "</font>"DeleteImage = "<font face=WingDings>" & chr(251) & "</font>"ToTopImage = "<font face=WingDings>" & chr(241) & "</font>"'*ToTopimage = "<img border=0 src=up.gif>"Session.LCID = 1046 %><%'************************************************'***** 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=0 BgColor=" & BgColor & ">" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font color=white Size='-2'><b>" & left(WeekDayName(i), 3) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font color=white size=-3> </Font>" Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="#ffffff"CellStr = "<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</a><BR>"'## Get the Memo Field out of Database for current DateMemo = GetCellData(dDay)IF Memo <> "" then '## Format Cell String if there is a Memo ## CellStr ="<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</Font></a>" & "<a href=#" & dDay & "><img alt='Visualizar evento' border=0 src=" & ViewDayImage & "></a>"'## Save Calendar Details to Print After the Calendar is Displayed ##Details = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD width=" & TableWidth-10 & " bgcolor='" & Bgcolor & "'>" & vbCrlfDetails = Details & " <a class=fonte-bca-data name='" & dDay & "'><Font Size=-2>" & Ucase(WeekDayName(weekday(dDay))) & " " & Ucase(MonthName(Month(dDay))) & " " & Day(dDay) & " , " & Year(dDay) & "</Font>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & " <TD Align=right bgcolor='" & BgColor & "'>" & vbCrlfDetails = Details & "<a href='#?d=" & dDay & "'>" & EditImage & "</a> " Details = Details & "<a href='#?d=" & dDay & "'>" & DeleteImage & "</a> " Details = Details & "<a href=#top>" & ToTopImage & "</a>" Details = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlfDetails = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD bgcolor='" & color & "'>" & vbCrlfDetails = Details & " <a class=fonte-cinza>" & Memo & "</a>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlf'## End Calendar Details ##End If'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## 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 "<BR>" & Details & "<BR>"For i=1 to 50Response.write "<BR>"NextEnd Sub'************************************************'************************************************Sub DisplayCalendarTop(dDay)Title = MonthName(month(dDay)) & " " & year(dDay)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=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(pPREVIOUS) & "&year=" & year(pPREVIOUS) & "'1><font FACE=WingDings color=white>" & chr(239) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<B>" & "<Font color=white>" & Title & "</font></B>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(nNEXT) & "&year=" & year(nNEXT) & "'><font FACE=WingDings color=white>" & chr(240) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlfEnd Sub'************************************************'************************************************Sub DisplayMonths()Response.Write "<TABLE Align=center CELLPADDING=0 CELLSPACING=0 WIDTH=" & TableWidth & ">" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & "#D3BEC3" & "' ALIGN=center>" & vbCrlfResponse.write "<Font color=white size=-2>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=1&year=" & year(now) & "'>Jan</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=2&year=" & year(now) & "'>Fev</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=3&year=" & year(now) & "'>Mar</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=4&year=" & year(now) & "'>Abr</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=5&year=" & year(now) & "'>Mai</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=6&year=" & year(now) & "'>Jun</a>  " & vbCrlfResponse.Write "<BR>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=7&year=" & year(now) & "'>Jul</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=8&year=" & year(now) & "'>Ago</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=9&year=" & year(now) & "'>Set</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=10&year=" & year(now) & "'>Out</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=11&year=" & year(now) & "'>Nov</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=12&year=" & year(now) & "'>Dez</a>  " & vbCrlfResponse.Write "</Font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR></TABLE>" & vbCrlf & vbCrlfEnd Sub'************************************************'************************************************Function GetCellData(dDay)Set rs = Server.CreateObject("ADODB.Recordset")sSQL = "Select * from CalendarInfo where Date=#" & dDay & "#"rs.open sSQL, Conn,3,3GetCellData = ""if rs.recordcount > 0 then GetCellData=rs("memo")rs.closeSet rs = nothingEnd Function'************************************************'************************************************Sub DisplaySmallCalendar(mMonth, yYear)Title = "<a href=calendar.asp?month=" & mMonth & "&year=" & yYear & ">" & MonthName(mMonth) & " " & yYear & "</a>"dDay = DateSerial(yYear,mMonth,1)mMonth = Month(dDay)yYear = Year(dDay)FirstDayOfMonth = Weekday(dDay)Response.Write "<TABLE Align=center width=150 CELLPADDING=0 CELLSPACING=0 BORDER=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<font size=-2>" & Title & "</font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlf'## Start Displaying the Actual Calendar ##Response.Write "<Table width=150 Align=center CellPadding=3 CellSpacing=1 Border=0 BgColor='" & BgColor & "'>" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor='" & bgcolor & "'>" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font Size='-3'><b>" & left(WeekDayName(i), 1) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font size=-3> </Font>"Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="Yellow"CellStr = "<Font size=-3>" & Day(dDay) & "</Font>"'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## For j=1 to 6 ##Response.Write "</Table>" & vbCrlfEnd Sub%>

Manda ...

tentei e ainda não consegui será que alguém pode dar um help?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aí vai...

<%TableWidth = 500BgColor = "#B75A75"CellColor = "#E9DEE2"'dbName = "calendar.mdb"Conn= "DBQ=********************************.mdb;Driver={Microsoft Access Driver (*.mdb)};"ViewDayImage = "goto.gif"EditImage = "<font face=WingDings>" & chr(50) & "</font>"DeleteImage = "<font face=WingDings>" & chr(251) & "</font>"ToTopImage = "<font face=WingDings>" & chr(241) & "</font>"'*ToTopimage = "<img border=0 src=up.gif>"Session.LCID = 1046 %><%'************************************************'***** 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=0 BgColor=" & BgColor & ">" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor=" & bgcolor & ">" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font color=white Size='-2'><b>" & left(WeekDayName(i), 3) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font color=white size=-3> </Font>" Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="#ffffff"CellStr = "<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</a><BR>"'## Get the Memo Field out of Database for current DateMemo = GetCellData(dDay)IF Memo <> "" then '## Format Cell String if there is a Memo ## CellStr ="<a class=fonte-cinza href='#?d=" & dDay & "'><Font size=-2>" & Day(dDay) & "</Font></a>" & "<a href=#" & dDay & "><img alt='Visualizar evento' border=0 src=" & ViewDayImage & "></a>"'## Save Calendar Details to Print After the Calendar is Displayed ##Details = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD width=" & TableWidth-10 & " bgcolor='" & Bgcolor & "'>" & vbCrlfDetails = Details & " <a class=fonte-bca-data name='" & dDay & "'><Font Size=-2>" & Ucase(WeekDayName(weekday(dDay))) & " " & Ucase(MonthName(Month(dDay))) & " " & Day(dDay) & " , " & Year(dDay) & "</Font>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & " <TD Align=right bgcolor='" & BgColor & "'>" & vbCrlfDetails = Details & "<a href='#?d=" & dDay & "'>" & EditImage & "</a> " Details = Details & "<a href='#?d=" & dDay & "'>" & DeleteImage & "</a> " Details = Details & "<a href=#top>" & ToTopImage & "</a>" Details = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlfDetails = Details & "<Table Align=center width=" & TableWidth & " cellspacing=2 cellpadding=3 border=0>" & vbCrlfDetails = Details & "<TR>" & vbCrlfDetails = Details & " <TD bgcolor='" & color & "'>" & vbCrlfDetails = Details & " <a class=fonte-cinza>" & Memo & "</a>" & vbCrlfDetails = Details & " </TD>" & vbCrlfDetails = Details & "</TR>" & vbCrlfDetails = Details & "</Table>" & vbCrlf'## End Calendar Details ##End If'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## 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 "<BR>" & Details & "<BR>"For i=1 to 50Response.write "<BR>"NextEnd Sub'************************************************'************************************************Sub DisplayCalendarTop(dDay)Title = MonthName(month(dDay)) & " " & year(dDay)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=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(pPREVIOUS) & "&year=" & year(pPREVIOUS) & "'1><font FACE=WingDings color=white>" & chr(239) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<B>" & "<Font color=white>" & Title & "</font></B>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<a href='" & request.servervariables("SCRIPT_NAME") & "?month=" & month(nNEXT) & "&year=" & year(nNEXT) & "'><font FACE=WingDings color=white>" & chr(240) & "</font></a>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlfEnd Sub'************************************************'************************************************Sub DisplayMonths()Response.Write "<TABLE Align=center CELLPADDING=0 CELLSPACING=0 WIDTH=" & TableWidth & ">" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & "#D3BEC3" & "' ALIGN=center>" & vbCrlfResponse.write "<Font color=white size=-2>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=1&year=" & year(now) & "'>Jan</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=2&year=" & year(now) & "'>Fev</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=3&year=" & year(now) & "'>Mar</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=4&year=" & year(now) & "'>Abr</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=5&year=" & year(now) & "'>Mai</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=6&year=" & year(now) & "'>Jun</a>  " & vbCrlfResponse.Write "<BR>"Response.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=7&year=" & year(now) & "'>Jul</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=8&year=" & year(now) & "'>Ago</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=9&year=" & year(now) & "'>Set</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=10&year=" & year(now) & "'>Out</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=11&year=" & year(now) & "'>Nov</a>  " & vbCrlfResponse.Write "  <a href='" & request.servervariables("SCRIPT_NAME") & "?month=12&year=" & year(now) & "'>Dez</a>  " & vbCrlfResponse.Write "</Font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR></TABLE>" & vbCrlf & vbCrlfEnd Sub'************************************************'************************************************Function GetCellData(dDay)Set rs = Server.CreateObject("ADODB.Recordset")sSQL = "Select * from CalendarInfo where Date=#" & dDay & "#"rs.open sSQL, Conn,3,3GetCellData = ""if rs.recordcount > 0 then GetCellData=rs("memo")rs.closeSet rs = nothingEnd Function'************************************************'************************************************Sub DisplaySmallCalendar(mMonth, yYear)Title = "<a href=calendar.asp?month=" & mMonth & "&year=" & yYear & ">" & MonthName(mMonth) & " " & yYear & "</a>"dDay = DateSerial(yYear,mMonth,1)mMonth = Month(dDay)yYear = Year(dDay)FirstDayOfMonth = Weekday(dDay)Response.Write "<TABLE Align=center width=150 CELLPADDING=0 CELLSPACING=0 BORDER=0>" & vbCrlfResponse.Write "<TR VALIGN=MIDDLE ALIGN=CENTER>" & vbCrlfResponse.Write "<TD BgColor='" & BgColor & "' ALIGN=center>" & vbCrlfResponse.Write "<font size=-2>" & Title & "</font>" & vbCrlfResponse.Write "</TD>" & vbCrlfResponse.Write "</TR>" & vbCrlfResponse.Write "</TABLE>" & vbCrlf'## Start Displaying the Actual Calendar ##Response.Write "<Table width=150 Align=center CellPadding=3 CellSpacing=1 Border=0 BgColor='" & BgColor & "'>" & vbCrlfResponse.Write "<TR Valign=Top Align=Center BgColor='" & bgcolor & "'>" & vbCrlfFor i = vbSunday To vbSaturday Response.Write "<TD><Font Size='-3'><b>" & left(WeekDayName(i), 1) & "</b></Font></TD>" & vbCrlfNextResponse.Write "</TR>" & vbCrlf'## Set dDay to the First day of the month ##dDay = DateSerial(yYear,mMonth,1)FOR j=1 to 6Response.Write "<TR>" & vbCrlfFOR i=vbSunday to vbSaturdayCellStr="<Font size=-3> </Font>"Color=cellcolorIf WeekDay(dDay) = i and Month(dDay) = mMonth then '## Set Color to Yellow if Current Dayif (Day(dDay) = Day(now)) and (Month(dDay) = Month(now)) and (Year(dDay) = Year(now)) then Color="Yellow"CellStr = "<Font size=-3>" & Day(dDay) & "</Font>"'## Get the Next Day dDay = DateAdd("d",1,dDay)End IfResponse.Write "<TD vAlign=top align=left BgColor='" & Color & "'>" & CellStr & "</TD>" & vbCrlfNEXT '## FOR i=vbSunday to vbSaturday ##Response.Write "</TR>" & vbCrlfNEXT '## For j=1 to 6 ##Response.Write "</Table>" & vbCrlfEnd Sub%>

Manda ...

tentei e ainda não consegui será que alguém pode dar um help?
E o problema continua sem solução. os registros vão para o bd mas na consulta alguns deles não aparecem...Socorro!!!

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.