<?php // $Id: updateAuthor.php,v 1.1 2005/10/27 10:13:33 geothms Exp geothms $
session_start();
$pTipoUtilizador = $_SESSION['tipoUtilizador'];
if ($pTipoUtilizador=="anonymous" || $pTipoUtilizador=="regular") { // separa por tipo de utilizador
  require('headersubUsers.inc');
  require('menusubUsers.inc');
  echo "<meta http-equiv='refresh' content='0; url=../users.php' />";
  exit;  // os anonimos não têem acesso a esta página
}
else {
  require('headersubAdmins.inc');
  require('menusubAdmins.inc');
}
?>

<hr/>



<?php
require('loginsub.php');
?>


<center>
<h3 class="maketitle">Prover/Drawer Author Update</h3>
</center>

<hr/>

<?php
$argumento = $_GET['argumento'];

$sql = "SELECT authorId,name,affiliation,url,email,dateSubmission
          FROM authors
         WHERE authorId='$argumento'";

$resultado = mysql_query($sql,$ligacao);


$linha = mysql_fetch_assoc($resultado);

$pAuthorId       = $linha['authorId'];
$pName           = $linha['name'];
$pAffiliation    = $linha['affiliation'];
$pURL            = $linha['url'];
$pEmail          = $linha['email'];
$pDateSubmission = $linha['dateSubmission'];



echo "<form enctype='multipart/form-data' action='uUpdateAuthor.php' method='post'>";
// O valor de BibRefId tem de ser passado para o processador do
// formulário, embora como hidden.
echo "<input type='hidden' name='AuthorId' value='$pAuthorId'>";
echo "<!-- ficha -->";
echo "<table width='100%' bgcolor='white' cellpadding='4' cellspacing='4'>";
echo "<tr>";
echo "<td width='100%' colspan='4' align='center'>Prover/Drawer Author Info</td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>Name</span></td>";
echo "<td width='75%' colspan='3'><span class='entrada'><input type='text' name='Name' size='120' value='$pName'></span></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>Affiliation</span></td>";
echo "<td width='75%' colspan='3'><TEXTAREA NAME='Affiliation' ROWS='10' COLS='120'>$pAffiliation</TEXTAREA></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>URL</span></td>";
echo "<td width='75%' colspan='3'><span class='entrada'><input type='text' name='URL' size='120' value='$pURL'></span></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>Email</span></td>";
echo "<td width='75%' colspan='3'><span class='entrada'><input type='text' name='Email' size='120' value='$pEmail'></span></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>Date Submission</span></td>";
echo "<td width='25%'><span class='entrada'><input type='text' name='DateSubmission' size='12' value='$pDateSubmission'></span></td>";
echo "<td width='50%' colspan='2'>&nbsp;</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='100%' colspan='4' align='center'><input type='submit' value='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update info &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'></td>";
echo "</tr>  ";
echo "</table>";
echo "</form>";
?>

<hr/>

<?php
  require('footer.inc');
?>