  <head>
    <link rel="stylesheet" href="../estils/hoja.css" type="text/css">
    <title>Llistat de tesis</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>
        <!-- Començament del cos -->
        <?php require("../private/connect.inc");
              require("../private/func.inc");

                $lang = $_COOKIE["lang"];
                if ($lang=="es") {
                  $taula ="tesis_es";
                } else if ($lang=="en") {
                  $taula ="tesis_en";
                } else {
                  $taula ="tesis";
                  $lang="cat";
                }
              echo "<h2>".$text[TitolTesis]."</h2>";

              $link=Conectar();
              $result=mysql_query("SELECT tid,titol,id1,id2,id3 FROM $taula", $link);
              echo("<table border=\"0\" width=\"90%\" align=\"left\">");
              echo("<tr bgcolor=\"#4f0000\"><td><b>".$text[Titol]."</b></td><td><b>Director</b></td></tr>");
              while($row = mysql_fetch_array($result)){
                $tid = $row["tid"];
                echo("<tr><td align=\"left\"> <div align=\"left\">" . htmlspecialchars($row["titol"]) . "</td>" );
                // Obtenim el directors, si algun es 0 vol dir que no te cap assignat
                $id1=htmlspecialchars(nom($row["id1"]));
                $id2=" <br> " . htmlspecialchars(nom($row["id2"]));
                if ($id2==" <br> 0") $id2="";
                $id3=" <br> " . htmlspecialchars(nom($row["id3"]));
                if ($id3==" <br> 0") $id3="";
                printf("<td><br>%s %s %s</b>&nbsp;&nbsp;&nbsp;</td>",
                $id1, $id2,$id3);

                echo("<td><form action=\"veure.php\" method=\"get\"><input
                      type=\"hidden\" name=\"tid\" value=\"" . htmlspecialchars($tid) ."\">");
                echo("<input type=\"image\" border=0 src=\"images/". $lang . "/veure.jpg\"></form></td></tr>");
              }
              mysql_free_result($result);
        ?>
        <td><br><input type="image" onClick="history.go(-1)" src="images/<?php echo $lang . "/"; ?>tornar.jpg"></td>
        </table>
        </blockquote></div>
        </td>
      </tr>
    </table>
  </body>
</html>

