Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning:  Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
<< ".($year-1).""
                            ) . "\n".
                            html_tag( 'th',
                                "< " .
                                date_intl( 'M', $prev_date). ""
                            ) . "\n".
                            html_tag( 'th', date_intl( 'F Y', $act_date ), '', $color[0], 'colspan="3"') .
                            html_tag( 'th',
                                "" .
                                date_intl( 'M', $next_date) . " >"
                            ) . "\n".
                            html_tag( 'th',
                                "".($year+1)." >>"
                            )
                       ) . "\n".
                       html_tag( 'tr',
                           html_tag( 'th', _("Sunday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Monday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Tuesday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Wednesday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Thursday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Friday"), '', $color[5], 'width="14%"' ) ."\n" .
                           html_tag( 'th', _("Saturday"), '', $color[5], 'width="14%"' ) ."\n"
                       )
               ) ,
           '', $color[0] ) ."\n";
}
/**
 * main logic for month view of calendar
 * @return void
 * @access private
 */
function drawmonthview() {
    global $year, $month, $color, $calendardata, $todayis;
    $aday = 1 - date('w', mktime(0, 0, 0, $month, 1, $year));
    $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
    while ($aday <= $days_in_month) {
        echo html_tag( 'tr' );
        for ($j=1; $j<=7; $j++) {
            $cdate="$month";
            ($aday<10)?$cdate=$cdate."0$aday":$cdate=$cdate."$aday";
            $cdate=$cdate."$year";
            if ( $aday <= $days_in_month && $aday > 0){
                echo html_tag( 'td', '', 'left', $color[4], 'height="50" valign="top"' ) ."\n".
                     html_tag( 'div', '', 'right' );
                echo(($cdate==$todayis) ? '[ ' . _("TODAY") . " ] " : '');
                echo "$aday";
            } else {
                echo html_tag( 'td', '', 'left', $color[0]) ."\n".
                     " ";
            }
            if (isset($calendardata[$cdate])){
                $i=0;
                while ($calfoo = each($calendardata[$cdate])) {
                    $calbar = $calendardata[$cdate][$calfoo['key']];
                    // FIXME: how to display multiline task
                    $title = '['. $calfoo['key']. '] ' .
                        str_replace(array("\r","\n"),array(' ',' '),htmlspecialchars($calbar['message']));
                    // FIXME: link to nowhere
                    echo "".htmlspecialchars($calbar['title'])."
\n";
                    $i=$i+1;
                    if($i==2){
                        break;
                    }
                }
            }
            echo "\n\n";
            $aday++;
        }
        echo '';
    }
}
/**
 * end of monthly view and form to jump to any month and year
 * @return void
 * @access private
 */
function endcalendar() {
    global $year, $month, $day, $color;
    echo html_tag( 'tr' ) ."\n" .
           html_tag( 'td', '', 'left', '', 'colspan="7"' ) ."\n" .
         "          \n".
         "          \n".
         "\n";
}
if( !isset( $month ) || $month <= 0){
    $month = date( 'm' );
}
if( !isset($year) || $year <= 0){
    $year = date( 'Y' );
}
if( !isset($day) || $day <= 0){
    $day = date( 'd' );
}
$todayis = date( 'mdY' );
$calself=basename($PHP_SELF);
displayPageHeader($color, 'None');
calendar_header();
readcalendardata();
startcalendar();
drawmonthview();
endcalendar();
?>