- <?php
- /**
- * <b>Day Calendar : Calendar</b><br />
- * The day calendar page lists all of the events for the specified date.
- * This section is searchable.
- * @author Kristen O'Brien <kristen_paristemi-com>
- * @copyright Copyright 2004, Kristen O'Brien
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @link http://www.paristemi.com Paristemi Main Site
- * @package paristemi
- * @subpackage paristemi_business_logic
- * @since Build 0.1
- * @version Build 0.7
- * @filesource
- */
- /**
- * Include the constants file and all of the files in the include list
- */
- if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
- if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
- else { require_once("../constants.php"); }
- }
- else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
- foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
- require_once ($SERVER_DIRECTORY.$INCLUDE_PATH.$CALENDAR_INCLUDE);
-
- if(getenv("QUERY_STRING")) {
- $month="";$day="";$year="";
- if(isset($HTTP_GET_VARS['mon'])) {$month = $HTTP_GET_VARS['mon'];}
- if(isset($HTTP_GET_VARS['day'])) {$day = $HTTP_GET_VARS['day'];}
- if(isset($HTTP_GET_VARS['year'])) {$year = $HTTP_GET_VARS['year'];}
- $today = getdate(mktime(0,0,0,$month,$day,$year));
- }
- else {
- $today = getdate(time());
- }
- $pagesubtitle = $today['weekday'].", ".$today['month']." ".$today['mday'].", ".$today['year'];
-
- require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
- "?pagetitle=".str_replace(" ","%20",htmlentities($S_DAY)." ".htmlentities($S_CALENDAR)).
- "&pagesubtitle=".str_replace(" ","%20",htmlentities($pagesubtitle)).
- "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_CAL));
-
- $smarty = UtilSmarty::createSmarty();
- $cal = new Calendar;
- $db = new Database();
- $db_cal = $db->GetClass('cal');
-
- $sidecal = $cal->calHeader();
- $smarty->assign('sidesections',array($sidecal['callinks']));
- $smarty->assign('icondescriptions',$sidecal['calicons']);
- $smarty = $cal->calSearchForm($smarty);
-
- $smarty->assign('heading',
- $today['weekday'].", ".$today['month']." ".$today['mday'].", ".$today['year']);
-
-
- $data =& $db_cal->GetDayData($today);
- if($data == null) { $smarty->assign('notice',$N_EVENTS_NONE); }
- else {
- $smarty->trusted_dir = $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH;
- $printtables = array();
- foreach ($data as $value) {
- $printtables[] = $cal->eventTable($db_cal->GetCalItemData($value->ID));
- }
- $smarty->assign('printtable',$printtables);
- }
-
- $begin_week = $cal->beginWeek($today);
- $next_day =& $cal->incDay($today);
- $last_day =& $cal->decDay($today);
-
- $smarty->assign('bottomlinks',array(array(
- 'LinkPath' => $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DAY_CAL_FILE."?mon=".
- $last_day['mon']."&day=".$last_day['mday']."&year=".$last_day['year'],
- 'LinkText' => $S_PREV_DAY),array(
- 'LinkPath' => $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DAY_CAL_FILE."?mon=".
- $next_day['mon']."&day=".$next_day['mday']."&year=".$next_day['year'],
- 'LinkText' => $S_NEXT_DAY)));
-
- UtilSmarty::displaySectionPage($smarty);
- ?>
- <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>