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

Start of the Terrex11 webform

parent 56c5b32d
No related branches found
No related tags found
No related merge requests found
<?php
ini_set('display_errors',true);
// Sample configuration file for the ucomm webforms project
set_include_path(dirname(__FILE__).'/lib/php/'.PATH_SEPARATOR.get_include_path());
/*
$con = mysql_connect("localhost","test","test");
if (!$con){
die('Could not connect: ' . mysql_error());
}else{
mysql_select_db("police_terrex11", $con);
}
*/
function myautoload($class)
{
$file = str_replace('_', '/', $class).'.php';
require_once $file;
}
$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.
spl_autoload_register('myautoload');
require_once '../../../lib/php/UNL/WDN/Emailer/Main.php';
This diff is collapsed.
File added
File added
<?php
if (file_exists(dirname(__FILE__).'/../../../config-landscape-outdoorevents.inc.php')) {
require_once dirname(__FILE__).'/../../../config-landscape-outdoorevents.inc.php';
} else {
require_once dirname(__FILE__).'/../../../config-landscape-outdoorevents.sample.php';
}
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'])
) {
$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>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>";
// 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->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
$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();
}
}
//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->head .= <<<EOF
<script type="text/javascript">
//<![CDATA[
WDN.jQuery(document).ready(function($){
WDN.initializePlugin('zenform');
WDN.initializePlugin('notice');
});
//]]>
</script>
<style type="text/css">
#maincontent .infoBox {
box-shadow:0 2px 3px #999999;
-moz-box-shadow:0 2px 3px #999999;
-webkit-box-shadow:0 2px 3px #999999;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.46, rgb(176,218,237)),
color-stop(0.6, rgb(201,228,242))
);
background-image: -moz-linear-gradient(
center bottom,
rgb(176,218,237) 46%,
rgb(201,228,242) 60%
);
background-color:#c9e4f2;
border:1px solid #DCDCDC;
font-size:1.1em;
margin-bottom:20px;
padding:20px 40px 10px;
position:relative;
font-family:ShinnBold,"Trebuchet MS",Tahoma,Arial,sans-serif;
color:#333333;
}
#maincontent .infoBox h3 {
line-height:1.3em;
margin-bottom:10px;
font-family:ShinnBold,"Trebuchet MS",Tahoma,Arial,sans-serif;
color:#555555;
}
#maincontent .infoBox#location_message {
background: #ac0302;
color: #ffffff;
}
#maincontent .infoBox#location_message h3 {
color: #fff;
}
#maincontent .infoBox#location_message a {
color: #fff;
text-decoration: underline;
}
</style>
EOF;
$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 = '';
if (isset($error_msg) && !empty($error_msg)) {
$page->maincontentarea .= <<<EOF
<div class="wdn_notice alert">
<div class="close">
<a href="#" title="Close this notice">Close this notice</a>
</div>
<div class="message">
<h4>Error</h4>
<p>{$error_msg}</p>
</div>
</div>
EOF;
}
$page->maincontentarea .= <<<EOF
<div class="three_col left">
<div class="infoBox">
<h3>Thank you for your interest in volunteering!</h3>
<p>Please follow these steps:</p>
<ol>
<li>Review the <a href="Volunteer_Briefing.pdf">Role Player Instructions</a> and contact <a href="mailto:bbenson2@unl.edu">bbenson2@unl.edu</a> with any questions.</li>
<li>Please let us know if you plan to participate by submitting the form below.</li>
<li>Also, you <strong>must</strong> complete and sign this <a href="Image_Release.pdf">image release form</a> - and return no later than May 5th.<br />
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>
</div>
<br />
<form class="zenform neutral" action="?" method="post">
<fieldset>
<legend>Registration</legend>
<ol>
<li>
<label for="name">
<span class="required">*</span>
Your Name
</label>
<input type="text" id="name" name="name" />
</li>
<li>
<label for="email">
<span class="required">*</span>
Email
</label>
<input type="text" id="email" name="email" />
</li>
<li>
<fieldset>
<legend>
<span class="required">*</span>
I have reviewed the <a href="Volunteer_Briefing.pdf" target="_blank">Role Player Instructions</a>
</legend>
<ol>
<li>
<input type="checkbox" id="instructions" name="instructions" />
<label for="instructions">Yes</label>
</li>
</ol>
</fieldset>
</li>
<li>
<fieldset>
<legend>
<span class="required">*</span>
I will submit my signed <a href="Image_Release.pdf" target="_blank">Image Release Form</a> no later than <strong>May 5th</strong>
</legend>
<ol>
<li>
<input type="checkbox" id="release" name="release" />
<label for="release">Yes</label>
</li>
</ol>
</fieldset>
</li>
</ol>
</fieldset>
<input type="submit" name="submit" value="Submit" id="submit" />
</form>
</div>
<div class="col right">
<div class="zenbox neutral">
<h3>Links</h3>
<ul>
<li><a href="http://police.unl.edu/">UNL Police</a></li>
<li><a href="http://emergency.unl.edu/">UNL Emergency Preparedness</a></li>
</ul>
</div>
</div>
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