Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/03/2011, 09:02
ronalddebian
 
Fecha de Ingreso: octubre-2008
Mensajes: 37
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Extrae fecha de nacimiento de bd para cálculo de edad

para ver el representante tengo este codigo :

<?php
require_once("../conexion.php");
$sql="select * from representante where id_repr=".$_GET["id_repr"]."";
$res=mysql_query($sql,$con);
?>
<html>
<head>
<title>Principal</title>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="../js/funciones.js"></script>
<script language="javascript">

function cancelar() {
location.href="index.php";
}

var cursor;
if (document.all) {
// Está utilizando EXPLORER
cursor='hand';
} else {
// Está utilizando MOZILLA/NETSCAPE
cursor='pointer';
}

function aceptar() {
location.href="index.php?cadena_busqueda=<?php echo $cadena_busqueda?>";
parent.window.close();
}

</script>
</head>
<body>
<?php
if ($reg=mysql_fetch_array($res))
{
?>
<div id="pagina">
<div id="zonaContenido">
<div align="center">
<div id="tituloForm" class="header">visualizar vivienda </div>
<div id="frmBusqueda">
<form action="edit_viv.php" method="post" name="form" id="form">
<table class="fuente8" width="98%" cellspacing=0 cellpadding=3 border=0>
<tr>
<td width="10%">Representante</td>
<td width="100%"><?php echo chao_tilde($reg["representante"]); ?></td>
</tr>
<tr>
<td>C&eacute;dula Identidad </td>
<td><?php echo $reg["ced_repr"]; ?></td>
</tr>
<tr>
<td>F. Nacimiento </td>
<td><?php echo $reg["f_nacimiento"]; ?></td>
</tr>
<td>Edad</td>
<td><?php echo $reg["edad"]; ?></td>
</tr>
<tr>
<td>Sexo </td>
<td><?php echo $reg["id_sexo"]; ?></td>
</tr>
<tr>
<td>Tel&eacute;no </td>
<td><?php echo $reg["telefono"]; ?></td>
</tr>
<tr>
<td>E-Mail </td>
<td><?php echo $reg["email"]; ?></td>
</tr>
<input type="hidden" name="id_viv" value="<?php echo $_GET["id_repr"];?>" />
</table>
</div>
<div id="botonBusqueda">

<img src="http://www.forosdelweb.com/f18/img/botonaceptar.jpg" width="85" height="22" onClick="aceptar()" border="1" onMouseOver="style.cursor=cursor">

</div>

</form>
</div>
</div>
</div>
<?php
}
?>
</body>
</html>