[ Index ] |
|
Code source de WebCalendar 1.0.5 |
1 <?php 2 /* $Id: datesel.php,v 1.31 2005/03/11 13:59:51 cknudsen Exp $ */ 3 include_once 'includes/init.php'; 4 5 // month and year are being overwritten so we will copy vars to fix. 6 // this will make datesel.php still work where ever it is called from. 7 // The values $fday, $fmonth and $fyear hold the form variable names 8 // to update when the user selects a date. (This is needed in 9 // the js/datesel.php file that gets included below.) 10 $fday = getGetValue ( "fday" ); 11 $fmonth = getGetValue ( "fmonth" ); 12 $fyear = getGetValue ( "fyear" ); 13 14 $INC = array('js/datesel.php'); 15 print_header($INC,'','',true); 16 17 if ( strlen ( $date ) > 0 ) { 18 $thisyear = substr ( $date, 0, 4 ); 19 $thismonth = substr ( $date, 4, 2 ); 20 } else { 21 $thismonth = date("m"); 22 $thisyear = date("Y"); 23 } 24 25 $next = mktime ( 3, 0, 0, $thismonth + 1, 1, $thisyear ); 26 $nextyear = date ( "Y", $next ); 27 $nextmonth = date ( "m", $next ); 28 $nextdate = date ( "Ym", $next ) . "01"; 29 30 $prev = mktime ( 3, 0, 0, $thismonth - 1, 1, $thisyear ); 31 $prevyear = date ( "Y", $prev ); 32 $prevmonth = date ( "m", $prev ); 33 $prevdate = date ( "Ym", $prev ) . "01"; 34 35 ?> 36 37 <div style="text-align:center;"> 38 <table align="center" class="minical"> 39 <tr> 40 <td><a title="<?php etranslate("Previous")?>" class="prev" href="datesel.php?form=<?php echo $form?>&fday=<?php echo $fday?>&fmonth=<?php echo $fmonth?>&fyear=<?php echo $fyear?>&date=<?php echo $prevdate?>"><img src="leftarrowsmall.gif" alt="<?php etranslate("Previous")?>" /></a></td> 41 <th colspan="5"><?php echo month_name ( $thismonth - 1 ) . " " . $thisyear;?></th> 42 <td><a title="<?php etranslate("Next")?>"class="next" href="datesel.php?form=<?php echo $form?>&fday=<?php echo $fday?>&fmonth=<?php echo $fmonth?>&fyear=<?php echo $fyear?>&date=<?php echo $nextdate?>"><img src="rightarrowsmall.gif" alt="<?php etranslate("Next")?>" /></a></td> 43 </tr> 44 <?php 45 echo "<tr class=\"day\">\n"; 46 if ( $WEEK_START == 0 ) echo "<td>" . 47 weekday_short_name ( 0 ) . "</td>\n"; 48 for ( $i = 1; $i < 7; $i++ ) { 49 echo "<td>" . 50 weekday_short_name ( $i ) . "</td>\n"; 51 } 52 if ( $WEEK_START == 1 ) echo "<td>" . 53 weekday_short_name ( 0 ) . "</td>\n"; 54 echo "</tr>\n"; 55 if ( $WEEK_START == "1" ) 56 $wkstart = get_monday_before ( $thisyear, $thismonth, 1 ); 57 else 58 $wkstart = get_sunday_before ( $thisyear, $thismonth, 1 ); 59 $monthstart = mktime ( 3, 0, 0, $thismonth, 1, $thisyear ); 60 $monthend = mktime ( 3, 0, 0, $thismonth + 1, 0, $thisyear ); 61 for ( $i = $wkstart; date ( "Ymd", $i ) <= date ( "Ymd", $monthend ); 62 $i += ( 24 * 3600 * 7 ) ) { 63 echo "<tr>\n"; 64 for ( $j = 0; $j < 7; $j++ ) { 65 $date = $i + ( $j * 24 * 3600 ); 66 if ( date ( "Ymd", $date ) >= date ( "Ymd", $monthstart ) && 67 date ( "Ymd", $date ) <= date ( "Ymd", $monthend ) ) { 68 echo "<td><a href=\"javascript:sendDate('" . 69 date ( "Ymd", $date ) . "')\">" . 70 date ( "j", $date ) . "</a></td>\n"; 71 } else { 72 echo "<td></td>\n"; 73 } 74 } 75 echo "</tr>\n"; 76 } 77 ?> 78 </table> 79 </div> 80 81 <?php print_trailer ( false, true, true ); ?> 82 </body> 83 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Nov 30 19:09:19 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |