Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/system/mod_calendar.php
<?php
################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 #
## --------------------------------------------------------------------------- #
##  ApPHP AdminPanel Pro                                                       #
##  Developed by:  ApPHP <hide@address.com>                                      #
##  License:       GNU LGPL v.3                                                #
##  Site:          http://www.apphp.com/php-adminpanel/                        #
##  Copyright:     ApPHP AdminPanel (c) 2006-2011. All rights reserved.        #
##                                                                             #
################################################################################
    
    // Initialize the session.
    session_start();
    
    require_once("../inc/classes/session.class.php");	
    require_once("../inc/checkAdminPagePermissions.php");

	require_once("../inc/functions.inc.php");
    require_once("../inc/config.inc.php");
    require_once("../inc/settings.inc.php");
	require_once("../inc/languages/".$SETTINGS['site_language'].".php");
	
	if(!module_istalled('calendar')) redirect_to("access_denied.php");
    //if(!page_access_allowed($_SERVER['SCRIPT_NAME'])) redirect_to("access_denied.php");

    ## +---------------------------------------------------------------------------+
    ## | 1. Creating & Calling:                                                    | 
    ## +---------------------------------------------------------------------------+
    // include calendar class and other files
    $config = new Config();	
    define("_DATABASE_HOST", $config->getHost());
    define("_DATABASE_NAME", $config->getDatabase()); 
    define("_DATABASE_USER_NAME", $config->getUser());
    define("_DATABASE_PASSWORD", $config->getPassword());
    
    require_once("../modules/calendar/inc/connection.inc.php");
    require_once("../modules/calendar/calendar.class.php");
    
    ## *** create calendar object
    $objCalendar = new Calendar();
    ## *** show debug info - false|true
    $objCalendar->Debug(false);
    
    ## +---------------------------------------------------------------------------+
    ## | 2. General Settings:                                                      | 
    ## +---------------------------------------------------------------------------+
    ## *** set form submission type: "get" or "post"
    /// $objCalendar->SetSubmissionType("post");
    ## *** get current timezone
    /// echo $objCalendar->GetCurrentTimeZone();

    ## *** set timezone
    ## *** (list of supported Timezones - http://us3.php.net/manual/en/timezones.php)
	$time_zone_name = isset($SETTINGS['time_zone_name']) ? $SETTINGS['time_zone_name'] : "America/Los_Angeles";
    $objCalendar->SetTimeZone($time_zone_name);
	
    ## *** set week day name length - "short" or "long"
    $objCalendar->SetWeekDayNameLength("long");
    ## *** set start day of week: from 1 (Sanday) to 7 (Saturday)
    $objCalendar->SetWeekStartedDay("1");
    ## *** define showing a week number of year
    $objCalendar->ShowWeekNumberOfYear(true);

    ## +---------------------------------------------------------------------------+
    ## | 3. Visual Settings:                                                       | 
    ## +---------------------------------------------------------------------------+
    ## *** set CSS style: "green"|"blue" - default
    $objCalendar->SetCssStyle("blue");
    ## *** set calendar width and height
    $objCalendar->SetCalendarDimensions("800px", "500px");
    ## *** set default calendar view - "daily"|"weekly"|"monthly"|"yearly"
    $objCalendar->SetDefaultView("monthly");
    ## *** set calendar caption
    $objCalendar->SetCaption("Calendar Management");

    ##  *** set (allow) calendar operations
    $operations = array(
		"add"    => (($_SESSION['adm_status'] == "main admin") ? true : false),
        "delete" => (($_SESSION['adm_status'] == "main admin") ? true : false)
	);
    $objCalendar->SetOperations($operations);   
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title><?php echo $SETTINGS['site_name']; ?> :: <?php echo lang('admin_panel'); ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link href="../styles/<?php echo $SETTINGS['css_style'];?>/style.css" type="text/css" rel="stylesheet">
</head>
<body dir="<?php echo $SETTINGS['language_dir'];?>">
<?php echo page_breadcrumbs(); ?>
<br />
<?php
if($_SESSION['adm_status'] == "main admin"){ 
	echo "<a href='../public/calendar.php' target='_blank'><b>[Public View]</b></a> <img class='external_link' src='../images/external_link.gif' alt='' />";
}
?>
<center>
<?php    
    ## +---------------------------------------------------------------------------+
    ## | 4. Draw Calendar:                                                         | 
    ## +---------------------------------------------------------------------------+
    $objCalendar->Show();
?>
</center>
<br />
</body>
</html>
Return current item: Basic Announce