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

Source for file sendinfo.php

Documentation is available at sendinfo.php

  1. <?php
  2. /**
  3. * <b>Send Info : Calendar</b><br />
  4. * Sends email to the specified event contact
  5. * @author Kristen O'Brien <kristen_paristemi-com>
  6. * @copyright Copyright 2004, Kristen O'Brien
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. * @link http://www.paristemi.com Paristemi Main Site
  9. * @package paristemi
  10. * @subpackage paristemi_business_logic
  11. * @since Build 0.6
  12. * @version Build 0.7
  13. * @filesource
  14. */
  15. /**
  16. * Include the constants file and all of the files in the include list
  17. */
  18. if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
  19. if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
  20. else { require_once("../constants.php"); }
  21. }
  22. else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
  23. foreach($INCLUDE_LIST as $includefile) { require_once $includefile; } ?>
  24. <?php require_once ($SERVER_DIRECTORY.$INCLUDE_PATH.$CALENDAR_INCLUDE); ?>
  25. <?php $cal = new Calendar; ?>
  26. <?php if(getenv("QUERY_STRING") || count($HTTP_POST_VARS) > 0) {
  27. if(!isset($HTTP_GET_VARS['include'])) { ?>
  28. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$HEADER; ?>
  29. <?php $cal->calHeader(); ?>
  30. <?php } }?>
  31. <?php if(count($HTTP_POST_VARS) > 0) {
  32. $id="";$fromname="";$toemail="";$fromemail="";$phonenumber="";
  33. if(isset($HTTP_POST_VARS['ID'])) {$id = $HTTP_POST_VARS['ID'];}
  34. $db = new Database();
  35. $db_cal = $db->GetClass('cal');
  36. $item =& $db_cal->GetCalItemData($id);
  37. if($item->Recursive) { $date = getdate($cal->nextEventFromRecursive($item)); }
  38. else { $date = $item->Start; }
  39. if(isset($HTTP_POST_VARS['FirstName']) && isset($HTTP_POST_VARS['LastName']))
  40. {$fromname = $HTTP_POST_VARS['FirstName']." ".$HTTP_POST_VARS['LastName']; }
  41. $toemail = $item->ContactEmail;
  42. if(isset($HTTP_POST_VARS['FromEmail'])) {$fromemail = $HTTP_POST_VARS['FromEmail'];}
  43. if(isset($HTTP_POST_VARS['PhoneNumber'])) {$phonenumber = $HTTP_POST_VARS['PhoneNumber'];}
  44. $ip = getenv ("REMOTE_ADDR");
  45. $sent = false;
  46. if($id != "" && $fromname != " " && $toemail != "" && $fromemail != "" && $phonenumber != "") {
  47. $sent = mail($toemail, $S_MSG_LOC_CONT_INFO.stripslashes($item->Title),
  48. $S_MSG_BODY_LOC_CONT_INFO_TO.$S_MSG_FOOTER."\r\n\r\n"
  49. .$S_EVENT.": ".stripslashes($item->Title)."\r\n".$S_START_DATE.": ".UtilDatetime::FormatPHPDate($date).
  50. "\r\n".$S_FROM_PERSON.": ".$fromname."\r\n".$S_PHONE_NUMBER.": ".$phonenumber.
  51. "\r\n".$S_FROM_EMAIL.": ".$fromemail,
  52. "From: ".$fromemail."\r\n"
  53. ."Reply-To: ".$fromemail."\r\n"
  54. ."X-Mailer: PHP/" . phpversion());
  55. if($sent) {
  56. $sent = mail($fromemail, $S_MSG_LOC_CONT_INFO.stripslashes($item->Title),
  57. $S_MSG_BODY_LOC_CONT_INFO_FROM.$S_MSG_FOOTER."\r\n\r\n"
  58. .$S_EVENT.": ".stripslashes($item->Title)."\r\n".$S_START_DATE.": ".UtilDatetime::FormatPHPDate($date).
  59. "\r\n".$S_FROM_PERSON.": ".$fromname."\r\n".$S_PHONE_NUMBER.": ".$phonenumber.
  60. "\r\n".$S_FROM_EMAIL.": ".$fromemail,
  61. "From: ".$FOOTER_CONTACT."\r\n"
  62. ."Reply-To: ".$FOOTER_CONTACT."\r\n"
  63. ."X-Mailer: PHP/" . phpversion());
  64. if($sent) {
  65. $sent = mail($FOOTER_CONTACT, $S_MSG_LOC_CONT_INFO.stripslashes($item->Title),
  66. $S_MSG_BODY_LOC_CONT_INFO_FROM.$S_MSG_RECORDS.$S_MSG_FOOTER."\r\n\r\n"
  67. .$S_EVENT.": ".stripslashes($item->Title)."\r\n".$S_START_DATE.": ".UtilDatetime::FormatPHPDate($date).
  68. "\r\n".$S_FROM_PERSON.": ".$fromname."\r\n".$S_PHONE_NUMBER.": ".$phonenumber.
  69. "\r\n".$S_FROM_EMAIL.": ".$fromemail."\r\n".$S_TO_EMAIL.":".$toemail."\r\n".$S_IP_ADDRESS.": ".$ip,
  70. "From: ".$fromemail."\r\n"
  71. ."Reply-To: ".$fromemail."\r\n"
  72. ."X-Mailer: PHP/" . phpversion());
  73. if($sent) {
  74. echo "<span class=\"sectioncurrent\"><p>".$S_MSG_SENT_LOC_CONT_INFO."</p></span>";
  75. echo "<p><a href=\"".$HTTP_DOCUMENT_ROOT."\">".$S_RETURN_SITE."</a></p>";
  76. }
  77. else { $sent = false; }
  78. }
  79. else { $sent = false; }
  80. }
  81. else { $sent = false; }
  82. }
  83. else {
  84. echo "<span class=\"error\"><p>".$E_MAIL_SEND.$E_FILL_FORM."</p></span>";
  85. echo "<p><a href=\"".$HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$ITEM_CAL_FILE;
  86. echo "?id=".$ID."&form=yes\">".$S_RETURN_FORM."</a>";
  87. }
  88. }
  89. ?>
  90. <?php if(getenv("QUERY_STRING") || count($HTTP_POST_VARS) > 0) {
  91. if(!isset($HTTP_GET_VARS['include'])) {
  92. ?>
  93. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>
  94. <?php } }?>

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