<?

include("../fnc.php");

enlinea_a();

$re="";

$javascript="";

$onload="";

$option="";

if($ire){

  $qmsg=mysql_query("select * from msg_mensajes where id = ".dec($ire));

  $imsg=mysql_fetch_array($qmsg);

  $re="RE: ";



  $javascript="<script language='javascript'>

               function focus(){

                document.form1.txtmensaje.focus();

               }

               </script>";



  $onload="onload=\"focus();\"";



  $option="<option value='".substr($imsg[de_tipo],0,2)."'>".$imsg[de_tipo]."</option>";

}

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>e-Ducativo - Bienvenido</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="../estilo1.css" rel="stylesheet" type="text/css">

<?=$javascript;?>

<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></head>



<body <?=$onload;?>>

<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">

  <tr>

    <td bgcolor="#336699">    <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E5E5E5">

      <tr bgcolor="#FFFFFF">

        <td width="40%"><img src="../images/logo_5.gif" width="300" height="50"></td>

        <td width="60%" background="../images/back_header_alumno.gif" bgcolor="#FFFFFF"><div align="right" class="usuario_nombre_enc"><strong><?echo "$unombre $uapellido";?><br>

          </strong>Tiene <?=mensajes($uuser);?> mensaje(s) sin leer</div></td>

      </tr>

      <tr bgcolor="#FFFFFF">

        <td height="15" colspan="2" background="../images/barra_encabezado.gif">&nbsp;</td>

        </tr>

    </table>

      <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

          <td width="20%" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><?php include("menu.php"); ?>&nbsp;</td>

          <td width="80%" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#333333">

            <tr align="center" valign="middle" bgcolor="#FFFFCC">

              <td height="20" background="../images/tema/bg_contenido.png" class="titulo_pagina"><div align="center" class="titulo_pagina"><strong>Escribir nuevo mensaje </strong></div></td>

            </tr>

            <tr>

              <td align="left" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><div align="left" class="parrafo">

                <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">

                  <tr>

                    <td background="../images/tema/bg_frm_campos.png" bgcolor="#FFFFFF"><form name="form1" method="post" action="mnt_mensaje_write.php">

                      <table width="100%"  border="0" cellspacing="0" cellpadding="1">

                        <tr bgcolor="#ECF2F9">

                          <td width="25%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center"><strong><img src="../images/cuad_1.png" width="9" height="9" border="0"><a href="mensajes.php" class="link_parrafo" onmouseover="javascript:window.status='Dé clic para regresar a la bandeja de entrada';return true;" onmouseout="window.status=''; return true;">Bandeja de entrada </a></strong></div></td>

                          <td width="25%" background="../images/tema/bg_frm_campos.png"><div align="center"></div></td>

                          <td width="25%" background="../images/tema/bg_frm_campos.png"><div align="center"></div></td>

                          <td width="25%" background="../images/tema/bg_frm_campos.png">&nbsp;</td>

                        </tr>

                      </table>

                      <hr size="1">

                      <table width="100%"  border="0" cellspacing="1" cellpadding="1">

                        <tr bgcolor="#6699CC">

                          <td colspan="3" class="titulo_formulario"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="2%"><img src="../images/tema/ic_formularios.png" width="35" height="32"></td>
                              <td width="98%" background="../images/tema/bg_titulo_frm.png">Escribir nuevo mensaje privado </td>
                            </tr>
                          </table></td>

                          </tr>

                        <tr bgcolor="<?=$bgcolor;?>">

                          <td width="23%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Para</strong></td>

                          <td colspan="2" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo"><div align="left"><a href="mensajes_read.php?m=<?=enc($imsg[id]);?>" class="link_parrafo">

                              </a>

                              <input name="txtpara" type="text" class="textbox" id="txtpara" tabindex="1" size="20" maxlength="20" value=<?=$imsg[de];?>>

                              (Ingrese el usuario destino) <strong><a href="#" class="lbl_buscar" onclick="ifield=document.form1.txtpara; chooser=window.open('./frm_busqueda_alumno_rpt.php','chooser','width=500, height=300, location=no,menubar=no,resaizable=no,status=no,menubar=no,scrollbars=yes'); chooser.ifield=ifield; window.ifield=ifield">BUSCAR USUARIO</a></strong></div></td>

                        </tr>

                        <tr bgcolor="<?=$bgcolor;?>">

                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Tipo de usuario </strong></td>

                          <td colspan="2" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo">

                          <select name="txttipousr" class="textbox" id="txttipousr" tabindex="2">

                            <?=$option;?>

                            <option value="Al">Alumno</option>

                            <option value="Ca">Catedr&aacute;tico</option>

                            <option value="Ad">Administrador</option>

                          </select></td>

                        </tr>

                        <tr bgcolor="<?=$bgcolor;?>">

                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Asunto</strong></td>

                          <td colspan="2" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo"><input name="txtasunto" type="text" class="textbox" id="txtasunto" tabindex="3" size="60" maxlength="255" value="<?=$re.$imsg[asunto];?>">

                            <div align="left"></div></td>

                        </tr>

                        <tr bgcolor="#FFFFFF">

                          <td colspan="3" background="../images/tema/bg_frm_campos.png"><hr size="1"></td>

                        </tr>

                        <tr bgcolor="<?=$bgcolor;?>">

                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Contenido del mensaje: </strong></td>

                          <td width="53%" align="left" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="justify" class="parrafo"></div>

                              <div align="justify"></div>

                              <div align="left">

                                <textarea name="txtmensaje" cols="70" rows="10" class="textbox" id="txtmensaje" tabindex="4"><?if($ire){echo chr(13).chr(13)."----MENSAJE ORIGINAL----".chr(13).$imsg[mensaje];}?></textarea>

                              </div></td>

                          <td width="24%" align="left" valign="top" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"> <p>:) =  <img src="../images/smile.gif" width="15" height="15"><br>

                              :( =  <img src="../images/sad.gif" width="15" height="15"><br>

                              :o =  

                              <img src="../images/shocked.gif" width="15" height="15"><br>

                              :p =  <img src="../images/tongue.gif" width="15" height="15">                          </p>                            </td>

                        </tr>

                        <tr bgcolor="<?=$bgcolor;?>">

                          <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><div align="center">

                            <input name="Submit" type="submit" class="boton_guardar" value="Enviar mensaje">

                          </div></td>

                          </tr>

                      </table>

                    </form></td>

                  </tr>

                </table>

                &nbsp; </div></td>

              </tr>

          </table></td>

        </tr>

    </table>    </td>

  </tr>

</table>

</body>

</html>
