events as $e) { if($e->concert == "true" && $e->starttime + $e->duration > time()) $str .= $e->show_simple(); } if(!isset($GLOBALS['date'])) $date = time() - (date("N", time()) - 1) * 24 * 60 * 60; else $date = $GLOBALS['date'] - (date("N", $GLOBALS['date'])-1) * 24 * 60 * 60; if($GLOBALS['action'] =="addentry") { $title = stripslashes($GLOBALS['title']); $description = stripslashes($GLOBALS['description']); if($GLOBALS['concert'] == "on") $concert = "true"; else $concert = "false"; $time = strtotime($GLOBALS['txtdate'] . " " . $GLOBALS['txttimefrom'] . ":00"); if($time !== FALSE) { $duration = strtotime($GLOBALS['txtdate'] . " " . $GLOBALS['txttimeto'] . ":00") - $time; $eid = time(); $event = new Event($eid, $title, $concert, $time, $duration, $description, $current_user->uid); $events->add($event); $events->write(); if($ZEND_DIR != "") googleCalendarEvent($event); if($DOKUWIKI_CALENDAR != "") { $file = $DOKUWIKI_CALENDAR; $fp = fopen($file, "w"); fprintf($fp, "=====DIEs calendar=====\n"); fprintf($fp, "Do not edit this file - it is automatically generated " . "by the ExecutionRoom CMS.\n\n"); fprintf($fp, "====Events====\n"); foreach($events->events as $event) { fprintf($fp, " * %s - %s %s: %s\n", date("j.n.Y G:i", $event->starttime), date("j.n.Y G:i", $event->starttime + $event->duration), $event->title, $event->description); } fclose($fp); } notify("calendar", "New calendar entry:\n" . $GLOBALS['title'] . "\n" . date("r", $time) . "\n" . $GLOBALS['description'] . "\n" . $FORUM_URL . "/?mode=calendar&date=" . $time); $str .= " \n"; } else { $str .= "
ERROR: Date is not in the correct " . "format! It was NOT posted. Please try again.
\n"; } } if($GLOBALS['action'] =="delete") { $events->delete($GLOBALS['eid']); $events->write(); } $str .= "

\n"; $str .= "[<]\n"; $str .= "  \n"; $str .= "[<<]\n"; $str .= "  \n"; $str .= date("F Y", $date) . "\n"; $str .= "  \n"; $str .= "[>>] \n"; $str .= "  \n"; $str .= "[>]
\n"; $str .= "[Today]
\n"; $str .= "

\n"; if($client_is_mobile_device) { for($day = 0; $day < 7; $day++) { $str .= "
\n"; $str .= "
\n"; $t = $date + $day * 24 * 60 * 60; $str .= " " . date("l j/n", $t) . "\n"; $str .= "[+]\n"; $str .= "
\n"; $t = strtotime(date("F j Y", $date + $day * 24 * 60 * 60)); $str .= "
4) $str .= " style=\"background: #311;\""; $str .= ">\n"; $str .= $events->show($t, $t + 24 * 60 * 60); $str .= "
\n"; $str .= "
\n"; } } else { $str .= "\n"; $str .= " \n"; for($day = 0; $day < 7; $day++) { $str .= " \n"; } $str .= " \n"; $str .= " \n"; for($day = 0; $day < 7; $day++) { $t = strtotime(date("F j Y", $date + $day * 24 * 60 * 60)); $str .= " \n"; } $str .= " \n"; $str .= "
\n"; $t = $date + $day * 24 * 60 * 60; $str .= " " . date("l j/n", $t) . "\n"; $str .= "
4) $str .= " style=\"background: #311;\""; $str .= ">\n"; $str .= " Add\n"; $str .= $events->show($t, $t + 24 * 60 * 60); $str .= "
\n"; } if($GLOBALS['adddate'] != "") { $str .= "
\n"; $str .= "Title:
\n"; $str .= "Concert:
\n"; $str .= "Desription:
\n"; $str .= "Date:
\n"; $str .= "From-Time:
\n"; $str .= "To-Time:
\n"; $str .= "
\n"; $str .= "\n"; $str .= "
\n"; } return $str; } ?>