<html>
<head>
<title>Staff Advisory Committee Nomination Letter</title>
</head>
<body>

<?php
	$dbserver = 'libitdb.lang.uc.edu';
	$dbuser = 'phpadmin';
	$dbpass = '25or624';
	$db = 'systems';
	$sqlConn = @mysql_connect($dbserver, $dbuser, $dbpass) or die("Couldn't connect to server");
	$dbConn = @mysql_select_db($db, $sqlConn) or die("Couldn't select database: $db");
	
	$sql_vote = "SELECT LName,FName, auth, email FROM sacTEST ORDER BY LName";
	$vote_result = @mysql_query($sql_vote, $sqlConn) or die("Couldn't execute query. $sql_vote");
	
	while ($row = mysql_fetch_array($vote_result))
	{
		$fname = $row['FName'];
		$lname = $row['LName'];
		$auth = $row['auth'];
		$email = $row['email'];
		$mail_to = $email;
		$mail_subj = "Staff Advisory Committee Nominations.";
		$mail_text = "The time of year has come to elect new members to serve " .
       "you on the Staff Advisory Committee.  This year nominations " .
       "will be taken between October 20th and October 24th. \n" .
		   "Voting will be done between October 25th and October 31st.\n" .
		   " \n" .
       "The Committee communicates concerns of classified and " .
       "unclassified staff to the Dean; provides input as requested " .
       "on proposed policies and programs and shares information " .
       "accordingly with the staff at large. Members serve for two years\n" .
       " \n" .
  		 "To nominate a fellow staff member, please click on the link below.\n" .
 			 " \n" .
			 "Click here to nominate: http://ul.uc.edu/groups/SAC/elections/nominate \n" ;
  
	
		$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("$mail_to","$mail_subj","$mail_text","$mail_header","-f$sendmail_param");
	}
	echo"Mail sent successfully.";

?>
</body>
</html>
