Ir para conteúdo

POWERED BY:

Arquivado

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

mergulhador

Problema com calendario

Recommended Posts

Ola gente,TEnho este script de calendarioo que quero fazer é passar só dia 18 ou dia 19... como parametro nao o dia completo, como é melhor corrigir isto<%@ Language=VBScript %><html><body><style>a:hover {color:red;}</style><style>A:link, A:active, A:visited { color : ; text-decoration : none; }A:hover { color : #ff0000; text-decoration : underline; }</style><script language="Javascript"> //Sending the values when the month and year are selected from the combo boxes function SendVal() { if((document.Cal.MonthNames.options(document.Cal.MonthNames.selectedIndex).text)!="") { if((document.Cal.ListYears.options(document.Cal.ListYears.selectedIndex).text)!="") { mon=document.Cal.MonthNames.options(document.Cal.MonthNames.selectedIndex).text yr=document.Cal.ListYears.options(document.Cal.ListYears.selectedIndex).text document.location.href="ASPCalendar.asp?Show=Yes&CurMonth=" + mon + "&CurYear=" + yr } } }</script><%res=Request.QueryString("Show")whichmonth=Request.QueryString("CurMonth")whichyear=Request.QueryString("CurYear")whataction=Request.QueryString("Action")%><form name="Cal"><% dim nextmonthdim acalandardays(42)nextmonth = 0dbcurrentdate = date()if res="Yes" then whichdate="01" & "/" & whichmonth & "/" & whichyear if whataction="Next" then dbcurrentdate=dateadd("m",1,cdate(whichdate)) elseif whataction="Prev" then dbcurrentdate=dateadd("m",-1,cdate(whichdate)) else dbcurrentdate=whichdate end ifend ifDim dbcurrentdate dim ifirstweekdayifirstweekday = datepart("W",dateserial(year(dbcurrentdate),month(dbcurrentdate),1))dim idaysinmonth idaysinmonth = datepart("d",dateserial(year(dbcurrentdate),month(dbcurrentdate)+1,1-1))dim iloopfor iloop = 1 to idaysinmonth acalandardays(iloop+ifirstweekday-1)=iloopnextdim icolumns,irowsicolumns = 7 irows = 6-int((42-(ifirstweekday+idaysinmonth))/7)%><table align =center border=1 cellspacing = 1 width=45% height=45%><th colspan=7 bgcolor=lightblue><%curmonth=monthname(month(dbcurrentdate))Response.Write curmonthcuryear=year(dbcurrentdate)Response.Write " " & curyear %>                                 <a href="ASPCalendar.asp?Show=Yes&CurMonth=<%=left(curmonth,3)%>&CurYear=<%=curyear%>&Action=Prev">Prev</a> <a href="ASPCalendar.asp?Show=Yes&CurMonth=<%=left(curmonth,3)%>&CurYear=<%=curyear%>&Action=Next">Next</a><%Response.Write "<tr>"Response.Write "<td align=center>"Response.Write "<font color=red><b>"Response.Write "Dom"Response.Write "</font>"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "Seg"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "Ter"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "Qua"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "Qui"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "---"Response.Write "</td>"Response.Write "<td align=center><b>"Response.Write "Sab"Response.Write "</td>"Response.Write "</tr>"%></font><% dim irowsloop ,icolumnsloopstartday=weekday("01" & "/" & monthname(month(dbcurrentdate)) & "/" & year(dbcurrentdate))ctr=1for irowsloop = 1 to irows Response.Write "<tr>" if ctr=1 then colm = startday else colm=1 end if if startday>1 then diff=colm - 1 end if for icolumnsloop=colm to icolumns if acalandardays((irowsloop-1)*7 +icolumnsloop) >= 0 then if diff>0 then for p=1 to diff Response.Write "<td valign= top align=right width=""14%"">" Response.Write "</td>" next diff=0 end if Response.Write "<td valign= top align=right width=""14%"">" if icolumnsloop=1 then Response.Write "<font color=red>" end if if month(dbcurrentdate)<month(Date()) then if acalandardays((irowsloop-1)*7 + icolumnsloop)=day(Date()) and month(dbcurrentdate)=month(Date()) and year(dbcurrentdate)=year(Date()) then Response.Write "<font color=blue>" end if Response.Write acalandardays((irowsloop-1)*7 + icolumnsloop) elseif month(dbcurrentdate)=month(Date()) and acalandardays((irowsloop-1)*7 + icolumnsloop) < day(Date()) then Response.Write acalandardays((irowsloop-1)*7 + icolumnsloop) elseif month(dbcurrentdate)=month(Date()) and acalandardays((irowsloop-1)*7 + icolumnsloop) >= day(Date())then Response.Write "<a href=ToSomePage.asp?" & acalandardays((irowsloop-1)*7 + icolumnsloop) & "-" & curmonth & "-" & curyear & ">" & acalandardays((irowsloop-1)*7 + icolumnsloop) & "</a>" elseif month(dbcurrentdate)>month(Date()) then Response.Write "<a href=ToSomePage.asp?" & acalandardays((irowsloop-1)*7 + icolumnsloop) & "-" & curmonth & "-" & curyear & ">" & acalandardays((irowsloop-1)*7 + icolumnsloop) & "</a>" end if Response.Write "</td>" else Response.Write "<td> </td>" end if ctr=2 next Response.Write "<tr>" colm=2nextResponse.Write "<br>"%></table></form></body></html>AbraçosLuciano

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara posta só aonde você quer pegar a data o código inteiro é desnecessário.

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.