<?php
$connect = pg_connect("host=localhost port=5432 dbname=pediatria user=postgres password=movilnet");
$especialidad = "SELECT * FROM especialidad ORDER BY descripcion";
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
?>
<!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>Acceso al Sistema de Citas en Linea</title>
<style type="text/css">
.sr {
background-color: #FFFFCF;
color: #000000;
font-family: Arial;
font-size: 12px;
}
input.color1 {background-color: #00CC99; font-weight: bold; font-size: 12px; color: white;}
</style>
</head>
<body background="img/Edificio.JPG">
<form action="usuario.php" method='POST'>
<fieldset style="width:inherit"><LEGEND style="color:#FF0000"></LEGEND>
<h1>
<table align='center'>
<tr>
<td class="sr" align='right' style="text-decoration:none">Registrar Usuario</td>
</tr>
</table></h1>
<table align='center'>
<tr>
<td class="sr" align='right' style="text-decoration:none">Nombre:</td>
<td class="sr"><input type="text" name="nombre" size="20" maxlength="20" align="right"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Apellido:</td>
<td class="sr"><input type="text" name="apellido" size="20" maxlength="20" align="right"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Email:</td>
<td class="sr"><input type="text" name="nombre" size="20" maxlength="20" align="right"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Login:</td>
<td class="sr"><input type="text" name="login" size="20" maxlength="20" align="right"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Contraseña:</td>
<td class="sr"><input type="password" name="contrasena" size="20" maxlength="20" align="right"/></td>
<td class="sr" align='right' style="text-decoration:none">Olvido su Contraseña?</td>
</tr>
<tr>
<td align='right'>Especialidad:</td>
<td><select name="especial" required>
<option value="">[Seleccione la Especialidad]</option>
<?php
//*** crear la tabla especialidad
$especial = @pg_query($connect,$especialidad);
while($espec = @pg_fetch_array($especial))
{
$id = $espec['id_especialidad'];
$descrip = $espec['descripcion'];
echo "<OPTION VALUE='$descrip'>$descrip</OPTION>";
}
?>
</select></td></tr>
</table>
<?php
////registro de usuarios
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$usuarios = "SELECT nombres,apellidos,email,usuario_login WHERE nombres = '$nombre' OR apellidos = '$apellido'";
$usuario = @pg_query($connect,$usuarios);
if ($usuario['nombres'] != '$nombre' and $usuario['apellidos'] != '$apellido')
{
echo 'no se encuentra definida en absoluto';
}
?>
<table align="center">
<tr>
<td>
<input class="color1" type="submit" name="action" value="Ingresar"/>
<!-- <INPUT TYPE="button" class="color1" VALUE="Salir" ONCLICK="window.location.href='menu.html'">
--> </td>
</tr>
</table>
</fieldset>
<br/>
</form>
</body>
</html>