Visualizzazione dei risultati da 1 a 2 su 2

Discussione: calendario e db

  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2007
    Messaggi
    14

    calendario e db

    Buondì
    a me serve un calendario che mi faccia linkare alcune date a eventi contenuti in un db access. Come si fa?
    Grazie

  2. #2
    Questo è il codice per un semplice calendario.
    Il resto prova ad implementarlo tu.
    codice:
    <%
    giorno = request.queryString("giorno")
    mese = request.queryString("mese")
    anno = request.queryString("anno")
    
    if len(giorno) = 0 or not isNumeric(giorno) then giorno = datePart("d",date())
    if len(mese) = 0 or not isNumeric(mese) then mese = datePart("m",date())
    if len(anno) = 0 or not isNumeric(anno) then anno = datePart("yyyy",date())
    
    dataCorrente = giorno & "/" & mese & "/" & anno
    if not isDate(dataCorrente) then dataCorrente = formatDateTime(date(),vbGeneralDate)
    
    giorno = datePart("d",dataCorrente)
    mese = datePart("m",dataCorrente)
    anno = datePart("yyyy",dataCorrente)
    
    primoGiornoMese = cDate("01" & "/" & mese & "/" & anno)
    primoGiornoSettimanaMese = datePart("w",primoGiornoMese)
    %>
    <table border="1">
    	<tr>
    		<td colspan="7"><%=uCase(monthName(mese))%><%=anno%></td>
    	</tr>
    	<tr>
    		<td>D</td>
    		<td>L</td>
    		<td>M</td>
    		<td>M</td>
    		<td>G</td>
    		<td>V</td>
    		<td>S</td>
    	</tr>
    	<tr>
    <%
    	for i = 1 to (primoGiornoSettimanaMese - 1)
    %>
    		<td></td>
    <%	
    	next
    
    	for g = 1 to 31
    		tmpDate = g & "/" & mese & "/" & anno
    		if isDate(tmpDate) then
    %>
    		<td><%=g%></td>
    <%		
    			if datePart("w",tmpDate) = 7 then
    				response.write "	</tr>" & vbCrLf
    				response.write "	<tr>" & vbCrLf
    			end if
    			ultimoGiornoSettimanaMese = datePart("w",tmpDate)
    		end if
    	next
    	
    	for i = (ultimoGiornoSettimanaMese + 1) to 7
    %>
    		<td></td>
    <%	
    	next
    	
    	mesePrecedente = dateAdd("m",-1,primoGiornoMese)
    	meseSuccessivo = dateAdd("m",1,primoGiornoMese)
    %>
    	</tr>
    	<tr>
    		<td colspan="2">&amp;mese=<%=datePart("m",mesePrecedente)%>&amp;anno=<%=datePart("yyyy",mesePrecedente)%>">&laquo;</td>
    		<td colspan="3"></td>
    		<td colspan="2">&amp;mese=<%=datePart("m",meseSuccessivo)%>&amp;anno=<%=datePart("yyyy",meseSuccessivo)%>">&raquo;</td>
    	</tr>
    </table>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.