<?
include("../fnc.php");
enlinea_a();
$tipo_trn="Add";
$valor_boton="Agregar Evento";
if($idc){
 $id_ca=dec($idc);
 $q=mysql_query("select * from calendario where id = '$id_ca'");
 if(mysql_num_rows($q)>0){
   $tipo_trn="Update";
   $info=mysql_fetch_array($q);
   $dia=day_of_date($info[fecha]);
   $mes=month_of_date($info[fecha]);
   $year=year_of_date($info[fecha]);
   $valor_boton="Actualizar Evento";
 }
}
?>
<!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">
<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></head>
<body>
<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_admin.gif" bgcolor="#FFFFFF"><div align="right" class="usuario_nombre_enc"><strong>JOSE EFREN MONTERROSO SOLARES<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" bgcolor="#FFFFCC">
        <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" bgcolor="#FFFFCC" class="titulo_pagina"><div align="center" class="titulo_seccion">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="65" background="../images/tema/bg_contenido.png">&nbsp;</td>
                    <td background="../images/tema/bg_contenido.png"><div align="center" class="titulo_pagina">CALENDARIO <img src="../images/flecha_3.jpg" width="9" height="9"> AGREGAR EVENTO </div></td>
                    <td width="65" background="../images/tema/bg_contenido.png"><div align="right"><a href="inicio.php" class="link_parrafo">Inicio<img src="../images/ic_home.png" width="21" height="21" border="0"></a></div></td>
                  </tr>
                </table>
              </div></td>
            </tr>
            <tr>
              <td align="left" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><div align="left" class="parrafo">
                <table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#666666">
                  <tr>
                    <td background="../images/tema/bg_contenido.png" bgcolor="#FFFFFF"><form name="form1" method="post" action="mnt_calendario.php">
                      <table width="100%"  border="0" cellspacing="1" cellpadding="1">
                        <tr bgcolor="#6699CC">
                          <td colspan="2" class="titulo_formulario">Agregar nuevo evento al calendario </td>
                        </tr>
                        <tr>
                          <td width="11%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">Fecha:</td>
                          <td width="89%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtdia" type="text" class="textbox" id="txtdia" size="2" maxlength="2" value="<?=$dia;?>">
      -
        <input name="txtmes" type="text" class="textbox" id="txtmes" size="2" maxlength="2" value="<?=$mes;?>">
      -
      <input name="txtyear" type="text" class="textbox" id="txtyear" size="4" maxlength="4" value="<?=$year;?>">
      [ <em>dia-mes-a&ntilde;o</em> ]</td>
                        </tr>
                        <tr>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">Hora</td>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9">
                          <select name="txthr" class="textbox" id="txthr">
                          <?
                          for($i=0;$i<=23;$i++){
                            if(strlen($i)==1){
                              $valor="0$i";
                            }else{
                              $valor=$i;
                            }
                            
                            $sel="";
                            if(substr($info[hora],0,2)==$valor){
                              $sel="selected class='selected_option'";
                            }
                            echo "<option value='$valor' $sel>$valor</option>";
                          }
                          ?>
                          </select>
                            :
                            <select name="txtmin" class="textbox" id="txtmin">
                            <?
                            for($i=0;$i<=59;$i++){
                             if($i<10){
                              $min="0$i";
                             }else{
                              $min=$i;
                             }
                              
                              $sel="";
                              if(substr($info[hora],3,2)==$min){
                                $sel="selected class='selected_option'";
                              }
                              echo "<option value='$min' $sel>$min</option>";
                            }
                            ?>
                            </select>
                              [<em>Hora:minutos</em>]</td>
                        </tr>
                        <tr>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">Asunto:</td>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtasunto" type="text" class="textbox" id="txtasunto" size="70" maxlength="255" value="<?=$info[asunto];?>"></td>
                        </tr>
                        <tr>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">Detalle:</td>
                          <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><textarea name="txtdetalle" cols="65" rows="4" class="textbox" id="txtdetalle"><?=$info[detalle];?></textarea>
                            <input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo_trn;?>">
                            <input name="idc" type="hidden" id="idc" value="<?=$idc;?>"></td>
                        </tr>
                        <tr bgcolor="#CFDFEF">
                          <td colspan="2"><div align="center">
                              <input name="Submit" type="submit" class="boton_guardar" value="<?=$valor_boton;?>">
                          </div></td>
                        </tr>
                      </table>
                      </form>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="22%" background="../images/tema/bg_contenido.png" bgcolor="#FFFFFF"><div align="center"><a href="frm_calendario.php"><img src="../images/regresar_c.png" width="32" height="32" border="0"></a> <br>
                              <strong>Regresar al calendario</strong> </div></td>
                          <td width="78%" background="../images/tema/bg_contenido.png" bgcolor="#FFFFFF">&nbsp;</td>
                        </tr>
                      </table></td>
                  </tr>
                </table>
                </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>
