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

Ayuda programacion calendario

Estas en el tema de Ayuda programacion calendario en el foro de ASP Clásico en Foros del Web. Hola: Necesito ayuda sobre la programacion de un calendario en asp. En el calendario tengo impreso el dia segun el mes, y abajo de cada ...
  #1 (permalink)  
Antiguo 22/12/2003, 12:56
 
Fecha de Ingreso: diciembre-2003
Mensajes: 5
Antigüedad: 21 años, 4 meses
Puntos: 0
Ayuda programacion calendario

Hola:

Necesito ayuda sobre la programacion de un calendario en asp.

En el calendario tengo impreso el dia segun el mes, y abajo de cada dia tengo escrito una caja de texto, puse un boton que graba los valores de las cajas de texto en una cookie, el problema que tengo es que cuando quiero visualizar el valor de cada caja de texto, no me muestra todos los valores.

¿Alguien me pudiera ayudar?

Gracias.
  #2 (permalink)  
Antiguo 22/12/2003, 22:56
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 2 meses
Puntos: 535
no entiendo.. un poco de código tal vez?
__________________
...___...
  #3 (permalink)  
Antiguo 23/12/2003, 10:54
 
Fecha de Ingreso: diciembre-2003
Mensajes: 5
Antigüedad: 21 años, 4 meses
Puntos: 0
ultima parte

Te envio el codigo completo, perdon pense que si lo publicaba aqui no apareceria completo el codigo pero ya veo que si me acepto el codigo.

Última edición por elvamtz; 23/12/2003 a las 10:56
  #4 (permalink)  
Antiguo 23/12/2003, 10:55
 
Fecha de Ingreso: diciembre-2003
Mensajes: 5
Antigüedad: 21 años, 4 meses
Puntos: 0
<%@ Language=VBScript %>
<%
':::::::::::::::::::::::::::::::::::::
'
' Declaro variables
'
':::::::::::::::::::::::::::::::::::::
Dim MyMonth ':::Month of calendario
Dim MyYear ':::Year of calendario
Dim FirstDay ':::First day of the month. 1 = Monday
Dim CurrentDay ':::Used to print dates in calendario
Dim Col ':::calendario column
Dim Row ':::calendario row

':::::::::::::::::::::::::::::::::::::
'
' Asigno Valores a las variables
'
':::::::::::::::::::::::::::::::::::::
if Request.Querystring("Month")<> "" then
MyMonth=Request.Querystring("Month")
else if Request.Form("txtmes")<>"" then
MyMonth=Request.Form("txtmes")
else
MyMonth=Month(Date)
end if
end if

if Request.Querystring("Year")<> "" then
MyYear=Request.Querystring("Year")
else if Request.Form("anio") then
MyYear=Request.Form("anio")
else
MyYear=Year(Date)
end if
end if

Call ShowHeader (MyMonth, MyYear)

'::::::::::::::::::::::::::::::::::::
'
' Boton Grabar
'
'::::::::::::::::::::::::::::::::::::
Contador="Contador"
if Request.Form("Grabar")<> "" then
'::: Grabo la cookie contadora
Contador="Contador"
Response.Cookies(Contador)("Numero")=Request.Cooki es(Contador)("Numero") + 1

':::Recorro los dias del mes actual para imprimir los turnos que el usuario selecciono
for i=1 to LastDay(MyMonth, MyYear)
Registro="Registro" & i & MyMonth & MyYear
Response.Cookies(Registro).expires="12/31/2003"
Response.Cookies(Registro)("Dia")=i
Response.Cookies(Registro)("Mes")= MyMonth
If Request.Form("txt" & i & MyMonth & MyYear )<> "" then
Response.Cookies(Registro)("Turno")=Request.Form(" txt" & i & MyMonth & MyYear )
Session("Registro" & i & MyMonth & MyYear)=Request.Form("txt" & i & MyMonth & MyYear )

else
Response.Cookies(Registro)("Turno")=""
Session("Registro" & i & MyMonth & MyYear)=""
end if
Response.Cookies(Registro)("Fecha")=i & "/" & MyMonth & "/" & MyYear
next



end if ':::Cierro sentencia del request.form grabar

FirstDay = WeekDay(DateSerial(MyYear, MyMonth, 1)) -1
CurrentDay = 1

'::::::::::::::::::::::::::::::::
'
' Imprime calendario
'
'::::::::::::::::::::::::::::::::
For Row = 0 to 5
For Col = 0 to 6
If Row = 0 and Col < FirstDay then
response.write "<td>&nbsp;</td>"
elseif CurrentDay > LastDay(MyMonth, MyYear) then
response.write "<td>&nbsp;</td>"
else
response.write "<td"
if cInt(MyYear) = Year(Date) and cInt(MyMonth) = Month(Date) and CurrentDay = Day(Date) then
response.write " class='calCeldaResaltado' align='center'>"
else
response.write " align='center'>"
end if


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 & "<br>"


':::Imprimo los valores correspondientes a los dias del mes

Registro="Registro" & CurrentDay & MyMonth & MyYear

If Request.Cookies(Registro)("Turno")="" then
Response.write "<input type='text' name='txt" & CurrentDay & MyMonth & MyYear & "' value='' size='1' maxlength='2'>" & "</div></a></td>"
else
Response.write "<input type='text' name='txt" & CurrentDay & MyMonth & MyYear & "' value='" & Request.Cookies(Registro)("Turno") & "' size='1' maxlength='2'>" & "</div></a></td>"

end if
CurrentDay = CurrentDay + 1

End If
Next

response.write "</tr>"
Next
response.write "</table></body></html>"

':::::::::::::::::::::::::::::::::
'
' Boton Salir
'
':::::::::::::::::::::::::::::::::
If Request.Form("Salir") <>"" then
contador=Request.Cookies("Contador")("Numero")
Response.redirect "inicio.asp?tam=" & contador
end if


'::::::::::::::::::::::::::::::::
'
' Sub and functions
'
':::::::::::::::::::::::::::::::::


Sub ShowHeader(MyMonth,MyYear)
%>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<style>
.calFondocalendarioio {background-color:gainsboro}
.calEncabe {font-family:Arial, Helvetica, sans-serif; font-size:11px}
.calFondoEncabe {background-color:lightgreen}
.calDias {font-family:Arial, Helvetica, sans-serif; font-size:9px; font-weight:900}
.calSimbolo {font-family:Arial, Helvetica, sans-serif; font-size:11px; text-decoration:none; font-weight:200; color:blue}
.calResaltado {font-family:Arial, Helvetica, sans-serif; font-size:11px; text-decoration:none; font-weight:700}
.calCeldaResaltado {background-color:white}
</style>
<title>calendario Inicial</title></head>

<body bgcolor='#ffffcc'>
<br>
<form name="form1" method="post" action="calendario.asp">
<div align="center"><font color="#0000A0" face="Arial, Helvetica, sans-serif" size="2"><b>Mes:
<input type="text" name="txtmes" value="<%=MyMonth%>" >
</b></font><b><font face="Arial, Helvetica, sans-serif" size="2"><br>
<font color="#0000A0">A&ntilde;o:</font></font> <font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="anio" value="<%=MyYear%>" >
</font></b><br><br>
<input type="submit" name="Grabar" value="Grabar">
<input type="submit" name="Salir" value="Salir">
</div>
<br>
<table border='1' cellspacing='3' cellpadding='3' width='200' align='center' class="calFondocalendarioio">
<tr align='center'>
<td colspan='7'>
<table border='0' cellspacing='1' cellpadding='1' width='100%' class="calFondoEncabe">
<tr>
<td align='left'>
<%
response.write "<a href = 'calendario.asp?"


if MyMonth - 1 = 0 then
response.write "month=12&year=" & MyYear -1
else
response.write "month=" & MyMonth - 1 & "&year=" & MyYear
end if
response.write "'><span class='calSimbolo'><<</span></a>"

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

response.write "<a href = 'calendario.asp?"

if MyMonth + 1 = 13 then
response.write "month=1&year=" & MyYear + 1
else
response.write "month=" & MyMonth + 1 & "&year=" & MyYear
end if
response.write "'><span class='calSimbolo'>>></span></a>"
%>
</td>
<td align='center'>
<%
response.write "<a href ='calendario.asp?"
response.write "month=" & Month(Date()) & "&year=" & Year(Date())
response.write "'><div class='calSimbolo'><b>Hoy</b></div></a>"
%>
</td>
<td align='right'>
<%
response.write "<a href = 'calendario.asp?"
response.write "month=" & MyMonth & "&year=" & MyYear -1
response.write "'><span class='calSimbolo'><<</span></a>"

response.write "<span class='calEncabe'> <b>" & MyYear & "</b> </span>"
response.write "<a href = 'calendario.asp?"
response.write "month=" & MyMonth & "&year=" & MyYear + 1
response.write "'><span class='calSimbolo'>>></span></a>"
%>
</td>
</tr>
</table>
</td>
</tr>
<tr align='center'>
<td width="19">
<div class='calDias'>
<div align="center">D</div>
</div>
</td>
<td width="15">
<div class='calDias' align="center">L</div>
</td>
<td width="18">
<div class='calDias' align="center">M</div>
</td>
<td width="16">
<div class='calDias'>
<div align="center">M</div>
</div>
</td>
<td width="15">
<div class='calDias' align="center">J</div>
</td>
<td width="16">
<div class='calDias'>
<div align="center">V</div>
</div>
</td>
<td width="19">
<div class='calDias'>
<div align="center">S</div>
</div>
</td>
</tr>
<%
End Sub

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
%>
</table>



</form>
  #5 (permalink)  
Antiguo 23/12/2003, 12:14
 
Fecha de Ingreso: noviembre-2003
Ubicación: Distrito Federal
Mensajes: 225
Antigüedad: 21 años, 5 meses
Puntos: 0
Hechale un ojo a tu correo, te mande un archivo espero te sirva
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

SíEste tema le ha gustado a 1 personas (incluyéndote)




La zona horaria es GMT -6. Ahora son las 17:22.