can anyone help me.... the calendar was not placed well...tnx a lot...
[ $current_month=date("F");
echo " <BR><CENTER><B><font size=12 color=yellow>Calendar for $this_year</font></b></center><BR>\n" ;
//function
for($count_month1=1; $count_month1<=3;$count_month1++){
//$this_month1=(date("n")==count_month1);
switch($count_month1){
case 1: $the_month="January";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"227\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 1;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 2: $the_month="February";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"227\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 2;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 3: $the_month="March";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"227\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 3;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
//break;
if($count_month1==3){
$the_month1 = 1;
$the_month2 = 2;
$the_month3 = 3;
show_month($the_month1);
show_month($the_month2);
show_month($the_month3);
echo "<BR><BR><BR><BR>";}
}
}
for($count_month2=4;$count_month2<=6;$count_month2++){
switch($count_month2){
case 4: $the_month="April";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 4;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 5: $the_month="May";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 5;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 6: $the_month="June";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 6;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
if($count_month2==6){
echo "<BR><BR>";
$the_month4 = 4;
$the_month5 = 5;
$the_month6 = 6;
show_month($the_month4);
show_month($the_month5);
show_month($the_month6);}
}
}
for($count_month3=7;$count_month3<=9;$count_month3++){
switch($count_month3){
case 7: $the_month="July";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 7;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 8: $the_month="August";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 8;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 9: $the_month="September";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month9= 9;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
//break;
if($count_month3==9){
echo "<BR><BR>";
$the_month7 = 7;
$the_month8 = 8;
$the_month9 = 9;
show_month($the_month7);
show_month($the_month8);
show_month($the_month9);
}
}
}
for($count_month4=10;$count_month4<=12;$count_month4++){
switch($count_month4){
case 10: $the_month="October";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 10;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 11: $the_month="November";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 11;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
break;
case 12: $the_month="December";
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">"
. "<tr bgcolor=\"#3BB9FF\">\n"
. "<center><th width=\"14%\"><font color=\"#F62217\">$the_month</font></th>"
. "</tr></table>\t\n";
$the_month = 12;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $current_year));
//break;
if($count_month4==12){
echo "<BR><BR>";
$the_month10 = 10;
$the_month11 = 11;
$the_month12 = 12;
show_month($the_month10);
show_month($the_month11);
show_month($the_month12);}
}
}
function next_line(){
echo "<BR><BR>";
show_month();
show_month();
show_month();
//show_month();
}
function next_line2(){
echo "<BR><BR><BR><BR><BR><BR><BR><BR>";
show_month();
show_month();
show_month();
show_month();
}
/This function display the months/
function show_month($the_month){
echo "<TABLE align=\"left\" border=\"3\" bordercolor=\"#000000\" cellpadding=\"2\" cellspacing=\"0\">\n"
. "<TR bgcolor=\"#DDDDDD\">\n"
. "<TH width=\"15\"> <font color=\"red\">Sun</font></th>\n"
. "<TH width=\"15\">Mon</th>\n"
. "<TH width=\"15\">Tue</th>\n"
. "<TH width=\"15\">Wed</th>\n"
. "<TH width=\"15\">Thu</th>\n"
. "<TH width=\"15\">Fri</th>\n"
. "<TH width=\"15\"> <font color=\"blue\">Sat</font></th>\n"
. "</tr>\n";
$this_year=date("Y");
//$the_month=8;
$this_month = date("n", mktime(0, 0, 0, $the_month, 1, $this_year));
/* Grab the first day of the month, and total days */
$first_day = date("w", mktime(0, 0, 0, $the_month, 1, $this_year));
$total_days = date("t", mktime(0, 0, 0, $the_month, 1, $this_year));
/* Start on the day of the first week */
$week_num = 1;
$day_num = 1;
/* While the day of the week isn't '7' */
while ($week_num <= 6)
{
echo "<TR>\n";
/* Loop through the week days */
for ( $i = 0; $i <= 6; $i++ )
{
/* If it's the first week then... */
if ($week_num == 1)
{
/* If it's not the first day yet, then use a space */
if ($i < $first_day)
$the_day = " ";
/* If it is the first day, then start with a '1' */
else if ($i == $first_day)
{
$the_day = 1;
}
}
else
{
/* If we're past the total days, then use spaces */
if ($the_day > $total_days)
$the_day = " ";
}
/* Display the day (or space) */
valign=\"top\"><b>$the_day</b></td>\n";
if($i==0){
echo "<TD height=\"0\" width=\"27\" valign=\"top\"><font color=\"red\">$the_day</font></td>\n";
}
elseif($i==6){
echo "<TD height=\"0\" width=\"27\" valign=\"top\"><font color=\"blue\">$the_day</font></td>\n";
}
else{
echo "<TD height=\"0\" width=\"27\" valign=\"top\"><font color=\"white\">$the_day</font></td>\n";
}
/* Incrememnt the day of the month */
if ($the_day != " ")
$the_day++;
}
/* Increment the week number */
$week_num++;
}
}
//end of function show_month()
?>
</body>
</html>[/QUOTE]