예제 #1
0
function getRoomEventList(array $rooms, $start, $end)
{
    $entries = array();
    $timed_entries = array();
    foreach ($rooms as $room) {
        $events_room = checktime_Room($start, $end, $room['area_id'], $room['room_id']);
        if (isset($events_room[$room['room_id']])) {
            foreach ($events_room[$room['room_id']] as $entry_id) {
                $event = getEntry($entry_id);
                if (count($event)) {
                    $a = '';
                    if ($event['time_start'] < $start) {
                        $a .= __('started') . ' ' . date('H:i d-m-Y', $event['time_start']);
                        $event['time_start'] = $start;
                    }
                    if ($event['time_end'] > $end) {
                        if ($a != '') {
                            $a .= ', ';
                        }
                        $a .= 'slutter ' . date('H:i d-m-Y', $event['time_end']);
                        $event['time_end'] = $end;
                    }
                    if ($a != '') {
                        $event['entry_name'] .= ' (' . $a . ')';
                    }
                    $timed_entries[$event['time_start']][$event['entry_id']] = $event['entry_id'];
                    $entries[$event['entry_id']] = $event;
                }
            }
        }
    }
    return array('timedEntries' => $timed_entries, 'allEntries' => $entries);
}
예제 #2
0
echo '<html><head><title>';
if (count($area2)) {
    echo $area2['area_name'] . ' - ';
}
echo date('d.m.Y', $start);
echo '</title></head>';
echo '<body background="img/infoskjerm-bg.png" style="margin: 0px; padding: 0px;">' . chr(10);
$Q_room = mysql_query("select id as room_id, room_name from `mrbs_room` where area_id = '" . $area . "' and hidden = 'false'");
$rooms = array();
while ($R_room = mysql_fetch_assoc($Q_room)) {
    $rooms[$R_room['room_id']] = $R_room['room_name'];
}
$entries = array();
$timed_entries = array();
foreach ($rooms as $room_id => $room) {
    $events_room = checktime_Room($start, $end, $area, $room_id);
    if (isset($events_room[$room_id])) {
        foreach ($events_room[$room_id] as $entry_id) {
            $event = getEntry($entry_id);
            if (count($event)) {
                $entries[$event['entry_id']] = $event;
                if ($event['time_start'] < $start) {
                    $event['time_start'] = $start;
                }
                $event['time_start'] = round_t_down($event['time_start'], $resolution);
                $timed_entries[$event['time_start']][$event['entry_id']] = $event['entry_id'];
            }
        }
    }
}
echo '<table width="1024" style="border-collapse: collapse;">' . chr(10);
예제 #3
0
     $start = $am7;
     $end = $pm7;
 }
 /* ## Make map of time ## */
 for ($t = $am7; $t <= $pm7; $t += $resolution) {
     $room_time[$R_room['room_id']][$t] = array();
     $room_time2[$R_room['room_id']][$t] = array();
     $room_time3[$R_room['room_id']][$t] = array();
 }
 $entries_room[$R_room['room_id']] = array();
 $room_max_col[$R_room['room_id']] = 1;
 if ($dayview == 1) {
     $am7 = $am7_tmp;
     $pm7 = $pm7_tmp;
 }
 $events_room = checktime_Room($start, $end, $R_room['area_id'], $R_room['room_id']);
 if (isset($events_room[$R_room['room_id']])) {
     foreach ($events_room[$R_room['room_id']] as $entry_id) {
         // Fixing time for this event
         $event = getEntry($entry_id);
         if (count($event)) {
             //echo '<b>'.date('H:i:s dmY',$event['time_start']).'</b> start<br>'.chr(10);
             //echo '<b>'.date('H:i:s dmY',$event['time_end']).'</b> end<br>'.chr(10);
             // Saving originals
             $event['time_start_real'] = $event['time_start'];
             $event['time_end_real'] = $event['time_end'];
             if ($event['time_start'] < $start) {
                 $event['time_start'] = $start;
                 $event['entry_name'] .= ' (' . __('started') . ' ' . date('H:i d-m-Y', $event['time_start_real']) . ')';
             }
             $event['time_start'] = round_t_down($event['time_start'], $resolution);