File: /home/asjudine/public_html/acobranzas/cobranzas_consulta_todo.php
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("../Conectarse.php");
echo "<form name='form' action='' method='post'>";
global $dbi;
$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 FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numcon, $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, $mester, $anoterz, $salant, $cupen, $cudesc, $salnue, $ven, $director, $bene) = mysql_fetch_row($control);
$cont = mysql_query('SELECT nombre, telefono, celular, direccion, ciudad, email FROM contactos_afiliados WHERE cedula_titular = "' . $_GET["ced2"] . '" and numero_contrato_titular = "' . $_GET["numcon"] . '" and tipo_contrato_titular = "' . $_GET["tipo"] . '" ');
if (!$cont) {
die('Invalid query cont 1: ' . mysql_error());
}
list($nomcon, $telcon, $celcon, $dircon, $ciucon, $emailcon) = mysql_fetch_row($cont);
$contcre = mysql_query('SELECT nombre, telefono, celular, direccion, ciudad, email FROM creditos_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" ');
if (!$contcre) {
die('Invalid query cont 1: ' . mysql_error());
}
list($nomcre, $telcre, $celucre, $direcre, $ciucre, $emailcre) = mysql_fetch_row($contcre);
$contben = mysql_query('SELECT nombre, telefono, celular, direccion, ciudad, email FROM beneficiarios WHERE cedula_titular = "' . $_GET["ced2"] . '" ');
if (!$contben) {
die('Invalid query cont 1: ' . mysql_error());
}
list($nomben, $telben, $celuben, $direben, $ciuben, $emailben) = mysql_fetch_row($contben);
$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);
$cont10 = mysql_query('SELECT nombre FROM entidad_laboral WHERE codigo = "' . "$enti". '"');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($enti) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT nombre FROM director_ventas WHERE codigo = "' . "$director". '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT concepto FROM descuentos WHERE id = "' . "$entre". '"');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($entre) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' . "$ven". '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($ven) = mysql_fetch_row($cont10);
if ($plan > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$plan". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($plan) = mysql_fetch_row($cont10);
}
if(isset($_POST["guardar"]))
{
$cont = mysql_query('SELECT nombre, telefono, celular, direccion, ciudad, email FROM contactos_afiliados WHERE cedula_titular = "' . $_GET["ced2"] . '" and numero_contrato_titular = "' . $_GET["numcon"] . '" and tipo_contrato_titular = "' . $_GET["tipo"] . '" ');
if (!$cont) {
die('Invalid query cont 1: ' . mysql_error());
}
list($nomcon, $telcon, $celcon, $dircon, $ciucon, $emailcon) = mysql_fetch_row($cont);
if ((mysql_num_rows($cont)==0))
{
$mss = mysql_query("INSERT INTO contactos_afiliados (nombre, cedula_titular, numero_contrato_titular, tipo_contrato_titular, telefono, celular, direccion, ciudad, email) VALUES ('" . $_POST["apesben"] . "', '" . $_POST["cedb"] . "', '" . $_POST["numcon"] . "', '" . $_POST["plan"] . "', '" . $_POST["teleben"] . "', '" . $_POST["celulben"] . "', '" . $_POST["direben"] . "', '" . $_POST["ciueben"] . "' , '" . $_POST["emailben"] . "')");
if (!$mss) {
die('Invalid query contactos_afiliados insertar: ' . mysql_error());
}
}
else
{
$mssq = mysql_query("UPDATE contactos_afiliados set nombre = '" . $_POST[apesben] . "', direccion = '" . $_POST[direben] . "', telefono = '" . $_POST[teleben] . "', celular = '" . $_POST[celulben] . "', ciudad = '" . $_POST[ciueben] . "', email = '" . $_POST[emailben] . "' WHERE cedula_titular = '" . $_GET[ced2] . "' and numero_contrato_titular = '" . $_GET[numcon] . "' and tipo_contrato_titular = '" . $_GET[tipo] . "' ");
if (!$mssq) {
die('Invalid query mssq insertar: ' . mysql_error());
}
}
$mssql3 = mysql_query("UPDATE cartera_serviasjudinet set direccion = '" . $_POST[dire] . "', telefono = '" . $_POST[tel] . "', celular = '" . $_POST[cel] . "', ciudad = '" . $_POST[ciud] . "', email = '" . $_POST[email] . "', fecha_nacimiento = '" . $_POST[fecna] . "' WHERE cedula = '" . $_GET[ced2] . "' and numerocontrato = '" . $_GET[numcon] . "' and tipocontrato = '" . $_GET[tipo] . "' ");
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet insertar: ' . mysql_error());
}
echo "<script>alert('Información Guardado Correctamente');</script>";
$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 FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" and tipocontrato = "' . $_GET["tipo"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numcon, $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, $mester, $anoterz, $salant, $cupen, $cudesc, $salnue, $ven, $director, $bene) = mysql_fetch_row($control);
$cont = mysql_query('SELECT nombre, telefono, celular, direccion, ciudad, email FROM contactos_afiliados WHERE cedula_titular = "' . $_GET["ced2"] . '" and numero_contrato_titular = "' . $_GET["numcon"] . '" and tipo_contrato_titular = "' . $_GET["tipo"] . '" ');
if (!$cont) {
die('Invalid query cont 1: ' . mysql_error());
}
list($nomcon, $telcon, $celcon, $dircon, $ciucon, $emailcon) = mysql_fetch_row($cont);
}
$sql = mysql_query('SELECT * FROM entidad_laboral order by nombre ');
if (!$sql) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$sql2 = mysql_query('SELECT * FROM descuentos order by codigo ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$sql3 = mysql_query('SELECT * FROM descuentos order by codigo ');
if (!$sql3) {
die('Invalid query: ' . mysql_error());
}
$row_sql3 = mysql_fetch_assoc($sql3);
$totalRows_sql3 = mysql_num_rows($sql3);
$sql4 = mysql_query('SELECT * FROM vendedores WHERE estado = "1" order by vendedor');
if (!$sql4) {
die('Invalid query: ' . mysql_error());
}
$row_sql4 = mysql_fetch_assoc($sql4);
$totalRows_sql4 = mysql_num_rows($sql4);
$sql5 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql5) {
die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
$sql6 = mysql_query('SELECT * FROM descuentos order by codigo ');
if (!$sql6) {
die('Invalid query: ' . mysql_error());
}
$row_sql6 = mysql_fetch_assoc($sql6);
$totalRows_sql6 = mysql_num_rows($sql6);
$sql7 = mysql_query('SELECT * FROM director_ventas WHERE estado = "1" order by nombre');
if (!$sql7) {
die('Invalid query: ' . mysql_error());
}
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);
$sql8 = mysql_query('SELECT * FROM planes_contratos WHERE codigo != "7" and codigo != "8" order by codigo ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
?>
<!DOCTYPE html>
<html>
<head>
<title>SOLICITUD INGRESO BENEFICIARIO</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:#FFFFFF;font-family:"Lucida Sans Unicode", "Lucida Grande", 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;}
.subtitulos{width: 100%;text-align: left;color: #b20606;padding: 2px 0;font-size: 13px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
td{border: #D7D7D7 solid 0.2px;}
.tdizq{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 14px;font-weight: 400; text-align: left;}
.tdcen{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 14px;font-weight: 400; text-align: center;}
.tdder{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 14px;font-weight: 400; text-align: right;}
.tdroja{background-color: #EEE; padding: 1px 1px;color: #CC0005;font-size: 14px;font-weight: 600; text-align: right;}
.tdi{background-color: #FDF8D5; padding: 1px 1px;color: #C0292E;font-size: 14px;font-weight: 500; text-align: left;}
.tdc{background-color: #FDF8D5; padding: 1px 1px;color: #C0292E;font-size: 14px;font-weight: 500; text-align: center;}
.tdd{background-color: #FDF8D5; padding: 1px 1px;color: #C0292E;font-size: 14px;font-weight: 500; text-align: right;}
.exp{color:#8A0000; font-size:12px;}
.boton1{width:200px;background-color: #ffffff;color: #000;padding: 4px;border:1px solid #580000;border-radius:2px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
input[type=text]{border:groove #191919 0.5px; border-radius: 3px; padding: 3px;background-color: #FFFFFF; font-weight:700px;}
select{border:solid #191919 0.5px; border-radius: 3px; padding: 3px;background-color: #FFFFFF; font-weight:600px; }
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 5px; text-align: center; font-size: 12px; font-family:Verdana, Geneva, sans-serif;}
.tdjustify{background-color: #fff; color: #000; padding: 5px; text-align: justify; font-size: 12px; font-family:Verdana, Geneva, sans-serif;}
.botonnew{width: 90px; background-color: #C0292E;color: #FFFFFF;padding: 1px;border-radius:5px;}
.botonnew:hover{background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</style>
<script Language="JavaScript">
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
}
}
function valida_envia(){
//valido LOS APELLIDOS
if (document.form1.ape.value.length==0){
alert("Tiene que escribir sus apellidos")
document.form1.ape.focus()
return (false);
}
//valido el nombre
if (document.form1.noms.value.length==0){
alert("Tiene que escribir sus nombres")
document.form1.noms.focus()
return (false);
}
//valido la cedula
if (document.form1.ced.value.length==0){
alert("Tiene que escribir el numero de cedula")
document.form1.ced.focus()
return (false);
}
return (true);
}
</script>
</head>
<body >
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">DATOS TITULAR</h3>
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
<div align="center">
<table border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<!--<caption>
<div align="center"><br />
<span class="Estilo72"> DATOS TITULAR</span><br />
<br />
</caption>-->
<tr>
<td class="tdder">Apellidos y Nombres:</td>
<td class="tdizq" colspan="3"><input name="apenom" type="text" class="Estilo66" 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" class="Estilo66" 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" class="Estilo66" id="cod" value="<?php echo $codi ?>" size="14" maxlength="20" readonly=""/></td>
<td class="tdder">Grado :</td>
<td class="tdizq"><input name="gra" type="text" class="Estilo66" id="gra" value="<?php echo $grad ?>" size="12" maxlength="10" readonly=""/></td>
<td class="tdder">Fecha Nacimiento :</td>
<td class="tdizq"><input name="fecna" type="text" class="Estilo66" id="fecna" value="<?php echo $fecna ?>" size="5" maxlength="5" />
<span class="exp">DIA-MES</span> </td>
</tr>
<tr>
<td class="tdder">Cuidad :</td>
<td class="tdizq"><input name="ciud" type="text" class="Estilo66" id="ciud" value="<?php echo $ciud ?>" size="14" maxlength="20" /></td>
<td class="tdder">Direccion :</td>
<td class="tdizq" colspan="3"><input name="dire" type="text" class="Estilo66" id="dire" value="<?php echo $dire ?>" size="45" maxlength="45" /></td>
</tr>
<tr>
<td class="tdder">Telefono :</td>
<td class="tdizq"><input name="tel" type="text" class="Estilo66" id="tel" value="<?php echo $tele ?>" size="10" maxlength="20" /></td>
<td class="tdder">Celular </td>
<td class="tdizq"><input name="cel" type="text" class="Estilo66" id="cel" value="<?php echo $celul ?>" size="20" maxlength="20" /></td>
<td class="tdder">E-mail :</td>
<td class="tdizq" colspan="2"><input name="email" type="text" class="Estilo66" id="email" value="<?php echo $email ?>" size="35" maxlength="35"/></td>
</tr>
<tr>
<td class="tdder">Plan :</td>
<td class="tdizq"><input name="plan" type="text" class="Estilo66" id="plan" value="<?php echo $plan ?>" size="5" maxlength="5" readonly=""/></td>
<td class="tdder"> N° Contrato:</td>
<td class="tdizq"><input name="numcon" type="text" class="Estilo66" id="numcon" value="<?php echo $numcon ?>" size="20" maxlength="20" readonly=""/></td>
</tr>
</table>
<table width="650" border="2" cellpadding="1" cellspacing="1" class="label">
<caption>
<span class="fecha" >DATOS CONTACTO</span><br />
</caption>
<tr>
<td class="tdder">Nombres:</td>
<td class="tdizq"><input name="apesben" type="text" class="Estilo66" id="apesben" value="<?php echo $nomcon ?>" size="50" maxlength="50" /></td>
<td class="tdder">Cuidad :</td>
<td class="tdizq"><input name="ciueben" type="text" class="Estilo66" id="ciueben" value="<?php echo $ciucon ?>" size="14" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Email:</td>
<td class="tdizq"><input name="emailben" type="text" class="Estilo66" id="emailben" value="<?php echo $emailcon ?>" size="35" maxlength="35" /></td>
<td class="tdder">Telefono :</td>
<td class="tdizq"><input name="teleben" type="text" class="Estilo66" id="teleben" value="<?php echo $telcon ?>" size="10" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Direccion :</td>
<td class="tdizq"><input name="direben" type="text" class="Estilo66" id="direben" value="<?php echo $dircon ?>" size="45" maxlength="45" /></td>
<td class="tdder">Celular :</td>
<td class="tdizq"><input name="celucren" type="text" class="Estilo66" id="celucren" value="<?php echo $celucren ?>" size="11" maxlength="11" /></td>
</tr>
</table>
<table width="650" border="2" cellpadding="1" cellspacing="1" class="label">
<caption>
<span class="fecha" >DATOS CREDITO</span><br />
</caption>
<tr>
<td class="tdder">Nombres:</td>
<td class="tdizq"><input name="nomcre" type="text" class="Estilo66" id="nomcre" value="<?php echo $nomcre ?>" size="50" maxlength="50" /></td>
<td class="tdder">Cuidad :</td>
<td class="tdizq"><input name="ciucre" type="text" class="Estilo66" id="ciucre" value="<?php echo $ciucre ?>" size="14" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Email:</td>
<td class="tdizq"><input name="emailcre" type="text" class="Estilo66" id="emailcre" value="<?php echo $emailcre ?>" size="35" maxlength="35" />
<td class="tdder">Telefono :</td>
<td class="tdizq"><input name="telcre" type="text" class="Estilo66" id="telcre" value="<?php echo $telcre ?>" size="10" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Direccion :</td>
<td class="tdizq"><input name="direcre" type="text" class="Estilo66" id="direcre" value="<?php echo $direcre ?>" size="45" maxlength="45" /></td>
<td class="tdder">Celular :</td>
<td class="tdizq"><input name="celucre" type="text" class="Estilo66" id="celucre" value="<?php echo $celucre ?>" size="11" maxlength="11" /></td>
</tr>
</table>
<table width="650" border="2" cellpadding="1" cellspacing="1" class="label">
<caption>
<div align="center" ><br />
<span class="fecha">DATOS BENEFICIARIO</span><br />
</caption>
<tr>
<td class="tdder"> Nombres:</td>
<td class="tdizq"><input name="nomben" type="text" class="Estilo66" id="nomben" value="<?php echo $nomben ?>" size="50" maxlength="50" /></td>
<td class="tdder">Cuidad :</td>
<td class="tdizq"><input name="ciuben" type="text" class="Estilo66" id="ciuben" value="<?php echo $ciuben ?>" size="14" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Email:</td>
<td class="tdizq"><input name="emailben" type="text" class="Estilo66" id="emailben" value="<?php echo $emailben ?>" size="35" maxlength="35" />
<td class="tdder">Telefono :</td>
<td class="tdizq"><input name="telben" type="text" class="Estilo66" id="telben" value="<?php echo $telben ?>" size="10" maxlength="20" /></td>
</tr>
<tr>
<td class="tdder">Direccion :</td>
<td class="tdizq"><input name="direben" type="text" class="Estilo66" id="direben" value="<?php echo $direben ?>" size="45" maxlength="45" /></td>
<td class="tdder">Celular :</td>
<td class="tdizq"><input name="celuben" type="text" class="Estilo66" id="celuben" value="<?php echo $celuben ?>" size="11" maxlength="11" /></td>
</tr>
</table>
</form>
</body>
</html>