Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
xfile.MyForum.ro Forum Index » PHP Tutorials

Post new topic   Reply to topic
Script calendat simplu
View previous topic :: View next topic  
Author Message
xfile
Administrator
Administrator


Joined: 20 Jun 2010
Posts: 116

PostPosted: 23/06/2010 21:47    Post subject: Script calendat modest Reply with quote

Code:
<?
if(isset($prm) and $prm > 0){
$m=$prm+$chm;}else{
$m= date("m");}

$d= date("d");     // Finds today's date
$y= date("Y");     // Finds today's year

$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month

$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar

$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar

$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}

/// Starting of top line showing name of the days of the week

echo " <table border='1' bordercolor='#FFFF00' cellspacing='0' cellpadding='0' align=center>

<tr><td>";

echo "<table cellspacing='0' cellpadding='0' align=center width='100' border='1'><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=-1'><</a> </td><td colspan=5 align=center bgcolor='#ffff00'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=1'>></a> </td></tr><tr>";

echo "<td><font size='3' face='Tahoma'><b>Sun</b></font></td><td><font size='3' face='Tahoma'><b>Mon</b></font></td><td><font size='3' face='Tahoma'><b>Tue</b></font></td><td><font size='3' face='Tahoma'><b>Wed</b></font></td><td><font size='3' face='Tahoma'><b>Thu</b></font></td><td><font size='3' face='Tahoma'><b>Fri</b></font></td><td><font size='3' face='Tahoma'><b>Sat</b></font></td></tr><tr>";

////// End of the top line showing name of the days of the week//////////

//////// Starting of the days//////////
for($i=1;$i<=$no_of_days;$i++){
echo $adj."<td valign=top><font size='2' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell
echo " </font></td>";
$adj='';
$j ++;
if($j==7){echo "</tr><tr>";
$j=0;}

}

echo "<tr><td colspan=7 align=center><font face='Verdana' size='2'><a href='http://www.plus2net.com'><b>plus2net.com Calendar</b></a></font></td></tr>";
echo "</tr></table></td></tr></table>";
echo "<center><font face='Verdana' size='2'><a href=php_calendar.php>Reset PHP Calendar</a></center></font>";

?>
Back to top
View user's profile Send private message
tabernaculum
Junior
Junior


Joined: 24 May 2012
Posts: 15
Location: Ukraine

PostPosted: 24/05/2012 22:16    Post subject: Reply with quote

You are so great
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    xfile.MyForum.ro Forum Index » PHP Tutorials All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional

Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro