File: /home/asjudine/public_html/formulario_modificar_cartera_credito_rotativo.php
<?php
require_once("Conectarse.php");
global $dbi;
$espacio = ' ';
$linea = '-';
$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, tipocontrato , numero_libranza , tipo_afiliado, codigo_sucursal, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota, fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director, beneficiarios, renovacion, causal_terminacion, fecha_terminacion, estado FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numcont, $plan, $num_lib, $titular, $codigosu, $dire, $tele, $celul, $ciud, $email, $cue, $ban, $enti, $unides, $codides, $entre, $fecna, $fechafil, $valcon, $numcuo, $valcuo, $fechainicio, $fechatermino, $fechaul, $mesini, $anoini, $mesfin, $anofin, $salant, $cupen, $cudesc, $salnue, $ven, $director, $bene, $renova, $causal, $fechater, $esta) = mysql_fetch_row($control);
$inipag = $anoini.'-'.$mesini;
$control = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' . "$codigosu". '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
list($codigosu) = mysql_fetch_row($control);
//CONSULTA SI TIENE CREDITO
/*$con = mysql_query('SELECT cedula, estado FROM creditos_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" || codigo = "' . $_GET["ced2"] . '" ');*/
//ahora consultamos si tiene credito rotativo
$con = mysql_query('SELECT cedula, estado FROM credito_rotativo WHERE cedula = "' . $_GET["ced2"] . '" ');
if (!$con) {
die('Invalid query 1: ' . mysql_error());
}
$numcre=mysql_num_rows($con);
list($cedcre, $estacre) = mysql_fetch_row($con);
if($cedcre > 0)
{
$cre = "SI";
}
else{
$cre = "NO";
}
/*if ($numcre == '0')
{
$cre = 'NO';
}
else
{
if ($estacre == 0)
{
$vigente = "H" ;
$cre = 'SI';
}else
{
$vigente = "V";
$cre = 'SI';
}
}
*/
// AQUI ACABA CONSULTA CREDITOS
//////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO
//////////////////////////////////
$consultar_rotativo = mysql_query('SELECT cedula, libranza_credito, fecha_inscripcion, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa FROM credito_rotativo WHERE cedula = "'.$_GET["ced2"].'" ');
if (!$consultar_rotativo) {
die('Invalid query: ' . mysql_error());
}
list($cedula_consulta, $cred, $fecha_inscribio, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa)=mysql_fetch_row($consultar_rotativo);
?>
<!DOCTYPE html>
<html>
<head>
<title>Solicitud Credito Rotativo</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*{margin: 0;padding: 0;}
body{background-color:#FFF;font-family:Geneva, Arial, Helvetica, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.cerrarsesion{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
.cerrarsesion:hover{background-color: #ffffff;color: #000;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #FFCC66; padding: 2px;color: #8A0003;font-size: 15px; text-align: center;font-weight:600;}
td{border:#D6D6D6 solid 1px;}
.tdizq{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
.tdcen{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
.tdder{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
.exp{color:#8A0000; font-size:10px;}
.rojo{color:#C60000;}
.fuerte{font-weight:400;}
.boton1{width:200px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{padding: 1px 3px; height:23px; background-color: #FFFFFF; font-weight:400;}
/*Estilo Complementario*/
.tdi{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdc{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdd{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 13px;}
.botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
input[type=text].corta{width: 30px;text-align:left;padding: 3px;}
.tdverde{background-color: #EEE; color:#008000; font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif; text-align:right;}
.marquee{padding: 0 30px}
.marca{width:80%; color:#DD3135; text-transform:uppercase;}
.verde{color:#008000;}
</style>
<script Language="JavaScript">
function valida_envia(){
/*if(document.form1.email.value != /^[-\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63}$/i || document.form1.email.value=="" || document.form1.email.value == "-")
{
alert("EMAIL Invalido.")
document.form1.email.focus()
return (false);
}
if(document.form1.cel.value != /^[6]\d{8}$/ || document.form1.cel.value == "" || document.form1.cel.value == "-")
{
alert("CELULAR INVALIDO.")
document.form1.cel.focus()
return (false);
}
*/
return (true);
}
</script>
<script>
function validarEntero(valor){
//intento convertir a entero.
//si era un entero no le afecta, si no lo era lo intenta convertir
valor = parseInt(valor)
//Compruebo si es un valor numérico
if (isNaN(valor)) {
//entonces (no es numero) devuelvo el valor cadena vacia
return ""
}else{
//En caso contrario (Si era un número) devuelvo el valor
return valor
}
}
</script>
</head>
<body >
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">SOLICITUD CREDITO ROTATIVO</h3>
<form action="" method="post" onsubmit="return valida_envia()" name="form1" id="form1">
<!--<div align="center">
<div class="Estilo1">SOLICITUD CARTERA JURIDICA</div>-->
<table width="1110" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="fecha" colspan="6">DATOS DEL TITULAR</td>
</tr>
<tr>
<td class="tdcen" scope="col" > </td>
<td class="tdder">Fecha Afiliacion</td>
<td class="tdizq"><input name="fechas" class="rojo" type="text" id="fechas" value="<?php echo $fechafil ?>" size="10" maxlength="10" readonly /></td>
<td class="tdder">Sucursal </td>
<td class="tdizq" colspan="3" scope="col">
<input name="codigosu" type="text" id="codigosu" value="<?php echo $codigosu ?>" size="20" maxlength="20" readonly />
CREDITO
<input name="cre" type="text" class="rojo" id="cre" value="<?php echo $cre ?>" size="4" maxlength="4" readonly />
- <input name="vigente" type="text" class="Estilo50" id="vigente" value="<?php echo $vigente ?>" size="4" maxlength="4" readonly />
</td>
</tr>
<tr>
<td class="tdder">Apellidos y Nombres</td>
<td class="tdizq" colspan="3"><input name="apenom" type="text" id="apenom" value="<?php echo $apes ?>" size="60" maxlength="65" readonly=""/>
</td>
<td class="tdder">Cedula No</td>
<td class="tdizq"><input name="cedb" type="text" id="cedb" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly="" /></td>
</tr>
<tr>
<td class="tdder">Cogido Militar </td>
<td class="tdizq"><input name="cod" type="text" id="cod" value="<?php echo $codi ?>" size="14" maxlength="20" readonly /></td>
<td class="tdverde">Grado</td>
<td class="tdizq"><input name="gra" type="text" id="gra" value="<?php echo $grad ?>" size="12" maxlength="10" /></td>
<td class="tdder">Fecha Nacimiento</td>
<td class="tdizq"><input name="fecna" type="text" id="fecna" value="<?php echo $fecna ?>" size="7" maxlength="7" readonly />
<span class="exp">DIA-MES</span> </td>
</tr>
<tr>
<td class="tdverde">Ciudad</td>
<td class="tdizq"><input name="ciud" type="text" id="ciud" value="<?php echo $ciud ?>" size="14" maxlength="20" /></td>
<td class="tdverde">Direccion </td>
<td class="tdizq" colspan="2"><input name="dire" type="text" id="dire" value="<?php echo $dire ?>" size="45" maxlength="45" /></td>
<td class="tdcen"></td>
</tr>
<tr>
<td class="tdverde">Telefono </td>
<td class="tdizq"><input name="tel" type="text" id="tel" value="<?php echo $tele ?>" size="10" maxlength="20" /></td>
<td class="tdverde">Celular</td>
<td class="tdizq"><input name="cel" type="text" id="cel" value="<?php echo $celul ?>" size="20" maxlength="20" /></td>
<td class="tdverde">E-mail :</td>
<td class="tdizq" colspan="2"><input name="email" type="text" id="email" value="<?php echo $email ?>" size="30" maxlength="30"/></td>
</tr>
<tr>
<td class="tdder">Plan :</td>
<td class="tdizq"><input name="plan" type="text" id="plan" value="<?php echo $plan ?>" size="5" maxlength="5" readonly /></td>
<td class="tdder">Cuenta No :</td>
<td class="tdizq"><input name="cue" type="text" id="cue" value="<?php echo $cue ?>" size="20" maxlength="20" readonly/></td>
<td class="tdder">Banco</td>
<td class="tdizq" colspan="2"><input name="ban" type="text" id="ban" value="<?php echo $ban ?>" size="20" maxlength="20" readonly/></td>
</tr>
<tr>
<td class="tdder">Numero Contrato</td>
<td class="tdizq"><input name="numcont" type="text" id="numcont" value="<?php echo $numcont ?>" size="12" maxlength="10" readonly/></td>
<td class="tdder">Numero libranza</td>
<td class="tdizq"><input name="num_lib" type="text" id="num_lib" value="<?php echo $num_lib ?>" size="12" maxlength="12" readonly=""/></td>
<td class="tdder">Libranza Credito</td>
<td class="tdizq"><input name="vendedor" type="text" class="rojo" id="ven" value="<?php echo $cred ?>" size="30" maxlength="30" readonly/></td>
</tr>
</table>
<!--
<br><br>
<table width="1110" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="fecha" colspan="6">COMPLETE LA SIGUIENTE INFORMACION</td>
</tr>
<tr>
<td class="tdder">FECHA</td>
<td class="tdizq">
<td class="tdder" colspan="3">FECHA INSCRIPCION</td>
<td class="tdizq" colspan="3"><input name="fecha_insc" type="text" class="rojo" id="fecha_insc" value="<?php echo $fecha_inscribio ?>" size="30" maxlength="30" readonly/></td>
</tr>
<tr>
<td class="tdder">Nombre Padre</td>
<td class="tdizq" colspan="2"><input name="nom_padre" type="text" id="nom_padre" value="<?php echo $nompadre ?>" size="40" maxlength="40" /></td>
<td class="tdder">Nombre Madre</td>
<td class="tdizq" colspan="2"><input name="nom_madre" type="text" id="nom_madre" value="<?php echo $nommadre ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder">Direccion de Padres</td>
<td class="tdizq" colspan="2"><input name="dir_padres" type="text" id="dir_padres" value="<?php echo $direcpadres ?>" size="40" maxlength="40" /></td>
<td class="tdder">Ciudad</td>
<td class="tdizq" colspan="2"><input name="ciudad_padres" type="text" id="ciudad_padres" value="<?php echo $ciudadpadres ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder">Telefono Padres</td>
<td class="tdizq" colspan="2"><input name="tel_padres" type="text" id="tel_padres" value="<?php echo $telpadres ?>" size="40" maxlength="40" /></td>
<td class="tdder">Celular Padres</td>
<td class="tdizq" colspan="2"><input name="cel_padres" type="text" id="cel_padres" value="<?php echo $celpadres ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder" >Referencia <br> COMPAÑERO</td>
<td class="tdizq" colspan="2"><input name="ref_compa" type="text" id="nom_padre" value="<?php echo $refcompa ?>" size="40" maxlength="40" /></td>
<td class="tdder">Nº Celular Compañero</td>
<td class="tdizq" colspan="2"><input name="cel_compa" type="text" id="nom_madre" value="<?php echo $celcompa ?>" size="40" maxlength="40" /></td>
</tr>
<tr align="center">
<td colspan="6"></td>
</TR>
</table>
-->
<p align="center">
<input name="enviar" type="submit" class="direcciona" id="enviar" value="MODIFICAR">
</p>
<br>
<div class="marquee">
<marquee behavior="alternate" scrolldelay="100">
<p class="marca" >Los campos en <span class="verde">verde</span> son ACTUALIZABLES</p></marquee>
</div>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["enviar"]))
{
$actualiza_datos_cartera = mysql_query('UPDATE cartera_serviasjudinet SET grado = "'.$_POST["gra"].'", ciudad = "'.$_POST["ciud"].'", direccion = "'.$_POST["dire"].'", telefono = "'.$_POST["tel"].'", celular = "'.$_POST["cel"].'", email = "'.$_POST["email"].'" WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
if (!$actualiza_datos_cartera) {
die('Invalid query actualiza err: ' . mysql_error());
}
$ced2 = $_GET["ced2"];
$numcon = $_GET["numcon"];
$plan = $_GET["tipo"];
echo "<script>alert('Datos Modificados');</script>";
echo "<script>window.location='formulario_ingresar_credito_inter.php?ced2=$ced2&numcon=$numcon&tipo=$plan';</script>";
}
?>