 |
 |
 |
// form not yet submitted
// display initial form
$printform = true;
if (isset($_POST['submit']))
{
$Status = $_POST['status'];
$Name= $_POST['name'];
$Email= $_POST['email'];
$Servicearea = $_POST['servicearea'];
$Helpfulness = $_POST['helpfulness'];
$Friendliness = $_POST['friendliness'];
$Jobknowledge = $_POST['jobknowledge'];
$Servicequality = $_POST['servicequality'];
$Responsetime = $_POST['responsetime'];
$Professionalism = $_POST['professionalism'];
$Comments = $_POST['comments'];
// set up error list array
$errorList = array();
$count = 0;
//Validate Email Addresses
if (!isset($_POST['email']) || ($_POST['email'] == "")) {
$errorList[$count] = "Your e-mail address is required.";
$count++;
}
elseif (!preg_match("/^.+@.+\..+/", $_POST['email']))
{
$errorList[$count] = "Your e-mail address is invalid.";
$count++;
}
// check for errors
if (sizeof($errorList) == 0)
{
// if none found...email the info to office of public safety
/* to: */
// $to = 'tracy@mc.edu';
$to = 'sherman@mc.edu';
/* subject */
$subject = 'Office of Public Safety Online Survey';
/* message */
$message = "
Mississippi College - Office of Public Safety - Online Survey

Office of Public Safety Online Survey
Status: {$Status}
Name: {$Name}
E-mail: {$Email}
Service Area: {$Servicearea}
Helpfulness: {$Helpfulness}
Friendliness: {$Friendliness}
Job Knowledge: {$Jobknowledge}
Quality of Service: {$Servicequality}
Response Time: {$Responsetime}
Professionalism: {$Professionalism}
Comments: {$Comments}
";
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: MC Web Server \r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
echo "
Congratulations, Survey Sent! ";
echo "Click here to return to MC Office of Public Safety Home Page!
";
$printform = FALSE;
}
else
{
// errors found
// print as list
echo "Your message cannot be sent yet because of the following error(s). Please correct the error(s). ";
echo "";
}
}
if ($printform) {
?>
Office of Public Safety
Online Survey
It is important that we obtain feedback concerning the services
our Public Safety department provides to the MC campus. This will
help us to evaluate our personnel and services. Please take a few
moments to complete the following survey. Your input is valued
and will effect any future management decisions. Thank you for
your interest in the Mississippi College Office of Public Saftey.
|
Emergency calls should be made to the Public Safety Office
at x3911 or directly to the 911 operator.
|
|
 |