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

Calendario en ASP , se puede ???

Estas en el tema de Calendario en ASP , se puede ??? en el foro de ASP Clásico en Foros del Web. Que tal colegas, necesito hacer un calendario en ASP y no dispongo mucho tiempo para hacerlo desde cero , y la verdad que lo que ...
  #1 (permalink)  
Antiguo 19/01/2006, 15:27
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
Calendario en ASP , se puede ???

Que tal colegas, necesito hacer un calendario en ASP y no dispongo mucho tiempo para hacerlo desde cero , y la verdad que lo que tengo que hacer es bastante complejo, ya que tiene que ser un calendario que sirva de agenda de eventos y citas , todo dinamico , pero bueno en principio mi problema es crear el calendario que me pueda mover entre los años y los meses , si alguien conoce la agenda de yahoo es algo asi lo que necesito , no se si se puede comprar un componente o hay algo mas o menos hecho para asi poder personalizarla un poco, muchas gracias!!!
  #2 (permalink)  
Antiguo 19/01/2006, 17:21
Avatar de Boxmaster  
Fecha de Ingreso: agosto-2004
Ubicación: Ahorita... frente a mi PC
Mensajes: 74
Antigüedad: 19 años, 10 meses
Puntos: 0
Si deseas el codigo yo baje un calendario que me fue de mucha ayuda, tiene muchas de las opciones que quieres manejar, se instala en el wwwroot y asi de facil lo puedes usar y/o modificar.

Todo el codigo viene en ASP con acceso a db de Access 2000

si deseas el codigo dame tu mail para que te lo envie.


Ok
  #3 (permalink)  
Antiguo 19/01/2006, 17:45
Avatar de ElAprendiz  
Fecha de Ingreso: enero-2002
Ubicación: Maipu, Chile
Mensajes: 3.706
Antigüedad: 22 años, 4 meses
Puntos: 2
busca en www.hotscripts.com
__________________
Manual de ASP Avanzado ;-)
  #4 (permalink)  
Antiguo 23/01/2006, 07:36
Avatar de zacktagnan  
Fecha de Ingreso: abril-2005
Mensajes: 501
Antigüedad: 19 años, 2 meses
Puntos: 3
Boxmaster:

A mi tambien me interesaría el mismo código del calendario ese que comentas para ver como es.

Si me lo puedes mandar a [email protected]

Saludos,

zacktagnan.
================================================== ==
  #5 (permalink)  
Antiguo 23/01/2006, 07:39
Avatar de mc_quake  
Fecha de Ingreso: enero-2006
Ubicación: www.ecocargo.cl
Mensajes: 683
Antigüedad: 18 años, 5 meses
Puntos: 8
me interesa el codigo llevo dias buscando

hola compadre ami tambien me interesa el codigo ya que llevo dias buscando uno espero que me lo puedas enviar mi mail es

[email protected]
  #6 (permalink)  
Antiguo 23/01/2006, 07:50
Avatar de zacktagnan  
Fecha de Ingreso: abril-2005
Mensajes: 501
Antigüedad: 19 años, 2 meses
Puntos: 3
En ese código, ¿se puede poner el Lunes como primer día de la semana?

Saludos,

zacktagnan.
================================================== ==
  #7 (permalink)  
Antiguo 23/01/2006, 09:56
Avatar de JuanRAPerez
Colaborador
 
Fecha de Ingreso: octubre-2003
Mensajes: 2.393
Antigüedad: 20 años, 7 meses
Puntos: 27
porque no pegan el codigo?
__________________
JuanRa Pérez
San Salvador, El Salvador
  #8 (permalink)  
Antiguo 23/01/2006, 10:14
 
Fecha de Ingreso: noviembre-2005
Ubicación: venezulea
Mensajes: 214
Antigüedad: 18 años, 6 meses
Puntos: 0
realmente me interesa el código

mi correo es: [email protected]
  #9 (permalink)  
Antiguo 23/01/2006, 11:35
Avatar de 3pies
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Desde una destilería
Mensajes: 2.584
Antigüedad: 20 años, 6 meses
Puntos: 144
Yo uso este calendario (no es mío, ya que solo he traducido los nombres de las variables, y he añadido algunas cosas, aunque no me acuerdo de qué). Os hacen falta 2 gif´s para moveros de un mes a otro, aunque podeis cambiar eso por las típicas << >>:
Código:
    <%
    Session.LCID = 1034
    fecha=FormatDateTime(now,vbshortdate)
    Dim dia,mes,anio,mesespanol,diaprimero,primerdia,mes2,anio2,diano,ultimodia,x,dia1
    dia = request.querystring("dia")
    if dia = "" then dia = day(fecha)
    mes = request.querystring("mes")
    if mes = "" then mes = month(fecha)
    anio = request.querystring("anio")
    if anio = "" then anio = year(fecha)
    if mes = 12 then
     mes2 = 1
     anio2 = anio + 1
    else
     mes2 = mes + 1
     anio2 = anio
    end if
    diaprimero = Cdate("1" & "/" & Cstr(mes) & "/" & Cstr(anio))
    diano = Cdate("1" & "/" & Cstr(mes2) & "/" & Cstr(anio2)) - 1
    primerdia = Weekday(Cdate("1" & "/" & Cstr(mes) & "/" & Cstr(anio))) - 1
    ultimodia = Weekday(diano) - 1
    if ultimodia = 0 then ultimodia = 7
    if primerdia = 0 then primerdia = 7
    Select Case mes
     case 1
      mesespanol = "Enero"
     case 2
      mesespanol = "Febrero"
     case 3
      mesespanol = "Marzo"
     case 4
      mesespanol = "Abril"
     case 5
      mesespanol = "Mayo"
     case 6
      mesespanol = "Junio"
     case 7
      mesespanol = "Julio"
     case 8
      mesespanol = "Agosto"
     case 9
      mesespanol = "Septiembre"
     case 10
      mesespanol = "Octubre"
     case 11
      mesespanol = "Noviembre"
     case 12
      mesespanol = "Diciembre"
    end Select
    x=1
    %>
    <table class="color" width="145" cellspacing="1" cellpadding="0">
     <tr><td colspan="7">
      <table width="100%" height="17" border="0" cellspacing="0" cellpadding="0">
       <tr class="color"><td>
        &nbsp;<a href="destino.asp?mes=<%if mes > 1 then response.write mes-1 else response.write 12 end if%>&anio=<%if mes > 1 then response.write anio else response.write anio-1 end if%>" onMouseOver="window.status='Ver el calendario del mes anterior';return true;" onMouseOut="window.status='';return;"><img src="img/atras2.gif" alt="Mes anterior" border="0" width="13" height="11"></a>
       </td>
       <td align="center">
        <strong><%=mesespanol%>&nbsp;<%=anio%></strong>
       </td>
       <td align="right">
        <a href="destino.asp?mes=<%if mes < 12 then response.write mes+1 else response.write 1 end if%>&anio=<%if mes < 12 then response.write anio else response.write anio+1 end if%>" onMouseOver="window.status='Ver el calendario del mes siguiente';return true;" onMouseOut="window.status='';return;"><img src="img/siguiente2.gif" alt="Mes siguiente" border="0" width="11" height="11"></a>&nbsp; 
       </td></tr>
      </table>
     </td></tr>
     <tr bgcolor="#E4BB79" align="center"><td width="14%">
      <strong>L</strong>
     </td>
     <td width="14%">
      <strong>M</strong>
     </td>
     <td width="14%">
      <strong>M</strong>
     </td>
     <td width="14%">
      <strong>J</strong>
     </td>
     <td width="14%">
      <strong>V</strong>
     </td>
     <td width="15%">
      <strong>S</strong>
     </td>
     <td width="15%">
      <strong>D</strong>
     </td></tr>
     <tr class="colorin"><%dia1 = (diaprimero - primerdia + x)
           do while dia1 <= (diano + 7 - ultimodia)
          %>
          <td<%if day(diaprimero - primerdia + x) = day(fecha) and month(diaprimero - primerdia + x) = month(fecha) then response.write " bgcolor=""#FAEED4""" end if%> align="center">
  
      <font color ="<%if dia1 >= diaprimero and dia1 <= diano then
         response.write "#856B41"
        else
         response.write "#B89256"
        end if%>">
      <%if dia1 >= diaprimero and dia1 <= diano then%>
       <%=day(diaprimero-primerdia+x)%>
      <%else%>
       <%=day(diaprimero-primerdia+x)%>
      <%end if%>
      </font> 
          </td>
      <%if weekday(diaprimero - primerdia + x - 1) = 7 then
       if dia1 < (diano + 7 - ultimodia) then
        response.write "</tr><tr class=""colorin"">"
       end if
      end if%>
      <%
      dia1 = dia1 + 1
      x= x + 1
      loop%>
     </tr>
    </table>
    %>
Fijaros que hay una página llamada destino.asp que se carga cuando pinchas en una fecha determinada. En esa página y dependiendo del valor del querystring, podeis poner el evento de que se trate.
  #10 (permalink)  
Antiguo 23/01/2006, 13:22
Avatar de ElAprendiz  
Fecha de Ingreso: enero-2002
Ubicación: Maipu, Chile
Mensajes: 3.706
Antigüedad: 22 años, 4 meses
Puntos: 2
este es muy bueno
http://scripts.ocean12tech.com/asp/calendar/
__________________
Manual de ASP Avanzado ;-)
  #11 (permalink)  
Antiguo 24/01/2006, 01:30
Avatar de zacktagnan  
Fecha de Ingreso: abril-2005
Mensajes: 501
Antigüedad: 19 años, 2 meses
Puntos: 3
A mi específicamente lo que me interesa aparte de estos calendarios que funcionan como una agenda, indicándote lo que pasa en el día, son esos que se abren en un recuadro, supongo que en una capa, a través de un enlace. Entonces, recorriendo los meses y años clicas finalmente en una fecha que automáticamente se inserta en un campo de texto de un formulario, cerrándose igualmente el calendario abierto.

Saludos,

zacktagnan.
=============================================
  #12 (permalink)  
Antiguo 24/01/2006, 09:07
Avatar de JuanRAPerez
Colaborador
 
Fecha de Ingreso: octubre-2003
Mensajes: 2.393
Antigüedad: 20 años, 7 meses
Puntos: 27
esta bonito el calendario y lo que dice zack se puede hacer con la idea basica que el mismo detallo
__________________
JuanRa Pérez
San Salvador, El Salvador
  #13 (permalink)  
Antiguo 08/03/2008, 00:29
 
Fecha de Ingreso: agosto-2007
Mensajes: 1
Antigüedad: 16 años, 10 meses
Puntos: 0
Re: Calendario en ASP , se puede ???

Boxmaster. Me podrias mandar el codigo a mi correo es [email protected]
  #14 (permalink)  
Antiguo 09/03/2008, 14:18
Usuario no validado
 
Fecha de Ingreso: julio-2003
Ubicación: <?="www.tuky.cl";?>
Mensajes: 132
Antigüedad: 20 años, 10 meses
Puntos: 4
Re: Calendario en ASP , se puede ???

Yo estoy terminando un calendario en ASP que utiliza un archivo XML como base para sacar información sobre eventos.

Y agregué un script llamado Facebox para mostrar la información del eventos...

está publicado en www.lyd.com todavía está en desarrollo el backend...

saludos!

* si quieren que publique el código me avisan
  #15 (permalink)  
Antiguo 24/03/2008, 15:26
Avatar de Epunamun  
Fecha de Ingreso: noviembre-2004
Mensajes: 133
Antigüedad: 19 años, 6 meses
Puntos: 0
Re: Calendario en ASP , se puede ???

porfavor serias tan amable de ver el codigo.

gracias,
  #16 (permalink)  
Antiguo 24/03/2008, 15:54
Usuario no validado
 
Fecha de Ingreso: julio-2003
Ubicación: <?="www.tuky.cl";?>
Mensajes: 132
Antigüedad: 20 años, 10 meses
Puntos: 4
Re: Calendario en ASP , se puede ???

Bueno, les cuento. El calendario se genera con ASP 3.0 y los eventos se importan desde un XML generado en otro servidor que solo soporta PHP 5.x y ocupo ajax para cargar los meses.

eventos.js
Código PHP:
function nuevoAjax()

    var 
xmlhttp=false;
    try
    {
        
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(
e)
    {
        try
        {
            
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(
E)
        {
            if (!
xmlhttp && typeof XMLHttpRequest!='undefined'xmlhttp=new XMLHttpRequest();
        }
    }
    return 
xmlhttp
}
function 
cargarMes(mesaniodiv) {
    var 
destino document.getElementById(div);    
    
    var 
ajax=nuevoAjax();
        
ajax.open("GET""/calendario.asp?MES="+mes+"&ANIO="+aniotrue);
        
ajax.onreadystatechange=function() 
        { 
            if (
ajax.readyState==1)
            {
                
// Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..."
                
destino.innerHTML="<div style=\"text-align: center; margin-top 20px;\"><img src=\"loading.gif\" border=\"0\" /></div>";
            }
            if (
ajax.readyState==4)
            {
                
destino.innerHTML=ajax.responseText;
            } 
        }
        
ajax.send(null);

eventos.php
Código PHP:
<?php

# Generamos las variables
$date time();
$meses = array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");

$day date('d'$date);
$month date('m'$date);
$year date('Y'$date);

if (isset(
$_GET[MES]))
    
$month $_GET[MES];
    
if (isset(
$_GET[ANIO]))
    
$year $_GET[ANIO];

$hostname "localhost";
$database "";
$username "";
$password "";
$link mysql_connect($hostname$username$password) or die(mysql_error()); 
mysql_select_db($database$link);

$first_day mktime(0,0,0,$month$day_num$year);
$last_day mktime(23,59,59,$monthcal_days_in_month(0$month$year), $year);
$result mysql_query("SELECT ID, fecha_desde, fecha_hasta FROM eventos_beta WHERE fecha_desde >= ".$first_day." AND fecha_hasta <= ".$last_day.""$link);

header('Content-Type: text/xml');
echo 
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo 
'<rss version="2.0">
<channel>
    <title>Eventos</title>
    <link>http://</link>
    <language>es-CL</language>
    <description></description>
    <generator>TukySolutions</generator>'
;

    while(
$rw mysql_fetch_assoc($result)) {
        echo 
"<item>
        <id>$rw[ID]</id>
        <evento_dia>"
.intval(date("d"$rw[fecha_desde]))."</evento_dia>
        <evento_mes>"
.intval(date("m"$rw[fecha_desde]))."</evento_mes>
        </item>"
;
    }
    
    echo 
'</channel></rss>';
exit();
?>
  #17 (permalink)  
Antiguo 24/03/2008, 15:55
Usuario no validado
 
Fecha de Ingreso: julio-2003
Ubicación: <?="www.tuky.cl";?>
Mensajes: 132
Antigüedad: 20 años, 10 meses
Puntos: 4
Re: Calendario en ASP , se puede ???

calendario.asp
Código PHP:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% 
Response.Expires = -%>
<%
    
Dim objXML
    Dim objItemList
    Dim objItem
    Dim event_ID
    Dim event_day
    Dim event_month
        
    Set objXML 
Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
    
objXML.async False
    
    objXML
.setProperty "ServerHTTPRequest"True
    
    
If Request.QueryString("MES") <> "" AND Request.QueryString("ANIO") <> "" Then
        objXML
.Load("http://www.otroservidor.com/eventos/eventos.php?MES="&Request.QueryString("MES")&"&ANIO="&Request.QueryString("ANIO")&"")
    Else
        
objXML.Load("http://www.otroservidor.com/eventos/eventos.php")
    
End If
    
    If 
objXML.parseError.errorCode <> 0 Then
    End 
If
    
    
Set objItemList objXML.getElementsByTagName("item")
    
Set objXML Nothing

    
For Each objItem In objItemList
    
         event_ID 
objItem.childNodes(0).text&";"&event_ID
         event_day 
objItem.childNodes(1).text&";"&event_day
         event_month 
objItem.childNodes(2).text&";"&event_month
    
    Next
    
    Dim arrID
arrStartarrMonth
    arrID 
Split(event_ID,";")
    
arrDay Split(event_day,";")
    
arrMonth Split(event_month,";")

    
Set objItemList Nothing
    
    Dim todays_month
    Dim todays_year
    Dim today
    Dim todays_day
    Dim global_month
    Dim global_year
    Dim global_day
    
    today 
date
    global_day 
Day(today)
    
global_month Month(today)
    
global_year Year(today)

    If 
Request.QueryString("MES") <> "" AND Request.QueryString("ANIO") <> "" Then
        todays_day 
global_day
        todays_month 
Request.QueryString("MES")
        
todays_year Request.QueryString("ANIO")
    Else
        
todays_day day(today)
        
todays_month month(today)    
        
todays_year year(today)   
    
End If
         
month_names = Array("","ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE")                      
         
Response.Write("<div style=""border-top: 1px #148ECF solid;background-color: #7490D9;color: #FFFFFF;font-family: Arial Narrow, Arial, Helvetica, sans-serif;font-size: 14px;font-weight: normal;padding: 5px;margin-top: 0px;""><img src=""/lyd/eventos/dots.jpg"" />EVENTOS &gt; "&month_names(todays_month)&" "&todays_year&"</div>")
           
'#2D3192
         this_month = datevalue(todays_month & "/1/" & todays_year)                           
         next_month = datevalue(dateadd("m", 1, todays_month &  "/1/" & todays_year))
         
         '
Find out when this month starts and ends.         
         
first_week_day weekday(this_month2) - 1
         days_in_this_month 
datediff("d"this_monthnext_month)
         
         
         
' Obtener la cantidad de dias del mes anterior                 
                          
         calendar_html = "<table style=""border: #FFFFFF solid;margin:10px auto;"" align=""center"">"
                           
         calendar_html = calendar_html & "<tr>"
          
         '
Fill the first week of the month with the appropriate number of blanks.       
         for 
week_day 0 to first_week_day 1            
             calendar_html 
calendar_html "<td></td>"   
         
next
            
         week_day 
first_week_day
         total_day 
0
         
for day_counter 1 to days_in_this_month           
             week_day 
week_day mod 7
            
             
if week_day 0 then
                calendar_html 
calendar_html "</tr><tr>"
             
end if
            
             
'Do something different for the current day.
             
            arrID = Split(event_ID,";")
            arrDay = Split(event_day,";")
            arrMonth = Split(event_month,";")
            
            encontrado = 0
            
            For i = 0 to UBound(arrDay) - 1
                If CInt(arrDay(i)) = CInt(day_counter) and CInt(todays_month) = CInt(arrMonth(i)) Then
                     ' 
Si existe evento en actual dia                     
                     calendar_html 
calendar_html "<td style=""border: 0; font-family: Arial, Helvetica, sans-serif;    font-size: 12px; background-color: #FF6600;""><a href=""/eventos/"&arrID(i)&"/"" style=""color: #D8DEEA;text-align: center;font-weight: bold;padding: 5px; display: block; text-decoration: none;"">"day_counter &"</a></td>"
                    
encontrado 1
                End 
if
            
Next
            
            
if encontrado 0 then
                
            
            
             
if CInt(todays_day) = CInt(day_counter) and CInt(todays_month) = CInt(global_monththen
                calendar_html 
calendar_html "<td style=""border: 0;    font-family: Arial, Helvetica, sans-serif;    font-size: 12px;background-color: #3B5999;color: #D8DEEA;text-align: center;font-weight: bold;padding: 6px;font-weight: bold;"">" day_counter "</td>"
             
else
                
calendar_html calendar_html "<td style=""border: 0;    font-family: Arial, Helvetica, sans-serif;    font-size: 12px;background-color: #D8DEEA;text-align: center;font-weight: bold;padding: 6px;color:#3B5999;font-weight: normal;""> " day_counter "</td>"
             
end if
         
end if
             
week_day week_day 1
             total_day 
week_day
         next
        
         
if total_day 7 then
             total_day 
total_day
             
for day_next_month 1 to total_day

             calendar_html 
calendar_html "<td style=""border: 0; font-family: Arial, Helvetica, sans-serif;    font-size: 12px;background-color: #EEEEEE;text-align: center;font-weight: bold;padding: 6px;color: #999999;font-weight: normal;"">"&day_next_month&"</td>"
            
next
         end 
if
          
         
Dim next_month_link
         Dim last_month_link
          
         
if CInt(todays_month) = 12 then
             todays_year 
CInt(todays_year) + 1
             next_month_link 
"<a href=""/lyd/eventos/1/"&todays_year&"/"" onClick=""cargarMes('1', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(1)&"</a>"
            
todays_year CInt(todays_year) - 2
            last_month_link 
"<a href=""/lyd/eventos/11/"&todays_year&"/"" onClick=""cargarMes('11', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(11)&"</a>"
        
elseif CInt(todays_month) = 1 then
            todays_year 
CInt(todays_year)
            
next_month_link "<a href=""/lyd/eventos/2/"&todays_year&"/"" onClick=""cargarMes('2', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(2)&"</a>"
            
todays_year CInt(todays_year) - 1
            last_month_link 
"<a href=""/lyd/eventos/12/"&todays_year&"/"" onClick=""cargarMes('12', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(12)&"</a>"
        
else
            
todays_year CInt(todays_year)
            
next_month_link "<a href=""/lyd/eventos/"&(CInt(todays_month) + 1)&"/"&todays_year&"/"" onClick=""cargarMes('"&(CInt(todays_month) + 1)&"', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(CInt(todays_month) + 1)&"</a>"
            
last_month_link "<a href=""/lyd/eventos/"&(CInt(todays_month) - 1)&"/"&todays_year&"/"" onClick=""cargarMes('"&(CInt(todays_month) - 1)&"', '"&todays_year&"', 'eventos_lyd'); return false;"">"&month_names(CInt(todays_month) - 1)&"</a>"
        
end if
          
         
calendar_html calendar_html "</tr>"
         
calendar_html calendar_html "<tr><td colspan=""3"" style=""color: #3A8FC6;font-size: 11px;text-align: left;""><br />&laquo; "&last_month_link&"</td>"
         
calendar_html calendar_html "<td></td><td colspan=""3"" style=""color: #3A8FC6;font-size: 11px;text-align: right;""><br />"&next_month_link&" &raquo;</td></tr>"
         
calendar_html calendar_html "</table>"
                   
         
response.Write(calendar_html)
         
%> 
saludos,

tuky-
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 01:07.