diff --git a/www/landscape/outdoorevents/index.php b/www/landscape/outdoorevents/index.php index dfd0406ba3c2c3e8fc8c5e33762553c08068ae44..2a3e87f597632f32e97c7077466ae5ff61d707cb 100644 --- a/www/landscape/outdoorevents/index.php +++ b/www/landscape/outdoorevents/index.php @@ -5,68 +5,85 @@ if (file_exists(dirname(__FILE__).'/../../../config-landscape-outdoorevents.inc. require_once dirname(__FILE__).'/../../../config-landscape-outdoorevents.sample.php'; } if (!empty($_POST)) { - $mailer = new UNL_WDN_Emailer_Main(); + $error_msg = ''; - $body .= "<h3>Event Information</h3>"; - if (isset($_POST['location_other'])) { - $body .= "<strong>Location:</strong> " . $_POST['location_other'] . "<br/>"; - } else { - $body .= "<strong>Location:</strong> " . $_POST['location'] . "<br/>"; + if (in_array($_POST['location'], array("lied","union","meier","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>'; } - $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> </strong> " . $_POST['city']." ".$_POST['state']." ".$_POST['zip']. "<br />"; - $body .= "<strong>Business 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 ($_POST['electricity']) { - $body .= '<strong>Electricity Hookup:</strong> <font color="#8B4513">Please contact Building Systems Maintenance at 402-472-1550</font><br/>'; + 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']) + ) { + $error_msg .= 'Please fill out all required fields'; } - $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 = "<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(); - - - $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; + if (empty($error_msg)) { + $mailer = new UNL_WDN_Emailer_Main(); + + $body .= "<h3>Event Information</h3>"; + if (isset($_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> </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 ($_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>"; + + $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(); + + + $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 another copy to the developer as a backup + $mailer->to_address = $sendToEmailDev; + $mailer->send(); + header('Location: thankyou.php'); + exit(); } - // Send another copy to the developer as a backup - $mailer->to_address = $sendToEmailDev; - $mailer->send(); - header('Location: thankyou.php'); - exit(); } //set_include_path(dirname(dirname(dirname(dirname(__FILE__)))).'/lib/php/'.PATH_SEPARATOR.get_include_path()); @@ -80,6 +97,7 @@ $page->head .= <<<EOF //<![CDATA[ WDN.jQuery(document).ready(function($){ WDN.initializePlugin('zenform'); + WDN.initializePlugin('notice'); $('#location').change(function() { if ($(this).val() == 'lied' || $(this).val() == 'union' || @@ -217,7 +235,23 @@ $page->breadcrumbs = '<ul> </ul>'; $page->titlegraphic = '<h1>Landscape Services</h1>'; $page->pagetitle = '<h2>Outdoor Event Space Request</h2>'; -$page->maincontentarea = <<<EOF +$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"> @@ -471,7 +505,7 @@ $page->maincontentarea .= <<<EOF <li style="clear:left;float:left"> <label for="business"> <span class="required">*</span> - Business Phone + Daytime Phone </label> <input type="text" id="business" name="business" /> </li>