<?
include("../fnc.php");
enlinea_a();
if(!$ide){
 alert("Parámetros incorrectos","javascript:history.go(-1)");
}
$id_ev=dec($ide);
$qev=mysql_query("select * from ec_evaluaciones
                  where id ='$id_ev'");
if(mysql_num_rows($qev)==0){
 alert("Error, la evaluación a catedráticos no existe","./frm_login.php");
}
$info=mysql_fetch_array($qev);
$tipo="Add";
if(!$nops and $tipo=="Add"){
 $nops=5;
}
?>
<!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 language="JavaScript" type="text/JavaScript">
<!--
function validar(){
  var objeto;
  var formulario=document.form1;
  
  objeto=formulario.txtvalor;
  if(objeto.value==""){
    alert("Ingrese un valor para la pregunta");
    objeto.focus();
    return (false);
  }
  objeto=formulario.txtpregunta;
  if(objeto.value==""){
    alert("Ingrese una pregunta");
    objeto.focus();
    return (false);
  }
  return (true);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</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> EVALUACION A CATEDRATICOS </strong></div></td>
            </tr>
            <tr>
              <td align="left" valign="top" bgcolor="#ECE9D8"><div align="left" class="parrafo">
                <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC">
                    <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
                            <tr>
                              <td bgcolor="#FFFFFF"><form name="form1" method="post" action="mnt_ec_m_pregunta.php" onsubmit="return validar();" autocomplete="off">
                                <table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                  <tr align="left" valign="middle" bgcolor="#336699">
                                    <td colspan="2" class="titulo_seccion_blanco"><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">Agregar una pregunta a la evaluación </td>
                                      </tr>
                                    </table></td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#FFFFFF">
                                    <td colspan="2" class="parrafo"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr align="left" valign="middle" bgcolor="#E9F2FE" class="lbl_formulario">
                                        <td width="24%" background="../images/tema/bg_frm_campos.png">Nombre de la evaluación <span class="lbl_formulario">: </span></td>
                                        <td width="76%" background="../images/tema/bg_frm_campos.png"><strong>
                                          <?=$info[nombre];?>
                                        </strong></td>
                                      </tr>
                                    </table>                                      </td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#FFCC66">
                                    <td class="lbl_campo">Valor:</td>
                                    <td class="menu_enc"><input name="txtvalor" type="text" class="textbox" id="txtvalor" size="3" maxlength="3"> 
                                      (La suma de los valores de las preguntas debe sumar 100 puntos) </td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#FFCC66">
                                    <td width="64" class="parrafo"><strong>Pregunta:</strong></td>
                                    <td width="520" class="menu_enc"><strong>
                                      <input name="txtpregunta" type="text" class="lbl_formulario" id="txtpregunta" size="70">
                                    </strong></td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#E9F2FE">
                                    <td colspan="2" background="../images/tema/bg_frm_campos.png" class="lbl_formulario"><hr size="1"></td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#E8E8E8">
                                    <td colspan="2" background="../images/tema/bg_frm_campos.png" class="lbl_formulario"><table width="99%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#009933">
                                      <tr>
                                        <td bgcolor="#FFFFFF">
                                        <table width="98%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                          <?
                                          $vl_op=100;
                                          for($i=1;$i<=$nops;$i++){
                                          ?>
                                          <tr align="left" valign="middle" bgcolor="#FFFFFF">
                                            <td width="3%"><div align="left">#<?=$i;?></div></td>
                                            <td width="47%"><input name="txtopcion[<?=$i;?>]" type="text" class="lbl_formulario" size="50" <?if($nops==2){if($i%2==1){echo "value='Verdadero'";}else{echo "value='Falso'";}}?>></td>
                                            <td width="50%"><span class="font_red_11">
                                              <input name="txtvopcion[<?=$i;?>]" type="text" id="txtvopcion[<?=$i;?>" size="2" maxlength="2" value="<?=$vl_op;?>">
                                              % asignado al valor de la opci&oacute;n</span></td>
                                          </tr>
                                          <?
                                          $vl_op-=25;
                                          }
                                          ?>
                                        </table></td>
                                      </tr>
                                    </table></td>
                                    </tr>
                                  <tr align="left" valign="middle" bgcolor="#E9F2FE">
                                    <td colspan="2" background="../images/tema/bg_frm_campos.png" class="lbl_formulario"><hr size="1"></td>
                                  </tr>
                                  <tr align="left" valign="middle" bgcolor="#E8E8E8">
                                    <td colspan="2" background="../images/tema/bg_frm_campos.png" class="lbl_formulario"><div align="center">
                                        <table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                          <tr bgcolor="#FFFFFF">
                                            <td width="9%" align="left" valign="middle" background="../images/tema/bg_frm_campos.png"><div align="left"><a href="frm_ec_prg.php?ide=<?=$ide;?>"><img src="../images/regresar_c.png" alt="No guarda los cambios" width="32" height="32" border="0"></a><br>
                                              <span class="textbox">Regresar</span></div></td>
                                            <td width="27%" background="../images/tema/bg_frm_campos.png">&nbsp;</td>
                                            <td width="34%" background="../images/tema/bg_frm_campos.png"><div align="left">
                                              <input name="Submit" type="submit" class="boton_guardar" value="Guardar pregunta">
                                            </div></td>
                                            <td width="30%" background="../images/tema/bg_frm_campos.png"><input name="ide" type="hidden" id="ide3" value="<?=$ide;?>">
                                              <input name="tipo_trn" type="hidden" id="tipo_trn3" value="Add">
                                              <input name="nops" type="hidden" id="nops" value="<?=$nops;?>"></td>
                                          </tr>
                                        </table>
                                      </div></td>
                                  </tr>
                                </table>
                              </form></td>
                            </tr>
                      </table>
                    &nbsp;</td>
                  </tr>
                </table>
              </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>
