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

if($idc){
 $id_co=dec($idc);
 $qver=mysql_query("select * from conocimientos where id = '$id_co'");
 if(mysql_num_rows($qver)==0){
  alert("El conocimiento o reporte no existe","javascript:history.go(-1)");
 }else{
  $info=mysql_fetch_array($qver);
  $tipo="Update";
 }
}else{
 $tipo="Add";
}
?>
<!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="#FFFFFF"><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> Actualizaci&oacute;n de conocimientos (reportes mala conducta)</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="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><form name="form1" method="post" action="mnt_conocimiento.php">
                      <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
                        <tr>
                          <td 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_conocimientos.png" width="35" height="32"></td>
                                  <td width="94%" background="../images/tema/bg_titulo_frm.png">Informaci&oacute;n del conocimiento </td>
                                </tr>
                              </table></td>
                              </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Alumno:</strong></td>
                              <td width="77%" colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo"><input name="txtalumno" type="text" class="textbox" id="txtalumno" value="<?=$info[alumno];?>" size="15" maxlength="15" readonly="true">
                                <strong></strong><?=$nombre;?></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td width="23%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Fecha:</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtdia" type="text" class="textbox" id="txtdia" size="2" maxlength="2" value="<?=day_of_date($info[fecha]);?>">
                               <span class="lbl_formulario">
                                <select name="txtmes" class="textbox" id="txtmes">
                                  <?
                                  if($tipo=="Add"){
                                    for($i=1;$i<=12;$i++){
                                      echo "<option value='$i'>".mes_letras($i)."</option>";
                                    }
                                  }else{
                                    echo "<option value='".month_of_date($info[fecha])."' class='selected_option'>".mes_letras(month_of_date($info[fecha]))."</option>";
                                    for($i=1;$i<=12;$i++){
                                      echo "<option value='$i'>".mes_letras($i)."</option>";
                                    }
                                  }
                                  ?>
                                </select>
                                <input name="txtyear" type="text" class="textbox" id="txtyear" size="5" maxlength="4" value="<?=year_of_date($info[fecha]);?>"></span></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Tipo:</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo">
                              <select name="txttipo" tabindex="5" class="textbox" id="txttipo">
                                  <?
                                  $qtipos=mysql_query("select * from conocimientos_tipos order by id");
                                  while($itipo=mysql_fetch_array($qtipos)){
                                    $sel="";
                                    if($itipo[id]==$info[tipo]){
                                     $sel="selected class='selected_option'";
                                    }
                                    echo "<option value='{$itipo[id]}' $sel>{$itipo[tipo]}</option>";
                                  }
                                  ?>
                                
                              </select></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Gravedad de la falta:</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo">
                              <select name="txtnivel" tabindex="6" class="textbox" id="txtnivel">
                              <?
                                  $qtipos=mysql_query("select * from conocimientos_niveles order by id");
                                  while($itipo=mysql_fetch_array($qtipos)){
                                    $sel="";
                                    if($itipo[id]==$info[nivel]){
                                     $sel="selected class='selected_option'";
                                    }
                                    echo "<option value='{$itipo[id]}' $sel>{$itipo[nivel]}</option>";
                                  }
                                  ?>    
                              </select></td>
                            </tr>
                            
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Detalle del reporte:</strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="parrafo"><textarea name="txtdescrip" cols="60" rows="6" class="textbox" id="txtdescrip"><?=$info[detalle];?></textarea>
                                <a href="#" onMouseOver="return overlib('Escriba detalladamente el reporte.');" onmouseout="return nd();"><img src="../images/con_info.png" width="16" height="16" border="0"></a></td>
                            </tr>
                            <tr align="left" valign="middle" bgcolor="#EEF7FB">
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="parrafo"><strong>Reportado por: </strong></td>
                              <td colspan="3" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtreportadopor" type="text" class="textbox" id="txtreporte" size="65" maxlength="255" value="<?=$info[reportado_por];?>">
                                <a href="#" onMouseOver="return overlib('Ingrese el nombre de quien reporta.');" onmouseout="return nd();"><img src="../images/con_info.png" width="16" height="16" border="0"></a></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="frm_rpt_conocimientos.php"><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="idc" type="hidden" id="idc" value="<?=$idc;?>">
                                    <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>
