<html>
<head>
<title>Staff Advisory Committee Strategic Plan Representative Election Voting Letter Election Ballot</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 FName, LName, auth, email FROM sacREP 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'];
		$flname = $lname.",".$fname;
		$auth = $row['auth'];
		$email = $row['email'];
		$mail_to = $email;
		$mail_subj = "REMINDER: Staff Advisory Committee Planning Representative Election Ballot.";
		$mail_text = "Remember, you may vote for one of the nominated staff members until December 14th.  Voting ends at midnight on December 14th.\n" .
		             "\n" .
                 "If you have not yet voted, please take the time now.  It only takes a few minutes. \n" .
			           "\n" .
		             "Please be careful.  Even though the fact that you voted is recorded, the nominees you vote for are not.  Since the nominees you vote for are not recorded, there is no way to go back and redo your vote.  So, again, please vote carefully. \n" .
	  						 "\n" .
	               "Login Instructions: \n" .
                 "1. Select your Username from the drop down box of eligible voters. \n" .
                 "2. Enter Auth Code in the space provided. \n" .
                 "------------------------------------------- \n" .
                 "Your Username is:  " . $flname . " \n" .
                 "Your Auth Codeis:  " . $auth . " \n" .
								 " \n" .
								 "Click here to vote http://ul.uc.edu/groups/SAC/elections_rep/vote/ \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>
