File: /home/asjudine/public_html/modificar_datos_credito_nombre.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
if(isset($_POST["consultar"]))
{
$mssql = mysql_query("select * from creditos where cedula = '$cedula' ",$dbi);
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$sql = "select ciudad, cedula, nombres, direccion_envio, ciudad_envio, telefono, celular, email, cuenta_ahorros, banco_cuenta, sucursal, numero_libranza from creditos where cedula = '$cedula' ";
$control = mysql_query($sql, $dbi) or die(mysql_error());
list($ciu, $ced, $nom, $dir, $ciuenv, $tel, $cel, $ema, $cue, $ban, $suc, $num_lib) = mysql_fetch_array($control);
}
}else{
echo "<script>alert('No existe el numero de cedula en la base de datos');</script>";
}
}
if(isset($_POST["enviar"]))
{
$mssql = "update creditos set ciudad='$ciudad',
direccion_envio='$direccion_env',
ciudad_envio='$ciudad_env',
telefono='$telefono',
celular='$celular',
email='$email',
cuenta_ahorros='$cuenta_aho',
banco_cuenta='$banco',
sucursal='$sucursal',
numero_libranza='$numero_libranza' where cedula = '$cedu' ";
mysql_query($mssql, $dbi) or die(mysql_error());
echo "<script>alert('Se ha modificado correctamente la informacion');</script>";
$sql = "select ciudad, cedula, nombres, direccion_envio, ciudad_envio, telefono, celular, email, cuenta_ahorros, banco_cuenta, sucursal, numero_libranza from creditos where cedula = '$cedu' ";
$control = mysql_query($sql, $dbi) or die(mysql_error());
list($ciu, $ced, $nom, $dir, $ciuenv, $tel, $cel, $ema, $cue, $ban, $suc, $num_lib) = mysql_fetch_array($control);
}
?>
<html>
<head>
<title>Modificar Creditos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.Estilo1 {
font-family: "Courier New", Courier, monospace;
font-weight: bold;
color: #3366FF;
font-size: 18px;
}
.tabla1 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-weight: bold;
color: #339999;
background-color: #B7FFFF;
border: medium doble #CC9900;
}
.Estilo55 { font-family: Arial;
font-size: 16px;
color: #0066FF;
font-weight: bold;
}
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.Estilo58 {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color: #003399; display: block; }
.Estilo51 { color: #3366FF;
font-weight: bold;
}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.boton111 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<p class="Estilo1">MODIFICAR DATOS CREDITO </p>
<p class="Estilo1"><span class="Estilo58">Debe especificar una cadena de caracteres a buscar:</span></p>
<table width="567" border="3" cellspacing="2" cellpadding="2">
<tr>
<td width="153"><div align="center"><span class="Estilo55">Nombre:</span></div></td>
<td width="141"><div align="center">
<label>
<input name="cedula" type="text" id="cedula" size="50" maxlength="50">
</label>
</div></td>
</tr>
</table>
<p class="Estilo1"><span class="Estilo51">
<input name="consultar" id="consultar" type="submit" class="boton11" value="Consultar" />
</span></p>
<table width="867" height="271" border="3" cellpadding="2" cellspacing="2" class="tabla1">
<tr>
<th width="135" height="39" scope="col"><div align="center">Cedula:
</div></th>
<th width="240" scope="col"><div align="left">
<input name="cedu" type="text" id="cedu" value="<?php echo $ced ?>" size="15" maxlength="15" readonly = "" />
</div></th>
<th width="150" scope="col">Nombre: </th>
<th width="300" scope="col"><div align="left">
<input name="nomb" type="text" id="nomb" value="<?php echo $nom ?>" size="50" maxlength="50" readonly = "" />
</div></th>
</tr>
<tr>
<td height="43"><div align="center">Ciudad:
</div></td>
<td height="43"><div align="left">
<input name="ciudad" type="text" id="ciudad" value="<?php echo $ciu ?>" size="30" maxlength="30" />
</div></td>
<td><div align="center">Numero Libranza : </div></td>
<td><input name="numero_libranza" type="text" id="numero_libranza" value="<?php echo $num_lib ?>" size="30" maxlength="30" /></td>
</tr>
<tr>
<td height="44"><div align="center">Direccion Envio :
</div></td>
<td height="44"><div align="left">
<input name="direccion_env" type="text" id="direccion_env" value="<?php echo $dir ?>" size="40" maxlength="40" />
</div></td>
<td><div align="center">Ciudad Envio :
</div></td>
<td><div align="left">
<input name="ciudad_env" type="text" id="ciudad_env" value="<?php echo $ciuenv ?>" size="40" maxlength="40" />
</div></td>
</tr>
<tr>
<td height="37"><div align="center">Telefono :
</div></td>
<td height="37"><div align="left">
<input name="telefono" type="text" id="telefono" value="<?php echo $tel ?>" size="20" maxlength="20" />
</div></td>
<td><div align="center">Celular :
</div></td>
<td><div align="left">
<input name="celular" type="text" id="celular" value="<?php echo $cel ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td height="45"><div align="center">Email :
</div></td>
<td height="45"><div align="left">
<input name="email" type="text" id="email" value="<?php echo $ema ?>" size="20" maxlength="20" />
</div></td>
<td><div align="center">Cuenta Ahorros No :
</div></td>
<td><div align="left">
<input name="cuenta_aho" type="text" id="cuenta_aho" value="<?php echo $cue ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td height="41"><div align="center">Banco :
</div></td>
<td height="41"><div align="left">
<input name="banco" type="text" id="banco" value="<?php echo $ban ?>" size="30" maxlength="30" />
</div></td>
<td><div align="center">Sucursal :
</div></td>
<td><div align="left">
<input name="sucursal" type="text" id="sucursal" value="<?php echo $suc ?>" size="40" maxlength="40" />
</div></td>
</tr>
</table>
<p><span class="Estilo51">
<input name="enviar" id="enviar" type="submit" class="boton111" value="Enviar" />
</span></p>
<p><span class="Estilo51">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_credito.php'" value="IR AL MENU">
</span></p>
</div>
</form>
</body>
</html>