File: /home/asjudine/www/info_beneficiario.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["guardar"]))
{
if($id!='')
{
mysql_query("INSERT INTO beneficiarios(cedula, nombre, cedula_titular, parentesco, telefono, celular, direccion, ciudad, departamento, email) VALUES ('" . $_POST["cedben"] . "', '" . $_POST["nomben"] . "', '" . $_POST["id"] . "', '" . $_POST["parentesco"] . "', '" . $_POST["telefono"] . "', '" . $_POST["celu"] . "', '" . $_POST["direccion"] . "', '" . $_POST["ciudad"] . "', '" . $_POST["departamento"] . "', '" . $_POST["email"] . "')");
/*value
('$cedben', '$nomben', '$id', '$parentesco', '$telefono','$celu', '$direccion', '$ciudad', '$departamento', '$email')";
mysql_query($sql, $dbi) or die(mysql_error()); */
echo "<script>alert('La informacion fue grabada correctamente');</script>";
}else{
echo "<script>alert('Debe consultar el titular para ingresar un Beneficiario');</script>";
}
}
?>
<!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>Documento sin título</title>
<style type="text/css">
<!--
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo6 {font-size: 16px}
.Estilo7 {color: #FF6600}
.Estilo8 {color: #0000FF}
.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;
}
.benef {}
.benef2 { background-color: #DAFAE4;
}
-->
</style>
</head>
<body>
<form action="" method="post" name="form2" class="benef2" id="form2">
<div align="center">
<table width="706" border="3" cellpadding="3" cellspacing="3" class="benef">
<tr>
<td colspan="4"><div align="center" class="Estilo6 Estilo7">Ingresar Informacion Beneficiario </div></td>
</tr>
<tr>
<td width="135"><div align="right" class="Estilo8">Apellidos y Nombres : </div></td>
<td colspan="3"><div align="left">
<input name="nomben" type="text" id="nomben" size="70" maxlength="70"/>
</div></td>
</tr>
<tr>
<td><div align="right" class="Estilo8">Cedula : </div></td>
<td width="125"><div align="left">
<input name="cedben" type="text" id="cedben" size="20" maxlength="20"/>
</div></td>
<td width="91"><div align="right" class="Estilo8">Parentesco : </div></td>
<td width="300"><label> </label>
<label>
<div align="left">
<select name="parentesco" id="parentesco">
<option>--SELECCION PARENTESCO--</option>
<option value="CONYUGUE">CONYUGUE</option>
<option value="HIJO">HIJO</option>
<option value="PADRES">PADRES</option>
<option value="HERMANOS">HERMANOS</option>
<option value="OTROS">OTROS</option>
</select>
</div>
</label></td>
</tr>
<tr>
<td><div align="right" class="Estilo8">Telefono : </div></td>
<td><input name="telefono" type="text" id="telefono" size="20" maxlength="20"/></td>
<td><div align="right" class="Estilo8">Celular : </div></td>
<td><div align="left">
<input name="celu" type="text" id="celu" size="20" maxlength="20"/>
</div></td>
</tr>
<tr>
<td><div align="right" class="Estilo8">Ciudad : </div></td>
<td><div align="left">
<input name="ciudad" type="text" id="ciudad" size="20" maxlength="20"/>
</div></td>
<td><div align="right" class="Estilo8">Direccion : </div></td>
<td><div align="left">
<input name="direccion" type="text" id="direccion" size="50" maxlength="50" />
</div></td>
</tr>
<tr>
<td><div align="right" class="Estilo8">Departamento : </div></td>
<td><div align="left">
<input name="departamento" type="text" id="departamento" />
</div></td>
<td><div align="right" class="Estilo8">Email : </div></td>
<td><div align="left">
<input name="email" type="text" id="email" size="40" maxlength="40"/>
</div></td>
</tr>
<tr>
<td colspan="4"><label>
<div align="center">
<input name="guardar" type="submit" class="Estilo8" id="guardar" value="Guardar" />
</div>
</label></td>
</tr>
</table>
</div>
<p align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_datos_cartera_servi.php'" value="IR AL MENU" />
</p>
</form>
</body>
</html>