calendário + agenda, dificuldade!!!
Olá,
O que o ocorre é o seguinte baixei esse código na net, e ae tudo bem funciona legal, supre minhas necessidades, mas não aparece os eventos cadastrados no calendário, ex: você cadastra um evento no dia 18/03 e qndo vai lá não aparece o link para você clicar e aparecer a pop-up, não estou entendendo onde devo alterar, alguém pode me ajudar.
O código é esse:
<%Option Explicitresponse.buffer = true'Declare all necessary variables hereDim http,image,path,imagePath,sqlDim x,xx,xxx,y,yy,yyy,num,x1,x2Dim lastDay,curMonth,curDay,curYear,eventTypeDim searchEnd,searchStart,currentDay,maxRowsDim today,todayCell,events,eventsIDDim cn_connection,rs_getEvent,rs_getTypeDim eventID(),eventName(),curDateDim dayCellDim bg1,bg2,bg3,fnt1,fnt2,cell_width1,cell_height1,cell_width2,cell_height2%><!--#include file="global.asp"--><!--#include file="getparameter.asp"--><!--#include file="schema.asp"--><%'search for valid date (2/31/2001 -> 2/28/2001)while not isDate(curMonth&"/"&curDay&"/"&curYear) curDay = curDay - 1wend'look for lasy day number of the current monthsearchEnd = 31while not isDate(curMonth&"/"&searchEnd&"/"&curYear) searchEnd = searchEnd - 1wend'searchStart is the first day of month'searchEnd is the last day of monthsearchStart = cdate(curMonth&"/1/"&curYear)searchEnd = cdate(curMonth&"/"&searchEnd&"/"&curYear)%><!--#include file="connect.asp"--><%sql = "SELECT id, startDate, endDate, name FROM calendarEvent " & _ "WHERE ((startDate >= #" & searchStart & "# AND endDate <= #" & searchEnd & "#) " & _ "OR (startDate < #"&searchStart&"# AND endDate >= #"&searchStart&"# AND endDate <= #"&searchEnd&"#) " & _ "OR (startDate <= #"&searchEnd&"# AND startDate >= #"&searchStart&"# AND endDate > #"&searchEnd&"#) " & _ "OR (startDate < #"&searchStart&"# AND endDate > #"&searchEnd&"#)) "if trim(eventType) = "" then'ignore itelseif cint(eventType) = 1 then sql = sql & "AND eventType = 1"elseif cint(eventType) = 2 then sql = sql & "AND eventType = 2"elseif cint(eventType) = 3 then sql = sql & "AND eventType = 3"elseif cint(eventType) = 4 then sql = sql & "AND eventType = 4"else 'ignore itend ifSet rs_getEvent = cn_Connection.Execute(sql)%><%'response.write("sql = " & sql & "<br>")%><%sql = "SELECT id,eventType FROM eventType"Set rs_getType = cn_Connection.Execute(sql)curDate = searchStartfor x = 1 to day(searchEnd) redim preserve eventID(x) redim preserve eventName(x) if not rs_getEvent.BOF then rs_getEvent.movefirst while not rs_getEvent.EOF x1 = rs_getEvent("startDate"):x2 = rs_getEvent("endDate") if x1 = curDate OR x2 = curDate OR (x1 < curDate AND x2 > curDate) then 'make a list for event for each day eventID(x) = eventID(x) & rs_getEvent("id") & "~||~" eventName(x) = eventName(x) & rs_getEvent("name") & "~||~" end if rs_getEvent.movenext wend %><%'response.write("<b>eventName("&x&") = "&eventName(x)&"</b><br><br>")%><% 'move current day to next day curDate = dateAdd("d",1,curDate)next'check if date is in this monthif Not month(DateAdd("d", curDay-1, curMonth&"/1/"&curYear)) = cint(curMonth) then curDay = 1lastDay = day(dateserial(curYear,curMonth+1,1-1))today = curMonth&"/"&curDay&"/"&curYear%><table><tr><td><table border="1" cellpadding="0" cellspacing="0"><tr> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>><a href="<%=http%>calendar.asp?curDay=<%= curDay %>&curMonth=<%= month(dateAdd("m", -1, today)) %>&curYear=<%= year(dateAdd( "m", -1, today)) %>&eventType=<%= eventType %>"><%= monthName(month(dateAdd( "m", -1, today))) %></a></font></td> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width15%>" colspan="5"><font <%=fnt1%>><%= monthName(curMonth) %> <%= curYear %></font></td> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>><a href="<%=http%>calendar.asp?curDay=<%= curDay %>&curMonth=<%= month(dateAdd("m", 1, today)) %>&curYear=<%= year(dateAdd( "m", 1, today)) %>&eventType=<%= eventType %>"><%= monthName(month(dateAdd( "m", 1, today))) %></a></font></td></tr><tr> <form action="<%=http%>calendar.asp" name="search" method="post"> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>><a href="<%=http%>calendar.asp?curDay=<%= curDay %>&curMonth=<%= curMonth %>&curYear=<%=curYear-1%>&eventType=<%= eventType %>"><%= curYear-1 %></a></font></td> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width15%>" colspan="5"><select name="curMonth"><% for x = 1 to 12 %><option value="<%= x %>" <% if cint(curMonth) = x then %> selected <% end if %>><%= monthName(x) %></option><% next %></select><select name="curYear"><% for x = 1990 to 2020 %><option value="<%= x %>" <% if cint(curYear) = x then %> selected <% end if %>><%= x %></option><% next %></select><input type="hidden" name="eventType" value="<%= eventType %>"><input type="submit" name="submit" value="Search"></td> <td bgcolor="<%=bg1%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>><a href="<%=http%>calendar.asp?curDay=<%= curDay %>&curMonth=<%= curMonth %>&curYear=<%=curYear+1%>&eventType=<%= eventType %>"><%= curYear+1 %></a></font></td> </form></tr><tr> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Sun</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Mon</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Tue</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Wed</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Thu</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Fri</font></td> <td bgcolor="<%=bg2%>" align="center" height="<%=cell_height1%>" width="<%=cell_width1%>"><font <%=fnt1%>>Sat</font></td> </tr><tr><%currentDay = 1 - weekday(dateserial(curYear,curMonth,1))+1lastDay = day(dateserial(curYear,curMonth+1,1-1))if cint(currentDay) = -4 AND lastDay > 30 then maxRows = 5elseif cint(currentDay) = -5 AND lastDay >= 30 then maxRows = 5else maxRows = 4end Ifnum = 1for x = 0 to maxRows %><tr><% for xx = 0 to 6 if currentDay > 0 AND currentDay <= lastDay then today = curMonth&"/"¤tDay&"/"&curYear %> <td align="left" valign="top" height="<%=cell_height2%>" width="<%=cell_width2%>""<% if cstr(today) = cstr(month(now())&"/"&day(now())&"/"&year(now())) then %> bgcolor="<%=todayCell%>"<% else %> bgcolor="<%=bg3%>"<% end if %>> <font <%=fnt1%>><%= currentDay %></font><br> <% 'outputting today's event name by looping through events array if eventName(num) <> "" then events = "" eventsID = "" events = split(eventName(num),"~||~") eventsID = split(eventID(num),"~||~") for y = 0 to ubound(events) %><a href="#" onclick="window.open('<%=HTTP%>detail.asp?id=<%=eventsID(y)%>','detail','scrollbars=yes,location=no,width=440,height=400')"><%=events(y)%></a><% if y <> ubound(events) then %><br><% end if next else %> <% end if %></font></td><% num = num + 1 else %><td><br></tr><% end if currentDay = currentDay + 1 next %><tr><%next%></tr><tr> <form name="viewtype" action="<%=http%>calendar.asp" method="post"> <td colspan="4" align="center"><select name="eventType"><option value="-1"<%if cint(eventType) = -1 then%> selected<%end if%>>Todos</option><%while not rs_getType.EOF %><option value="<%=rs_getType("id")%>"<%if cint(eventType) = cint(rs_getType("id")) then%> selected<%end if%>><%= rs_getType("eventType") %></option><% rs_getType.moveNext %><%wend%></select><input type="hidden" name="curMonth" value="<%= curMonth %>"><input type="hidden" name="curYear" value="<%= curYear %>"> <input type="submit" name="viewevent1" value="Select Event Type"></td> </form> <form name="backtoday" action="<%=http%>calendar.asp" method="post"> <td colspan="3" align="center"><input type="submit" name="bakctoday1" value="Back to Today"></td> </form> </tr></td></tr></table></td></tr></table></body></html><!--#include file="disconnect.asp"--><!--#include file="replace.asp"-->
Discussão (1)
Carregando comentários...