note 43709 deleted from ref.calendar by betz

From: Date: Sun, 31 Oct 2004 18:18:04 +0000
Subject: note 43709 deleted from ref.calendar by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79413@lists.php.net to get a copy of this message
Note Submitter: dindinha_debs at hotmail dot com ---- I see the calendar, and think that is beatifull , but isn't enougth. I change a litle and the new version is above: <html> <body> <center><table border="1"> <tr> <td></td> </tr> <tr> <?php For($m=-1;$m<2;$m++){ print "<td>"; $lastmonth = mktime (0, 0, 0, date("m")+$m, date("d"), date("Y")); $s=0; // Get the calender info $t_days = cal_days_in_month(CAL_GREGORIAN, (date("m",$lastmonth) ), date("Y",$lastmonth) ); $day = date("w", mktime(0, 0, 0, date("m",$lastmonth ), 1, date("Y",$lastmonth ))); ?> <table border = "0"> <tr><th bgcolor = "yellow" colspan = "7"><?php echo (date("F Y",$lastmonth )); ?></th></tr> <tr><th>Sun</th><th>Mon</th><th>Tue</th> <th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr> <?php for ($i = 0; $i <= $t_days; $i++) { if ($day > 6) {$s++; echo "</tr>\n<tr>\n"; $day = 0; } //------------------------------------------------// if ($i == date("j")&& $m == 0) {?> <td align = "center"><b><?php echo $i; $day++; echo "</b></td>\n"; } else if ($i > 0) {?> <td align = "center"><?php echo $i; $day++; echo "</td>\n"; } else if ($day > 0) {?> <tr><td colspan = "<?php echo $day; ?>"><?php echo "</td>\n"; } //-----------------------------------------------// if ($i == $t_days && $day < 6) {?> <td colspan = "<?php echo 7 - $day; ?>"><?php echo "</td>\n</tr>\n"; } } if ($s==4){print "<tr>\n<td>&nbsp</td></tr>"; } ?> </table></td> <?php }?> </tr></table> </center> </body> </html>

« previous php.notes (#79413) next »