<?php 
session_start();
/*
 * Authors/seedetailsAuthor.php
 * 
 * Copyright 2009, 2018 Pedro Quaresma <pedro@mat.uc.pt>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */

require_once('../servidor.php');

$pUtilizador = $_SESSION['utilizador'];
$pSenha = $_SESSION['senha'];
$pTipoUtilizador = $_SESSION['tipoUtilizador'];
if ($pTipoUtilizador=="anonymous" || $pTipoUtilizador=="regular") {// separa por tipo de utilizador
  require($entradaFILE.'headerUsers.php');
  require($entradaFILE.'menuUsers.php');
} 
else {
  require($entradaFILE.'headerAdmins.php');
  require($entradaFILE.'menuAdmins.php');
}
?>



<?php
require($entradaFILE.'dbLogin.php');


echo "<hr/>\n";

?>


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

<hr/>

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

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

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


$linha = mysqli_fetch_assoc($resultado);

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


echo "<!-- ficha -->";
echo "<table width='100%' bgcolor='white' cellpadding='4' cellspacing='4'>";
echo "<tr>";
echo "<td width='100%' colspan='4' align='center'><span class='titulo'>Prover/Drawer Author Info</span></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'>$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'><span class='entrada'>$pAffiliation</span></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'><a href='$pURL'>$pURL</a></span></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left' width='25%'><span class='ficha'>Electronic Address</span></td>";
echo "<td width='75%' colspan='3'><span class='entrada'>$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'>$pDateSubmission</span></td>";
echo "<td width='50%' colspan='2'>&nbsp;</td>";
echo "</tr>";
echo "</table>";

?>

<hr/>

<?php
   require($entradaFILE.'footer.php');
?>
