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

Add logic for select box; Change from/to config for email

parent ddbf897a
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,10 @@ function myautoload($class)
require_once $file;
}
$sendToEmail = "jdoe1@unl.edu";
$sendToEmailDev= "appdev1@unl.edu";
$sendFromEmail = "no-reply@ucommxsrv1.unl.edu"; //Will send email from this address.
$sendToEmail = "jdoe1@unl.edu"; //Contact person who is collecting data
$sendToEmailBackup = "sdoe2@unl.edu"; //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');
......
......@@ -7,8 +7,12 @@ if (file_exists(dirname(__FILE__).'/../../../config-landscape-outdoorevents.inc.
if (!empty($_POST)) {
$mailer = new UNL_WDN_Emailer_Main();
$body .= "<h5>Event Information</h5>";
$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/>";
......@@ -18,7 +22,7 @@ if (!empty($_POST)) {
$body .= "<strong>Expected Attendance:</strong> " . $_POST['attendance'] . "<br/>";
$body .= "<strong>Sponsor:</strong> " . $_POST['sponsor'] . "<br/>";
$body .= "<h5>Contact Information</h5>";
$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/>";
......@@ -27,12 +31,12 @@ if (!empty($_POST)) {
$body .= "<strong>Home Phone:</strong> " . $_POST['home'] . "<br/>";
$body .= "<strong>Fax:</strong> " . $_POST['fax'] . "<br/>";
$body .= "<h5>Event Requirements</h5>";
$body .= "<h3>Event Requirements</h3>";
$body .= "<strong>Litter Containers:</strong> " . $_POST['litter_number'] . "<br/>";
$body .= "<strong>Picnic Tables:</strong> " . $_POST['picnic_number'] . "<br/>";
$body .= "<strong>Electricity Hookup:</strong> " . $_POST['electricity'] . "<br/>";
$body .= "<h5>Other Information</h5>";
$body .= "<h3>Other Information</h3>";
$body .= "<strong>Bad Weather Contingency:</strong> " . $_POST['weather'] . "<br/>";
$body .= "<strong>Additional Comments:</strong> " . $_POST['comments'] . "<br/>";
......@@ -42,9 +46,17 @@ if (!empty($_POST)) {
$mailer->from_address = $sendFromEmail;
$mailer->subject = $emailSubject;
$mailer->send();
$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();
......@@ -61,8 +73,27 @@ $page->head .= file_get_contents('http://www.unl.edu/landscape/share
$page->head .= <<<EOF
<script type="text/javascript">
//<![CDATA[
WDN.jQuery(document).ready(function(){
WDN.jQuery(document).ready(function($){
WDN.initializePlugin('zenform');
$('#location').change(function() {
if ($(this).val() == 'lied' ||
$(this).val() == 'union' ||
$(this).val() == 'meier' ||
$(this).val() == 'sheldon' ||
$(this).val() == 'wick') {
$('#location_message').show();
$('#location_other_li').hide();
$('#submit').hide();
} else if ($(this).val() == 'other') {
$('#location_message').hide();
$('#location_other_li').show();
$('#submit').show();
} else {
$('#location_message').hide();
$('#location_other_li').hide();
$('#submit').show();
}
});
});
//]]>
</script>
......@@ -126,6 +157,7 @@ width:120px;
#maincontent .infoBox {
box-shadow:0 2px 3px #999999;
-moz-box-shadow:0 2px 3px #999999;
-webkit-box-shadow:0 2px 3px #999999;
background-image:-moz-linear-gradient(
......@@ -155,6 +187,22 @@ 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;
}
/* THINGS TO HIDE ON LOAD */
#location_message, #location_other_li {
display: none;
}
</style>
EOF;
......@@ -206,6 +254,18 @@ $page->maincontentarea = <<<EOF
<option value="other">Other...</option>
</select>
</li>
<li id="location_message" class="infoBox">
<h3>NOTICE</h3>
<p>This location's outdoor events are not arranged through Landscape Services.</p>
<p>Please contact them directly. <a href="http://www.unl.edu/unlspecialevents">Contact info available here</a></p>
</li>
<li style="clear:left" id="location_other_li">
<label for="location_other">
<span class="required">*</span>
Please specify location:
</label>
<input type="text" id="location_other" name="location_other" />
</li>
<li style="float:left">
<label for="begindate_month">
<span class="required">*</span>
......@@ -502,7 +562,7 @@ $page->maincontentarea .= <<<EOF
</li>
</ol>
</fieldset>
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="submit" value="Submit" id="submit" />
</form>
</div>
<div class="col right">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment