<html>
  <head>
    <link rel="stylesheet" href="../estils/hoja.css" type="text/css">
    <title>Personal</title>
  </head>

  <body leftmargin="0" topmargin="0" bgcolor="#8F0000">
    <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
      <tr>
        <!-- Menú dret -->
        <td align="left" valign="top" width="100" bgcolor="#4F0000">
          <?php include("../menu.inc") ?>
        </td>

        <!-- Capçalera -->
        <td align="left" valign="top" width="100%" class="centered">
        <h2>Departament d'Enginyeria Informàtica i Matemàtiques</h2>
        <img src="images/separador.gif"><br>
        <br><center><?php include("../language.inc"); ?></center><br>
        <div align="left"><blockquote>
        <h2><?php echo $text[PersonalLlistat]; ?></h2>
        <!-- Començament del cos -->
        <?php require("../private/connect.inc");
              require("../private/func-personal.inc");
              $link=Conectar();
              if ($_GET["order"]==1) {
                $result=mysql_query("SELECT * FROM personal ORDER BY area", $link);
              } else {
                $result=mysql_query("SELECT * FROM personal ORDER BY nom", $link);
              }
              echo("<table border=\"0\" width=\"90%\" align=\"left\">");
              echo("<tr bgcolor=black><td><b><a href=\"llistat.php?order=0\">".$text[Nom]."</a></b></td><td><b>".$text[Despatx]."</b></td>
              </td><td><b><a href=\"llistat.php?order=1\">".$text[Area]."</a></b></td></tr>");
              while($row = mysql_fetch_array($result)){
                $id = $row["id"];
                echo("<tr><td align=\"left\"> <div align=\"left\">" .
                htmlspecialchars($row["nom"]) . "</td>" );
                printf("<td>%s</td>", htmlspecialchars($row["despatx"]));
                printf("<td>%s</td>", area($row["area"]));
                echo("<td><form action=\"veure.php\" method=\"get\"><input
                      type=\"hidden\" name=\"id\" value=\"$id\">");
                echo("<input type=\"image\" border=0 src=\"images/".$lang."/veure.jpg\"></form></td></tr>");
              }
              mysql_free_result($result);
              mysql_close($link);
              if ($_GET["order"]==1) {
                echo "<tr><td><br><br>&nbsp;&nbsp;<a href=\"print.php?order=1\"><img src=\"images/".$lang."/imprimir.jpg\"
                border=0></a></td></tr>";
              } else {
                echo "<tr><td><br><br>&nbsp;&nbsp;<a href=\"print.php?order=0\"><img src=\"images/".$lang."/imprimir.jpg\"
                border=0></a></td></tr>";
              }
        ?>
        <td colspan="5"><br><input type="image" onClick="history.go(-1)"
        src="images/<?php echo $lang . "/"; ?>tornar.jpg"></form><br><br></td>
        </table>
        </blockquote></div>
        </td>
      </tr>
    </table>
  </body>
</html>

