<?
if(!isset($_SERVER['PHP_AUTH_USER'])){
   Header("WWW-Authenticate: Basic realm=\"GLOBEC Admin\"");
   Header("HTTP/1.0 401 Unauthorized");
   echo "Why did you hit the cancel button\n";
   exit;
}
else{
   $user_passwords = array (
      // user1 is the login name and password1
      // is that users password. Add as many
      // lines as you like.
      "usglobec" => "prsw07",
      "llagle" => "globec",
      "mgazzale" => "globec",
      "dale" => "globec",
      "arango" => "bluesun2"
      );

   if (($_SERVER['PHP_AUTH_USER'] == "") || ($_SERVER['PHP_AUTH_PW'] == "")){
      Header("WWW-Authenticate: Basic realm=\"GLOBEC Admin\"");
      Header("HTTP/1.0 401 Unauthorized");
      echo "Sorry, could not find your password!";
      exit;
   }
   else if (strcmp($user_passwords[$_SERVER['PHP_AUTH_USER']],$_SERVER['PHP_AUTH_PW']) == 0){}
   else{
      Header("WWW-Authenticate: Basic realm=\"GLOBEC Admin\"");
      Header("HTTP/1.0 401 Unauthorized");
      echo "Sorry, could not find your password!";
      exit;
   }
}

$pre   = '../../';
include  $pre . "common.php";
$title = "2007 US GLOBEC Pan-Regional Synthesis Workshop";
$logo  = false;
//include HEAD;

$t = array('m_p','t_a','t_p','w_a','w_p','th_a','th_p');
$query  = "SELECT * FROM workshops WHERE workshop='synth07' AND confirmed='Y' ORDER BY last";
$result = $db->sql_query($query);

$out = "<h1>2007 US GLOBEC Pan-Regional Synthesis Workshop Participant List</h1>\n <br />";

$out .= "<table border=\"1\">\n<tr>\n   <td>&nbsp;</td>\n   <td><b>Name</b></td>\n
   <td><b>Affiliation</b></td>\n   <td><b>E-mail</b></td>\n</tr>";

for($i=0;$row = $db->sql_fetchrow($result);$i++){
   $name  = stripslashes($row['last']) . ", " . stripslashes($row['first']);
   $affil = stripslashes($row['institution']);
   $email = '<a href="mailto:' . $row['email'] . '">' . $row['email'] . '</a>';
   $num   = $i+1;
   $out  .= "<tr>\n";
   $out  .= "   <td>$num</td>\n   <td>$name</td>\n   <td>$affil</td>\n   <td>$email</td>\n";
   $out .= "</tr>\n";
}

$out .= "</table>\n<br /><br />";

echo $out;

include FOOT;
?>
