Bilgisayar Bölümü ASP Kod ve Script Arşivi


ASP Calendar

<html>
<head>
<title>Calendar</title>
</head>
<body Text=blue link=green vlink=green alink=red>
<center>
<font size=3><b>
<%
If Request.QueryString="" Then
imonth=Month(Date)
iyear=Year(Date)
%>
<form action=calendar.asp method=Get name=myform>
Month: <Select name=month>
<%
For i=1 To 12
If i=Month(Date) Then
Response.Write "<Option value="& i &" selected>"& MonthName(i) &VBCrLf
Else
Response.Write "<Option value="& i &">"& MonthName(i) &VBCrLf
End If
Next
%>
</Select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Year: <Select name=year>
<%
For i=2000 To 2005
If i=Year(Date) Then
Response.Write "<Option value="& i &" selected>"& i &VBCrLf
Else
Response.Write "<Option value="& i &">"& i &VBCrLf
End If
Next
%>
</Select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<Input Type=submit value="Get the month"
</form>
<br>
<font color=red size=3><%=WeekDayName(WeekDay(Date))&" "&Day(Date)&" "&MonthName(Month(Date))&" "&Year(Date)%></font>
<%
Sub navmonth()
If imonth>1 Then
Response.Write "<font size=2>"
Response.Write "<br><a href=calendar.asp?month="&imonth-1&"&year="&iyear&"><font face=webdings>3</font> "&MonthName(imonth-1)&" "&iyear&"</a>"
Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.Write "</font>"
End If
If imonth<12 Then
Response.Write "<font size=2>"
Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.Write "<a href=calendar.asp?month="&imonth+1&"&year="&iyear&">"&MonthName(imonth+1)&" "&iyear&" <font face=webdings>4</font></a><br>"
Response.Write "</font>"
End If
End Sub
navmonth()
getcurrmonth()
Else
imonth=Request.QueryString("month")
iyear=Request.QueryString("year")
%>
<form action=calendar.asp method=Get name=myform>
Month: <Select name=month>
<%
For i=1 To 12
If i=CInt(imonth) Then
Response.Write "<Option value="& i &" selected>"& MonthName(i) &VBCrLf
Else
Response.Write "<Option value="& i &">"& MonthName(i) &VBCrLf
End If
Next
%>
</Select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Year: <Select name=year>
<%
For i=2000 To 2005
If i=CInt(iyear) Then
Response.Write "<Option value="& i &" selected>"& i &VBCrLf
Else
Response.Write "<Option value="& i &">"& i &VBCrLf
End If
Next
%>
</Select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<Input Type=submit value="Get the month"
</form>
<br>
<font size=3 color=red>Today Is: <a href=calendar.asp><%=Day(Date)&" "&MonthName(Month(Date))&" "&Year(Date)%></a>
</font>
<%
navmonth()
getcurrmonth()
End If
Sub getcurrmonth()
Response.Write "<br>"&MonthName(imonth)
Response.Write " "
Response.Write iyear
Response.Write "<br>"
Response.Write "<table cellpadding=3 border=1 bordercolor=green><tr bgcolor=pink>"
Response.Write "<td><b><font size='-1'>Sun</font></td><td><b><font size='-1'>Mon</td><td><b><font size='-1'>Tue</td><td><b><font size='-1'>Wed</td><td><b><font size='-1'>Thu</td><td><b><font size='-1'>Fri</td><td><b><font size='-1'>Sat</td></tr>"
Response.Write "<tr>"
thisdate=DateSerial(iyear, imonth, 1)
nextday=1
For cday=1 To 7
If WeekDay(thisdate)>cday Then
Response.Write "<td bgcolor=#eeeeee></td>"
Else
If cday=1 Then
Response.Write "<td align=center bgcolor=#eeeeee><b><font color=red><a title='"&FormatDateTime(thisdate,1)&"'>"&nextday&"</font></a></b></td>"
nextday=nextday+1
thisdate=DateSerial(iyear, imonth, nextday)
ElseIf iyear=Year(Now) And imonth=Month(Now) And nextday=Day(Now) Then
Response.Write "<td align=center bgcolor=blue><b><a title='"&FormatDateTime(thisdate,1)&"'><font color=#eeeeee>" & nextday & "</font></a></td>"
nextday=nextday+1
thisdate=DateSerial(iyear, imonth, nextday)
Else
Response.Write "<td align=center bgcolor=#eeeeee><b><a title='"&FormatDateTime(thisdate,1)&"'>" & nextday & "</a></td>"
nextday=nextday+1
thisdate=DateSerial(iyear, imonth, nextday)
End If
End If
Next
Response.Write "</tr><tr>"
weekdays=1
While Month(thisdate)=CInt(imonth)
If weekdays=1 Then
Response.Write "<td align=center bgcolor=#eeeeee><b><font color=red><a title='"&FormatDateTime(thisdate,1)&"'>" & nextday & "</a></font></b></td>"
nextday=nextday+1
weekdays=weekdays+1
ElseIf iyear=Year(Now) And imonth=Month(Now) And nextday=Day(Now) Then
Response.Write "<td align=center bgcolor=blue><b><a title='"&FormatDateTime(thisdate,1)&"'><font color=#eeeeee>" & nextday & "</font></a><b></td>"
nextday=nextday+1
weekdays=weekdays+1
Else
Response.Write "<td align=center bgcolor=#eeeeee><b><a title='"&FormatDateTime(thisdate,1)&"'>" & nextday & "</td>"
nextday=nextday+1
weekdays=weekdays+1
End If
If weekdays>7 Then
weekdays=1
Response.Write "<tr>"
End If
thisdate=DateSerial(CInt(iyear), CInt(imonth), nextday)
Wend
End Sub
%>
</table>
</center>
</body>
</html>

ASP Kitabı

 

Faydalılar: Altın Fiyatları |Hediye Kolye | pırlanta fiyatları
Ana Sayfa  Sık Kullanılanlara Ekle   admin[at]bilgisayarbolumu.com | © 2006 - 2020 Bilgisayarbolumu.com