<?php
	$db_name = "systems";
	$table_name = "sacTEST";
  
	$today="";
	$FLName = $_POST['FLName'];
	$connection = @mysql_connect("libitdb.lang.uc.edu", "phpadmin", "25or624")
		or die("Couldn't connect to database server");

	$query= "SELECT * FROM $table_name WHERE (numkey='$FLName')";
	$db = @mysql_select_db($db_name, $connection)
		or die("Couldn't select database: $db_name");
	$result = @mysql_query($query, $connection)
		or die("Couldn't execute query. <p>$query</p>");

		while ($row = mysql_fetch_array($result)) {
			$LName = $row['LName'];
			$FName = $row['FName'];
			$auth = $row['auth'];
			$mailTo = $row['email'];
    	}
	$Nominee = $FName." ".$LName . " , you have been nominated to serve on the" . 
                       " Staff Advisory Committee for two years starting" .
                       " on January 1st." . "  To accept or decline this" .
                       " nomination, please click on the URL below" .
                       " before nidnight on October 15th." . 
                       "  When prompted, provide your authorization code." .
                       "  Your authorization code is " . $auth . "  Then" .
                       " click the ACCEPT button or the DECLINE button" .
                       "  Thank You." .
                       " http://ul.uc.edu/groups/SAC/elections/accept" ;

  $Message2 = "A message is being sent to " . $FName." ".$LName . " , you have been nominated to serve on the SAC Team." ;

//mail function 
// notify the person responsible
//$mailTo = "sac@mail.libraries.uc.edu"; 
$msgSubject = "SAC Nomination"; 
$msgBody = $Nominee;
$xHeaders = "From: sac@mail.libraries.uc.edu";

//	$mail_subj = "SAC Nomination";
//			$mail_text = $Nominee;
	//		$mail_header = "From: libhelp@uc.edu\r\n";
//			$mail_header .= "X-Mailer: server\r\n";
//			$mail_header .= "Reply To: libhelp@uc.edu\r\n";
	//		$sendmail_param = "libhelp@uc.edu";
	//		mail("$mailTo","$mail_subj","$mail_text","$mail_header","-f$sendmail_param");
			//echo"Sent";
			//echo "$mail_text";
// notify the requestor their help call has been received.
//mail ($mailTo, $msgSubject, $msgBody, $mail_header); 
mail ($mailTo, $msgSubject, $msgBody, $xHeaders); 
echo "
<html>
<head>
<title>SAC Nomination Result</title>
</head>
<body>

<h1 align=\"center\">Thank you for your nomination.</h1>
<center>
<p>$Message2</p>

</body>
</html>
";

?>
