<?php 
session_start();
/*
 * Provers/listingProvers.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');
}

// coloca o valor para a página de ajuda apropriada
$_SESSION['helpsection']='interaction';


?>


<center>
<h3 class="maketitle">Geometric Provers listing</h3>
</center>



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

<?php

// cria uma pesquisa
$sql = "SELECT proverId,name,version
          FROM provers";

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

$ncampos =mysqli_num_fields($resultado);


$linha = mysqli_fetch_assoc($resultado);

$pProverId       = $linha['proverId'];
$pName           = $linha['name'];
$pVersion        = $linha['version'];

// echo "<center>";
// echo "<h4 class='maketitle'>$nlinhas Geometric Provers</h4>";
// echo "</center>";


print "<p>&nbsp;</p>";
print "<center>";
print "<table border=1>\n";
print "<tr>\n";
print "<th> Prover Id</th><th> Name - Version</th><th>&nbsp;</th><th>&nbsp;</th>";
print "</tr>\n\n";

// Uma ideia é transformar isto num formulário em que o utilizador
// podia seleccionar os teoremas dos quais quereria ver os detalhes.

while ($linha = mysqli_fetch_assoc($resultado)){
  print "<tr>\n";
  $pProverId=trim($linha['proverId']);
  $pName=trim($linha['name']);
  $pVersion=trim($linha['version']);
  print " <td align=center>$pProverId</td>\n"; 
  print " <td>$pName - $pVersion</td>\n";
  print " <td>&nbsp;</td>\n";
  print " <td><a href=seedetailsProver.php?argumento=$pProverId>See details</a></td>\n";
  print"</tr>";
 }
print "</table>\n";
print "</center>";
print "<p>&nbsp;</p>";

?>




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