C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\webcalendar\datesel.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/* $Id: datesel.php,v 1.31 2005/03/11 13:59:51 cknudsen Exp $ */
include_once 'includes/init.php';

// month and year are being overwritten so we will copy vars to fix.
// this will make datesel.php still work where ever it is called from.
// The values $fday, $fmonth and $fyear hold the form variable names
// to update when the user selects a date.  (This is needed in
// the js/datesel.php file that gets included below.)
$fday getGetValue "fday" );
$fmonth getGetValue "fmonth" );
$fyear getGetValue "fyear" );

$INC = array('js/datesel.php');
print_header($INC,'','',true);

if ( 
strlen $date ) > ) {
  
$thisyear substr $date0);
  
$thismonth substr $date4);
} else {
  
$thismonth date("m");
  
$thisyear date("Y");
}

$next mktime 300$thismonth 11$thisyear );
$nextyear date "Y"$next );
$nextmonth date "m"$next );
$nextdate date "Ym"$next ) . "01";

$prev mktime 300$thismonth 11$thisyear );
$prevyear date "Y"$prev );
$prevmonth date "m"$prev );
$prevdate date "Ym"$prev ) . "01";

?>

<div style="text-align:center;">
<table align="center" class="minical">
<tr>
<td><a title="<?php etranslate("Previous")?>"  class="prev" href="datesel.php?form=<?php echo $form?>&amp;fday=<?php echo $fday?>&amp;fmonth=<?php echo $fmonth?>&amp;fyear=<?php echo $fyear?>&amp;date=<?php echo $prevdate?>"><img src="leftarrowsmall.gif"  alt="<?php etranslate("Previous")?>" /></a></td>
<th colspan="5"><?php echo month_name $thismonth ) . " " $thisyear;?></th>
<td><a title="<?php etranslate("Next")?>"class="next"  href="datesel.php?form=<?php echo $form?>&amp;fday=<?php echo $fday?>&amp;fmonth=<?php echo $fmonth?>&amp;fyear=<?php echo $fyear?>&amp;date=<?php echo $nextdate?>"><img src="rightarrowsmall.gif"  alt="<?php etranslate("Next")?>" /></a></td>
</tr>
<?php
echo "<tr class=\"day\">\n";
if ( 
$WEEK_START == ) echo "<td>" .
  
weekday_short_name ) . "</td>\n";
for ( 
$i 1$i 7$i++ ) {
  echo 
"<td>" .
    
weekday_short_name $i ) . "</td>\n";
}
if ( 
$WEEK_START == ) echo "<td>" .
  
weekday_short_name ) . "</td>\n";
echo 
"</tr>\n";
if ( 
$WEEK_START == "1" )
  
$wkstart get_monday_before $thisyear$thismonth);
else
  
$wkstart get_sunday_before $thisyear$thismonth);
$monthstart mktime 300$thismonth1$thisyear );
$monthend mktime 300$thismonth 10$thisyear );
for ( 
$i $wkstartdate "Ymd"$i ) <= date "Ymd"$monthend );
  
$i += ( 24 3600 ) ) {
  echo 
"<tr>\n";
  for ( 
$j 0$j 7$j++ ) {
    
$date $i + ( $j 24 3600 );
    if ( 
date "Ymd"$date ) >= date "Ymd"$monthstart ) &&
      
date "Ymd"$date ) <= date "Ymd"$monthend ) ) {
      echo 
"<td><a href=\"javascript:sendDate('" .
        
date "Ymd"$date ) . "')\">" .
        
date "j"$date ) . "</a></td>\n";
    } else {
      echo 
"<td></td>\n";
    }
  }
  echo 
"</tr>\n";
}
?>
</table>
</div>

<?php print_trailer falsetruetrue ); ?>
</body>
</html>