$html .= $AppUI->_("Show Events for") . ":" . '<select name="show_user_events" onchange="document.pickFilter.submit()"' . ' class="text">'; $q = new DBQuery(); $q->addTable('users', 'u'); $q->addTable('contacts', 'con'); $q->addQuery('user_id, user_username, contact_first_name, contact_last_name'); $q->addWhere('user_contact = contact_id'); if ($rows = $q->loadList()) { foreach ($rows as $row) { $html .= '<option value="' . $row['user_id'] . '"' . ($user_id == $row['user_id'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($row['user_username']) . '</option>'; } } $html .= '</select>'; } $html .= '</form>'; $cal = new CMonthCalendar(); $html .= $cal->_drawBirthdays($this_day->format('%Y%m%d')); $html .= '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">'; $this_day->setTime($start, 0, 0); for ($i = 0, $n = ($end - $start) * 60 / $inc; $i < $n; $i++) { $html .= "\n<tr>"; $tm = $this_day->format($tf); $html .= "\n\t" . '<td width="1%" align="right" nowrap="nowrap">' . ($this_day->getMinute() ? $tm : '<b>' . $tm . '</b>') . '</td>'; $timeStamp = $this_day->format('%H%M%S'); if (@$events2[$timeStamp]) { $count = count($events2[$timeStamp]); for ($j = 0; $j < $count; $j++) { $row = $events2[$timeStamp][$j]; $et = new CDate($row['event_end_date']); $et_date = new CDate($row['event_end_date']); $et_date->setTime(0, 0, 0); if ($et_date->after($this_day)) {
$day = $show_day->getDay(); $href = '?m=calendar&a=day_view&date=' . $dayStamp . '&tab=0'; $s = ''; if ($column == 0) { $s .= "\t<tr>\n"; } $s .= "\t\t" . '<td class="weekDay" style="width:50%;">' . "\n"; $s .= "\t\t" . '<table style="width:100%;border-spacing:0;">' . "\n"; $s .= "\t\t\t" . '<tr><td align="' . ($column == 0 ? 'left' : 'right') . '"><a href="' . htmlspecialchars($href) . '">'; $s .= $dayStamp == $today ? '<span style="color:red">' : ''; $day_string = trim('<strong>' . htmlentities($show_day->format('%d'), ENT_COMPAT, $locale_char_set) . '</strong>'); $day_name = trim(htmlentities($show_day->format("%A"), ENT_COMPAT, $locale_char_set)); $s .= trim($column == 0 ? $day_string . ' ' . $day_name : $day_name . ' ' . $day_string); $s .= $dayStamp == $today ? '</span>' : ''; $s .= "\t\t\t" . '</a></td></tr>' . "\n"; $s .= "\t\t\t" . '<tr><td>' . $cal_week->_drawBirthdays($dayStamp) . $cal_week->_drawEvents($dayStamp) . '</td></tr>' . "\n"; $s .= "\t\t</table>\n"; $s .= "\t\t</td>\n"; if ($column == 1) { $s .= "\t</tr>\n"; } $column = 1 - $column; // select next day $show_day->addSeconds(24 * 3600); echo $s; } ?> <tr> <td colspan="2" align="right" bgcolor="#efefe7"> <a href="?m=calendar&a=week_view"><?php echo $AppUI->_('today');