<?php
if (isset($_SESSION['usuario'])){
$user=$_SESSION['usuario'];
}
else{
?>
<script>
location.href="index.php?errorusuario=3";
</script>
<?php }

include("conexion.php");

//CAPTURA DE DATOS DEL URL

$idMateria=$_GET['idMateria'];

//Eliminar registro
$cons2="SELECT materia FROM materias WHERE idMateria ='$idMateria'";
$res2=mysql_query($cons2,$conex) or die ("No se pudo eliminar la materia especificada");
$nombremat=mysql_result($res2,0,'materia');
?>
<!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" />
</head>

<body>
<form action="editmateria2.php" method="post" name="form1">
		  <table width="700" border="0" align="center" cellpadding="0" cellspacing="10">
            <tr>
              <td><p class="style10">Editar Materia</p>
                <hr align="left" width="100%" size="1" color="#999999" />
                <p>&nbsp;</p>
                <table width="600" border="0" align="center" cellspacing="5">
                  <tr>
                    <td width="157" class="style1"><p align="right" class="style4">Nombre de la Materia:</p></td>
                    <td width="424"><input name="materia" type="text" class="cuadrotexto" id="materia" size="60" value="<?php echo $nombremat;?>" /></td>
                  </tr>
                  <tr>
                    <td class="style1"><input type="hidden" name="id" id="id" value="<?php echo $idMateria;?>" /></td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
                <p class="style4"></p>
                <table width="140" border="0" align="center" cellspacing="10">
                  <tr>
                    <td width="193"><div align="right">
                        <input name="Reset" type="button" class="boton2" value="Cancelar" onClick="javascript:history.back()">
                    </div></td>
                    <td width="273"><input name="Submit2" type="submit" class="boton2" value="Guardar" /></td>
                  </tr>
                </table>
                <p></p></td>
            </tr>
  </table>
</form>
</body>
</html>
