2 include_once $gfplugins.'webcalendar/www/includes/init.php';
4 // month and year are being overwritten so we will copy vars to fix.
5 // this will make datesel.php still work where ever it is called from.
6 // The values $fday, $fmonth and $fyear hold the form variable names
7 // to update when the user selects a date. (This is needed in
8 // the js/datesel.php file that gets included below.)
9 $fday = getGetValue ( "fday" );
10 $fmonth = getGetValue ( "fmonth" );
11 $fyear = getGetValue ( "fyear" );
13 $INC = array('js/datesel.php');
14 print_header($INC,'','',true);
16 if ( strlen ( $date ) > 0 ) {
17 $thisyear = substr ( $date, 0, 4 );
18 $thismonth = substr ( $date, 4, 2 );
20 $thismonth = date("m");
21 $thisyear = date("Y");
24 $next = mktime ( 3, 0, 0, $thismonth + 1, 1, $thisyear );
25 $nextyear = date ( "Y", $next );
26 $nextmonth = date ( "m", $next );
27 $nextdate = date ( "Ym", $next ) . "01";
29 $prev = mktime ( 3, 0, 0, $thismonth - 1, 1, $thisyear );
30 $prevyear = date ( "Y", $prev );
31 $prevmonth = date ( "m", $prev );
32 $prevdate = date ( "Ym", $prev ) . "01";
36 <div style="text-align:center;">
37 <table align="center" class="minical">
39 <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>
40 <th colspan="5"><?php echo month_name ( $thismonth - 1 ) . " " . $thisyear;?></th>
41 <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>
44 echo "<tr class=\"day\">\n";
45 if ( $WEEK_START == 0 ) echo "<td>" .
46 weekday_short_name ( 0 ) . "</td>\n";
47 for ( $i = 1; $i < 7; $i++ ) {
49 weekday_short_name ( $i ) . "</td>\n";
51 if ( $WEEK_START == 1 ) echo "<td>" .
52 weekday_short_name ( 0 ) . "</td>\n";
54 if ( $WEEK_START == "1" )
55 $wkstart = get_monday_before ( $thisyear, $thismonth, 1 );
57 $wkstart = get_sunday_before ( $thisyear, $thismonth, 1 );
58 $monthstart = mktime ( 3, 0, 0, $thismonth, 1, $thisyear );
59 $monthend = mktime ( 3, 0, 0, $thismonth + 1, 0, $thisyear );
60 for ( $i = $wkstart; date ( "Ymd", $i ) <= date ( "Ymd", $monthend );
61 $i += ( 24 * 3600 * 7 ) ) {
63 for ( $j = 0; $j < 7; $j++ ) {
64 $date = $i + ( $j * 24 * 3600 );
65 if ( date ( "Ymd", $date ) >= date ( "Ymd", $monthstart ) &&
66 date ( "Ymd", $date ) <= date ( "Ymd", $monthend ) ) {
67 echo "<td><a href=\"javascript:sendDate('" .
68 date ( "Ymd", $date ) . "')\">" .
69 date ( "j", $date ) . "</a></td>\n";
80 <?php print_trailer ( false, true, true ); ?>