<?php
if (isset($_SESSION['usuario'])){
$user=$_SESSION['usuario'];
}
else{
?>
<script>
location.href="index.php?errorusuario=3";
</script>
<?php }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="ucaestilos.css" rel="stylesheet" type="text/css" />
<script>
function retorna()
{
location.href="main.php?a=474";
}
</script>
</head>
<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><form action="editalumno2.php" method="post" name="form1">
		  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><p class="style4">Editar alumno:</p>
                <hr align="left" width="100%" size="1" color="#999999" />
                <div align="center">
                <?php
					$alu=$_GET['Alumno'];
										
                	$cons="SELECT CvePersonal,NomPersonal,ApePersonal,semestre,status,grupo FROM personal WHERE CvePersonal='$alu'";
					$res=mysql_query($cons,$conex) or die ("No se realizo cons");
					$nom=mysql_result($res,0,'NomPersonal');
					$ape=mysql_result($res,0,'ApePersonal');
					$sem=mysql_result($res,0,'semestre');
					$status=mysql_result($res,0,'status');
					$grupo=mysql_result($res,0,'grupo');
				?>
                  <?php if (isset($_GET['error']))
      $error=$_GET['error'];
 {
if (isset ($error))
 {
			  $error=$_GET['error'];
			  if($error==1)
			  {
			  echo "<p class='style3'>�La matr�cula ya existe... intenta con otra!</p>";
			  }
}
else
{
}
}
  ?>
                </div>
                <table width="500" border="0" align="center" cellspacing="5">
                  <tr>
                    <td width="125" class="style1"><div align="right" class="style4">Matr&iacute;cula:</div></td>
                    <td width="356"><input name="matricula" type="text" class="cuadrotexto" id="matricula" size="20" maxlength="40" value="<?php echo $alu;?>" readonly></td>
                  </tr>
                  <tr>
                    <td class="style4"><div align="right">Nombre(s):</div></td>
                    <td><input name="nombre" type="text" class="cuadrotexto" id="nombre" size="50" maxlength="100" value="<?php echo $nom;?>"></td>
                  </tr>
                  <tr>
                    <td class="style4"><div align="right">Apellidos:</div></td>
                    <td><input name="apellidos" type="text" class="cuadrotexto" id="apellidos" size="50" maxlength="100" value="<?php echo $ape;?>"></td>
                  </tr>
                  <tr>
                    <td class="style4"><div align="right">Estatus:</div></td>
                    <td><select name="status" class="cuadrotexto" id="status">
                      <option value="Activo" <?php if($status=='Activo'){echo "selected='selected'";} ?>>Activo</option>
                      <option value="Inactivo" <?php if($status=='Inactivo'){echo "selected='selected'";} ?>>Inactivo</option>
                      <option value="Baja" <?php if($status=='Baja'){echo "selected='selected'";} ?>>Baja</option>
                      <option value="Egresado" <?php if($status=='Egresado'){echo "selected='selected'";} ?>>Egresado</option>
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td class="style4"><div align="right">Semestre:</div></td>
                    <td><select name="semestre" class="cuadrotexto" id="semestre">
                    <option value="<?php echo $sem; ?>" selected="selected"><?php echo $sem; ?></option>
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>
                        <option value="6">6</option>
                        <option value="7">7</option>
                        <option value="8">8</option>
                        <option value="9">9</option>
                        <option value="10">10</option>
                        
                        <option value="EQ">EQ</option>
                        <option value="IRR">IRR</option>
                        
                        <option value="1-N">1-N</option>
                        <option value="1-V">1-V</option>
                        
                    </select>
                    <input name="sem" type="hidden" id="sem" value="<?php echo $sem;?>" /></td>
                  </tr>
                  <tr>
                    <td class="style4"><div align="right">Grupo:</div></td>
                    <td><input name="grupo" type="text" class="cuadrotexto" id="grupo" value="<?php echo $grupo; ?>" /></td>
                  </tr>
                </table>
                <p class="style4"></p>
                <table width="140" border="0" align="center" cellspacing="10">
                  <tr>
                    <td width="52"><div align="right">
                        <input name="Reset" type="button" class="boton2" value="Cancelar" onClick="javascript:retorna()">
                    </div></td>
                    <td width="54"><input name="Submit2" type="submit" class="boton2" value="Guardar" /></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
		  </form></td>
  </tr>
</table>
</body>
</html>