<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" type="text/javascript"></script>
<meta charset="utf-8">
<title>Documento sin título</title>
<style media="screen">
.button {
padding: .5em;
border: 1px solid steelblue;
background: steelblue;
color: #FFF;
text-transform: uppercase;
font-size: 1.2rem;
text-decoration: none;
display: block;
margin: 1em auto;
max-width: 250px;
text-align: center;
}
</style>
<script>
function identificar(numdoc,nom){
var mostrar= document.getElementById("nombre").value = nom ;
document.getElementById("numero_documento").value = numdoc ;
}
</script>
</head>
<body>
<center ><img src="imagen.png" width="250" height="100" alt=""/>
<table width="45%" align="center">
<img src="trueque.jpg" width="222" height="100" alt=""/>
</table>
<table width="45%" align="center">
</table>
<h1><div align="center"> <font size="5"><b>DATOS USUARIOS TRUEQUE</b></div></h1>
</head>
<a href='../Curso PHP/nuevo_registro.php' class="button">Nuevo Registro</a>
<form action="../Salida/procesarprue.php" method= "POST" name="datos_usuario" id= "datos_usuario">
<table width="45%" align="center">
<?php
$link = mysql_connect('localhost','root','') or die('No se pudo conectar: ' . mysql_error());
mysql_select_db('bdprueba') or die('No se pudo seleccionar la base de datos');
$nombre=$_POST['nombre'];
// Realizar una consulta MySQL
$result=mysql_query("select tipodocumento,numerodocumento,nombre from tbusuarios where profesion is null or email is null group by numerodocumento,tipodocumento, nombre");
?>
<tr>
<td>selecione el usuario para registrar los libros</td>
<td><select name='usuario' id='usuario' onChange="identificar()">
<option value="">Elige...</option>
<?php
while($row=mysql_fetch_array($result)){
if($_POST["usuario"]==$row['nombre'])
{
echo '<option value="'.$row['tipodocumento'].'" selected>'.$row['tipodocumento'].'</option>';
}else{
echo '<option value="'.$row['numerodocumento'].'" selected>'.$row['nombre'].'</option>';
}
}
?>
<tr>
<td>nombre completo</td>
<td><label for="nombre"></label>
<input type="text" name="nombre" id="nombre" value="" readonly></td>
</tr>
<td>tipos de documento</td>
<td><label for="tipo_documento"></label>
<select name="operacion" id="operacion">
<option value="CC">Cedula de Ciudadania </option>
<option value="TI">Tarjeta de Identidad </option>
<option value="CE">Código Estudiante </option>
<option value="CEX">Cedula Extranjeria</option>
<option value="PS">Passaporte</option>
</select></td>
</tr>
<tr>
<td>n° de documento</td>
<td><label for="numerodo_cumento"></label>
<input type="text" name="numero_documento" id="numero_documento" value="<?php echo $row['numerodocumento'];?>" readonly></td>
</tr>
<?
mysql_free_result($result);
// Cerrar la conexión
mysql_close($link);
?>
<td>profesión</td>
<td><label for="profesion"></label>
<input type="text" name="profesion" id="profesion"></td>
</tr>
<td>genero literario preferido</td>
<td><label for="genero"></label>
<select name="genero_preferido" id="genero_preferido">
<option value= "1">Novela</option>
<option value= "2">Cuento</option>
<option value= "3">Ensayo</option>
<option value= "4">Poesia</option>
<option value= "5">Otro</option>
<td><label for="genero"></label>
<input type="text" name="genero" id="genero"></td>
</tr>
<td>tipo de usuario</td>
<td><label for="tipo"></label>
<select name="tipo_Usuario" id="tipo_Usuario">
<option value= "1">Estudiante de EAFIT</option>
<option value= "2">Empleado de EAFIT</option>
<option value= "3">Egresado</option>
<option value= "4">Externo</option>
<td><label for="tipo"></label>
</tr>
<td>correo electrónico</td>
<td><label for="correo"></label>
<input type="text" name="correo" id="correo"></td>
</tr>
<td>titulo del libro que entregó</td>
<td><label for="titulo"></label>
<input type="text" name="edi" id="edi"></td>
</tr>
<td>editorial </td>
<td><label for="edi"></label>
<input type="text" name="edi" id="edi"></td>
</tr>
<td>titulo del libro que se llevó</td>
<td><label for="titulo_libro"></label>
<input type="text" name="titulo_libro" id="titulo_libro"></td>
</tr>
<td>editorial </td>
<td><label for="edito"></label>
<input type="text" name="edito" id="edito"></td>
</tr>
<td>como le pareció el evento</td>
<td><label for="califi"></label>
<select name="calificacion" id="calificacion">
<option value= "1">Exelente</option>
<option value= "2">Bueno</option>
<option value= "3">Regular</option>
<option value= "4">Malo</option>
</tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Enviando" id="enviando" value="Enviar"></td>
<td colspan="2" align="center"></td>
</tr>
</table>
</form>
<body>
</body>
</html>