<?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>Deiminari Mail</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"], "deiminaris");
          $link=Conectar();

          $result=mysql_query("SELECT * FROM deiminaris_mail", $link);
          while ($row = mysql_fetch_array($result)){
            if ($mails == "") {
              $mails = $row["email"];
            } else {
              $mails= $mails . ", " . $row["email"];
            }
          }

          mysql_free_result($result);
        ?>
        <h2>Administració Deiminaris: Enviar notificació no predefinida</h2>
        <?php

              echo "<form action=\"sendmail.php\" method=\"post\">
                      <br><b>Asunte:</b><br>
                      <input type=\"text\" name=\"subject\" size=\"80\"><br>
                      <br><b>Destinataris:</b><br>
                      <input type=\"text\" name=\"mails\" size=\"80\" value=\"$mails\"><br>
                      <br><b>Missatge:</b><br>
                      <textarea name=\"body\" cols=\"80\" rows=\"20\"></textarea><br>
                      <input type=\"hidden\" name=\"did\" value=\"" .
                      htmlspecialchars($did) . "\">
                      <br>&nbsp;&nbsp;<input type=\"image\" border=0
                      src=\"images/enviar.jpg\"></form>";


        ?>
        <br>
        <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>

