Hoofdmenu
•
Home
•
ASP Tips
•
Artikelen
•
ASP Lessen
•
Scripts
•
Opleidingen
•
Resources
•
Madness Forum
•
Nieuws
•
Adverteren?
Members
Inloggen
Registreer je nu!
Wachtwoord vergeten?
Laatste reacties
26-11
ASP en formulieren
09-06
ASP en databases
14-03
SQL de basis
28-02
Formulier > E-mail
07-08
Nieuwe versie Madne...
Madness.nl Forum
21:41
Te mooi om waar te ..
08:47
application
08:46
Domein Hosting
08:45
USB webserver
08:45
Eigen Scripts
08:44
Database paging
10:21
Even voorstellen?
10:18
Re: It agree, it is..
10:16
ASp.NET MVC
20:42
GPS-applicatie VB v..
Kalender script
Terug naar scripts
Auteur:
FangorN
Geplaatst op: 8-4-2004 11:58:54
Laatste update: 8-4-2004 12:00:41
Aantal keer bekeken: 28313
Download script (zip file)
Kalender script
Omschrijving:
Met dit script wordt er een kalender getoont van de huidige maand of of een geselecteerde maand/jaar.
Script:
Pagina:
calender.asp
<% @LANGUAGE=VBScript %> <% Option Explicit Response.Expires = 0 SetLocale("nl-nl") %> <HTML> <HEAD> <TITLE>ASP kalender</TITLE> <STYLE TYPE="text/css"> <!-- today {FONT-WEIGHT: bold; BACKGROUND-COLOR: #cccccc;} TABLE {BORDER-RIGHT: 1px solid #000000; BORDER-BOTTOM: 1px solid #000000;} SELECT, INPUT, .def {FONT-FAMILY: Arial; FONT-SIZE: 9pt;} TD {BORDER-LEFT: 1px solid #000000; BORDER-TOP: 1px solid #000000; FONT-FAMILY: Arial; FONT-SIZE: 9pt;} grey {FONT-WEIGHT: bold; BACKGROUND-COLOR: #e0e0e0;} --> </STYLE> </HEAD> <BODY CLASS="def"> <% Dim intMaand, intJaar, intAantalWeken, strEDag, strLDag, intDagenInMaand,strToday Dim aDagNamen Dim t1, t2, tdag, tweek Function addLeadingZero(value) 'pre: value is an integer value 'return: the value, converted to a string, with a leading zero if ' the original value is smaller than 10 If value < 10 Then value = "0" & CStr(value) Else value = CStr(value) End If addLeadingZero = value End Function aDagNamen = Array("Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo") strToday = Date() If Request.ServerVariables("REQUEST_METHOD") = "POST" Then If Request.Form("action") = "submit" Then 'bovenste formulier intMaand = CInt(Request.Form("month")) intJaar = CInt(Request.Form("year")) End If If Request.Form("action") = "previous" Then 'previous-knop; haal waarden op intMaand = CInt(Request.Form("m")) intJaar = CInt(Request.Form("y")) 'verlaag met 1 maand If intMaand > 1 Then intMaand = intMaand - 1 Else intMaand = 12 intJaar = intJaar - 1 End If End If If Request.Form("action") = "next" Then 'next-knop; haal waarden op intMaand = CInt(Request.Form("m")) intJaar = CInt(Request.Form("y")) 'verhoog met 1 maand If intMaand < 12 Then intMaand = intMaand + 1 Else intMaand = 1 intJaar = intJaar + 1 End If End If Else 'niets ingevuld, pak datum van vandaag intMaand = DatePart("m", strToday) intJaar = DatePart("yyyy", strToday) End If 'Bepaal eerste dag van de huidige maand strEDag = CDate("1-" & intMaand & "-" &intJaar) 'Bepaal het aantal dagen in deze maand intDagenInMaand = DateDiff("d", strEDag, DateAdd("m", 1, strEDag)) 'Bepaal de laatste dag van deze maand strLDag = CDate(intDagenInMaand & "-" & intMaand & "-" & intJaar) 'Bepaal het aantal jaarweken waarin deze maand zit intAantalWeken = DatePart("ww", strLDag, vbMonday) - DatePart("ww",strEDag, vbMonday) + 1 Response.Write "Eerste dag van de maand: " & FormatDateTime(strEDag,vbLongDate) & "<BR>" & vbLf Response.Write "Laatste dag van de maand: " & FormatDateTime(strLDag,vbLongDate) & "<BR>" & vbLf %> <FORM ACTION="<%= Request.ServerVariables("SCRIPT_NAME") %>" METHOD="post"> <SELECT NAME="month"> <% For t1=1 To 12 Response.Write "<OPTION VALUE=""" & t1 & """" If t1 = intMaand Then Response.Write " SELECTED" End If Response.Write ">" & MonthName(t1) & "</OPTION>" & VBLf Next %> </SELECT> <SELECT NAME="year"> <% For t1=1995 To 2015 Response.Write "<OPTION VALUE=""" & t1 & """" If t1 = intJaar Then Response.Write " SELECTED" End If Response.Write ">" & t1 & "</OPTION>" & VBLf Next %> </SELECT> <INPUT TYPE="submit" NAME="action" VALUE="submit"> </FORM> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2"> <TR><TD COLSPAN="<%= (intAantalWeken+1) %>" ALIGN="center"><B> <%=MonthName(intMaand) & " " & intJaar %></B></TD></TR> <% Response.Write "<TR>" & VBLf Response.Write "<TD> </TD>" 'extra veld voor dagen-kolom For t1 = 0 To intAantalWeken-1 tweek = DatePart("ww", strEDag, vbMonday) + t1 Response.Write "<TD CLASS=""grey"">" If tweek > 52 Then Response.Write " " Else Response.Write addLeadingZero(tweek) End If Response.Write "</TD>" & VBLf Next Response.Write "</TR>"& VBLf For t2 = 1 to 7 Response.Write "<TR>" & VBLf Response.Write "<TD CLASS=""grey"" ALIGN=""center"">" & aDagNamen(t2-1)& "</td>" & VBLf For t1 = 0 To intAantalWeken-1 tdag = t1*7+t2 - WeekDay(strEDag, vbMonday) + 1 Response.Write "<TD" If tdag >=1 And tdag <= intDagenInMaand Then If DateValue(tdag & "-" & intMaand & "-" & intJaar) = strToday Then Response.Write " CLASS=""today""" End If End If Response.Write ">" If tdag < 1 Or tdag > intDagenInMaand Then Response.Write " " Else Response.Write addLeadingZero(tdag) End If Response.Write "</TD>" & VBLf Next 't1 Response.Write "</TR>" & VBLf Next 't2 %> </TABLE> <FORM ACTION="<%= Request.ServerVariables("SCRIPT_NAME") %>" METHOD="post"> <INPUT TYPE="hidden" NAME="m" VALUE="<%= intMaand %>"> <INPUT TYPE="hidden" NAME="y" VALUE="<%= intJaar %>"> <INPUT TYPE="submit" NAME="action" VALUE="previous"> <INPUT TYPE="submit" NAME="action" VALUE="next"> </FORM> </BODY> </HTML>
Reacties
Reacties:
Kalender script
(Aantal reacties: 1 )
»
Nieuwe reactie
View Mode :
|
|
|
|
|
Door:
archeo
Feb 15, 12:47
Het wordt natuurlijk pas echt handig als je dan ook vanuit de kalender kan linken naar evenementen, er evenementen uit kan halen of in kan zetten, enz.
Is er ook zo'n script beschikbaar?
(Reply...)
Scripts
Overzicht
Script insturen
Zoeken
Zoekterm(en):
Copyright © 2002-2004 Ramon Siem A Joe