home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / calendar-2010-08-23.tar.gz / calendar-2010-08-23.tar / calendar / year.php < prev   
PHP Script  |  2003-10-12  |  8KB  |  172 lines

  1. <?php
  2. $current_view = 'year';
  3. define('BASE', './');
  4. include(BASE.'functions/ical_parser.php');
  5.  
  6. ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
  7. $this_day = $day_array2[3]; 
  8. $this_month = $day_array2[2];
  9. $this_year = $day_array2[1]. '01'. '01';
  10. $display_date = $day_array2[1];
  11.  
  12. $unix_time = strtotime($getdate);
  13. $startYear = strtotime ($this_year);
  14. $checkad = date ("Ymd", $startYear);
  15.  
  16. $next_year = strtotime ("+1 year", strtotime("$getdate"));
  17. $next_year = date ("Ymd", $next_year);
  18. $prev_year = strtotime ("-1 year", strtotime("$getdate"));
  19. $prev_year = date ("Ymd", $prev_year);
  20.  
  21. $thisday2 = localizeDate($dateFormat_week_list, $unix_time);
  22.  
  23. include (BASE.'includes/header.inc.php'); 
  24.  
  25. ?>
  26. <center>
  27. <table width="676" border="0" cellspacing="0" cellpadding="0" class="calborder">
  28.     <tr>
  29.         <td align="center" valign="middle" bgcolor="white">
  30.             <table width="100%" border="0" cellspacing="0" cellpadding="0">
  31.                   <tr>
  32.                       <td align="left" width="120" class="navback"> </td>
  33.                       <td class="navback">
  34.                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
  35.                               <tr>
  36.                                 <td align="right" width="45%" class="navback"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$prev_year\"><img src=\"styles/$style_sheet/left_day.gif\" alt=\"[$last_year_lang]\" border=\"0\" align=\"right\"></a>"; ?></td>
  37.                                 <td align="center" width="10%" class="navback" nowrap valign="middle"><font class="H20"><?php echo $display_date; ?></font></td>
  38.                                   <td align="left" width="45%" class="navback"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$next_year\"><img src=\"styles/$style_sheet/right_day.gif\" alt=\"[$next_year_lang]\" border=\"0\" align=\"left\"></a>"; ?></td>
  39.                               </tr>
  40.                           </table>
  41.                       </td>
  42.                       <td align="right" width="120" class="navback">    
  43.                           <table width="120" border="0" cellpadding="0" cellspacing="0">
  44.                             <tr>
  45.                                 <td><?php echo '<a class="psf" href="day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/day_on.gif" alt="'.$day_view_lang.'" border="0"></a></td>'; ?>
  46.                                 <td><?php echo '<a class="psf" href="week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/week_on.gif" alt="'.$week_view_lang.'" border="0"></a></td>'; ?>
  47.                                 <td><?php echo '<a class="psf" href="month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/month_on.gif" alt="'.$month_view_lang.'" border="0"></a></td>'; ?>
  48.                                 <td><?php echo '<a class="psf" href="year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/year_on.gif" alt="'.$year_view_lang.'" border="0"></a></td>'; ?>
  49.                             </tr>
  50.                         </table>
  51.                     </td>
  52.                   </tr>
  53.               </table>
  54.         </td>
  55.     </tr>
  56. </table>
  57. <br>    
  58. <table border="0" width="670" cellspacing="0" cellpadding="0">
  59.     <tr>    
  60.         <?php
  61.         $m=0;    
  62.         $n=0;
  63.         do {
  64.         
  65.         ?>
  66.         <td width="210" valign="top" align="left">
  67.             <table border="0" width="210" cellspacing="0" cellpadding="0" class="calborder">
  68.                 <tr>
  69.                     <td colspan="7">
  70.                         <table border="0" width="210" cellspacing="0" cellpadding="0">
  71.                             <tr>
  72.                                 <td width="1" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td>
  73.                                 <?php 
  74.                                     $monthlink = date("Ym", $startYear); 
  75.                                     $monthlink = $monthlink . $this_day;
  76.                                 ?>
  77.                                 <td align="center" class="sideback"><?php echo '<a class="ps3" href="month.php?cal=' . $cal . '&getdate=' . $monthlink . '">'; ?><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, $startYear)); ?></font></a></td>
  78.                                 <td width="1" class="sideback"></td>
  79.                             </tr>
  80.                         </table>
  81.                     </td>
  82.                 </tr>
  83.                 <tr>
  84.                 <?php
  85.                     $start_day = strtotime($week_start_day);
  86.                     for ($i=0; $i<7; $i++) {
  87.                         $day_num = date("w", $start_day);
  88.                         $day = $daysofweekshort_lang[$day_num];
  89.                         print '<td width="30" height="14" class="dateback" align="center"><font class="V9BOLD">' . $day . '</font></td>' . "\n";
  90.                         $start_day = strtotime("+1 day", $start_day); 
  91.                     }
  92.                 ?>
  93.                 </tr>
  94.                 <tr>
  95.                     <td colspan="7">
  96.                         <table border="0" width="210" cellspacing="1" cellpadding="0" class="yearmonth">
  97.                             <?php
  98.                                     $minical_time = $startYear;
  99.                                     $minical_month = date("m", $minical_time);
  100.                                     $minical_year = date("Y", $minical_time);
  101.                                     $first_of_month = $minical_year.$minical_month."01";
  102.                                     $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day));
  103.                                     $i = 0;
  104.                                     $whole_month = TRUE;
  105.                                     $num_of_events = 0;
  106.                                     do {
  107.                                         $day = date ("j", $start_day);
  108.                                         $daylink = date ("Ymd", $start_day);
  109.                                         $check_month = date ("m", $start_day);
  110.                                         if ($check_month != $minical_month) $day= "<font class=\"V9G\">$day</font>";
  111.                                         if ($i == 0) echo '<tr height="30">';
  112.                                         if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) {
  113.                                             foreach ($master_array[("$daylink")] as $event_times) {
  114.                                                 foreach ($event_times as $val) {
  115.                                                 if (!isset($val["event_start"])) $image1 = '<img src="styles/'. $style_sheet . '/allday_dot.gif" alt=" " width="11" height="10" border="0">';
  116.                                                 if (isset($val["event_start"])) $image2 = '<img src="styles/'. $style_sheet . '/event_dot.gif" alt=" " width="11" height="10" border="0">';
  117.                                                 }
  118.                                             }    
  119.                                             if (isset($master_array[("$daylink")][-1])) $image2 = '<img src="styles/silver/allday_dot.gif" alt=" " border="0">';
  120.                                             echo '<td width="30" height="30" align="right" valign="top" class="monthreg" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#FFFFFF" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n";
  121.                                             echo '<table width="100%" border="0" cellspacing="0" cellpadding="1">' . "\n";
  122.                                             echo '<tr>' . "\n";
  123.                                             echo '<td align="right" valign="top" class="V9">' . "\n";
  124.                                             echo '<a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a>' . "\n";
  125.                                             echo '</td>' . "\n";
  126.                                             echo '</tr>' . "\n";
  127.                                             echo '<tr>' . "\n";
  128.                                             echo '<td align="center" valign="top">' . $image1 . $image2 . '</td>' . "\n";
  129.                                             echo '</tr>' . "\n";
  130.                                             echo '</table>' . "\n";
  131.                                         } elseif ($check_month == $minical_month) {
  132.                                             echo '<td width="30" height="30" align="right" valign="top" class="monthreg" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#FFFFFF" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n";
  133.                                             echo '<font class="V9"><a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a></font></td>' . "\n";
  134.                                         } else {
  135.                                             echo '<td width="30" height="30" align="right" valign="top" class="monthoff" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#F2F2F2" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n";
  136.                                             echo '<a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a></td>' . "\n";
  137.                                         }
  138.                                         $start_day = strtotime("+1 day", $start_day); 
  139.                                         $i++;
  140.                                         $image1 = '';
  141.                                         $image2 = '';
  142.                                         if ($i == 7) { 
  143.                                             echo '</tr>';
  144.                                             $i = 0;
  145.                                             $checkagain = date ("m", $start_day);
  146.                                             if ($checkagain != $minical_month) $whole_month = FALSE;    
  147.                                         }
  148.                                     } while ($whole_month == TRUE);
  149.                                     $startYear = strtotime ("+1 month", $startYear);
  150.                                 ?>
  151.                         </table>
  152.                     </td>
  153.                 </tr>
  154.             </table>
  155.         </td>
  156.         <?php 
  157.                 if ($m < 2) echo '<td width="20"><img src="images/spacer.gif" width="20" height="1" alt=" "></td>';
  158.                 $m++;
  159.                 $n++;
  160.                 if (($m == 3) && ($n < 12)) {
  161.                     $m = 0;
  162.                     echo '</tr><tr>';
  163.                     echo '<td colspan="5"><img src="images/spacer.gif" width="1" height="20" alt=" "></td>';
  164.                     echo '</tr><tr>';
  165.                 }
  166.             } while (($m < 3) && ($n < 12)); 
  167.         ?>
  168. </tr>
  169. </table>
  170. </center>
  171. <?php include (BASE.'includes/footer.inc.php'); ?>
  172.