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

Add a config file for Landscape form, start work on sending the email

parent 0c9273ce
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("landscape_outdoorevents", $con);
}
*/
function myautoload($class)
{
$file = str_replace('_', '/', $class).'.php';
require_once $file;
}
$sendToEmail = ""; //Will send form data to this email address.
$sendFromEmail = "no-reply@ucommxsrv1.unl.edu"; //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';
<?php
set_include_path(dirname(dirname(dirname(dirname(__FILE__)))).'/lib/php/'.PATH_SEPARATOR.get_include_path());
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)) {
$mailer = new UNL_WDN_Emailer_Main();
$body .= "<strong>Name:</strong> " . $_POST['name'] . "<br/>";
$body .= "<strong>Phone Number:</strong> " . $_POST['phone'] . "<br/>";
$body .= "<strong>Email Address:</strong> " . $_POST['email'] . "<br/>";
$body .= "<strong>URL to video:</strong> " . $_POST['video'] . "<br/>";
$body .= "<strong>Type:</strong> " . $_POST['type'] . "<br/>";
$body .= "<strong>Proposal:</strong><br/>" . $_POST['proposal'] . "<br/>";
$mailer->html_body = $body;
$mailer->to_address = $sendToEmail;
$mailer->from_address = $sendFromEmail;
$mailer->subject = $emailSubject;
$mailer->send();
// Send another copy to the UNL WDN address, as a backup.
$mailer->to_address = 'ericrasmussen1@gmail.com';
$mailer->send();
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');
......@@ -104,6 +131,7 @@ color:#555555;
}
</style>
EOF;
$page->navlinks = file_get_contents('http://www.unl.edu/landscape/sharedcode/navigation.html');
$page->footercontent = file_get_contents('http://www.unl.edu/landscape/sharedcode/footer.html');
$page->leftcollinks = file_get_contents('http://www.unl.edu/landscape/sharedcode/relatedLinks.html');
......@@ -123,7 +151,8 @@ $page->maincontentarea = <<<EOF
<h3>Thanks for your interest in holding your event at UNL!</h3>
<p>Please note the following:</p>
<ul>
<li>This form pertains to <strong><em>outdoor spaces</em></strong> that are managed by Landscape Services. For other spaces on campus visit <a href="http://www.unl.edu/unlspecialevents">UNL Special Events</a></li>
<li>This form pertains to <strong><em>outdoor spaces</em></strong> that are managed by Landscape Services.<br />
For other spaces on campus visit <a href="http://www.unl.edu/unlspecialevents">UNL Special Events</a></li>
<li>Student organizations should <strong><em>not</em></strong> use this form but should contact <a href="http://involved.unl.edu/">Student Involvement</a></li>
<li>This is a request form, your submission does not confirm/reserve access to the space. We will contact you as to availability.</li>
</ul>
......@@ -141,12 +170,12 @@ $page->maincontentarea = <<<EOF
<select name="location" id="location">
<option value="none"></option>
<option value="lied">Lied Center Plaza</option>
<option value="love">Love (Library) Memorial Garden</option>
<option value="love">Love Library Memorial Garden</option>
<option value="maxwell">Maxwell Arboretum</option>
<option value="union">Nebraska Union Plaza</option>
<option value="meier">Nebraska Union Meier Commons</option>
<option value="porch">The Porch (East Campus)</option>
<option value="sheldon">Sheldon Memorial Art Gallery & Sculpture Garden</option>
<option value="sheldon">Sheldon Memorial Art Gallery &amp; Sculpture Garden</option>
<option value="wick">Wick Alumni Center and Holling Garden</option>
<option value="other">Other...</option>
</select>
......
thank you
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment