<?php
	$db_name = "systems";
	$table_name = "sacREP";

	//Create a connection
	$connection = @mysql_connect("libitdb.lang.uc.edu", "phpadmin", "25or624") or die("Couldn't connect to database server.");

	//Select a database
	$db = @mysql_select_db($db_name, $connection) or die("Couldn't select $db_name database ");

	//SQL statement
	$query = "SELECT numkey, LName, FName FROM $table_name ORDER BY LName" ;

	//execute SQL query and get result
	$sql_result = @mysql_query($query, $connection) or die ("Couldn't execute query. <p>$query</p>");

  if (!$sql_result) {
		echo "<p>couldn't get list! $sql_result</p>";
	}
	else
	{
		echo "

<HTML>
<HEAD>
<TITLE>Staff Advisory Committee for Strategic Planning Representative Voter Authentication</TITLE>
</HEAD>
<BODY>

<H1>Voter Authentication:</H1>
<p>Please select your name from the drop down box below and then enter the authentication code provided to you via email.</p>

<FORM METHOD=\"post\" ACTION=\"SAC_vote.php\">

  <TABLE CELLSPACING=\"3\" CELLPADDING=\"3\">
    <TR>
      <TD height=\"125\" VALIGN=TOP><P><STRONG>Staff Member's Name:</STRONG><BR>
          <select name=\"FLName\">
            <option selected value=\"\">Select <b>Your</b> Name.......</option>
			";
				while ($row = @mysql_fetch_array($sql_result)) {
					
					$numkey = $row['numkey'];
					$LName = $row['LName'];
					$FName = $row['FName'];
					$blank = " ";
					$FLName = $FName.$blank.$LName;
					echo "<option value=\"$numkey\">$FLName</option>";
					
				}
		echo "
          </select>
        <p>
				Enter Your Auth Code: <input type=\"text\" name=\"authtext\" size=15> 
        </p>
        <P>
          <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Submit Authentication\">
        </P></TD>
    </TR>
    <TR>
      <TD width=\"904\" height=\"125\" VALIGN=TOP> <P>&nbsp;
        </TD>
    </TR>
  </TABLE>
  
</FORM>

</BODY>
</HTML>
";
}
?>
