<?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>Modificar novetat</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");
              ident();
              autoritzar($_COOKIE["login"], "novetats");
              $link=Conectar();
              $nid=addslashes($_POST["nid"]);
              $lang = $_REQUEST["lang"];
              if ($lang == "es") {
                $taula = "novetats_es";
              } else if ($lang == "en") {
                $taula = "novetats_en";
              } else {
                $taula = "novetats";
              }
              $result=mysql_query("SELECT date,titol,bodytext FROM " . $taula . " WHERE nid = $nid",$link);
              $row = mysql_fetch_array($result);
              mysql_free_result($result);
        ?>
        <h2>Administració Novetats: Modificar</h2>
        <form action="preview-mod.php" method="post">
          <b>Títol:</b><br>
          <?php
            printf ("<input name=\"nid\" type=hidden value=\"%s\">", $_POST["nid"]);
            printf ("<input name=\"lang\" type=hidden value=\"%s\">", $lang);
            printf ("<input name=\"titol\" size=\"65\" maxlength=\"80\" type=\"text\" value=\"%s\">",
            htmlspecialchars($row["titol"]));
          ?>  
          <br><br>
          <b>Text:</b><i>Insertar en format <a href="../ajuda/html.php"
          >HTML</a></i><br>
          <textarea name="bodytext" cols="65" rows="15"><?php echo
          htmlspecialchars($row["bodytext"]); ?></textarea><br><br>
          <b>Idioma:</b><br>
          <select name="idioma">
            <option <?php if ($lang=="cat") { echo "SELECTED"; } ?>>Català</option>
            <option <?php if ($lang=="es") { echo "SELECTED"; } ?>>Castellano</option>
            <option <?php if ($lang=="en") { echo "SELECTED"; } ?>>English</option>
          </select>
          <br><br>
          <?php
            echo ("<input type=\"checkbox\" name=\"actualitzar\"
            value=\",date=" . $row["date"] . "\" checked>");
          ?>
          No actualitzar data<br><br>
          &nbsp;&nbsp;<input type="image" border=0 src="images/vistaprevia.jpg">
        </form>
        <input type="image" onClick="history.go(-1)" src="images/tornar.jpg">
        </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>

