Quick Search:
Oracle PL/SQL Code Library
Find Or Post Oracle Jobs
Oracle Discussion & Chat
 PHP Code: Calendar for any month any year Jump to:  
Category: >> PHP Code >> Calendar for any month any year Bookmark and Share

<< lastnext >>

Snippet Name: Calendar for any month any year

Description: Simple, nice looking calendar displays any month and year.

Also see:
» Convert UK Dates To mySQL Format Dates
» Delete files older than 'X'
» String to Date
» Month, Day, Year dropdown boxes
» Calculate date of Easter Sunday
» Define a schedule of holidays
» Add and Subtract dates
» Basic PHP Calendar
» Convert 12 to 24 hour time and vice ve...
» What Season Is It?
» Delete by date
» Days in month #2
» Days in month #1
» Count days between dates
» Find days between dates #1
» Build Date Select Boxes

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

    # ***  Set time stamp.Check for month requested(value from request form) 
    # ***  If no value has been set then make it for current month 
   IF(!$year){$year=2000; } 
     IF(!$req_month || $req_month=="none") 
   # *** Find out the month number from the time stamp we just created   
    # *** Find out the day of the week from the same(0 to 6 for Sunday to   
    # *** Saturday) add "1" so that it becomes 1 to 7  
    # *** Set number days in requested month   
IF($month==1 || $month==3 || $month==5 || $month==7 || $month==8 || $month==10 || 
ELSEIF($month==4 || $month==6 || $month==9 || $month==11) 
 # *** If the month requested is Feb. Check whether it is Leap Year      
                   { $no_of_days=29 ;} 
# ************ HTML code goes from here  
# ************ First row in HTML table displays month and year   
# ************ Second row is allotted for week days 
# ************ Table contains six more rows (total 42 table cells)   
<table width=300> 
<tr bgcolor="#003366"><td colspan=7> 
<font face="Arial , Times New Roman " size=2 color="#ffffff"><b><?PHP ECHO "$month_full   
$year" ; ?></b></font></td></tr> 
<tr bgcolor="#006699"> 
<td><font face="Arial , Times New Roman " size=2 color="#ffffff">Sun</fon></td><td><font 
face="Arial , Times New Roman " size=2 color="#ffffff">Mon</font></td><td><font 
face="Arial , Times New Roman " size=2 color="#ffffff">Tue</font></td><td><font 
face="Arial , Times New Roman " size=2 color="#ffffff">Wed</font></td><td><font 
face="Arial , Times New Roman " size=2 color="#ffffff">Thu</font></td><td><font 
face="Arial , Times New Roman " size=2 color="#ffffff">Fri</font></td><td><font face="Arial , 
Times New Roman " size=2 color="#ffffff">Sat</font></td> 
<tr bgcolor="silver"> 
# *** We need to start form week day and print total number of days  
# *** in this month.For that we need to find out the last cell.  
# *** While looping end current row and start new row for each 7 cells 
   IF($i<$week_day || $i>=$last_cell) 
     ECHO "<td>?</td>"; 
      IF($i%7==0){ECHO "</tr><tr bgcolor=\"silver\">\n";}    
        ECHO "<td>$day</td>"; 
       IF($i%7==0) { ECHO "</tr><tr bgcolor=\"silver\">\n"; } 

Oracle Magazine
and Oracle White Papers

SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 29 users online    © 2009 psoug.org

Forgot your password?