paristemi
[ class tree: paristemi ] [ index: paristemi ] [ all elements ]

Source for file daycal.php

Documentation is available at daycal.php

  1. <?php
  2. /**
  3. * <b>Day Calendar : Calendar</b><br />
  4. * The day calendar page lists all of the events for the specified date.
  5. * This section is searchable.
  6. * @author Kristen O'Brien <kristen_paristemi-com>
  7. * @copyright Copyright 2004, Kristen O'Brien
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @link http://www.paristemi.com Paristemi Main Site
  10. * @package paristemi
  11. * @subpackage paristemi_business_logic
  12. * @since Build 0.1
  13. * @version Build 0.7
  14. * @filesource
  15. */
  16. /**
  17. * Include the constants file and all of the files in the include list
  18. */
  19. if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
  20. if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
  21. else { require_once("../constants.php"); }
  22. }
  23. else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
  24. foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
  25. require_once ($SERVER_DIRECTORY.$INCLUDE_PATH.$CALENDAR_INCLUDE);
  26.  
  27. if(getenv("QUERY_STRING")) {
  28. $month="";$day="";$year="";
  29. if(isset($HTTP_GET_VARS['mon'])) {$month = $HTTP_GET_VARS['mon'];}
  30. if(isset($HTTP_GET_VARS['day'])) {$day = $HTTP_GET_VARS['day'];}
  31. if(isset($HTTP_GET_VARS['year'])) {$year = $HTTP_GET_VARS['year'];}
  32. $today = getdate(mktime(0,0,0,$month,$day,$year));
  33. }
  34. else {
  35. $today = getdate(time());
  36. }
  37. $pagesubtitle = $today['weekday'].", ".$today['month']." ".$today['mday'].", ".$today['year'];
  38.  
  39. require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
  40. "?pagetitle=".str_replace(" ","%20",htmlentities($S_DAY)." ".htmlentities($S_CALENDAR)).
  41. "&pagesubtitle=".str_replace(" ","%20",htmlentities($pagesubtitle)).
  42. "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_CAL));
  43. $smarty = UtilSmarty::createSmarty();
  44. $cal = new Calendar;
  45. $db = new Database();
  46. $db_cal = $db->GetClass('cal');
  47. $sidecal = $cal->calHeader();
  48. $smarty->assign('sidesections',array($sidecal['callinks']));
  49. $smarty->assign('icondescriptions',$sidecal['calicons']);
  50. $smarty = $cal->calSearchForm($smarty);
  51. $smarty->assign('heading',
  52. $today['weekday'].", ".$today['month']." ".$today['mday'].", ".$today['year']);
  53.  
  54. $data =& $db_cal->GetDayData($today);
  55. if($data == null) { $smarty->assign('notice',$N_EVENTS_NONE); }
  56. else {
  57. $smarty->trusted_dir = $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH;
  58. $printtables = array();
  59. foreach ($data as $value) {
  60. $printtables[] = $cal->eventTable($db_cal->GetCalItemData($value->ID));
  61. }
  62. $smarty->assign('printtable',$printtables);
  63. }
  64. $begin_week = $cal->beginWeek($today);
  65. $next_day =& $cal->incDay($today);
  66. $last_day =& $cal->decDay($today);
  67. $smarty->assign('bottomlinks',array(array(
  68. 'LinkPath' => $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DAY_CAL_FILE."?mon=".
  69. $last_day['mon']."&amp;day=".$last_day['mday']."&amp;year=".$last_day['year'],
  70. 'LinkText' => $S_PREV_DAY),array(
  71. 'LinkPath' => $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DAY_CAL_FILE."?mon=".
  72. $next_day['mon']."&amp;day=".$next_day['mday']."&amp;year=".$next_day['year'],
  73. 'LinkText' => $S_NEXT_DAY)));
  74. UtilSmarty::displaySectionPage($smarty);
  75. ?>
  76. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>

Documentation generated on Mon, 10 May 2004 12:08:13 -0700 by phpDocumentor 1.3.0RC3