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 / includes / calendar_nav.php next >
Text File  |  2003-10-12  |  10KB  |  220 lines

  1.     <?php
  2.     
  3.     if ($cal == $ALL_CALENDARS_COMBINED) {
  4.         $cal_displayname2 = $all_cal_comb_lang;
  5.     } else {
  6.         $cal_displayname2 = $calendar_name . " $calendar_lang";
  7.     }
  8.     if (strlen($cal_displayname2) > 24) {
  9.         $cal_displayname2 = substr("$cal_displayname2", 0, 21);
  10.         $cal_displayname2 = $cal_displayname2 . "...";
  11.     }
  12.     
  13.     $next_day = date("Ymd", strtotime("+1 day", $unix_time));
  14.     $prev_day = date("Ymd", strtotime("-1 day", $unix_time));
  15.  
  16.     // Get the real date to display as "go to today", not the date displayed in the calendar
  17.     $really_unix_time = strtotime(date('Ymd'));
  18.     $really_today_today = date ('Ymd', $really_unix_time);
  19.         
  20.     $fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15');
  21.     ?>
  22. <br>
  23. <table border="0" width="737" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
  24.     <tr>
  25.         <td align="left" valign="top" width="1%"  class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$prev_day\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"[$last_day_lang]\" border=\"0\" align=\"left\"></a>"; ?></td>
  26.         <td align="center" class="sideback"><font class="G10B"><b><?php print (localizeDate ($dateFormat_day, strtotime($getdate))); ?></b></font></td>
  27.         <td align="right" valign="top" width="1%"  class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$next_day\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"[$next_day_lang]\" border=\"0\" align=\"right\"></a>"; ?></td>
  28.     </tr>
  29.     <tr>
  30.         <td colspan="3"><img src="images/spacer.gif" width="1" height="5" alt=" "></td>
  31.     </tr>
  32.     <tr>
  33.         <td width="1%" valign="top" align="right">
  34.             <table cellpadding="0" cellspacing="0" border="0" width="160">
  35.                 <tr>
  36.                     <td valign="middle" align="center">
  37.                         <table width="160" border="0" cellpadding="0" cellspacing="0">
  38.                             <tr>
  39.                                 <td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("-1 month", $fake_getdate_time))); ?></font></td>
  40.                             </tr>
  41.                             <tr>
  42.                                 <td bgcolor="#FFFFFF" align="center">
  43.                                     <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  44.                                         <?php
  45.                                             $start_day = strtotime($week_start_day);
  46.                                             echo '<tr>';
  47.                                             for ($i=0; $i<7; $i++) {
  48.                                                 $day_num = date("w", $start_day);
  49.                                                 $day = $daysofweekreallyshort_lang[$day_num];
  50.                                                 echo '<td align="center" class="G10BOLD">'.$day.'</td>';
  51.                                                 $start_day = strtotime("+1 day", $start_day); 
  52.                                             }
  53.                                             echo '</tr>';
  54.                                             $minical_time         = strtotime("-1 month", $fake_getdate_time);
  55.                                             $minical_month         = date("m", $minical_time);
  56.                                             $minical_year         = date("Y", $minical_time);
  57.                                             $first_of_month     = $minical_year.$minical_month."01";
  58.                                             $start_day             = strtotime(dateOfWeek($first_of_month, $week_start_day));
  59.                                             $i                     = 0;
  60.                                             $whole_month         = TRUE;
  61.                                             $num_of_events         = 0;
  62.                                             do {
  63.                                                 $day             = date ("j", $start_day);
  64.                                                 $daylink         = date ("Ymd", $start_day);
  65.                                                 $check_month     = date ("m", $start_day);
  66.                                                 if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>';
  67.                                                 if ($i == 0) echo "<tr>\n";
  68.                                                 if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) {
  69.                                                     echo '<td width="22" align="center" class="G10B">';
  70.                                                     echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>';
  71.                                                     echo '</td>';
  72.                                                 } else {
  73.                                                     echo '<td width="22" align="center" class="G10B">';
  74.                                                     echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>';
  75.                                                     echo '</td>';
  76.                                                 }
  77.                                                 $start_day = strtotime("+1 day", $start_day); 
  78.                                                 $i++;
  79.                                                 if ($i == 7) { 
  80.                                                     echo '</tr>';
  81.                                                     $i = 0;
  82.                                                     $checkagain = date ("m", $start_day);
  83.                                                     if ($checkagain != $minical_month) $whole_month = FALSE;    
  84.                                                 }
  85.                                             } while ($whole_month == TRUE);
  86.                                         ?>
  87.                                     </table>
  88.                                     <img src="images/spacer.gif" width="1" height="3" alt=" "><br>
  89.                                 </td>
  90.                             </tr>
  91.                         </table>
  92.                     </td>
  93.                 </tr>
  94.             </table>
  95.         </td>
  96.         <td width="98%" valign="top" align="center">
  97.             <table border="0" width="330" cellspacing="0" cellpadding="0">
  98.                 <tr>
  99.                     <td width="160" valign="top">
  100.                         <table cellpadding="0" cellspacing="0" border="0" width="160">
  101.                             <tr>
  102.                                 <td bgcolor="#FFFFFF" align="left" class="G10BOLD">
  103.                                     <?php 
  104.                                     
  105.                                     echo '<b>'.$jump_lang.'</b><br>';
  106.                                     echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>';
  107.                                     echo "<form style=\"margin-bottom:0;\" action=\"month.php\" method=\"GET\"><select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">";
  108.                                     include('./functions/list_icals.php');
  109.                                     include('./functions/list_years.php');
  110.                                     include('./functions/list_months.php');
  111.                                     include('./functions/list_weeks.php');
  112.                                     echo "</form>";
  113.                                     echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>';
  114.                                     
  115.                                     ?>
  116.                                 </td>
  117.                             </tr>
  118.                         </table>
  119.                     </td>
  120.                     <td><img src="images/spacer.gif" width="20" height="1" alt=" "></td>
  121.                     <td width="160" valign="top">
  122.                         <table cellpadding="0" cellspacing="0" border="0" width="160">
  123.                             <tr>
  124.                                 <td valign="middle" align="left" valign="top">
  125.                                     <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%">
  126.                                         <tr>
  127.                                             <td colspan="7"><img src="images/spacer.gif" width="21" height="2" alt=" "></td>
  128.                                         </tr>
  129.                                         <tr>
  130.                                             <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td>
  131.                                             <td colspan="6"><font class="G10BOLD"><?php echo "$cal_displayname2"; ?></font></td>
  132.                                         </tr>
  133.                                         <tr>
  134.                                             <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td>
  135.                                             <td colspan="6" class="G10B">
  136.                                             <?php 
  137.                                                 echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$really_today_today\">$goday_lang</a><br>\n";
  138.                                                 echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$really_today_today\">$goweek_lang</a><br>\n";
  139.                                                 echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$really_today_today\">$gomonth_lang</a><br>\n";
  140.                                                 echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$really_today_today\">$goyear_lang</a><br>\n";
  141.                                                 echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$getdate&printview=$current_view\">$goprint_lang</a><br>\n";
  142.                                                 if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&getdate=$getdate\">$preferences_lang</a><br>\n";
  143.                                                 if ($cal != $ALL_CALENDARS_COMBINED) echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n";
  144.                                              ?>
  145.                                             </td>
  146.                                         </tr>
  147.                                     </table>
  148.                                 </td>
  149.                             </tr>
  150.                         </table>    
  151.                     </td>
  152.                 </tr>
  153.             </table>
  154.         </td>
  155.         <td width="1%" valign="top" align="left">
  156.     <table cellpadding="0" cellspacing="0" border="0" width="160">
  157.         <tr>
  158.             <td valign="middle" align="center">
  159.                 <table width="160" border="0" cellpadding="3" cellspacing="0">
  160.                     <tr>
  161.                         <td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("+1 month", $fake_getdate_time))); ?></font></td>
  162.                     </tr>
  163.                     <tr>
  164.                         <td bgcolor="#FFFFFF" align="center">
  165.                             <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  166.                                 <?php
  167.                                     $start_day = strtotime($week_start_day);
  168.                                     echo '<tr>';
  169.                                     for ($i=0; $i<7; $i++) {
  170.                                         $day_num = date("w", $start_day);
  171.                                         $day = $daysofweekreallyshort_lang[$day_num];
  172.                                         echo '<td align="center" class="G10BOLD">'.$day.'</td>';
  173.                                         $start_day = strtotime("+1 day", $start_day); 
  174.                                     }
  175.                                     echo '</tr>';
  176.                                     $minical_time         = strtotime("+1 month", $fake_getdate_time);
  177.                                     $minical_month         = date("m", $minical_time);
  178.                                     $minical_year         = date("Y", $minical_time);
  179.                                     $first_of_month     = $minical_year.$minical_month."01";
  180.                                     $start_day             = strtotime(dateOfWeek($first_of_month, $week_start_day));
  181.                                     $i                     = 0;
  182.                                     $whole_month         = TRUE;
  183.                                     $num_of_events         = 0;
  184.                                     do {
  185.                                         $day             = date ("j", $start_day);
  186.                                         $daylink         = date ("Ymd", $start_day);
  187.                                         $check_month     = date ("m", $start_day);
  188.                                         if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>';
  189.                                         if ($i == 0) echo "<tr>\n";
  190.                                         if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) {
  191.                                             echo '<td width="22" align="center" class="G10B">';
  192.                                             echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>';
  193.                                             echo '</td>';
  194.                                         } else {
  195.                                             echo '<td width="22" align="center" class="G10B">';
  196.                                             echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>';
  197.                                             echo '</td>';
  198.                                         }
  199.                                         $start_day = strtotime("+1 day", $start_day); 
  200.                                         $i++;
  201.                                         if ($i == 7) { 
  202.                                             echo '</tr>';
  203.                                             $i = 0;
  204.                                             $checkagain = date ("m", $start_day);
  205.                                             if ($checkagain != $minical_month) $whole_month = FALSE;    
  206.                                         }
  207.                                     } while ($whole_month == TRUE);
  208.                                 ?>
  209.                             </table>
  210.                             <img src="images/spacer.gif" width="1" height="3" alt=" "><br>
  211.                         </td>
  212.                     </tr>
  213.                 </table>
  214.             </td>
  215.         </tr>
  216.     </table>    
  217. </td>
  218. </tr>
  219. </table>
  220.