Skip to content
Snippets Groups Projects
Commit b7fb49d6 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Add thank you page, get email working

parent 768edc2e
Branches
No related tags found
No related merge requests found
......@@ -19,11 +19,9 @@ function myautoload($class)
$url = "http://localhost/workspace/ucomm_webforms/police/terrex11/";
$sendToEmail = "jdoe1@unl.edu"; //Contact person who is collecting data
$sendToEmailBackup = "sdoe2@unl.edu"; //Backup contact, set to NULL if not wanted
$sendToEmailBackup2 = "wdoe2@unl.edu"; //2nd Backup contact, set to NULL if not wanted
$sendToEmailDev= "appdev1@unl.edu"; //Application developer as a backup
$sendFromEmail = $sendToEmail; //Will send email from this address.
$emailSubject = "UNL Outdoor Event Space Request"; //Subject for the email.
$emailSubject = "May 11, 2011 Terrex Drill"; //Subject for the email.
spl_autoload_register('myautoload');
require_once '../../../lib/php/UNL/WDN/Emailer/Main.php';
......@@ -7,94 +7,53 @@ if (file_exists(dirname(__FILE__).'/../../../config-landscape-outdoorevents.inc.
if (!empty($_POST)) {
$error_msg = '';
if (in_array($_POST['location'], array("lied","union","sheldon","wick"))) {
$error_msg .= 'This location\'s outdoor events are not arranged through Landscape Services. Please contact them directly. <a href="http://www.unl.edu/unlspecialevents">Contact info available here</a>';
}
if (($_POST['location'] == 'other' && empty($_POST['location_other'])) ||
empty($_POST['location']) || empty($_POST['begindate_month']) || empty($_POST['begindate_day']) ||
empty($_POST['enddate_month']) || empty($_POST['enddate_day']) ||
empty($_POST['title']) || empty($_POST['starttime_hour']) || empty($_POST['endtime_hour']) || empty($_POST['attendance']) ||
empty($_POST['name']) || empty($_POST['email']) || empty($_POST['streetaddress']) || empty($_POST['city']) || empty($_POST['state']) || empty($_POST['zip']) ||
empty($_POST['business']) || empty($_POST['weather']) || empty($_POST['agree'])
) {
if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['instructions']) || empty($_POST['release'])) {
$error_msg .= 'Please fill out all required fields';
}
if (empty($error_msg)) {
$mailer = new UNL_WDN_Emailer_Main();
$body = "<h3>Event Information</h3>";
if (!empty($_POST['location_other'])) {
$body .= "<strong>Location:</strong> " . $_POST['location_other'] . "<br/>";
} else {
$body .= "<strong>Location:</strong> " . $_POST['location'] . "<br/>";
}
$body .= "<strong>Begin Date:</strong> " . $_POST['begindate_month']."/".$_POST['begindate_day']."/".$_POST['begindate_year']. " ";
$body .= "<strong>End Date:</strong> " . $_POST['enddate_month']."/".$_POST['enddate_day']."/".$_POST['enddate_year']. "<br/>";
$body .= "<strong>Title of Event:</strong> " . $_POST['title'] . "<br/>";
$body .= "<strong>Description:</strong> " . $_POST['description'] . "<br/>";
$body .= "<strong>Start Time:</strong> " . $_POST['starttime_hour'].":".$_POST['starttime_minute']." ".$_POST['starttime_ampm']. " ";
$body .= "<strong>End Time:</strong> " . $_POST['endtime_hour'].":".$_POST['endtime_minute']." ".$_POST['endtime_ampm']. "<br/>";
$body .= "<strong>Expected Attendance:</strong> " . $_POST['attendance'] . "<br/>";
$body .= "<strong>Sponsor:</strong> " . $_POST['sponsor'] . "<br/>";
$body .= "<h3>Contact Information</h3>";
$body .= "<strong>Name:</strong> " . $_POST['name'] . "<br/>";
$body .= "<strong>Email:</strong> " . $_POST['email'] . "<br/>";
$body .= "<strong>Address:</strong> " . $_POST['streetaddress'] . "<br/>";
$body .= "<strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong> " . $_POST['city']." ".$_POST['state']." ".$_POST['zip']. "<br />";
$body .= "<strong>Daytime Phone:</strong> " . $_POST['business'] . "<br/>";
$body .= "<strong>Home Phone:</strong> " . $_POST['home'] . "<br/>";
$body .= "<strong>Fax:</strong> " . $_POST['fax'] . "<br/>";
$body .= "<h3>Additional Event Requests</h3>";
$body .= "<strong>Recycling Containers:</strong> " . $_POST['recycle_number'] . "<br/>";
$body .= "<strong>Litter Containers:</strong> " . $_POST['litter_number'] . "<br/>";
$body .= "<strong>Picnic Tables:</strong> " . $_POST['picnic_number'] . "<br/>";
if (isset($_POST['electricity'])) {
$body .= '<strong>Electricity Hookup:</strong> <font color="#8B4513">Please contact Building Systems Maintenance at 402-472-1550</font><br/>';
}
$body = '<h3>Thank you for your interest in volunteering for the May 11th Statewide Emergency Drill.</h3>';
$body .= '
<ul>
<li>Image Release<br />
You will need to <a href="http://go.unl.edu/terrex11/Image_Release.pdf">complete and sign this form</a> - and return to my office <u>no later than May 5th</u>.<br />
My campus mailing address is: Beth Benson, 313 Canfield/Admin; 68588-0429
</li>
<li><a href="http://go.unl.edu/terrex11/Volunteer_Briefing.pdf">Role Player Instructions</a> - please review and let me know if you have any questions</li>
<li><a href="http://go.unl.edu/terrex11/Parking_Map.pdf">Map of the campus</a> notating - parking (if needed) and Bessey Hall where we will meet at 7:00 a.m. on May 11th</li>
</ul>
<p>
Thank you for volunteering for this exercise. Your time and efforts are greatly appreciated.
</p>
<p>
Beth Benson<br />
<a href="mailto:bbenson2@unl.edu">bbenson2@unl.edu</a>
</p>
$body .= "<h3>Other Information</h3>";
$body .= "<strong>Bad Weather Contingency:</strong> " . $_POST['weather'] . "<br/>";
$body .= "<strong>Additional Comments:</strong> " . $_POST['comments'] . "<br/>";
$body .= "<p>This email was sent from:" . $url . "</p>";
Note: In the unforeseen event that the Statewide Emergency Drill is cancelled we will publish notification on the <a href="http://www.unl.edu/ucomm/unltoday/">UNL website</a>. Accordingly, if no further notification is posted, the exercise will proceed as scheduled. Those participating in the Drill as either role players or volunteers are encouraged to check the website the evening of May 10th.
';
// Setup and send email to requestor
$note = "<p>Note: This request does not confirm/reserve access to the space. We will contact you as to availability.</p>";
$mailer->html_body = $note.$body;
$mailer->html_body = $body;
$mailer->to_address = $_POST['email'];
$mailer->from_address = $sendFromEmail;
$mailer->subject = $emailSubject;
$mailer->send();
// Add the attachment for internal emails
$mailer->attachment['file'] = $csv;
$mailer->attachment['c_type'] = 'text/csv';
$mailer->attachment['name'] = 'newevent.csv';
$mailer->attachment['isfile'] = false;
/*
// Setup email for UNL staff recipients
$mailer->html_body = $body;
$mailer->from_address = $_POST['email'];
// Send to head of Landscape Services
// Send to head person
$mailer->to_address = $sendToEmail;
$mailer->send();
// Send to backup contact
if (!empty($sendToEmailBackup)) {
$mailer->to_address = $sendToEmailBackup;
$mailer->send();
}
// Send to 2nd backup contact
if (!empty($sendToEmailBackup2)) {
$mailer->to_address = $sendToEmailBackup2;
$mailer->send();
}
// Send another copy to the developer as a backup
$mailer->to_address = $sendToEmailDev;
$mailer->send();
*/
// Redirect to thank you page
header('Location: thankyou.php');
exit();
......@@ -204,7 +163,7 @@ $page->maincontentarea .= <<<EOF
Return completed form to Beth Benson, 313 Canfield/Admin; 68588-0429</li>
<li>Report to Bessey Hall at 7:00 am on May 11th. (<a href="Parking_Map.pdf">Parking Map</a>)</li>
</ol>
<p>Note: In the unforseen event that the Statewide Emergency Drill is cancelled we will publish notification on the <a href="http://www.unl.edu/ucomm/unltoday/">UNL website</a>. Accordingly, if no further notification is posted, the exercise will proceed as scheduled. Those participating in the Drill as either role players or volunteers are encouraged to check the <a href="http://www.unl.edu/ucomm/unltoday/">website</a> the evening of May 10th.</p>
<p>Note: In the unforeseen event that the Statewide Emergency Drill is cancelled we will publish notification on the <a href="http://www.unl.edu/ucomm/unltoday/">UNL website</a>. Accordingly, if no further notification is posted, the exercise will proceed as scheduled. Those participating in the Drill as either role players or volunteers are encouraged to check the <a href="http://www.unl.edu/ucomm/unltoday/">website</a> the evening of May 10th.</p>
</div>
<br />
<form class="zenform neutral" action="?" method="post">
......
<?php
set_include_path(dirname(dirname(dirname(dirname(__FILE__)))).'/lib/php/'.PATH_SEPARATOR.get_include_path());
require_once 'UNL/Templates.php';
$page = UNL_Templates::factory('Fixed');
$page->doctitle = '<title>UNL | Emergency Planning and Preparedness | Terrex11</title>';
//$page->head .= file_get_contents('http://emergency.unl.edu/sharedcode/localSiteLinks.html');
$page->navlinks = file_get_contents('http://emergency.unl.edu/sharedcode/navigation.html');
$page->footercontent = file_get_contents('http://emergency.unl.edu/sharedcode/footer.html');
$page->leftcollinks = file_get_contents('http://emergency.unl.edu/sharedcode/relatedLinks.html');
$page->contactinfo = file_get_contents('http://emergency.unl.edu/sharedcode/footerContactInfo.html');
$page->breadcrumbs = '<ul>
<li><a href="http://www.unl.edu/">UNL</a></li>
<li><a href="http://emergency.unl.edu/">Emergency Planning and Preparedness</a></li>
<li>Terrex11</li>
</ul>';
$page->titlegraphic = '<h1>Statewide Emergency Drill Registration</h1>';
$page->pagetitle = '<h2>May 11, 2011 Terrex Drill</h2>';
$page->maincontentarea = <<<EOF
<h3>Thank you for registering, an email has been sent to you with a recap of the event and instructions.</h3>
<p>Please contact <a href="mailto:bbenson2@unl.edu">bbenson2@unl.edu</a> with any questions.</p>
EOF;
echo $page->toHtml();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment