<?php setcookie("login", $_COOKIE["login"] , time()+3600, "/", "deim.etse.urv.es", 1 ); ?>
<?php setcookie("sessio", $_COOKIE["sessio"] , time()+3600, "/", "deim.etse.urv.es", 1 ); ?>
<html>
  <head>
    <link rel="stylesheet" href="../estils/hoja.css" type="text/css">
    <title>Afegir tesi</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>
        <div align="left"><blockquote>

        <!-- Començament del cos -->
        <?php 
          require("../private/connect.inc");
          require("../private/ident.inc");
          require("../private/func.inc");
          ident();
      	  autoritzar($_COOKIE["login"], "tesis");
         ?>
        <h2>Administració Tesis: Afegir</h2>
        <form action="preview.php" method="post">
          <b>Títol:</b><br>
          <input name="titol" size="75" maxlength="100" type="text"><br><br>
          <b>Paraules clau:</b><br>
          <input name="keywords" size="75" maxlength="100" type="text"><br><br>
          <b>Assignatures relacionades:</b><br>
          <input name="assignatures_rel" size="75" maxlength="100" type="text"><br><br>
          <b>Director 1:</b><br>
          <select name="id1">
          <?php
            $link=Conectar();
            $result=mysql_query("SELECT nom FROM personal ORDER BY nom");
            // Si nomes pot modificar les seves tesis, al afegir una tesis ell ha de ser 1
            // dels directors
            if (permis($_COOKIE["login"], "tesis_total")=="false") {
              echo "<option>" . login2nom($_COOKIE["login"]) . "</option>";
            } else {
              while($row = mysql_fetch_array($result)){
                echo "<option>" . $row["nom"] . "</option>";
              }
            }
          ?>
          </select><br><br>
          <b>Director 2:</b><br>
          <select name="id2">
            <option selected>Cap</option>
          <?php
            mysql_data_seek($result, 0);
            while($row = mysql_fetch_array($result)){
              echo "<option>" . $row["nom"] . "</option>";
            }
          ?>

          </select><br><br>
          <b>Director 3:</b><br>
          <select name="id3">
            <option selected>Cap</option>
          <?php
            mysql_data_seek($result, 0);
            while($row = mysql_fetch_array($result)){
              echo "<option>" . $row["nom"] . "</option>";
            }
            mysql_free_result($result);
          ?>
          </select><br><br>
          <b>Categoria:</b><br>
          <select name="categoria">
          <?php
            $link=Conectar();
            $result=mysql_query("SELECT titol FROM categories");
            while($row = mysql_fetch_array($result)){
              echo "<option>" . $row["titol"] . "</option>";
            }
            mysql_free_result($result);
          ?>
          </select><br><br>
          <b>Idioma:</b><br>
          <select name="idioma">
            <option>Català</option>
            <option>Castellano</option>
            <option>English</option>
          </select>
          <br><br>

          <b>Resum:</b> <i>Insertar en format <a href="../ajuda/html.php"
          >HTML</a></i><br>
          <textarea name="resum" cols="65" rows="15"></textarea><br><br>
          &nbsp;&nbsp;<input type="image" border="0" src="images/vistaprevia.jpg">
        </form>
        <input type="image" src="images/tornar.jpg" onClick="history.go(-1)">
        </blockquote></div>
        </td>
        <td align="left" valign="top" width="100">
          <br />
          <br />
          <br />
          <br />
          <a href="../desconectar.php" class="link2"><img src="images/tancar.jpg" border="0"></a>
        </td>
      </tr>
    </table>
  </body>
</html>

