Exemple #1
0
include_once 'lib/ResCalendar.class.php';
// Check that the user is logged in
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
}
$t = new Template(translate('Resource Calendar'));
// Print HTML headers
$t->printHTMLHeader();
// Print welcome box
$t->printWelcome();
// Begin main table
$t->startMain();
$type = isset($_GET['view']) ? $_GET['view'] : MYCALENDARTYPE_DAY;
$machid = isset($_GET['machid']) ? $_GET['machid'] : null;
$scheduleid = isset($_GET['scheduleid']) ? $_GET['scheduleid'] : null;
$calendar = new ResCalendar(Auth::getCurrentID(), $type, get_calendar_actual_date(), $machid, $scheduleid);
$calendar->print_calendar();
// End main table
$t->endMain();
list($e_sec, $e_msec) = explode(' ', microtime());
// End execution timer
$tot = (double) $e_sec + (double) $e_msec - ((double) $s_sec + (double) $s_msec);
echo '<!--Schedule printout time: ' . sprintf('%.16f', $tot) . ' seconds-->';
// Print HTML footer
$t->printHTMLFooter();
/**
* Sets the 'actualDate' field of the MyCalendar object
* @param none
* @return datestamp of the viewed date
*/
function get_calendar_actual_date()
Exemple #2
0
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
}
$t = new Template(translate('My Calendar'));
// Print HTML headers
$t->printHTMLHeader();
// Print welcome box
$t->printWelcome();
// Begin main table
$t->startMain();
$t->startNavLinkTable();
$t->showNavLinksTable(Auth::isAdmin());
$t->endNavLinkTable();
$t->splitTable();
$type = isset($_GET['view']) ? $_GET['view'] : MYCALENDARTYPE_DAY;
$calendar = new MyCalendar(Auth::getCurrentID(), $type, get_calendar_actual_date());
$calendar->print_calendar();
// End main table
$t->endMain();
$timer->stop();
$timer->print_comment();
// Print HTML footer
$t->printHTMLFooter();
/**
* Sets the 'actualDate' field of the MyCalendar object
* @param none
* @return datestamp of the viewed date
*/
function get_calendar_actual_date()
{
    if (isset($_GET['date'])) {