- <?php
- /**
- * <b>Event Description : Calendar</b><br />
- * The event description page lists all of the details associated with a calendar event.
- * 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);
-
- $smarty = UtilSmarty::createSmarty();
- $cal = new Calendar;
- $db = new Database();
- $db_cal = $db->GetClass('cal');
-
- $pagesubtitle="";$id="";$form="";
- if(getenv("QUERY_STRING")) {
- if(isset($HTTP_GET_VARS['id'])) {$id = $HTTP_GET_VARS['id'];}
- if(isset($HTTP_GET_VARS['form'])) {$form = $HTTP_GET_VARS['form'];}
- $item =& $db_cal->GetCalItemData($id);
- $printdate = "";
- if($item->Recursive) {
- $recstamp = $cal->nextEventFromRecursive($item);
- if($recstamp != 0) {
- $recdate = getdate($recstamp);
- $printdate = $recdate['month']." ".$recdate['mday'].", ".$recdate['year'];
- }
- }
- else if($item->Start['year'] == $item->Stop['year'] &&
- $item->Start['mon'] == $item->Stop['mon'] &&
- $item->Start['mday'] == $item->Stop['mday']) {
- $printdate .= $item->Start['month']." ".$item->Start['mday'].
- ", ".$item->Start['year'];
- }
- else {
- $printdate .= $item->Start['month']." ".$item->Start['mday'].
- ", ".$item->Start['year']." - ";
- $printdate .= $item->Stop['month']." ".$item->Stop['mday'].
- ", ".$item->Stop['year'];
- }
- $pagetitle = stripslashes($item->Title);
- $pagesubtitle = "";
- if($item->SShow){ if($item->Title != $item->STitle) { $pagesubtitle .= $item->STitle; } }
- else if($item->Type == $S_BIBLE_COLLEGE) { $pagesubtitle .= $S_BIBLE_COLLEGE; }
- $pagesubtitle .= " - ".$printdate;
- }
-
- if(getenv("QUERY_STRING") || count($HTTP_POST_VARS) > 0) {
- if(!isset($HTTP_GET_VARS['include'])) {
- require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
- "?pagetitle=".str_replace(" ","%20",htmlentities(stripslashes($pagetitle))).
- "&pagesubtitle=".str_replace(" ","%20",htmlentities(stripslashes($pagesubtitle))).
- "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_CAL));
- $sidecal = $cal->calHeader();
- $smarty->assign('sidesections',array($sidecal['callinks']));
- $smarty->assign('icondescriptions',$sidecal['calicons']);
- $smarty = $cal->calSearchForm($smarty);
- }
- }
- if(getenv("QUERY_STRING")) {
- if($form == "yes") {
- $smarty->assign('heading',$S_FORM_LOC_CONT_INFO);
- $smarty->assign('formname','contactform');
- $smarty->assign('formaction',$SEND_INFO_CAL_FILE);
- $smarty->assign('hiddeninputs',array(array('name'=>'ID','value'=>$id)));
- $smarty->assign('textinputs',array(array('heading'=>$S_FORM_FIRST_NAME,'name'=>'FirstName','size'=>'35'),
- array('heading'=>$S_FORM_LAST_NAME,'name'=>'LastName','size'=>'35'),
- array('heading'=>$S_FORM_EMAIL,'name'=>'FromEmail','size'=>'35'),
- array('heading'=>$S_FORM_PHONE,'name'=>'PhoneNumber','size'=>'35')));
- $smarty->assign('formnote',$S_FORM_WAIT_NOTE);
- $smarty->assign('resetname',$S_FORM_RESET);
- $smarty->assign('submitname',$S_FORM_SUBMIT);
- }
- else { $smarty->assign('printtable',$cal->eventTable($item)); }
- }
- else { $smarty->assign('notice',$N_EVENT_NONE); }
- UtilSmarty::displaySectionPage($smarty);
-
- if(getenv("QUERY_STRING") || count($HTTP_POST_VARS) > 0) {
- if(!isset($HTTP_GET_VARS['include'])) {
- require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER;
- }
- } ?>