<html>
<head>
<title>Staff Advisory Committee Strategic Plan Representative 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 LName, FName, 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))
	{
		$lname = $row['LName'];
		$fname = $row['FName'];
		$auth = $row['auth'];
		$email = $row['email'];
		$mail_to = $email;
		$mail_subj = "ATTENTION: REVOTE Staff Advisory Committee for Strategic Plan Representative Election Ballot.";
		$mail_text = "Staff, \n\n Due to an error in the dates sent out in the previous emails.  There were some omissions to the candidate list.  We will need to re-vote.  I greatly appreciate your understanding.\n\n
		
		Thomas \n
		IT Analyst\n\n
		
		It is time to vote for SAC Strategic Plan Representative.  You may vote for one of the nominated staff members between December 18th and December 23rd.  Voting ends at midnight on December 23rd.\n" .
		             "\n" .
                 "The Staff Advisory Committee seeks only one representative. \n" .
			           "\n" .
			           "The opening is for a full one year term and will be filled by the top nominee who receives the highest number of votes. \n" .
								 "\n" . 
		             "You may only vote once.  So, 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:  " . $lname.",". $fname . " \n" .
                 "Your Auth Code is:  " . $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>
