Пример #1
0
*/
list($s_sec, $s_msec) = explode(' ', microtime());
// Start execution timer
/**
* Include Template class
*/
include_once 'lib/Template1.class.php';
/**
* Include scheduler-specific output functions
*/
include_once 'lib/Schedule1.class.php';
// Check that the user is logged in
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
}
$t = new Template1(translate('Online Scheduler'));
$s = new Schedule(isset($_GET['scheduleid']) ? $_GET['scheduleid'] : null);
// Print HTML headers
$t->printHTMLHeader();
// Print welcome box
$t->printWelcome();
// Begin main table
$t->startMain();
ob_start();
// The schedule may take a long time to print out, so buffer all of that HTML data
if ($s->isValid) {
    // Print Calendar Navigation on the left side
    $t->startNavLinkTable();
    $t->showNavLinksTable(Auth::isAdmin());
    $t->endNavLinkTable();
    //	$s->print_calendars();
Пример #2
0
* It provides a login form and will automatically
* forward any users who have cookies set to ctrlpnl.php
* @author Nick Korbel <*****@*****.**>
* @version 06-25-04
* @package phpScheduleIt
*
* Copyright (C) 2003 - 2007 phpScheduleIt
* License: GPL, see LICENSE
*/
/**
* Include Template class
*/
include_once 'lib/Template1.class.php';
// Auth included in Template.php
$auth = new Auth();
$t = new Template1();
$msg = '';
$resume = isset($_POST['resume']) ? $_POST['resume'] : '';
// Logging user out
if (isset($_GET['logout'])) {
    $auth->doLogout();
} else {
    if (isset($_POST['login'])) {
        if ($conf['app']['wrlc']) {
            $msg = $auth->doLoginGwid($_POST['gwid'], $_POST['name']);
        } else {
            $msg = $auth->doLogin($_POST['email'], $_POST['password'], isset($_POST['setCookie']) ? 'y' : null, false, $resume, $_POST['language']);
        }
    } else {
        if (isset($_COOKIE['ID'])) {
            $msg = $auth->doLogin('', '', 'y', $_COOKIE['ID'], $resume);
Пример #3
0
        Auth::print_login_msg();
    }
    include_once 'lib/Blackout1.class.php';
    $Class = 'Blackout';
    $_POST['minres'] = $_POST['maxRes'] = null;
} else {
    include_once 'lib/Reservation1.class.php';
    $Class = 'Reservation';
}
if ((!isset($_GET['read_only']) || !$_GET['read_only']) && $conf['app']['readOnlyDetails']) {
    // Make sure user is logged in
    if (!Auth::is_logged_in()) {
        Auth::print_login_msg();
    }
}
$t = new Template1();
//AK HTTP_REFERER is striped by Gelman firewall
if (isset($_POST['btnSubmit'])) {
    //	echo $_POST['btnSubmit'];
    $t->set_title(translate("Processing {$Class}"));
    $t->printHTMLHeader();
    $t->startMain();
    process_reservation($_POST['fn']);
} else {
    //	echo 'not submitted';
    $res_info = getResInfo();
    $t->set_title($res_info['title']);
    $t->printHTMLHeader();
    $t->startMain();
    present_reservation($res_info['resid']);
}
        $param = implode(',', $args);
        $this->_element->{$name}($param);
    }
}
class Template3 extends HtmlTemplate
{
    protected $_element;
    public function __construct($ele, $html)
    {
        $this->_element = $ele;
        $this->_html = $html;
        $this->set('<ul>' . $this->_html . '</ul>');
    }
    public function __call($name, $args)
    {
        $param = implode(',', $args);
        $this->_element->{$name}($param);
    }
}
$tpl1 = new Template1();
$tpl1->render();
$tpl1->set('Hello Decorator!');
$tpl1->render();
$tpl2 = new Template2($tpl1, 'Hello TPL 2');
$tpl2->render();
$tpl2->set('Hello TPL 2 agian');
$tpl2->render();
$tpl2 = new Template3($tpl1, 'Hello TPL 3');
$tpl2->render();
$tpl2->set('Hello TPL 3 agian');
$tpl2->render();