Ir para conteúdo

POWERED BY:

Arquivado

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

Otavio Biaz

calendário asp

Recommended Posts

Peguei este script e ele é show de bola só que quando vou colocar 2 eventos ou + na mesma data ele trava e não mostra mais nada preciso de um help.

Já tentei de tudo mas não entendo por que não aparece nada na linha de baixo e ainda trava.

 

Obrigado

 

 

<%@ LANGUAGE="VBScript" %>
<!--#INCLUDE FILE="dbcon.asp" -->
<%
Session.LCID = 2057
'Option Explicit

set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open DBCon

Function FormatStr(String)
	on Error resume next
	String = Replace(String, CHR(13), "")
	String = Replace(String, CHR(10) & CHR(10), "</P><P>")
	String = Replace(String, CHR(10), "<BR>")
	FormatStr = String
End Function

Dim dtToday 
dtToday = Date()

Dim dtCurViewMonth ' First day of the currently viewed month
Dim dtCurViewDay ' Current day of the currently viewed month
Dim frmDate ' Date submitted by form

' if the GO button was used, build the date from the month and year

If InStr(1, Request.Form, "subGO", 1) > 0  then
	if Request.Form("CURDATE_month") = "" then
		tmpMonth = month(now())
	else
		tmpMonth = Request.Form("CURDATE_month")
	End If
	
	if Request.Form("CURDATE_year") = "" then
		tmpyear = year(now())
	else
		tmpyear = Request.Form("CURDATE_year")
	End If
		
	tmpDate = "1 " & tmpMonth & " 1999"
	
	mnth = Month(tmpDate)
	frmDate = DateSerial(tmpyear, mnth, 1)
Else

	frmDate = Request.Form("CURDATE")
	
end if

if Request("view_date") <> "" then 
	frmDate= DateSerial(year(Request("view_date")), month(Request("view_date")), 1)
end if

%>


<% REM This section defines functions to be used later on. %>
<% REM This sets the Previous Sunday and the Current Month %>
<% 

'--------------------------------------------------
   Function DtPrevSunday(ByVal dt)
      Do While WeekDay(dt) > vbSunday
         dt = DateAdd("d", -1, dt)
      Loop
   DtPrevSunday = dt
   End Function
'--------------------------------------------------
%>

<%REM Set current view month from posted CURDATE,  or
' the current date as appropriate.

' if posted from the form
' if prev button was hit on the form
   If InStr(1, Request.Form, "subPrev", 1) > 0 Then
      dtCurViewMonth = DateAdd("m", -1, frmDate)
' if next button was hit on the form
   ElseIf InStr(1, Request.Form, "subNext", 1) > 0 Then
      dtCurViewMonth = DateAdd("m", 1, frmDate)
' anyother time
      Else
' date add in text box
         If InStr(1, Request.Form, "subGO", 1) > 0 then
			dtCurViewMonth = frmDate
		 Else
			if Request("view_date") <> "" then 
				dtCurviewMonth = frmDate
			else
            dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1)
            End If
         End If
   End If
%>

<% REM --------BEGINNING OF DRAW CALENDAR SECTION-------- %>
<% REM This section executes the event query and draws a matching calendar. %>
<%
   Dim iDay, iWeek, sFontColor, dictDte(31,2), intCount
   strSql = "SELECT * FROM diary WHERE month(dte)= " & month(dtCurViewMonth) & " and year(dte) = " & year(dtCurViewMonth) & " order by dte"
   
   set rs = my_conn.Execute (StrSql)
   
   intCount= 0
   
   ' populate array with days of month
   on Error resume next
   
  
   do until rs.EOF
  
   if intCount > 31 then exit do
   if Day(rs("dte")) = intCount + 1 then 
		dictDte(intCount, 1) = rs("text_field")
		rs.Movenext
	Else 
		dictDte(intCount, 1) = " "
	End If
	dictDte(intCount, 2) = intCount + 1
	intCount = intCount + 1
   loop
  
%>

<html>
<head>
</head>
<body>
 <center><font FACE="Times New Roman" SIZE="5" color="#000080">Calendar</font>
       <form NAME="fmNextPrev" ACTION="diary.asp" METHOD="POST">
       <table CELLPADDING="3" CELLSPACING="0" WIDTH="95%" BORDER="2" BGCOLOR="#99CCFF" BORDERCOLORDARK="#003399" BORDERCOLORLIGHT="#FFFFFF">
          <tr VALIGN="MIDDLE" ALIGN="CENTER">
             <td COLSPAN="7">
             <table CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0">
                <tr VALIGN="MIDDLE" ALIGN="CENTER">
                   <td WIDTH="30%" ALIGN="RIGHT">
                      <input TYPE="IMAGE" NAME="subPrev" SRC="Left.gif" BORDER="0" WIDTH="18" HEIGHT="20" HSPACE="0" VSPACE="0">
                   </td>
                   <td WIDTH="40%">
                      <font FACE="Arial" COLOR="#000000">
                      <b><%=MonthName(Month(dtCurViewMonth)) & " " & Year(dtCurViewMonth)%></b>
                     </font>
                   </td>
                   <td WIDTH="30%" ALIGN="LEFT">
                      <input TYPE="IMAGE" NAME="subNext" SRC="Right.gif" BORDER="0" WIDTH="18" HEIGHT="20" HSPACE="0" VSPACE="0">
                   </td>
                </tr>
             </table>
             </td>
          </tr>

          <tr VALIGN="TOP" ALIGN="CENTER" BGCOLOR="#000099">

          <% For iDay = vbSunday To vbSaturday %>
             <th WIDTH="14%"><font FACE="Arial" SIZE="-2" COLOR="#FFFFFF"><%=WeekDayName(iDay)%></font></th>
          <%Next %>

         </tr>

<%
   dtCurViewDay = DtPrevSunday(dtCurViewMonth)
  
   For iWeek = 0 To 5
      Response.Write "<TR VALIGN=TOP>" & vbCrLf

Dim sBGCOLOR 
sBGCOLOR = "#99ccff"


For iDay = 0 To 6
sBGCOLOR = "#99ccff"
If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
 If dtCurViewDay = dtToday Then sBGCOLOR = "#99ccbb"
else 
 sBGCOLOR = "#99ccff"
 
End If
Response.Write "<TD HEIGHT=50 bgcolor='" & sBGCOLOR & "' >"
         
  	
   If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
		If dtCurViewDay = dtToday Then
               sFontColor = "#ff0000"

            Else
               sFontColor = "#00000"
            End If
      
         '---- Write day of month
            Response.Write "<FONT FACE=""Arial"" SIZE=""-2"" COLOR=""" & sFontColor & """><B>"
            Response.Write "<a href=view_day.asp?" & "view_date=" & day(dtCurViewday) & "-" & monthname(month(dtCurViewday)) & "-" & year(dtCurViewday) & ">"  & Day(dtCurViewDay) & "</a></B><br>" & formatStr(dictDte(Day(dtCurViewDay)- 1, 1)) & "</FONT><BR>"
         '---Else
            '---Response.Write " "
         End If

         Response.Write "</TD>" & vbCrLf
         dtCurViewDay = DateAdd("d", 1, dtCurViewDay)
      Next
      Response.Write "</TR>" & vbCrLf
   Next
%>
<%REM --------END OF DRAW CALENDAR SECTION-------- 

my_conn.Close
set my_conn = nothing
%>
</table>
<select name="CURDATE_month">
  <option value="<%=monthName(month(dtCurViewMonth))%>" selected><%=monthName(month(dtCurViewMonth))%>
  <option value="January">January
  <option value="February">February
  <option value="March">March
  <option value="April">April
  <option value="May">May
  <option value="June">June
  <option value="July">July
  <option value="August">August
  <option value="September">September
  <option value="October">October
  <option value="November">November
  <option value="December">December
</select>

<input TYPE="text" NAME="CURDATE_YEAR" VALUE="<%=year(dtCurViewMonth)%>" size="6"><br>
<input type="hidden" Name="CURDATE" Value="<%=dtCurViewMonth%>">
<input type="submit" value=" GO " name="subGO">
</form>
</center></div>
</font>
</center>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tu consegue cadastrar mais de um evento? Ou na hora de cadastrar ele da pau?

 

Se tu conseguir cadastrar mais de um evento, tu coloca na resposta um movenext para ele mostrar os outros resultados. Eu acho que isso deve funcionar. hehehe

 

Tu tem como me mandar esse codigo completo não? To precisando de um desse tipo... =\

Se tiver como envia para leobemfica@gmail.com.

Irei adaptar no meu site, mas manterei os creditos.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tu consegue cadastrar mais de um evento? Ou na hora de cadastrar ele da pau?

 

Se tu conseguir cadastrar mais de um evento, tu coloca na resposta um movenext para ele mostrar os outros resultados. Eu acho que isso deve funcionar. hehehe

 

Tu tem como me mandar esse codigo completo não? To precisando de um desse tipo... =\

Se tiver como envia para leobemfica@gmail.com.

Irei adaptar no meu site, mas manterei os creditos.

 

Abraços

 

eu consigo cadastrar normalmente no banco de dados so que da pau se cadastrar duas ou mais datas iguais e dali pra frente não mostra mais.

o movenext já esta la no select

o link de download é este

http://www.scriptbrasil.com/es/download/codigo/7373/

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem um exemplo que disponibilizei no fórum, onde o calendário funciona como uma agenda, onde você pode colocar mais de um evento no mesmo dia e horário

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem um exemplo que disponibilizei no fórum, onde o calendário funciona como uma agenda, onde você pode colocar mais de um evento no mesmo dia e horário

 

tem como mandar o link do exemplo pois não achei, obrigado.

Compartilhar este post


Link para o post
Compartilhar em outros sites

me manda uma MP com seu email, que te envio

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem um exemplo que disponibilizei no fórum, onde o calendário funciona como uma agenda, onde você pode colocar mais de um evento no mesmo dia e horário

 

 

me manda uma MP com seu email, que te envio

 

@xanburzum,

 

Porque você não posta o link aqui no tópico ?

 

Assim todos poderão se beneficiar da informação.

Compartilhar este post


Link para o post
Compartilhar em outros sites

ja enviei no seu email....

Compartilhar este post


Link para o post
Compartilhar em outros sites

xanburzum, tem como você me mandar este exemplo de calendário tipo agenda nos meus emails? akaleejam@gmail.com e akaleejam@hotmail.com. Obrigado desde já!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Opa amigo...

 

tem sim, , posso te mandar na segunda, pois tenho o code no trabalho....

 

e me manda um email socilitando, que te dou um replay

Compartilhar este post


Link para o post
Compartilhar em outros sites

Opa amigo...

 

tem sim, , posso te mandar na segunda, pois tenho o code no trabalho....

 

e me manda um email socilitando, que te dou um replay

xanburzum, manda este código pra mim, te mandei um email mas acho que você não recebeu. Tente mandar nestes endereços:

akaleejam@gmail.com

akaleejam@hotmail.com

 

Não mande no leandro@clune.com.br, este é meu email de trabalho e eu estou afastado do trabalho devido um probleminha e não tenho acesso a ele aqui em casa.

Valeu!

Compartilhar este post


Link para o post
Compartilhar em outros sites

acabei de te enviar no Gmail

Compartilhar este post


Link para o post
Compartilhar em outros sites

Beleza amigo...

caso faça alguma modificação , posta ae, depois...

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.