<?php // $Id: iInsertAuthor.php,v 1.1 2005/10/21 14:09:56 geothms Exp geothms $
session_start();
$pTipoUtilizador = $_SESSION['tipoUtilizador'];
if ($pTipoUtilizador=="anonymous" || $pTipoUtilizador=="regular") { // separa por tipo de utilizador
  require('headersubUsers.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');
?>



<center>
<h3 class="maketitle">Geometry Drawers, Insert/Update</h3>
</center>



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

<?php

// cria uma pesquisa
$sql = "SELECT drawerId,name,version
          FROM drawers
         WHERE not(name='No drawer selected')
      ORDER BY drawerId";
$resultado = mysql_query($sql,$ligacao);


// O números de campos obtidos
$ncampos =mysql_num_fields($resultado);
$nlinhas =mysql_num_rows($resultado);

echo "<center>";
echo "<h4 class='maketitle'>$nlinhas Geometry Drawers</h4>";
echo "</center>";


print "<p>&nbsp;</p>";
print "<center>";
print "<table border=1>\n";
print "<tr>\n";
print " <td colspan=5 STYLE='background:#efefef' align='right'><a href=insertDrawer.php>Insert a new Geometric Drawer</a></td>\n";
print "</tr>\n\n";
print "<tr>\n";
print "<th> Id </th><th> Name</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th>";
print "</tr>\n\n";
while ($linha = mysql_fetch_assoc($resultado)){
  print "<tr>\n";
  $pDrawerId=trim($linha['drawerId']);
  $pDrawerName=trim($linha['name']);
  $pDrawerVersion=trim($linha['version']);
  print " <td align=center>$pDrawerId</td>\n"; 
  print " <td>$pDrawerName, $pDrawerVersion</td>\n";
  print " <td>&nbsp;</td>\n";
  print " <td><a href=seedetailsDrawer.php?argumento=$pDrawerId>See details</a></td>\n";
  print " <td><a href=updateDrawer.php?argumento=$pDrawerId>update</a></td>\n";
  print"</tr>\n\n";
 }
print "</table>\n";
print "</center>";
print "<p>&nbsp;</p>";
?>




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