<?php require("header.php"); ?>
<?php $OL=1; require("../calendar.php"); ?>
<?php
// DETERMINE YEAR TO DISPLAY
if (!$_REQUEST['yr']) $yr=date("Y");
else $yr = $_REQUEST['yr'];
if (!is_numeric($yr)) $yr=date("Y");
$thisYearPrev=$yr;
$thisYearNext=$yr;

// DETERMINE MONTH FOR AGENDA VIEW
if (!$_REQUEST['mo']) $mo=date("m");
else $mo = $_REQUEST['mo'];
if ($mo<1) $mo=12;
if ($mo>12) $mo=1;
$agendaMO=$mo;

// DETERMINE PREVIUOS AND NEXT YEARS AND MONTHS
$yearPrev=$yr-1;
$yearNext=$yr+1;
$monthPrev=$mo-1;
$monthNext=$mo+1;
if ($monthPrev<1) {$monthPrev=12; $thisYearPrev--;}
if ($monthNext>12) {$monthNext=1; $thisYearNext++;}
?>
<table width="100%" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td align="center"><h2><strong>Annual Calendar Example</strong></h2><br />
      <table width="900" border="0" cellspacing="0" cellpadding="4">
        <tr>
    <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="4">
      <tr>
        <td width="20%" align="left" bgcolor="#C9DBED" class="style3"><a href="annual.php?mo=<?php echo $mo; ?>&yr=<?php echo $yearPrev; ?>" title="Back Year">&lt;&lt;</a> <a href="annual.php?mo=<?php echo $monthPrev; ?>&yr=<?php echo $thisYearPrev; ?>" title="Back Month">&lt;</a></td>
        <td align="center" bgcolor="#C9DBED"><strong><?php echo $yr; ?></strong></td>
        <td width="20%" align="right" bgcolor="#C9DBED" class="style3"><a href="annual.php?mo=<?php echo $monthNext; ?>&yr=<?php echo $thisYearNext; ?>" title="Forward Month">&gt;</a> <a href="annual.php?mo=<?php echo $mo; ?>&yr=<?php echo $yearNext; ?>" title="Forward Year">&gt;&gt;</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#E2EDF5"><?php
$EPCANNUAL=1;
require("../calendar.php"); 
?></td>
  </tr>
  <tr>
      <td align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" bgcolor="#C9DBED">Events for selected month</td>
  </tr>
  <tr>
    <td align="center"><br>      <?php
// SHOW AGENDA CALENDAR
$LIST=1;
$DF = "M jS, Y (D)"; 
$template="modern.php";
$mo = $agendaMO;
require("../calendar.php");
?></td>
  </tr>
</table>
</body>
</html>