<?
include("conf.php");
include("funciones.php");
require("clases/class.profesor.php");
if($_POST){
if($_POST["id_profesor"]!=''){
$profesor=new profesor($_POST["id_profesor"]);
}else{
$profesor=new profesor();
}
$profesor->nombre=$_POST["nombre"];
$profesor->apellidos=$_POST["apellidos"];
$profesor->telefono=$_POST["telefono"];
$profesor->ciudad=$_POST["ciudad"];
$profesor->direccion=$_POST["direccion"];
$profesor->cp=$_POST["cp"];
$profesor->imparte=$_POST["imparte"];
$profesor->detalles=$_POST["detalles"];
$profesor->fecha_nacimiento=fechaABd($_POST["fecha_nacimiento"]);
$profesor->guardar();
}else{
$profesor=new profesor($_GET["id_profesor"]);
}
?>
<!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=windows-1252" />
<title>Datos profesor</title>
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?
if($_POST){
echo '<script>window.opener.location.reload(); window.close();</script>';
}
?>
<table width="300" border="0" cellspacing="2" class="tabla_formulario">
<tr>
<td colspan="3" bgcolor="#339933" class="texto_blanco">Datos del profesor </td>
</tr>
<form id="form1" name="form1" method="post" action="">
<input type="hidden" name="id_profesor" value="<? echo $_GET["id_profesor"]; ?>" />
<tr>
<td width="23"> </td>
<td width="81"> </td>
<td width="180"> </td>
</tr>
<tr>
<td> </td>
<td class="texto">Nombre</td>
<td class="texto">
<input type="text" name="nombre" value="<? echo $profesor->nombre; ?>" /> </td>
</tr>
<tr>
<td> </td>
<td class="texto">Apellidos</td>
<td class="texto"><input type="text" name="apellidos" value="<? echo $profesor->apellidos; ?>" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Teléfono</td>
<td class="texto"><input type="text" name="telefono" value="<? echo $profesor->telefono; ?>" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Dirección</td>
<td class="texto"><input type="text" name="direccion" value="<? echo $profesor->direccion; ?>" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Ciudad</td>
<td class="texto"><input type="text" name="ciudad" value="<? echo $profesor->ciudad; ?>" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Código postal </td>
<td class="texto"><input name="cp" type="text" value="<? echo $profesor->cp; ?>" size="6" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Fecha nacimiento </td>
<td class="texto"><input name="fecha_nacimiento" type="text" value="<? echo fechaDesdeBd($profesor->fecha_nacimiento); ?>" size="11" onclick="if(self.gfPop)gfPop.fPopCalendar(document.form1.fecha_nacimiento);return false;" /></td>
</tr>
<tr>
<td> </td>
<td class="texto">Puede impartir clases de </td>
<td class="texto"><textarea name="imparte" rows="4"><? echo $profesor->imparte; ?></textarea></td>
</tr>
<tr>
<td> </td>
<td class="texto">Detalles</td>
<td class="texto"><textarea name="detalles" rows="4"><? echo $profesor->detalles; ?></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="center"><input type="submit" name="Submit" value="Guardar" /></td>
</tr>
</form>
</table>
<!-- PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="js/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
</body>
</html>