Foros del Web » Programando para Internet » ASP Clásico »

Hacer un calendario de evento en ASP

Estas en el tema de Hacer un calendario de evento en ASP en el foro de ASP Clásico en Foros del Web. Hola amigos me gustaria saber si me pudieran ayudar, en la construcion de un calendario el cual me muestre informacion que almacene en una base ...
  #1 (permalink)  
Antiguo 06/09/2005, 18:56
 
Fecha de Ingreso: mayo-2005
Mensajes: 8
Antigüedad: 19 años, 1 mes
Puntos: 0
Hacer un calendario de evento en ASP

Hola amigos me gustaria saber si me pudieran ayudar, en la construcion de un calendario el cual me muestre informacion que almacene en una base de datos access, esto lo quiero hacer para mostrar minutas de comida, es decir si presiona en el calendario el 10 de septiembre me muestre los tres tipos de colaciones que hay para ese dia algo pareceido hay en esta pagina http://www.bisiacaria.com
Bueno espero su ayuda y buena disposicion

Atte.,

Gianni
  #2 (permalink)  
Antiguo 06/09/2005, 19:35
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 5 meses
Puntos: 16
checa si te sirve el calendario que uso en www.bosquepinardelaventa.com, es ASP con Access, el calendario esta en Eventos
  #3 (permalink)  
Antiguo 07/09/2005, 13:35
 
Fecha de Ingreso: mayo-2005
Mensajes: 8
Antigüedad: 19 años, 1 mes
Puntos: 0
Gracias sjam7 voy a dar un vistazo y te aviso
  #4 (permalink)  
Antiguo 07/09/2005, 13:39
 
Fecha de Ingreso: mayo-2005
Mensajes: 8
Antigüedad: 19 años, 1 mes
Puntos: 0
Cita:
Iniciado por sjam7
checa si te sirve el calendario que uso en www.bosquepinardelaventa.com, es ASP con Access, el calendario esta en Eventos
Hola si es algo asi lo que ando buscand donde lo puedo conseguir???
  #5 (permalink)  
Antiguo 07/09/2005, 18:59
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 22 años, 5 meses
Puntos: 4
mira si este te sirve, te coloca el calendario y en cada dia tiene un enlace a una pagina cualquiera.asp lo qeu hace es enviarle como parametro la fecha a la otra pagina donde iran tus eventos
espero te sirva
suerte.,

Código:
 
<%
Dim giorno,mese,anno,tmese,day1,primog, mese2, anno2, dayoff,ultimog,x,giorno1
   
   giorno = request("giorno")
   If giorno = "" then
   giorno = day(now())
   End If
   
   mese = request("mese")
   If mese = "" then
   mese = month(now())
   End If

   anno = request("anno")
   If anno = "" then
   anno = year(now())
   End If

   If mese = 12 then
	  mese2 = 1
   anno2 = anno+1
   else 
   mese2 = mese+1
   anno2 = anno
   End If
   
   day1 = Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno))
	  dayoff = Cdate("1"+"/"+Cstr(mese2)+"/"+Cstr(anno2))-1
	  primog = Weekday(Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno)))-1
   ultimog = Weekday(dayoff)-1
   
   If ultimog = 0 then
   ultimog = 7
   End If
   
   If primog = 0 then
   primog = 7
   End If
  
	  ' Escribe el nombre del mes en la parte superior
   Select Case mese
   case 1
   tmese = "Ene"
   case 2
	tmese = "Feb"
   case 3
   tmese = "Mar"
   case 4
   tmese = "Abr"
   case 5
   tmese = "May"
   case 6
   tmese = "Jun"
   case 7
   tmese = "Jul"
   case 8
   tmese = "Ago"
   case 9
   tmese = "Sep"
   case 10
   tmese = "Oct"
   case 11
   tmese = "Nov"
   case 12
   tmese = "Dic"
   End Select
x=1
   %>
			  <table width="190" border="0" cellspacing="1" cellpadding="1">
				<tr bgcolor="#3399CC">
				  <td><a href="listado.asp?mese=<%if mese > 1 then response.write mese-1 else response.write 12 End If%>&anno=<%if mese > 1 then response.write anno else response.write anno-1 End If%>"><img src="../img/botones/ant.gif" border="0"></a></td>
				  <td width="50%" bordercolor="#666666" bgcolor="#3399CC"><strong><%=tmese%></strong></td>
				  <td width="50%" align="center" bordercolor="#666666"><strong><%=anno%></strong></td>
				  <td><a href="listado.asp?mese=<%if mese < 12 then response.write mese+1 else response.write 1 End If%>&anno=<%if mese < 12 then response.write anno else response.write anno+1 End If%>"><img src="../img/botones/sig.gif" border="0"></a></td>
				</tr>
				<tr>
				  <td colspan="4">
					<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#666666">
					  <tr align="center" bgcolor="#CCCCCC">
						<td><strong>L</strong></td>
						<td><strong>M</strong></td>
						<td><strong>M</strong></td>
						<td><strong>J</strong></td>
						<td><strong>V</strong></td>
						<td><strong> S</strong></td>
						<td><strong> D </strong></td>
					  </tr>
					  <tr>
						<%
giorno1 = (day1-primog+x)
Do While giorno1 <= (dayoff+7-ultimog)
%>

						<td <%If day(day1-primog+x)=day(now()) and month(day1-primog+x)=month(now()) then response.write "bgcolor=""#FFF7D5""" End If%>>
						  <div align="center"> <font color ="<%if giorno1 >= day1 and giorno1 <= dayoff then
	 response.write "#000000"
	 Else
	 response.write "#CCCCCC"
	 End If%>">
							<%if giorno1 >= day1 and giorno1 <= dayoff then%>

							<a href="javascript:jumpto('listado_iframe.asp?dia=<%=day(day1-primog+x)%>&mes=<%=month(day1-primog+x)%>&ano=<%=year(day1-primog+x)%>')"><%=day(day1-primog+x)%></a>
							<%else%>
							<%=day(day1-primog+x)%>
							<%End If%>
						</font></div></td>
						<%If weekday(day1 - primog + x - 1) = 7 Then
response.write "</tr>"

End If%>
						<%
giorno1 = giorno1 + 1
x=x+1
loop%>
					</table></td>
				</tr>
			  </table>
			  <table width="190" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td width="18"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>"><img src="../img/botones/sig.gif" border="0"></a> </td>
				  <td width="152"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>" target="_self">Ir al d&iacute;a actual </a> </td>
				</tr>
			  </table>
			  <table width="190" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td valign="bottom">
					<form name="form1" method="post" action="listado.asp" target = "_self">
					  <table width="170" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td width="49">
							<select name="mese" size="1" class="combo">
							  <!-- Es un cliclo donde Ponermos los nombres de los meses en el Combo Box -->
							  <option value="<% =request("mese") %>" selected>
							  <% = left(Ucase(monthname(request("mese"))), 3) %>
							  </option>
							  <% dim mes
	 for mes=1 to 12 %>
							  <option value="<% =mes %>">
							  <% =left(Ucase(monthname(mes)), 3) %>
							  </option>
							  <% next %>
							</select>
						  </td>
						  <td width="48">
							<select name="anno" size="1" class="combo">
							  <!-- Ciclo que nos poner los anos en el combo Box -->
							  <option value="<% =request("anno") %>" selected>
							  <% =request("anno") %>
							  </option>
							  <% dim ano
	  for ano=year(now) to (year(now) + 10) %>
							  <option value="<% =ano %>">
							  <% =ano %>
							  </option>
							  <% next %>
							</select>
						  </td>
						  <td width="73">
							<button name="boton" type="submit"  class="menu" title="Ir" ><img src="../img/botones/ir.gif"></button></td>
						</tr>
					  </table>
				  </form></td>
				</tr>
			  </table>
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #6 (permalink)  
Antiguo 08/09/2005, 02:04
 
Fecha de Ingreso: enero-2002
Mensajes: 1.438
Antigüedad: 22 años, 5 meses
Puntos: 0
Código:
<%
' Funciones calendario
Function MonthName(MyMonth)
	Select Case MyMonth
		Case 1
			MonthName = "Enero"
		Case 2
			MonthName = "Febrero"
		Case 3
			MonthName = "Marzo"
		Case 4
			MonthName = "Abril"
		Case 5
			MonthName = "Mayo"
		Case 6
			MonthName = "Junio"
		Case 7
			MonthName = "Julio"
		Case 8
			MonthName = "Agosto"
		Case 9
			MonthName = "Septiembre"
		Case 10
			MonthName = "Octubre"
		Case 11
			MonthName = "Noviembre"
		Case 12
			MonthName = "Diciembre"
		Case Else
			MonthName = "ERROR!"
	End Select
End Function

Function LastDay(MyMonth, MyYear)
' Returns the last day of the month. Takes into account leap years
' Usage: LastDay(Month, Year)
' Example: LastDay(12,2000) or LastDay(12) or Lastday

	Select Case MyMonth
		Case 1, 3, 5, 7, 8, 10, 12
			LastDay = 31

		Case 4, 6, 9, 11
			LastDay = 30

		Case 2
			If IsDate(MyYear & "-" & MyMonth & "-" & "29") Then LastDay = 29 Else LastDay = 28

		Case Else
			LastDay = 0
	End Select
End Function
%>
<%
Dim MyMonth 'Month of calendar
Dim MyYear 'Year of calendar
Dim FirstDay 'First day of the month. 1 = Monday
Dim CurrentDay 'Used to print dates in calendar
Dim Col 'Calendar column
Dim Row 'Calendar row

MyMonth = Request.Querystring("Month")


If IsEmpty(MyMonth) then MyMonth = Month(Date)
if IsEmpty(MyYear) then MyYear = Year(Date)

FirstDay = WeekDay(DateSerial(MyYear, MyMonth, 1)) -2
if firstDay = -1 then FirstDay = 6
CurrentDay = 1

set Festivo = Server.CreateObject("ADODB.Recordset")
Festivo.ActiveConnection = MM_MyEmpresas_STRING
Festivo.Source = "SELECT *  FROM Trafico  WHERE Fecha Between '"& MyYear &"-"& MyMonth & "-1' and '2006-01-01' ORDER BY Fecha"
Festivo.CursorType = 0
Festivo.CursorLocation = 2
Festivo.LockType = 3
Festivo.Open()
Festivo_numRows = 0
'fin calendario

%>
Código:
                  <% 'inicio calendario %> <table border='1' cellspacing='0'  width='90%' align='center' class="calFondoCalendario">
                    <tr align='center'> 
                      <td colspan='7'> <table border='0' cellspacing='1' cellpadding='1' width='100%' class="calFondoEncabe">
                          <tr> 
                            <td align='left'> <div align="center"><font  size="-2"><b><a href="../ADR/RestriccionesTrafico.asp">Restricciones 
                                tr&aacute;fico de MM.PP.</a></b></font><br>
                                <%
						response.write "<a href = 'Micuenta.asp?"
						if MyMonth - 1 = 0 then 
							response.write "month=12"
						else 
							response.write "month=" & MyMonth - 1 
						end if
						response.write "'><span class='calSimbolo'><<</span></a>"

						response.write "<span class='calEncabe'> <b>" & MonthName(MyMonth) & " 2005</b> </span>"

						response.write "<a href = 'micuenta.asp?"
						if MyMonth + 1 = 13 then 
							response.write "month=1"
						else 
							response.write "month=" & MyMonth + 1 
						end if
						response.write "'><span class='calSimbolo'>>></span></a>"
			%>
                              </div></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr align='center'> 
                      <td> <div class='calDias'>L</div></td>
                      <td> <div class='calDias'>M</div></td>
                      <td> <div class='calDias'>X</div></td>
                      <td> <div class='calDias'>J</div></td>
                      <td> <div class='calDias'>V</div></td>
                      <td> <div class='calDias'>S</div></td>
                      <td> <div class='calDias'>D</div></td>
                    </tr>
                    <%

For Row = 0 to 5
  For Col = 0 to 6
    If Row = 0 and Col < FirstDay then
	  response.write "<td><font size='-7'>&nbsp;</font></td>"
	elseif CurrentDay > LastDay(MyMonth, MyYear) then
	      Response.write "<td><font size='-7'>&nbsp;</font></td>"
		  if col = 6 then
		    row = 5
		  end if 
		else
		  MM_Celda =  "<td"
		  MM_Celda_class = " align='Center'"
          if col=6 or col=5 then
		        if col=5 then 
			      MM_Celda_class = " class='calRojo' align='center' title='P. Vasco: Desde las 22h restricciones para vehículos de más de 7500 Kg en carreteras del anexo II. Cataluña: Restricciones especiales, para vehículos de más de 3500 Kg'"
			    else	
				  MM_Celda_class = " class='calRojo' align='center' title='Estatal: Restricción de 8h a 24h; P. Vasco: de 0h a 24h para vehículos de más de 7500 Kg con MMPP en carreteras del anexo II'"
				end if
				if CurrentDay = LastDay(MyMonth, MyYear) then
				  row = 5
				end if
			  end if   
			  if CurrentDay=Day(Festivo.Fields.Item("Fecha").Value) and cInt(MyMonth)= Month(Festivo.Fields.Item("Fecha").Value) then
			 	  if col=5 then 
				    MM_Celda_class = " class='calRojo' align='center' title='Restricción de "& (Festivo.Fields.Item("de").Value) & "h a "& (Festivo.Fields.Item("a").Value) & "h ("& (Festivo.Fields.Item("ambito").Value) & "); P. Vasco: Desde las 22h restricciones para vehículos de más de 7500Kg  en carreteras del anexo II; Cataluña: Restricciones especiales, para vehículos de más de 3500 Kg'"
                  else
				    MM_Celda_class = " class='calRojo' align='center' title='Restricción de "& (Festivo.Fields.Item("de").Value) & "h a "& (Festivo.Fields.Item("a").Value) & "h ("& (Festivo.Fields.Item("ambito").Value) & ")'"
				  end if
				  festivo.MoveNext()
			  end if
			  MM_Celda = MM_Celda & MM_Celda_class & ">"
			  response.Write (MM_Celda)
			  if cInt(MyYear) = Year(Date) and cInt(MyMonth) = Month(Date) and CurrentDay = Day(Date) then 
				Response.Write "<div class='calResaltado'>" 
			  else
				Response.Write "<div class='calSimbolo'>" 
			  end if
			  Response.Write CurrentDay & "</div></a></td>"
			  CurrentDay = CurrentDay + 1
		   End If
  Next
  response.write "</tr>"
Next
Festivo.Movefirst() 
%>
                    <%
Festivo.Close()
'final calendario

%>
  #7 (permalink)  
Antiguo 08/09/2005, 15:13
 
Fecha de Ingreso: mayo-2005
Mensajes: 8
Antigüedad: 19 años, 1 mes
Puntos: 0
Gracias amigos pero saben la verdad es que no entiendo, pues copio el codigo pero solo me manda errores al ejecutarlo, perdon por no ser experto, pero me la podrian hacer un pokito mas facil
  #8 (permalink)  
Antiguo 08/09/2005, 18:43
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 22 años, 5 meses
Puntos: 4
ya lo arregle para que no te salgan errores
copialo y pegalo y correlo.
me cuentas

Código:
 
<%
Dim giorno,mese,anno,tmese,day1,primog, mese2, anno2, dayoff,ultimog,x,giorno1
   
   giorno = day(now)
   If giorno = "" then
   giorno = day(now())
   End If
   
   mese = month(now) 
  If mese = "" then
   mese = month(now())
   End If

   anno = year(now)
   If anno = "" then
   anno = year(now())
   End If

   If mese = 12 then
  mese2 = 1
   anno2 = anno+1
   else 
   mese2 = mese+1
   anno2 = anno
   End If
   
   day1 = Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno))
  dayoff = Cdate("1"+"/"+Cstr(mese2)+"/"+Cstr(anno2))-1
  primog = Weekday(Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno)))-1
   ultimog = Weekday(dayoff)-1
   
   If ultimog = 0 then
   ultimog = 7
   End If
   
   If primog = 0 then
   primog = 7
   End If
  
  ' Escribe el nombre del mes en la parte superior
   Select Case mese
   case 1
   tmese = "Ene"
   case 2
tmese = "Feb"
   case 3
   tmese = "Mar"
   case 4
   tmese = "Abr"
   case 5
   tmese = "May"
   case 6
   tmese = "Jun"
   case 7
   tmese = "Jul"
   case 8
   tmese = "Ago"
   case 9
   tmese = "Sep"
   case 10
   tmese = "Oct"
   case 11
   tmese = "Nov"
   case 12
   tmese = "Dic"
   End Select
x=1
   %>
  <table width="190" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="#3399CC">
  <td><a href="listado.asp?mese=<%if mese > 1 then response.write mese-1 else response.write 12 End If%>&anno=<%if mese > 1 then response.write anno else response.write anno-1 End If%>"><img src="../img/botones/ant.gif" border="0"></a></td>
  <td width="50%" bordercolor="#666666" bgcolor="#3399CC"><strong><%=tmese%></strong></td>
  <td width="50%" align="center" bordercolor="#666666"><strong><%=anno%></strong></td>
  <td><a href="listado.asp?mese=<%if mese < 12 then response.write mese+1 else response.write 1 End If%>&anno=<%if mese < 12 then response.write anno else response.write anno+1 End If%>"><img src="../img/botones/sig.gif" border="0"></a></td>
</tr>
<tr>
  <td colspan="4">
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#666666">
  <tr align="center" bgcolor="#CCCCCC">
<td><strong>L</strong></td>
<td><strong>M</strong></td>
<td><strong>M</strong></td>
<td><strong>J</strong></td>
<td><strong>V</strong></td>
<td><strong> S</strong></td>
<td><strong> D </strong></td>
  </tr>
  <tr>
<%
giorno1 = (day1-primog+x)
Do While giorno1 <= (dayoff+7-ultimog)
%>

<td <%If day(day1-primog+x)=day(now()) and month(day1-primog+x)=month(now()) then response.write "bgcolor=""#FFF7D5""" End If%>>
  <div align="center"> <font color ="<%if giorno1 >= day1 and giorno1 <= dayoff then
response.write "#000000"
Else
response.write "#CCCCCC"
End If%>">
<%if giorno1 >= day1 and giorno1 <= dayoff then%>

<a href="javascript:jumpto('listado_iframe.asp?dia=<%=day(day1-primog+x)%>&mes=<%=month(day1-primog+x)%>&ano=<%=year(day1-primog+x)%>')"><%=day(day1-primog+x)%></a>
<%else%>
<%=day(day1-primog+x)%>
<%End If%>
</font></div></td>
<%If weekday(day1 - primog + x - 1) = 7 Then
response.write "</tr>"

End If%>
<%
giorno1 = giorno1 + 1
x=x+1
loop%>
</table></td>
</tr>
  </table>
  <table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="18"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>"><img src="../img/botones/sig.gif" border="0"></a> </td>
  <td width="152"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>" target="_self">Ir al d&iacute;a actual </a> </td>
</tr>
  </table>
  <table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td valign="bottom">
<form name="form1" method="post" action="listado.asp" target = "_self">
  <table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="49">
<select name="mese" size="1" class="combo">
  <!-- Es un cliclo donde Ponermos los nombres de los meses en el Combo Box -->
  <option value="<% =request("mese") %>" selected>
  <% = left(Ucase(monthname(request("mese"))), 3) %>
  </option>
  <% dim mes
for mes=1 to 12 %>
  <option value="<% =mes %>">
  <% =left(Ucase(monthname(mes)), 3) %>
  </option>
  <% next %>
</select>
  </td>
  <td width="48">
<select name="anno" size="1" class="combo">
  <!-- Ciclo que nos poner los anos en el combo Box -->
  <option value="<% =request("anno") %>" selected>
  <% =request("anno") %>
  </option>
  <% dim ano
  for ano=year(now) to (year(now) + 10) %>
  <option value="<% =ano %>">
  <% =ano %>
  </option>
  <% next %>
</select>
  </td>
  <td width="73">
<button name="boton" type="submit"  class="menu" title="Ir" ><img src="../img/botones/ir.gif"></button></td>
</tr>
  </table>
  </form></td>
</tr>
  </table>
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #9 (permalink)  
Antiguo 09/09/2005, 10:51
 
Fecha de Ingreso: mayo-2005
Mensajes: 8
Antigüedad: 19 años, 1 mes
Puntos: 0
Gracias por el tiempo utilizado en ayudarme sabes me sigue dando error, tal vez estoy haciendo algo mal, el error es el siguiente:
***Tipo de error:
***Microsoft VBScript runtime (0x800A0005)
***invalid procedure call or argument: 'monthname'
***/portal/calendario.asp, línea 134

Tipo de error:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'monthname'
/portal/calendario.asp, línea 134

en este codigo:
133 <option value="<% =request("mese") %>" selected>
134 <% = left(Ucase(monthname(request("mese"))), 3) %>
  #10 (permalink)  
Antiguo 09/09/2005, 11:25
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 5 meses
Puntos: 16
checa este: OJO, checa los datos de la BD, esta tiene los campos:
id
fecha
evento
nombre
lugar
hora
comentarios

Código:
<%
RS = Server.MapPath("db/base.mdb")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & RS & ";"
Set RS = Server.CreateObject("ADODB.Recordset")
et RS2 = Server.CreateObject("ADODB.Recordset")

Function GetDaysInMonth(iMonth, iYear)
	Dim dTemp
	dTemp = DateAdd("d", -1, DateSerial(iYear, iMonth + 1, 1))
	GetDaysInMonth = Day(dTemp)
End Function

Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth)
	Dim dTemp
	dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth)
	GetWeekdayMonthStartsOn = WeekDay(dTemp)
End Function

Function SubtractOneMonth(dDate)
	SubtractOneMonth = DateAdd("m", -1, dDate)
End Function

Function AddOneMonth(dDate)
	AddOneMonth = DateAdd("m", 1, dDate)
End Function


Dim dDate 
Dim iDIM 
Dim iDOW  
Dim iCurrent 
Dim iPosition


If IsDate(Request.QueryString("date")) Then
	dDate = CDate(Request.QueryString("date"))
Else
	If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then
		dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year"))
	Else
		dDate = Date()
		
		If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
			Response.Write "La fecha seleccionada no es valida. El calendario regresa al dia de hoy.<BR><BR>"
		End If
		
		'If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not a valid date. The calendar was set to today's date.<BR><BR>"
	End If
End If

mes=Month(CDate(dDate))
if mes=1 then mesactual="Enero"
if mes=2 then mesactual="Febrero"
if mes=3 then mesactual="Marzo"
if mes=4 then mesactual="Abril"
if mes=5 then mesactual="Mayo"
if mes=6 then mesactual="Junio"
if mes=7 then mesactual="Julio"
if mes=8 then mesactual="Agosto"
if mes=9 then mesactual="Septiembre"
if mes=10 then mesactual="Octubre"
if mes=11 then mesactual="Noviembre"
if mes=12 then mesactual="Diciembre"


iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)
%>
<TABLE width="150" BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR>
<TD>
<TABLE width="150" BORDER=0 CELLPADDING=0 CELLSPACING=1 class="bordeTODO" bgcolor="#33FFFF">
		<TR bgcolor="#CCCCCC"> 
		  <TD ALIGN="center" COLSPAN=7> 
			<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
			  <TR> 
			 <TD width="29%" height="13" ALIGN="left" background="images/fondobtn2.gif"><A HREF="agenda.asp?date=<%= SubtractOneMonth(dDate)%>" alt="Ir al mes anterior"><FONT COLOR=#FFFFFF style="font-size:10px" face="Trebuchet MS, Arial, Verdana"><b>&lt;&lt; 
				 </b></FONT></A></TD>
			 <TD width="43%" height="13" ALIGN="center" background="images/fondobtn2.gif"><FONT COLOR=#ffffff style="font-size:11px" face="Trebuchet MS, Arial, Verdana"><B><%=mesactual%></B></FONT></TD>
			 <TD width="28%" height="13" ALIGN="right" background="images/fondobtn2.gif"><A HREF="agenda.asp?date=<%= AddOneMonth(dDate)%>" alt="Ir al siguiente mes"><FONT COLOR=#ffffff style="font-size:10px" face="Trebuchet MS, Arial, Verdana"><b> 
				 &gt;&gt;</b></FONT></A></TD>
			  </TR>
			</TABLE></TD>
		</TR>
		<TR valign="middle" bgcolor="#CCCCCC"> 
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>D</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>L</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>M</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>M</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>J</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>V</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>S</B></FONT></TD>
		</TR>
		<%
If iDOW <> 1 Then
	Response.Write vbTab & "<TR>" & vbCrLf
	iPosition = 1
	Do While iPosition < iDOW
		Response.Write vbTab & vbTab & "<TD>&nbsp;</TD>" & vbCrLf
		iPosition = iPosition + 1
	Loop
End If

iCurrent = 1
iPosition = iDOW
Do While iCurrent <= iDIM
	If iPosition = 1 Then
		Response.Write vbTab & "<TR>" & vbCrLf
	End If

	if iPosition=1 then
	 fondo="#eeeeee"
	else
	 fondo=""
	end if 


if iCurrent = "5" and Month(dDate)="5" then
	 fondo="#0099CC"
elseif iCurrent = "16" and Month(dDate)="9" then
	 fondo="#0099CC"
elseif iCurrent = "1" and Month(dDate)="1" then
	 fondo="#0099CC"
elseif iCurrent = "25" and Month(dDate)="12" then
	 fondo="#0099CC"
elseif iCurrent = "5" and Month(dDate)="2" then
	 fondo="#0099CC"
end if
	
	If iCurrent = Day(dDate) Then
		if base="mysql" then
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99ccc'"" onmouseout=""this.style.background='#00FFFF'"" width=18 height=20 ALIGN=center BGCOLOR=#00FFFF><A HREF=""./agenda.asp?date=" & Year(dDate) & "-" & Month(dDate) & "-" & iCurrent & """ class=a2><FONT face=""Verdana"" SIZE=""1"" COLOR=#000099><b>" & iCurrent & "</b></FONT></A></TD>" & vbCrLf
		else
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99ccc'"" onmouseout=""this.style.background='#00FFFF'"" width=18 height=20 ALIGN=center BGCOLOR=#00FFFF><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"" COLOR=#000099><b>" & iCurrent & "</b></FONT></A></TD>" & vbCrLf
		end if
	Else
		fechahoy= iCurrent & "/" & Month(dDate) & "/" & Year(dDate)
		SQL2="SELECT * FROM eventos WHERE fecha="&fechahoy&" order by fecha"

		RS2.Open SQL2,oConn,1,1
		if not rs2.eof then
		if base="mysql" then
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='#3D87CA'"" width=18 height=20 ALIGN=center BGcolor=#3D87CA><A HREF=""./agenda.asp?date=" & Year(dDate) & "-" & Month(dDate) & "-" & iCurrent & """ class=a2><FONT face=""Verdana"" SIZE=""1"" color=#ffffff>" & iCurrent & "</FONT></A></TD>" & vbCrLf
		else
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='#3D87CA'"" width=18 height=20 ALIGN=center BGcolor=#3D87CA><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"" color=#ffffff>" & iCurrent & "</FONT></A></TD>" & vbCrLf
		end if
		else
	    Response.Write vbTab & vbTab & "<TD onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='"&fondo&"'"" width=18 height=20 ALIGN=center BGcolor="&fondo&"><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"">" & iCurrent & "</FONT></A></TD>" & vbCrLf
		end if
		rs2.close
	End If
	
	If iPosition = 7 Then
		Response.Write vbTab & "</TR>" & vbCrLf
		iPosition = 0
	End If
	
	iCurrent = iCurrent + 1
	iPosition = iPosition + 1
Loop

If iPosition <> 1 Then
	Do While iPosition <= 7
		Response.Write vbTab & vbTab & "<TD>&nbsp;</TD>" & vbCrLf
		iPosition = iPosition + 1
	Loop
	Response.Write vbTab & "</TR>" & vbCrLf
End If
%>
	  </TABLE>
</TD>
</TR>
</TABLE>
<table height="5" border="0" cellspacing="0" cellpadding="0">
  <tr> 
	<td></td>
  </tr>
</table>
<table width="150" border="0" cellpadding="0" cellspacing="2" bgcolor="#66FFFF" class="bordeTODO">
  <tr> 
	<td width="18" height="20" bgcolor="#0099CC" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td width="126" height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  festivo</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#eeeeee" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Domingo</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#3D87CA" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  con evento</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#99cccc" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Puntero</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#00FFFF" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  actual </font></td>
  </tr>
</table>
  #11 (permalink)  
Antiguo 09/09/2005, 11:34
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 22 años, 5 meses
Puntos: 4
ya le correji lo qeu dices, pruebalo denuevo y m ecuentas.

Código:
<%
Dim giorno,mese,anno,tmese,day1,primog, mese2, anno2, dayoff,ultimog,x,giorno1
   
   giorno = day(now)
   If giorno = "" then
   giorno = day(now())
   End If
   
   mese = month(now) 
  If mese = "" then
   mese = month(now())
   End If

   anno = year(now)
   If anno = "" then
   anno = year(now())
   End If

   If mese = 12 then
  mese2 = 1
   anno2 = anno+1
   else 
   mese2 = mese+1
   anno2 = anno
   End If
   
   day1 = Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno))
  dayoff = Cdate("1"+"/"+Cstr(mese2)+"/"+Cstr(anno2))-1
  primog = Weekday(Cdate("1"+"/"+Cstr(mese)+"/"+Cstr(anno)))-1
   ultimog = Weekday(dayoff)-1
   
   If ultimog = 0 then
   ultimog = 7
   End If
   
   If primog = 0 then
   primog = 7
   End If
  
  ' Escribe el nombre del mes en la parte superior
   Select Case mese
   case 1
   tmese = "Ene"
   case 2
tmese = "Feb"
   case 3
   tmese = "Mar"
   case 4
   tmese = "Abr"
   case 5
   tmese = "May"
   case 6
   tmese = "Jun"
   case 7
   tmese = "Jul"
   case 8
   tmese = "Ago"
   case 9
   tmese = "Sep"
   case 10
   tmese = "Oct"
   case 11
   tmese = "Nov"
   case 12
   tmese = "Dic"
   End Select
x=1
   %>
  <table width="190" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="#3399CC">
  <td><a href="listado.asp?mese=<%if mese > 1 then response.write mese-1 else response.write 12 End If%>&anno=<%if mese > 1 then response.write anno else response.write anno-1 End If%>"><img src="../img/botones/ant.gif" border="0"></a></td>
  <td width="50%" bordercolor="#666666" bgcolor="#3399CC"><strong><%=tmese%></strong></td>
  <td width="50%" align="center" bordercolor="#666666"><strong><%=anno%></strong></td>
  <td><a href="listado.asp?mese=<%if mese < 12 then response.write mese+1 else response.write 1 End If%>&anno=<%if mese < 12 then response.write anno else response.write anno+1 End If%>"><img src="../img/botones/sig.gif" border="0"></a></td>
</tr>
<tr>
  <td colspan="4">
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#666666">
  <tr align="center" bgcolor="#CCCCCC">
<td><strong>L</strong></td>
<td><strong>M</strong></td>
<td><strong>M</strong></td>
<td><strong>J</strong></td>
<td><strong>V</strong></td>
<td><strong> S</strong></td>
<td><strong> D </strong></td>
  </tr>
  <tr>
<%
giorno1 = (day1-primog+x)
Do While giorno1 <= (dayoff+7-ultimog)
%>

<td <%If day(day1-primog+x)=day(now()) and month(day1-primog+x)=month(now()) then response.write "bgcolor=""#FFF7D5""" End If%>>
  <div align="center"> <font color ="<%if giorno1 >= day1 and giorno1 <= dayoff then
response.write "#000000"
Else
response.write "#CCCCCC"
End If%>">
<%if giorno1 >= day1 and giorno1 <= dayoff then%>

<a href="javascript:jumpto('listado_iframe.asp?dia=<%=day(day1-primog+x)%>&mes=<%=month(day1-primog+x)%>&ano=<%=year(day1-primog+x)%>')"><%=day(day1-primog+x)%></a>
<%else%>
<%=day(day1-primog+x)%>
<%End If%>
</font></div></td>
<%If weekday(day1 - primog + x - 1) = 7 Then
response.write "</tr>"

End If%>
<%
giorno1 = giorno1 + 1
x=x+1
loop%>
</table></td>
</tr>
  </table>
  <table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="18"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>"><img src="../img/botones/sig.gif" border="0"></a> </td>
  <td width="152"> <a href="listado.asp?mese=<%=month(now())%>&anno=<%=year(now())%>" target="_self">Ir al d&iacute;a actual </a> </td>
</tr>
  </table>
  <table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td valign="bottom">
<form name="form1" method="post" action="listado.asp" target = "_self">
  <table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="49">
<select name="mese" size="1" class="combo">
  <!-- Es un cliclo donde Ponermos los nombres de los meses en el Combo Box -->
  <option value="<% =request("mese") %>" selected>
  <% = left(Ucase(monthname(month(now))), 3) %>
  </option>
  <% dim mes
for mes=1 to 12 %>
  <option value="<% =mes %>">
  <% =left(Ucase(monthname(mes)), 3) %>
  </option>
  <% next %>
</select>
  </td>
  <td width="48">
<select name="anno" size="1" class="combo">
  <!-- Ciclo que nos poner los anos en el combo Box -->
  <option value="<% =year(now)%>" selected>
  <% =year(now)%>
  </option>
  <% dim ano
  for ano=year(now) to (year(now) + 10) %>
  <option value="<% =ano %>">
  <% =ano %>
  </option>
  <% next %>
</select>
  </td>
  <td width="73">
<button name="boton" type="submit"  class="menu" title="Ir" ><img src="../img/botones/ir.gif"></button></td>
</tr>
  </table>
  </form></td>
</tr>
  </table>
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #12 (permalink)  
Antiguo 10/09/2005, 16:01
 
Fecha de Ingreso: septiembre-2005
Mensajes: 20
Antigüedad: 18 años, 9 meses
Puntos: 0
Falta algo

El codigo parece bueno, tendria que comprobar coincidencias en la BD, pero falta algo que no acierto a ver que si bien el calendario funciona no hace la comprobacion!

Por otro lado al canviar de mes la fecha canvia del formato 5-9-2005 a 05-09-2005

He probado lo que se me ha ocurrido pero no veo donde esta


Cita:
Iniciado por sjam7
checa este: OJO, checa los datos de la BD, esta tiene los campos:
id
fecha
evento
nombre
lugar
hora
comentarios

Código:
<%
RS = Server.MapPath("db/base.mdb")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & RS & ";"
Set RS = Server.CreateObject("ADODB.Recordset")
et RS2 = Server.CreateObject("ADODB.Recordset")

Function GetDaysInMonth(iMonth, iYear)
	Dim dTemp
	dTemp = DateAdd("d", -1, DateSerial(iYear, iMonth + 1, 1))
	GetDaysInMonth = Day(dTemp)
End Function

Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth)
	Dim dTemp
	dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth)
	GetWeekdayMonthStartsOn = WeekDay(dTemp)
End Function

Function SubtractOneMonth(dDate)
	SubtractOneMonth = DateAdd("m", -1, dDate)
End Function

Function AddOneMonth(dDate)
	AddOneMonth = DateAdd("m", 1, dDate)
End Function


Dim dDate 
Dim iDIM 
Dim iDOW  
Dim iCurrent 
Dim iPosition


If IsDate(Request.QueryString("date")) Then
	dDate = CDate(Request.QueryString("date"))
Else
	If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then
		dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year"))
	Else
		dDate = Date()
		
		If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
			Response.Write "La fecha seleccionada no es valida. El calendario regresa al dia de hoy.<BR><BR>"
		End If
		
		'If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not a valid date. The calendar was set to today's date.<BR><BR>"
	End If
End If

mes=Month(CDate(dDate))
if mes=1 then mesactual="Enero"
if mes=2 then mesactual="Febrero"
if mes=3 then mesactual="Marzo"
if mes=4 then mesactual="Abril"
if mes=5 then mesactual="Mayo"
if mes=6 then mesactual="Junio"
if mes=7 then mesactual="Julio"
if mes=8 then mesactual="Agosto"
if mes=9 then mesactual="Septiembre"
if mes=10 then mesactual="Octubre"
if mes=11 then mesactual="Noviembre"
if mes=12 then mesactual="Diciembre"


iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)
%>
<TABLE width="150" BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR>
<TD>
<TABLE width="150" BORDER=0 CELLPADDING=0 CELLSPACING=1 class="bordeTODO" bgcolor="#33FFFF">
		<TR bgcolor="#CCCCCC"> 
		  <TD ALIGN="center" COLSPAN=7> 
			<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
			  <TR> 
			 <TD width="29%" height="13" ALIGN="left" background="images/fondobtn2.gif"><A HREF="agenda.asp?date=<%= SubtractOneMonth(dDate)%>" alt="Ir al mes anterior"><FONT COLOR=#FFFFFF style="font-size:10px" face="Trebuchet MS, Arial, Verdana"><b>&lt;&lt; 
				 </b></FONT></A></TD>
			 <TD width="43%" height="13" ALIGN="center" background="images/fondobtn2.gif"><FONT COLOR=#ffffff style="font-size:11px" face="Trebuchet MS, Arial, Verdana"><B><%=mesactual%></B></FONT></TD>
			 <TD width="28%" height="13" ALIGN="right" background="images/fondobtn2.gif"><A HREF="agenda.asp?date=<%= AddOneMonth(dDate)%>" alt="Ir al siguiente mes"><FONT COLOR=#ffffff style="font-size:10px" face="Trebuchet MS, Arial, Verdana"><b> 
				 &gt;&gt;</b></FONT></A></TD>
			  </TR>
			</TABLE></TD>
		</TR>
		<TR valign="middle" bgcolor="#CCCCCC"> 
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>D</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>L</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>M</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>M</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>J</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>V</B></FONT></TD>
		 <TD height="20" ALIGN="center"><FONT COLOR=#000000 size="1" face="Arial, Verdana, Helvetica, sans-serif"><B>S</B></FONT></TD>
		</TR>
		<%
If iDOW <> 1 Then
	Response.Write vbTab & "<TR>" & vbCrLf
	iPosition = 1
	Do While iPosition < iDOW
		Response.Write vbTab & vbTab & "<TD>&nbsp;</TD>" & vbCrLf
		iPosition = iPosition + 1
	Loop
End If

iCurrent = 1
iPosition = iDOW
Do While iCurrent <= iDIM
	If iPosition = 1 Then
		Response.Write vbTab & "<TR>" & vbCrLf
	End If

	if iPosition=1 then
	 fondo="#eeeeee"
	else
	 fondo=""
	end if 


if iCurrent = "5" and Month(dDate)="5" then
	 fondo="#0099CC"
elseif iCurrent = "16" and Month(dDate)="9" then
	 fondo="#0099CC"
elseif iCurrent = "1" and Month(dDate)="1" then
	 fondo="#0099CC"
elseif iCurrent = "25" and Month(dDate)="12" then
	 fondo="#0099CC"
elseif iCurrent = "5" and Month(dDate)="2" then
	 fondo="#0099CC"
end if
	
	If iCurrent = Day(dDate) Then
		if base="mysql" then
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99ccc'"" onmouseout=""this.style.background='#00FFFF'"" width=18 height=20 ALIGN=center BGCOLOR=#00FFFF><A HREF=""./agenda.asp?date=" & Year(dDate) & "-" & Month(dDate) & "-" & iCurrent & """ class=a2><FONT face=""Verdana"" SIZE=""1"" COLOR=#000099><b>" & iCurrent & "</b></FONT></A></TD>" & vbCrLf
		else
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99ccc'"" onmouseout=""this.style.background='#00FFFF'"" width=18 height=20 ALIGN=center BGCOLOR=#00FFFF><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"" COLOR=#000099><b>" & iCurrent & "</b></FONT></A></TD>" & vbCrLf
		end if
	Else
		fechahoy= iCurrent & "/" & Month(dDate) & "/" & Year(dDate)
		SQL2="SELECT * FROM eventos WHERE fecha="&fechahoy&" order by fecha"

		RS2.Open SQL2,oConn,1,1
		if not rs2.eof then
		if base="mysql" then
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='#3D87CA'"" width=18 height=20 ALIGN=center BGcolor=#3D87CA><A HREF=""./agenda.asp?date=" & Year(dDate) & "-" & Month(dDate) & "-" & iCurrent & """ class=a2><FONT face=""Verdana"" SIZE=""1"" color=#ffffff>" & iCurrent & "</FONT></A></TD>" & vbCrLf
		else
		Response.Write vbTab & vbTab & "<TD class=bordeTODO onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='#3D87CA'"" width=18 height=20 ALIGN=center BGcolor=#3D87CA><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"" color=#ffffff>" & iCurrent & "</FONT></A></TD>" & vbCrLf
		end if
		else
	    Response.Write vbTab & vbTab & "<TD onmouseover=""this.style.background='#99cccc'"" onmouseout=""this.style.background='"&fondo&"'"" width=18 height=20 ALIGN=center BGcolor="&fondo&"><A HREF=""./agenda.asp?date=" & iCurrent & "-" & Month(dDate) & "-" & Year(dDate) & """ class=a2><FONT face=""Verdana"" SIZE=""1"">" & iCurrent & "</FONT></A></TD>" & vbCrLf
		end if
		rs2.close
	End If
	
	If iPosition = 7 Then
		Response.Write vbTab & "</TR>" & vbCrLf
		iPosition = 0
	End If
	
	iCurrent = iCurrent + 1
	iPosition = iPosition + 1
Loop

If iPosition <> 1 Then
	Do While iPosition <= 7
		Response.Write vbTab & vbTab & "<TD>&nbsp;</TD>" & vbCrLf
		iPosition = iPosition + 1
	Loop
	Response.Write vbTab & "</TR>" & vbCrLf
End If
%>
	  </TABLE>
</TD>
</TR>
</TABLE>
<table height="5" border="0" cellspacing="0" cellpadding="0">
  <tr> 
	<td></td>
  </tr>
</table>
<table width="150" border="0" cellpadding="0" cellspacing="2" bgcolor="#66FFFF" class="bordeTODO">
  <tr> 
	<td width="18" height="20" bgcolor="#0099CC" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td width="126" height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  festivo</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#eeeeee" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Domingo</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#3D87CA" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  con evento</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#99cccc" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Puntero</font></td>
  </tr>
  <tr class="bordeTOP"> 
	<td height="20" bgcolor="#00FFFF" class="bordeTODO"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;</font></td>
	<td height="20"><font size="1" face="Arial, Verdana, Helvetica, sans-serif">&nbsp;Dia 
	  actual </font></td>
  </tr>
</table>
  #13 (permalink)  
Antiguo 11/09/2005, 12:58
 
Fecha de Ingreso: septiembre-2005
Mensajes: 20
Antigüedad: 18 años, 9 meses
Puntos: 0
calendario consulta BD

Bien encontre donde estaba el error

suponiendo que el canpo fecha de la bd es campo texto:

SQL2="SELECT * FROM eventos WHERE fecha='"&fechahoy&"'"

asi si que salen
  #14 (permalink)  
Antiguo 11/09/2005, 20:02
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 5 meses
Puntos: 16
cual codigo te funciono? el que yo puse?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:59.