<?
include("../fnc.php");
enlinea_a();

if($idev){
 $id_ev=dec($idev);
 $qver=mysql_query("select * from ec_evaluaciones where id = '$id_ev'");
 if(mysql_num_rows($qver)==0){
  alert("La evaluación no existe","javascript:history.go(-1)");
 }else{
  $info=mysql_fetch_array($qver);
  $info[hora_inicio]=horacompleta_of_date($info[fecha_inicio]);
  $info[hora_fin]=horacompleta_of_date($info[fecha_fin]);
  $tipo="Update";
 }
}else{
 $tipo="Add";
 $info[fecha_inicio]=$fecha;
 $info[fecha_fin]=$fecha;
}
?>
<!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">
<script type="text/javascript" src="../jsincludes/overlib.js"></script>
<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><?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> </strong>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="65">&nbsp;</td>
                    <td><div align="center" class="titulo_pagina"><strong>EVALUACION A CATEDRATICOS </strong></div></td>
                    <td width="65"><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" bgcolor="#FFFFCC"><div align="left" class="parrafo">
                <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td background="../images/tema/bg_contenido.png"><form name="form1" method="post" action="mnt_ec_evaluacion.php">
                      <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
                        <tr>
                          <td background="../images/tema/bg_contenido.png" bgcolor="#FFFFFF"><table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                            <tr align="left" valign="middle" bgcolor="#6699CC">
                              <td height="15" colspan="4" class="titulo_formulario"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="6%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_formularios.png" width="35" height="32"></td>
                                  <td width="94%" background="../images/tema/bg_titulo_frm.png">Informaci&oacute;n general de la evaluaci&oacute;n </td>
                                </tr>
                              </table></td>
                              </tr>
                           
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td width="26%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Nombre de la evaluaci&oacute;n </strong></td>
                              <td width="74%" colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtnombre" type="text" class="textbox" id="txtnombre" size="60" maxlength="255" value="<?=$info[nombre];?>">                                <img src="../images/con_info.png" width="16" height="16" border="0" onMouseOver="return overlib('Ingrese un nombre que identifique a la evaluación.');" onmouseout="return nd();"></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Activa del</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo">
                                <select name="txtddia" class="textbox" id="txtddia">
                                <?
                                if($tipo=="Add"){
                                  for($i=1;$i<=31;$i++){
                                     $sel="";
                                     if($i==date("d")){$sel="selected";}
                                     echo "<option value='$i' $sel>".$i."</option>";
                                  }
                                }else{
                                  //echo "<option value='".day_of_date($info[fecha_inicio])."' class='selected_option'>".day_of_date($info[fecha_inicio])."</option>";
                                  for($i=1;$i<=31;$i++){
                                     $sel="";
                                     if(day_of_date($info[fecha_inicio])==$i){
                                       $sel="selected class='selected_option'";
                                     }
                                     echo "<option value='$i' $sel>".$i."</option>";
                                  }
                                }
                                ?>
                                </select>
                                  <span class="lbl_formulario"> -
                                  <select name="txtdmes" class="textbox" id="txtdmes">
                                 <?
                                  if($tipo=="Add"){
                                    for($i=1;$i<=12;$i++){
                                      $sel="";
                                      if($i==date("m")){$sel="selected";}
                                      echo "<option value='$i' $sel>".mes_letras($i)."</option>";
                                    }
                                  }else{
                                    echo "<option value='".month_of_date($info[fecha_inicio])."' class='selected_option'>".mes_letras(month_of_date($info[fecha_inicio]))."</option>";
                                    for($i=1;$i<=12;$i++){
                                      echo "<option value='$i'>".mes_letras($i)."</option>";
                                    }
                                  }
                                  ?>
                                  </select>
                                  - </span>
                                  <input name="txtdyear" type="text" class="textbox" id="txtdyear" size="5" maxlength="4" value="<?=year_of_date($info[fecha_inicio]);?>">
                                  <span class="parrafo">a partir de las</span>
                                  <select name="txtdhora" class="textbox" id="txtdhora">
                                    <?
                                    $sel="selected";
                                    if($tipo=="Update"){
                                     $sel="";
                                     echo "<option value='".hora_of_time($info[hora_inicio])."' class='selected_option'>".hora_of_time($info[hora_inicio])."</option>";
                                    }
                                    ?>
                                    <option value="00">00</option>
                                    <option value="01">01</option>
                                    <option value="02">02</option>
                                    <option value="03">03</option>
                                    <option value="04">04</option>
                                    <option value="05">05</option>
                                    <option value="06">06</option>
                                    <option value="07">07</option>
                                    <option value="08">08</option>
                                    <option value="09">09</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                    <option value="13">13</option>
                                    <option value="14">14</option>
                                    <option value="15">15</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                    <option value="21">21</option>
                                    <option value="22">22</option>
                                    <option value="23" <?=$sel;?>>23</option>
                                  </select>
                                  <span class="parrafo">:</span>
                                  <select name="txtdmin" class="textbox" id="select3">
                                    <?
                                    $sel="selected";
                                    if($tipo=="Update"){
                                     $sel="";
                                     echo "<option value='".minutos_of_time($info[hora_inicio])."' class='selected_option'>".minutos_of_time($info[hora_inicio])."</option>";
                                    }
                                    ?>
                                    <option value="00">00</option>
                                    <option value="05">05</option>
                                    <option value="10">10</option>
                                    <option value="15">15</option>
                                    <option value="20">20</option>
                                    <option value="25">25</option>
                                    <option value="30">30</option>
                                    <option value="35">35</option>
                                    <option value="40">40</option>
                                    <option value="45">45</option>
                                    <option value="50">50</option>
                                    <option value="55" <?=$sel;?>>55</option>
                                  </select>
                                  <span class="parrafo">horas</span> </td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Activa al</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo"><select name="txthdia" class="textbox" id="txthdia">
                               <?
                                if($tipo=="Add"){
                                  for($i=1;$i<=31;$i++){
                                     $sel="";
                                     if($i==date("d")){$sel="selected";}
                                     echo "<option value='$i' $sel>".$i."</option>";
                                  }
                                }else{
                                  echo "<option value='".day_of_date($info[fecha_fin])."' class='selected_option'>".day_of_date($info[fecha_fin])."</option>";
                                  for($i=1;$i<=31;$i++){
                                     echo "<option value='$i'>".$i."</option>";
                                  }
                                }

                                ?>

                                </select>
                                  <span class="lbl_formulario">-
                                  <select name="txthmes" class="textbox" id="select2">
                                  <?
                                  if($tipo=="Add"){
                                    for($i=1;$i<=12;$i++){
                                      $sel="";
                                      if($i==date("m")){$sel="selected";}
                                      echo "<option value='$i' $sel>".mes_letras($i)."</option>";
                                    }
                                  }else{
                                    echo "<option value='".month_of_date($info[fecha_fin])."' class='selected_option'>".mes_letras(month_of_date($info[fecha_fin]))."</option>";
                                    for($i=1;$i<=12;$i++){
                                      echo "<option value='$i'>".mes_letras($i)."</option>";
                                    }
                                  }

                                  ?>
                                  </select>
                                  -
                                  <input name="txthyear" type="text" class="textbox" id="txthyear" size="5" maxlength="4" value="<?=year_of_date($info[fecha_fin]);?>">
                                  </span>    hasta  las<span class="lbl_formulario"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                  <select name="txthhora" class="textbox" id="txthhora">
                                    <?
                                    $sel="selected";
                                    if($tipo=="Update"){
                                     $sel="";
                                     echo "<option value='".hora_of_time($info[hora_fin])."' class='selected_option'>".hora_of_time($info[hora_fin])."</option>";
                                    }
                                    ?>
                                    <option value="00">00</option>
                                    <option value="01">01</option>
                                    <option value="02">02</option>
                                    <option value="03">03</option>
                                    <option value="04">04</option>
                                    <option value="05">05</option>
                                    <option value="06">06</option>
                                    <option value="07">07</option>
                                    <option value="08">08</option>
                                    <option value="09">09</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                    <option value="13">13</option>
                                    <option value="14">14</option>
                                    <option value="15">15</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                    <option value="21">21</option>
                                    <option value="22">22</option>
                                    <option value="23" <?=$sel;?>>23</option>
                                  </select>
                                  <span class="parrafo">:</span>
                                  <select name="txthmin" class="textbox" id="select6">
                                    <?
                                    $sel="selected";
                                    if($tipo=="Update"){
                                     $sel="";
                                     echo "<option value='".minutos_of_time($info[hora_fin])."' class='selected_option'>".minutos_of_time($info[hora_fin])."</option>";
                                    }
                                    ?>
                                    <option value="00">00</option>
                                    <option value="05">05</option>
                                    <option value="10">10</option>
                                    <option value="15">15</option>
                                    <option value="20">20</option>
                                    <option value="25">25</option>
                                    <option value="30">30</option>
                                    <option value="35">35</option>
                                    <option value="40">40</option>
                                    <option value="45">45</option>
                                    <option value="50">50</option>
                                    <option value="55" <?=$sel;?>>55</option>
                                  </select>
                                  <span class="parrafo">horas</span> </td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Activa</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtactiva" type="checkbox" id="txtactiva" value="S" <?if($info[activa]=="S"){echo "checked";}?>>                                <img src="../images/con_info.png" width="16" height="16" border="0" onMouseOver="return overlib('<strong>Evaluación activa:</strong><br>Es vible para los alumnos.<br><br><strong>Encuesta NO activa:</strong><br>Hace que la evaluación esté oculta para los alumnos. No importando que se encuentre dentro del período de respuesta.');" onmouseout="return nd();"></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#E8E8E8">
                              <td colspan="4" background="../images/tema/bg_frm_campos.png" class="lbl_formulario"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                <tr bgcolor="#CFDFEF">
                                  <td width="20%"><div align="left"><a href="<?if($tipo=="Add"){echo "frm_agregar_encuesta.php";}else{echo "frm_mis_evaluacionescatedraticos.php?gid=".enc(base64_decode($idg))."&cid=".enc(base64_decode($idc));}?>"><img src="../images/regresar_c.png" width="32" height="32" border="0"></a>
                                    <input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo;?>">
                                    <input name="tipou" type="hidden" id="tipou" value="<?=$tipou;?>">
                                    <input name="tipo_usuario" type="hidden" id="tipo_usuario" value="<?=$tipo_usuario;?>">
                                    <input name="ide" type="hidden" id="ide" value="<?=$idev;?>">
                                    <br>
                                    Salir
                                  </div></td>
                                  <td width="30%" align="center" valign="middle"><div align="center">
                                    <input name="Submit" type="submit" class="boton_guardar" value="Guardar los cambios">
                                  </div></td>
                                  <td width="33%" align="center" valign="middle"><div align="center">
                                    <input name="Submit2" type="reset" class="boton_deshacer" value="Deshacer los cambios">
                                  </div></td>
                                  <td width="17%"><div align="center">
                                  </div></td>
                                </tr>
                              </table></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table>
                    </form></td>
                  </tr>
                </table>
              </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>
