dbWriter Home
IP to Country Look up
Site Map

IP to Country DB

Free Databases:

ASP Code

ASP Links

VB Script functions:
Array
Case/Select
In String (inStr)
Replace

HTML code:
SELECT Color
SELECT Countries
SELECT Language
SELECT State/Province

SQL:

SQL Functions:
Delete leading Char
Get Browser
Long number from IP

Stored Procedures:

SQL Tricks:
Delete ALL duplicates
Delete dup records

MISC
IP Address Owner
MS SQL Server

Mortgage Calcs:
how much is my payment
Loan Amortization
Loan Calculator
Mortgage Calculator
Motrgage Pay Off

dbWriter License

Link to US

Links

Contact US
 

dbWriter ASP calendar code

      A calendar that returns the last day of the month and  takes into account leap years!!
 

 

<< September 2008 >>
S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30     
   Current Month

You have selected -- 9/8/2008

 

<%
Dim iMonth 'Month of calendar
Dim iYear 'Year of calendar
Dim FirstDay 'First day of the month. 0 = Sunday
Dim CurrentDay 'Used to print dates in calendar
Dim Col 'Calendar column
Dim Row 'Calendar row

iMonth = cint(Request.Querystring("Month"))
iYear = cint(Request.Querystring("Year"))

If iMonth = 0 then iMonth = Month(Date)
if iYear = 0 then iYear = Year(Date)

Call ShowHeader (iMonth, iYear)

FirstDay = WeekDay(DateSerial(iYear, iMonth, 1)) -1
CurrentDay = 1

DIM sWeekDay, iRows
sWeekDay = WeekDay(DateSerial(iYear, iMonth, 1))

IF sWeekDay <= 5 and LastDay(iMonth, iYear) >= 30 THEN
iRows = 4
ELSEIF sWeekDay =1 and iMonth = 2 THEN
iRows = 3
ELSEIF iMonth = 2 THEN
iRows = 4
ELSE
iRows = 5
END IF

For Row = 0 to iRows
For Col = 0 to 6
If Row = 0 and Col < FirstDay then
response.write "<td bgcolor='FFFFFF'>&nbsp;</td>"
elseif CurrentDay > LastDay(iMonth, iYear) then
response.write "<td bgcolor='FFFFFF'>&nbsp;</td>"
else
response.write "<td"

if iMonth = Month(Date) and CurrentDay = Day(Date) and iYear = Year(Date)then
response.write " bgcolor='#CCCCCC' align='center'>"
else
response.write " align='center' bgcolor='FFFFFF'>"
end if
%>
<a href="ASP_calendar.asp?view=archive&day=<%=CurrentDay%>&month=<%=iMonth%>&year=<%=iYear%>"><%=CurrentDay%></a></td>

<%
'response.write CurrentDay & "</td>"
CurrentDay = CurrentDay + 1
End If

Next
response.write "</tr>"
Next

response.write "</table>"


'------ Sub and functions


Sub ShowHeader(iMonth,iYear)
%>
<div align="center">
<table border='0' cellspacing='1' cellpadding='2' width='200' bgcolor="#000080" >
<tr align='center'>
<td colspan='7' bgcolor="FFFFFF">
<table border='0' cellspacing='0' cellpadding='2' width='100%' bgcolor="FFFFFF" >
<tr>
<td align='left' >


<%
'********************** Prev Month

response.write "<a title='Prev Month' href = 'ASP_calendar.asp?view="&Request.QueryString("view")&"&day="&Request.QueryString("day")&"&"
if iMonth - 1 = 0 then
response.write "month=12&year=" & iYear -1
else
response.write "month=" & iMonth - 1 & "&year=" & iYear
end if
response.write "' ><<</a>"
%>

</td><td align='center' bgcolor="FFFFFF" >

<a title="Select month- <%=MonthName(iMonth)%>" href="ASP_calendar.asp?view=theMonth&month=<%=iMonth%>&year=<%=iYear%>"><%=MonthName(iMonth) &"&nbsp;"& iYear%></a>


</td><td align='right' >

<%
'********************** Next Month

response.write "<a title='Next Month' href = 'ASP_calendar.asp?view="&Request.QueryString("view")&"&day="&Request.QueryString("day")&"&"
if iMonth + 1 = 13 then
response.write "month=1&year=" & iYear + 1
else
response.write "month=" & iMonth + 1 & "&year=" & iYear
end if
response.write "' >>></a>"
%>

</td></tr></table>
</td>
</tr>
<tr align='center' >
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>S</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>M</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>T</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>W</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>T</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>F</i></b></font></td>
<td bgcolor="#C0C0C0"><font color="#FF0000"><b><i>S</i></b></font></td>
</tr>
<%
End Sub

Function LastDay(iMonth, iYear)
' Returns the last day of the month. Takes into account leap years

Select Case iMonth
Case 1, 3, 5, 7, 8, 10, 12
LastDay = 31

Case 4, 6, 9, 11
LastDay = 30

Case 2
If IsDate(iYear & "-" & iMonth & "-" & "29") Then LastDay = 29 Else LastDay = 28

Case Else
LastDay = 0

End Select
End Function
%>
</div>
<table border='0' cellspacing='1' cellpadding='1' width='100%' >
<tr><td align='center' >
&nbsp;&nbsp;&nbsp;<a href="ASP_calendar.asp?view=archiveMonth&month=<%=month(now)%>&year=<%=year(now)%>">Current Month</a>
</td>
</tr>
</table>
 

Partners/Links © 2005 - 2008 dbWriter.com All Rights Reserved
This site is protected by the dbWriter IPtoCountry MS/SQL database!!
Site map | Link to US
Contact Us

Sign up for PayPal and start accepting credit card payments instantly.