File: /home/asjudine/public_html/ingresar_beneficiarios.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
function Conectarse()
{
if (!($link=@mysql_connect("localhost","asjudine","as2006")))
{
echo "Error conectando con el servidor.";
exit();
}
$dbname = "asjudinet";
if (!@mysql_select_db($dbname,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
Conectarse();
if(isset($_POST["consultar"]))
{
//$sqlnom = "select cedula, nombre from asjudinet_cartera where cedula = '$ced'";
//$control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$resul = mysql_query('SELECT cedula, nombre FROM asjudinet_cartera WHERE cedula = "' . $_POST[ced] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($ced2, $nom) = mysql_fetch_row($resul);
}
?>
<!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>Ingresar Beneficiarios</title>
<style type="text/css">
<!--
.Estilo1 { color: #FF6633;
font-size: 24px;
font-style: italic;
}
.Estilo2 { color: #FF6633;
font-size: 16px;
}
.Estilo3 { color: #2492FF;
font-weight: bold;
}
.recaudo { font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #000000;
background-color: #B6CBDC;
margin: 4px;
padding: 8px;
width: auto;
border: medium outset #339966;
}
.titular {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
background-color: #E9F0CA;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #009999;
}
.Estilo4 {
color: #CC3333;
font-weight: bold;
font-size: 18px;
}
.Estilo5 {
color: #009933;
font-weight: bold;
}
.benef {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #1665F8;
background-color: #D2CAE3;
height: auto;
width: auto;
border: medium outset #33CCCC;
}
.Estilo6 {font-size: 16px}
.Estilo7 {color: #FF6600}
.Estilo8 {color: #0000FF}
.benef {
}
.listben {
font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #000000;
background-color: #CFECFC;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
body {
background-color: #E7F8FE;
}
.benef2 {
background-color: #DAFAE4;
}
.titular2 {
background-color: #FFEFDD;
border: thin none #009966;
}
.sig1 {
font-family: "Courier New", Courier, monospace;
font-size: 10px;
font-style: normal;
background-color: #D2FBDD;
border: thin doble #DCD7F2;
}
.Estilo51 {
color: #FF3366;
font-weight: bold;
font-size: 14px;
}
-->
</style>
</head>
<body>
<form action="" method="post" name="form1" class="titular2" id="form1">
<div align="center">
<table width="360" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
<div align="center"><span class="Estilo1">INGRESO DE BENEFICIARIOS </span> </div>
</caption>
<tr>
<th colspan="2" scope="col"><label>Digite el Numero de Cedula del Titular </label></th>
</tr>
<tr>
<td width="162"><div align="center"><span class="Estilo2">CEDULA : </span></div></td>
<td width="152"><div align="center">
<input name="ced" type="text" id="ced" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="consultar" type="submit" class="Estilo3" id="consultar" value="Consultar" />
</div></td>
</tr>
</table>
<p> </p>
<table width="719" border="3" cellpadding="3" cellspacing="3" class="titular">
<tr>
<th colspan="4" scope="col"><span class="Estilo4">Informacion Titular </span></th>
</tr>
<tr>
<td width="63"><div align="center"><span class="Estilo5">Nombre : </span></div></td>
<td width="421"><label>
<input name="nomb" type="text" id="nomb" value="<?php echo $nom ?>" size="70" maxlength="70" readonly = ""/>
</label></td>
<td width="63"><div align="center"><span class="Estilo5">Cedula : </span></div></td>
<td width="121"><input name="cedu" type="text" id="cedu" value="<?php echo $ced2 ?>" size="20" maxlength="20" readonly = ""/></td>
</tr>
</table>
<p>
<?php
//$msql = "select cedula, nombre from beneficiarios where cedula_titular = '$ced2'";
// $result = mysql_query($msql, $dbi);
$result = mysql_query('SELECT cedula, nombre FROM beneficiarios WHERE cedula_titular = "' . $_POST[ced2] . '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{
echo "<table width=750 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=4 bgcolor=#ECE9D8><div align=center class='titular'>BENEFICIARIOS</div></td>
</tr>
<tr align=center>
<td width='34' class=recaudo>NOMBRE</td>
<td width='34' class=recaudo>CEDULA</td>
</tr>";
while(list($nombf,$cedbf) = mysql_fetch_row($result))
{
echo "<tr class=listben><td align=center>$cedbf</td><td align=center>$nombf</td></tr>";
}
}
?>
</table>
</p>
<table width="382" border="1" class="sig1">
<tr>
<td width="265" height="40"><div align="center"><span class="Estilo51">Desea ingresa otro beneficiario </span></div></td>
<td width="99"><label>
<div align="center">
<?php echo "<input type='button' value='Continuar' name=cont class=benef onClick =window.open('info_beneficiario.php?id=$ced2','','top=50,left=100,toolbar=no,scrollbars=yes,width=790,height=320,status=yes')></a>"; ?>
</div>
</label></td>
</tr>
</table>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_datos_cartera_servi.php'" value="IR AL MENU" />
</p>
</div>
</form>
<p> </p>
</body>
</html>