<?php
	$db_name = "systems";
	$table_name = "sacREP";
  
	$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'];
			$mailTo2 = $row['email'];
    	}
	$Nominee = $FName." ".$LName . " , you have been nominated to serve on the" . 
                       " Strategic Planning Committee for one year starting" .
                       " on January 1st." . "  To accept or decline this" .
                       " nomination, please click on the URL below" .
                       " before midnight on December 9th." . 
                       "  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_rep/accept" ;

  $Message2 = "A message is being sent to " . $FName." ".$LName . " , you have been nominated to serve on the Strategic Planning Committe as the SAC Representative." ;

//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_header = "From: sac@mail.libraries.uc.edu\r\n";
		$mail_header .= "X-Mailer: server\r\n";
		$mail_header .= "Reply To: sac@mail.libraries.uc.edu\r\n";
		$sendmail_param = "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("$mailTo2","$mail_subj","$mail_text","$mail_header","-f$sendmail_param");
			//echo"Sent";
			//echo "$mail_text";
// notify the requestor their help call has been received.
mail("$mailTo2","$msgSubject","$msgBody","$mail_header","-f$sendmail_param");
//mail ($mailTo2, $msgSubject, $msgBody, $mail_header); 
echo "
<html>
<head>
<title>Strategic Planning Representative Nomination Result</title>
</head>
<body>

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

</body>
</html>
";

?>
