Ejemplo n.º 1
0
<?php 
if ($events_exist) {
    ?>
    <table cellspacing="1" border="0" class="list" width="100%">
    <tr>
        <th width="2%">№</th>
        <th width="18%">Срок</th>
        <th width="78%">Тема</th>
        <th width="2%">&nbsp;</th>
    </tr>
<?php 
    $event = new calendar_event();
    for ($i = 0; $i < count($day_events); $i++) {
        $event->Init();
        $event->LoadItem($day_events[$i]);
        if (!trim($event->what)) {
            $event->what = 'Без темы';
        }
        ?>
    <tr ondblclick="return editEvent(<?php 
        echo $event->id_event;
        ?>
);" class="active" title="Двойной щелчёк для редактирования">
        <td><?php 
        echo $i + 1;
        ?>
.</td>
        <td nowrap><?php 
        echo format_date('{d}/{m}/{Y}', $event->start_date);
        ?>
Ejemplo n.º 2
0
<?php 
if ($events_exist) {
    ?>
    <table cellspacing="1" border="0" class="list" width="100%">
    <tr>
        <th width="2%">№</th>
        <th width="18%">Срок</th>
        <th width="78%">Тема</th>
        <th width="2%">&nbsp;</th>
    </tr>
<?php 
    $event = new calendar_event();
    for ($i = 0; $i < count($week_events); $i++) {
        $event->Init();
        $event->LoadItem($week_events[$i]);
        if (!trim($event->what)) {
            $event->what = 'Без темы';
        }
        ?>
    <tr ondblclick="return editEvent(<?php 
        echo $event->id_event;
        ?>
);" class="active" title="Двойной щелчёк для редактирования">
        <td><?php 
        echo $i + 1;
        ?>
.</td>
        <td nowrap><?php 
        echo format_date('{d}/{m}/{Y}', $event->start_date);
        ?>
Ejemplo n.º 3
0
$where[] = '"mark"=\'yes\'';
$where[] = '"completed"=\'no\'';
$date = date('Y-m-01');
$start_day = strtotime('-1 months', strtotime($date));
$stop_day = strtotime('+3 months -1 day', $start_day);
$stop_date = date('Y-m-d', $stop_day);
$start_date = date('Y-m-d', $start_day);
$where[] = '"start_date"<=\'' . $stop_date . '\' AND "stop_date">=\'' . $start_date . '\'';
$query = 'SELECT * FROM ' . TABLE_CALENDAR_EVENT . ' WHERE ' . join(' AND ', $where) . ' ';
$db->query($query);
if (count($db->value) > 0) {
    $events = $db->value;
    $event = new calendar_event();
    for ($i = 0; $i < count($events); $i++) {
        $event->Init();
        $event->LoadItem($events[$i]);
        $start = strtotime($event->start_date);
        $start = $start > $start_day ? $start : $start_day;
        $stop = strtotime($event->stop_date);
        $stop = $stop < $stop_day ? $stop : $stop_day;
        while ($start <= $stop) {
            $dates[date('Y', $start)][date('n', $start)][date('j', $start)] = 1;
            $start = strtotime('+1 day', $start);
        }
    }
    $selector = '#yahoo-com3.yui-skin-eco .yui-calendar.y2000 .m0 .d0 a';
    foreach ($dates as $year => $monthes) {
        foreach ($monthes as $month => $days) {
            foreach ($days as $day => $val) {
                $selector .= ',' . "\n\r" . '#yahoo-com3.yui-skin-eco .yui-calendar.y' . $year . ' .m' . $month . ' .d' . $day . ' a';
            }