Ir para conteúdo

POWERED BY:

Arquivado

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

WLJ

wlj

Recommended Posts

Falae pessoal, tudo beleza??? Seguinte... peguei esse codigo na net para fazer um calendario mas naum manjo de vbscript... o problema é o seguinte eu precisaria colocar links nos dias e neste caso que peguei (ASPCalendar) não tem links... poderiam me orientar como colocar esses links?

 

Creio que seja no código abaixo que vai o link... se não me desculpem...

 

for i = 1 to UBound(dayNames)   with response  	.Write "<td class=""days"" width=""13%""><div align=center class=""days"">"  	.Write dayNames(i)  	.Write "</td>"  end with  	next	Response.Write "</tr>"		dim ib, thisDay	'do while tmpDayInt2 < lastDay	for ib = 1  to 6	Response.Write "<tr>" & chr(10)  for i = 1 to 7  	    if int(tmpDayInt2) = int(day(now)) - 1 and int(month(now)) = int(selMonth) and int(year(now)) = int(selYear) then   	thisDay = " id=""today"""  else  	thisDay = ""  end if  	  	  	if tmpDayInt2 = selDay - 1 and firstWeekday > tmpDayInt + 1 then    Response.Write "<td class=""normalday"" width=""14%""><div align=""center"" class=""day"">"  	elseif tmpDayInt2 = selDay - 1 then    Response.Write "<td class=""selectedday"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">"  	else    ' check if day is weekend    if i = 6 or i = 7 then    	Response.Write "<td class=""weekend"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">"     else    	Response.Write "<td class=""normalday"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">"     end if  	end if  

Compartilhar este post


Link para o post
Compartilhar em outros sites

Em todo caso esse é o código inteiro... a única coisa que mudei foi passar do ingles pro pt...

 

<%option explicitResponse.Expires=-240' Session lcid for finnish date and time is 1035Session.LCID = 1046Response.Buffer = trueResponse.Addheader "Pragma","no-cache"'============================================================================================' VARIABLES'============================================================================================Dim myToday ' this dayDim iDim SelMonth, selDay, selYearDim tmpStrDim monthNamesFin, monthNamesEn, monthNames, dayNamesFin, dayNamesEn, dayNamesDim lastDayDim tmpLangdim firstWeekDayDim scriptNamescriptName = Request.ServerVariables("SCRIPT_NAME")scriptName = replace(replace(scriptName, "default.asp", ""),"Default.asp", "")Dim imgPathimgPath = "/images/"'============================================================================================' HTML'============================================================================================%><html><head><title>ASPCalendar</title><style type="text/css">.day{	font-family:arial;	font-size:11px;	}.day a {	font-weight:bold;	color: #000000;	text-decoration:none;}.day a:visited {	font-weight:bold;	color: #000000;	}.day a:hover {	font-weight:bold;	color: #2a2a2a;}.weekend {	background-color: #f6f6f6;}.monthtableouter {	background-color: #cccccc;}.monthtableinner {	width: 200px;}.normalday {	background-color: #ffffff;}.title {	background-color: #f6f6f6;	font-weight:bold;	font-family:verdana;	font-size:12px;}.month, .days {	background-color: #f6f6f6;	font-size:10px;	font-weight:normal;	font-family:arial;}.selectedday {	background-color: #DBDBDB;}#today {	border: 1px #000000 solid;	background-color: #C4C4C4;}</style></head><body><form method="get" action="<%=Request.ServerVariables("file:///C|/Documents%20and%20Settings/Jo%E3o/Desktop/SCRPIPT_NAME")%>"><%' call calendarmakeCalendar Request("l"),Request("d"),Request("m"),Request("y"),request("s")%></form></body></html><%'============================================================================================' FUNCTIONS'============================================================================================function language(byval lang)' english monthsmonthNamesEn = array("", "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro")' english days dayNamesEn = array("", "Seg", "Ter", "Qua", "Qui", "---", "Sab", "Dom") tmpLang = lang  dayNames = dayNamesEn  monthNames = monthNamesEnend function'============================================================================================' renders monthselectionfunction monthSelect()	Response.Write "<select name=""m"" class=""month"" onChange=""showNew()"">" & chr(10)  	for i = 1 to Ubound(monthNames)  if i = int(selMonth) then  	 tmpStr = " selected"  else 	 tmpStr = ""  end if  Response.Write "<option value=""" & i & """" & tmpStr & ">" & monthNames(i) & " </option>" & chr(10)	next		Response.Write "</select>" & chr(10)end function'============================================================================================' renders yearselectionfunction yearSelect()	Response.Write "<select name=""y"" class=""month"" onChange=""showNew()"">" & chr(10)	for i = year(now) - 5 to year(now) + 5  if i = int(selYear) then  	 tmpStr = " selected"  else 	 tmpStr = ""  end if  Response.Write "<option value=""" & i & """" & tmpStr & ">" & i & "</option>" & chr(10)	next		' lets check if the next month value is more than 12	' if, then show 1 month of next year	dim selMonthShowNext, selYearShowNext	selMonthShowNext = selMonth + 1	selYearShowNext = selYear	if selMonthShowNext < 1 then   selMonthShowNext = 12  selYearShowNext = selYear - 1	end if	if selMonthShowNext > 12 then   selMonthShowNext = 1  selYearShowNext = selYear + 1	end if	end function'============================================================================================' calculate datesfunction dayToShow(byval selDayTmp, byval selMonthTmp, byval selYearTmp)selDay = selDayTmp : selMonth = selMonthTmp : selYear = selYearTmp' if day selection values are empty, use current dateif len(SelDay) = 0 then SelDay = day(now)if len(SelYear) = 0 then SelYear = year(now)if len(selMonth) = 0 then selMonth = month(now)' if month is 0, then show month 12 of previous yearif selMonth < 1 then	selMonth = 12	selYear = selYear - 1end if' if month is over 12, then show 1 month of next yearIf selMonth > 12 then	selMonth = 1	selyear = selYear + 1end if' temporary date for date calculationsdim tmpDatetmpDate = CDate("1." & selMonth & "." & selYear)' how many days are in this monthlastDay = day(DateSerial(Year(tmpDate), Month(tmpDate) + 1, 0))' what is the weekday of first day in this monthfirstWeekDay = weekday(DateSerial(Year(tmpDate), Month(tmpDate), 0)+1, 2)' check if selected date is valuableif selDay < 1 then selDay = 1if int(selDay) > int(lastDay) then selDay = lastDayend Function'============================================================================================' render calendarfunction makeCalendar(byval lang, byval selDayTmp, byval selMonthTmp, byval selYearTmp, byval linkDays)		Dim arrlinkDay	arrLinkDay = split(linkDays, ",")		dayToShow selDayTmp, selMonthTmp, selYearTmp	language(lang)		dim tmpDayInt, tmpDayInt2	tmpDayint = 0		' render javascript 	with response  .Write "<script language=""javascript"">" & chr(10)  .write "function showNew() {" & chr(10)  .Write "document.forms[0].submit();" & chr(10)  .Write "}" & chr(10) & "</script>"  '.Write "<form method=""get"" action=""" & Request.ServerVariables("SCRIPT_NAME") & """>"  .Write "<table border=""0"" cellpadding=""0"" cellspacing=""0"" class=""monthtableouter""><tr><td>"  .Write "<table border=""0"" cellpadding=""1"" cellspacing=""1"" class=""monthtableinner"">" & chr(10)  .Write "<tr>" & chr(10) & "<td class=""title"" colspan=""7""><div align=""center"" class=""title"">"  .Write monthNames(selMonth)& " " & selYear & "</div></td>" & chr(10) & "</tr>" & chr(10)  .Write "<tr>"	end with		for i = 1 to UBound(dayNames)   with response 	 .Write "<td class=""days"" width=""13%""><div align=center class=""days"">" 	 .Write dayNames(i) 	 .Write "</td>"  end with  	next	Response.Write "</tr>"		dim ib, thisDay	'do while tmpDayInt2 < lastDay	for ib = 1  to 6	Response.Write "<tr>" & chr(10)  for i = 1 to 7 	     if int(tmpDayInt2) = int(day(now)) - 1 and int(month(now)) = int(selMonth) and int(year(now)) = int(selYear) then  	 thisDay = " id=""today"""  else 	 thisDay = ""  end if 	  	  	 if tmpDayInt2 = selDay - 1 and firstWeekday > tmpDayInt + 1 then    Response.Write "<td class=""normalday"" width=""14%""><div align=""center"" class=""day"">" 	 elseif tmpDayInt2 = selDay - 1 then    Response.Write "<td class=""selectedday"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">" 	 else    ' check if day is weekend    if i = 6 or i = 7 then   	 Response.Write "<td class=""weekend"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">"     else   	 Response.Write "<td class=""normalday"" width=""14%""" & thisDay & "><div align=""center"" class=""day"">"     end if 	 end if   	  	  	 if firstWeekday > tmpDayInt + 1 or lastDay < tmpDayInt2 + 1 then    Response.Write " " 	 else    tmpDayInt2 = tmpDayInt2 + 1        dim dayFound, arrI    dayFound = false    for arrI = Lbound(arrLinkDay) to UBound(arrLinkDay)   	 if int(tmpDayInt2) = int(arrLinkDay(arrI)) then dayFound = true    next    if dayFound = true then   	 with response      .Write "<a href=""" & scriptName & "?d=" & tmpDayInt2 & "&m="       .write selMonth & "&y=" & selYear & """>" & tmpDayInt2 & "</a>"   	    	 end with   	 dayFound = false    else   	 Response.Write tmpDayInt2    end if         	 end if     	 Response.Write "</td>" & chr(10) 	 tmpDayInt = tmpDayInt + 1  next  	Response.Write "</tr>" & chr(10)	'loop	next		with Response  .Write "<tr>" & chr(10) & "<td class=""title"" colspan=""7"" nowrap>" & chr(10)  .Write "<div align=""center"" class=""title"">"  .Write monthSelect()  .Write " "  .write yearSelect()  .Write "</div>" & chr(10) & "</td>"  .Write chr(10) & "</tr>" & chr(10) & "</table></td></tr></table>"  '.Write "</form>"	end withend function'============================================================================================' that's it, the end%>

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.