<%@ LANGUAGE="VBSCRIPT" %> <% dim nomemese(12) dim nomegio(7) dim mesesig(12) nomemese(1) = "Gennaio" nomemese(2) = "Febbraio" nomemese(3) = "Marzo" nomemese(4) = "Aprile" nomemese(5) = "Maggio" nomemese(6) = "Giugno" nomemese(7) = "Luglio" nomemese(8) = "Agosto" nomemese(9) = "Settembre" nomemese(10) = "Ottobre" nomemese(11) = "Novembre" nomemese(12) = "Dicembre" nomegio(1) = "Lun" nomegio(2) = "Mar" nomegio(3) = "Mer" nomegio(4) = "Gio" nomegio(5) = "Ven" nomegio(6) = "Sab" nomegio(7) = "Dom" mesesig(1) = "Gen" mesesig(2) = "Feb" mesesig(3) = "Mar" mesesig(4) = "Apr" mesesig(5) = "Mag" mesesig(6) = "Giu" mesesig(7) = "Lug" mesesig(8) = "Ago" mesesig(9) = "Set" mesesig(10) = "Ott" mesesig(11) = "Nov" mesesig(12) = "Dic" ' Restituisce i limiti di un periodo se fine = True restituisce l'ultimo giorno del periodo Function Per2Date(Periodo, Fine) Dim g, m, a a = Cint(Left(Periodo,2)) m = CInt(Right(Periodo,2)) If a < 50 then a = a + 2000 Else a = a + 1900 End If If Fine Then if m = 12 Then Per2Date = DateSerial (a + 1, 1, 1) ' CDate("1/1/" & Cstr(a+1)) else Per2Date = DateSerial (a, m + 1, 1) ' CDate(Cstr(m+1) & "/1/" & Cstr(a)) end if Per2Date = Per2Date - 1 Else Per2Date = DateSerial (a, m, 1) ' CDate(Cstr(m) & "/1/" & Cstr(a)) End if End Function ' Converte mese e anno in riferimento Function MAtoR(Anno, Mese) Dim mst, ast mst = Trim(CStr(Mese)) If Len(mst)=1 Then mst = "0" & mst End If ast = Trim(CStr(Anno)) If Len(ast)=1 Then ast = "0" & ast End if If Len(ast)>2 Then ast = Right(Ast,2) End if MAtoR = ast & mst End Function ‘Restituisce il mese da un riferimento Function RtoM(Rife) RtoM = CInt(Right(Rife,2)) End Function ‘Restituisce il mese da un riferimento Function RtoA(Rife) Dim anm anm = CInt(Left(Rife,2)) If anm < 50 Then anm = 2000 + anm Else anm = 1900 + anm End If RtoA = anm End Function 'Aggiunge un mese al riferimento Function AddMese(Rife) Dim mnm, anm mnm = RtoM(Rife) anm = RtoA(Rife) mnm = mnm + 1 If mnm > 12 Then mnm = 1 anm = anm + 1 End If AddMese = MAtoR(anm, mnm) End Function ‘Sottrae un mese al riferimento Function SubMese(Rife) Dim mnm, anm mnm = RtoM(Rife) anm = RtoA(Rife) mnm = mnm – 1 If mnm < 1 Then mnm = 12 anm = anm - 1 End If SubMese = MAtoR(anm, mnm) End Function 'Restituisce il nome del giorno Function Giorno(G, M, A) Giorno = NomeGio(WeekDay( DateSerial(A, M, G) , 2)) End Function 'Restituisce il nome del giorno Function GiorSig(D) GiorSig = NomeGio(WeekDay(D, 2)) End Function Dim R If Request.QueryString("PER") <> “” Then R = Request.QueryString(“PER”) If CInt(Right(R, 2)) > 12 or CInt(Right(R, 2)) < 1 Then R = MAtoR(Year(Date), Month(Date)) Response.Write "Errore di periodo
” End if Else R = MAtoR(Year(Date), Month(Date)) End If Dim OldCat Dim vdi, vdf vdi = Per2Date(R, False) vdf = Per2Date(R, True) TargetLink = “” fEmptyRecordset = False fFirstPass = True fNeedRecordset = False If IsEmpty(Session(“rs_appunta”)) Then fNeedRecordset = True Else If Session(“rs_appunta”) Is Nothing Then fNeedRecordset = True Else Set rs_appuSQL = Session(“rs_appunta”) End If End If If fNeedRecordset Then Set AppuEven = Server.CreateObject(“ADODB.Connection”) AppuEven.ConnectionTimeout = Session(“AppData_ConnectionTimeout”) AppuEven.CommandTimeout = Session(“AppData_CommandTimeout”) AppuEven.Open Session(“AppData_ConnectionString”), Session(“AppData_RuntimeUserName”), Session(“AppData_RuntimePassword”) Set cmdTemp = Server.CreateObject(“ADODB.Command”) Set rs_appuSQL = Server.CreateObject(“ADODB.Recordset”) cmdTemp.CommandText = “SELECT DISTINCTROW Titolo.Codice, Titolo.DtIni, Titolo.DtEnd, Titolo.Orario, Titolo.OraRif, Titolo.Grass1, Titolo.Corsi1, Titolo.Sopra1, ” cmdTemp.CommandText = cmdTemp.CommandText + “Titolo.Grass2, Titolo.Corsi2, Titolo.Sopra2, Titolo.Titolo, Titolo.SottoT, Titolo.RicURL, Titolo.CodURL, ” cmdTemp.CommandText = cmdTemp.CommandText + “Descr.Ordine, Descr.Ora, Descr.Grass, Descr.Attivita, Titolo.Utente, Titolo.Agg ” cmdTemp.CommandText = cmdTemp.CommandText + “FROM Descr RIGHT JOIN Titolo ON Descr.Codice = Titolo.Codice ” cmdTemp.CommandText = cmdTemp.CommandText + “ORDER BY Titolo.DtIni, Titolo.OraRif, Descr.Codice, Descr.Ordine” cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = AppuEven rs_appuSQL.CacheSize = 100 rs_appuSQL.Open cmdTemp, , 1, 3 End If On Error Resume Next If rs_appuSQL.BOF And rs_appuSQL.EOF Then fEmptyRecordset = True On Error Goto 0 If Err Then fEmptyRecordset = True If fNeedRecordset Then Set Session(“rs_appunta”) = rs_appuSQL End If rifini = False rifend = False %>
<% if Per2Date(SubMese(R),False) => Per2Date(vpmin, False) Then rifini = True End if if Per2Date(AddMese(R),True) <= Per2Date(vpmax, True) Then rifend = True End if %>
TREVI – Appuntamenti <% = nomemese(RtoM(R)) & chr(32) & RtoA(R)%>
<% = nomemese(RtoM(R))%>
<%else%> <%end if%> <% End If %> <% = nomemese(RtoM(SubMese(R)))%>
<% = RtoA(SubMese(R))%> <% If rifini Then %> <% End If %>
<% If Not fEmptyRecordset Then rs_appuSQL.MoveFirst End If OldCat = "" dim spec(10,3) NoAppunta = True Do If fEmptyRecordset Then Exit Do If rs_appuSQL.EOF Then Exit Do Visu = False If rs_appuSQL("DtIni") >= vdi and rs_appuSQL(“DtIni”)<= vdf Then Visu = true If rs_appuSQL("DtEnd") >= vdi and rs_appuSQL(“DtEnd”)<= vdf Then Visu = true If vdi => rs_appuSQL(“DtIni”) and vdi <= rs_appuSQL("DtEnd") Then Visu = true If vdf => rs_appuSQL(“DtIni”) and vdf <= rs_appuSQL("DtEnd") Then Visu = true If Visu Then cod = "" fdinid = "" fdinim = "" fdiniy = "" fdfind = "" fdfinm = "" fdfiny = "" forar = "" fso1t = "" fso1g = false fso1i = false fso2t = "" fso2g = false fso2i = false ftito = "" fsott = "" fdesl = "" flink = "" fnrig = 0 NoAppunta = False cod = rs_appuSQL("Codice") If not isnull(rs_appuSQL("DtIni")) then fdinid = day(rs_appuSQL("DtIni")) fdinim = month(rs_appuSQL("DtIni")) fdiniy = year(rs_appuSQL("DtIni")) End if If not isnull(rs_appuSQL("DtEnd")) then fdfind = day(rs_appuSQL("DtEnd")) fdfinm = month(rs_appuSQL("DtEnd")) fdfiny = year(rs_appuSQL("DtEnd")) End if If not isnull(rs_appuSQL("Orario")) then forar = rs_appuSQL("Orario") End if If not isnull(rs_appuSQL("Sopra1")) then fso1t = rs_appuSQL("Sopra1") End if If not isnull(rs_appuSQL("Grass1")) then fso1g = rs_appuSQL("Grass1") End if If not isnull(rs_appuSQL("Corsi1")) then fso1i = rs_appuSQL("Corsi1") End if If not isnull(rs_appuSQL("Sopra2")) then fso2t = rs_appuSQL("Sopra2") End if If not isnull(rs_appuSQL("Grass2")) then fso2g = rs_appuSQL("Grass2") End if If not isnull(rs_appuSQL("Corsi2")) then fso2i = rs_appuSQL("Corsi2") End if If not isnull(rs_appuSQL("Titolo")) then ftito = rs_appuSQL("Titolo") End if If not isnull(rs_appuSQL("SottoT")) then fsott = rs_appuSQL("SottoT") End if If not isnull(rs_appuSQL("RicUrl")) then fdesl = rs_appuSQL("RicUrl") End if If not isnull(rs_appuSQL("CodUrl")) then flink = rs_appuSQL("CodUrl") End if Do while rs_appuSQL("Codice") = cod If not isnull(rs_appuSQL("Attivita")) then fnrig = fnrig + 1 spec(fnrig, 2) = rs_appuSQL("Attivita") If not isnull(rs_appuSQL("Ora")) then spec(fnrig,1) = rs_appuSQL("Ora") End if spec(fnrig,3) = False If isnull(rs_appuSQL("Grass")) then spec(fnrig,3) = False Else If (rs_appuSQL("Grass")) then spec(fnrig,3) = True Else spec(fnrig,3) = False End if End if End if rs_appuSQL.MoveNext If rs_appuSQL.EOF Then Exit Do Loop %>
Non ci sono ancora appuntamenti segnalati <% End If %>