Exemplo n.º 1
0
<?php

db_include('get_webpage_access_allowed');
lib_include('ical_lib');
$now = new DateTime();
$end = new DateTime();
$now = $now->sub(new DateInterval('P1D'));
$end = $end->add(new DateInterval('P3W'));
$icsDates = ics_to_array(URL_ICAL_BOOKING);
$events = get_ics_events($icsDates, $now, $end);
usort($events, 'compare_ics_events');
?>

<aside>
	<?php 
if (get_webpage_access_allowed('ui/sidebar_admin.php')) {
    include 'sidebar_admin.php';
}
?>

	<center><b>Upcoming Events</b></center>

	<?php 
foreach ($events as $key => $value) {
    ?>
		<br />
		<?php 
    echo "{$value['Date']} {$value['Time']}";
    ?>
		<br />
		<?php 
Exemplo n.º 2
0
// Set the webroot
if (isset($_SERVER['CONTEXT_DOCUMENT_ROOT']) && $_SERVER['CONTEXT_DOCUMENT_ROOT']) {
    $GLOBALS['webroot'] = $_SERVER['CONTEXT_DOCUMENT_ROOT'];
} else {
    if (preg_match('/(\\/var\\/www\\/dev.underthecouch.org\\/[^\\/]+)\\//', __FILE__, $matches) == 1) {
        $GLOBALS['webroot'] = $matches[1];
    }
}
// Require the necessary includes
require_once 'common/php/constants.php';
require_once 'common/php/include.php';
lib_include('db_lib');
lib_include('session_lib');
db_include('get_webpage_access_allowed');
// Initialize the database connection
get_or_connect_to_db();
// Start a session
set_session_save_handler();
SessionLib::startSession();
SessionLib::registerSession();
// Make sure we can access the page we want
$requested_page = $_REQUEST['file'];
if (!get_webpage_access_allowed($requested_page)) {
    require_once '404.php';
} else {
    // Finally load the requested page
    if (isset($requested_page) && file_exists($requested_page)) {
        require_once $requested_page;
    }
}
exit;