File: /home/asjudine/public_html/consulta_servicios_beneficiario.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$contr = mysql_query('SELECT cedula, nombre, cedula_titular, parentesco, telefono, celular, direccion, ciudad, email, estado FROM solicitud_beneficiario WHERE cedula_titular = "' . $_GET["ced2"] . '" and contrato_titular = "' . $_GET["numcon"] . '" ');
if (!$contr) {
die('Invalid query 10ñ: ' . mysql_error());
}
list($cedben, $apesben, $cedula, $parente, $teleben, $celulben, $direben, $ciudben, $emailben, $causalben, $fechareben, $estadoben) = mysql_fetch_row($contr);
if ($esta == '1')
{
$estado = "VIGENTE";
}
else{
$estado = "HISTORICO";
}
$inipag = $anoini.'-'.$mesini;
if ($causal > 00)
{
$control = mysql_query('SELECT concepto FROM descuentos WHERE codigo = "' . $causal. '" and (unidad = "' . $unides. '" || unidad = "" ) ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)== 0))
{
$control = mysql_query('SELECT concepto FROM descuentos WHERE codigo = "' . $causal. '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
}
list($causal) = mysql_fetch_row($control);
}
//consulta PROCESOS JURIDICOS
$control = mysql_query('SELECT cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, tipo_afiliado, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso FROM procesos WHERE cedula = "' ."$cedula". '" and numero_contrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
while(list($cedpro, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $codigo_sucursal, $clase_negocio, $despacho_judicial, $ciudad_despacho, $tipo_afiliado, $calidad_juridica_afiliado, $tipo_orden, $numero_carpeta, $ultimo_folio, $codigo_abogado, $fecha_actuacion, $actividad_proceso, $estado_proceso) = mysql_fetch_row($control))
{
$numpro = $numpro + 1 ;
}
$contgg = mysql_query('SELECT cedula, cedula_titular FROM beneficiarios WHERE cedula_titular = "' ."$cedula". '" and numero_contrato_titular = "' . $_GET["numcon"] . '" ');
if (!$contgg) {
die('Invalid query: ' . mysql_error());
}
while(list($ceduc, $cedtiu ) = mysql_fetch_row($contgg))
{
$control = mysql_query('SELECT cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, tipo_afiliado, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso FROM procesos WHERE cedula = "' ."$ceduc". '" and numero_contrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
while(list($ces, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $codigo_sucursal, $clase_negocio, $despacho_judicial, $ciudad_despacho, $tipo_afiliado, $calidad_juridica_afiliado, $tipo_orden, $numero_carpeta, $ultimo_folio, $codigo_abogado, $fecha_actuacion, $actividad_proceso, $estado_proceso) = mysql_fetch_row($control))
{
$numben = $numben + 1 ;
}
}
//AQUI ACABA LA CONSUTA DE PROCESOS JURIDICOS
// CONSULTA SI TIENE CREDITO
$con = mysql_query('SELECT cedula FROM creditos_serviasjudinet WHERE cedula = "' ."$cedula". '" || codigo = "' ."$cedula". '" ');
if (!$con) {
die('Invalid query 1: ' . mysql_error());
}
$numcre=mysql_num_rows($con);
list($cedcre) = mysql_fetch_row($con);
if ($numcre == '0')
{
$cre = 'NO';
}else{
$cre = 'SI';
}
// AQUI ACABA CONSULTA CREDITOS
if(isset($_POST["proce"]))
{
$numcon=$_GET["numcon"] ;
$ced2=$_GET["ced2"] ;
echo "<SCRIPT LANGUAGE='javascript'>window.location.href='cartera_num_proceso_ben_usu.php?ced2=$ced2&numcon=$numcon'</SCRIPT>";
}
$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);
}
$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 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=utf-8" />
<title>Consulta Beneficiario</title>
<style type="text/css">
<!--
.est_cont5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: normal;
background-color: #EDFAF4;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.color_fondo_sc {
background-color: #DCE0E4;
}
.Estilo1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #D6ECFE;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.Estilo2 {
font-size: 14px;
font-weight: bold;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.est_cont6 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #006262;
background-color: #EDFED3;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin solid #D9B6F8;
}
.sol_cre1 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #0B3495;
background-color: #E6FAFF;
margin: 1px;
padding: 1px;
height: 18px;
width: auto;
border: thin outset #56AD95;
}
.col_cre2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #F92F0B;
background-color: #B3D9F0;
height: auto;
width: auto;
border: medium groove #FC9227;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
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;
}
.campo1 {background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo1 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo1 { font-family: "Courier New", Courier, monospace;
font-size: 11px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
height: 18px;
width: auto;
}
.datos1 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
text-decoration: blink;
background-color: #CCFFCC;
margin: 5px;
padding: 7px;
height: auto;
width: auto;
border: thin solid #0099FF;
}
.datos1 {font-family: Georgia, "Times New Roman", Times, serif;
font-size: 16px;
background-color: #FDE0C1;
margin: 2px;
padding: 3px;
border: medium doble #DBAED7;
}
.datos1 { font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-weight: normal;
background-color: #B8F5E8;
margin: 4px;
padding: 5px;
border: thin outset #009999;
}
.datos2 { font-family: "Courier New", Courier, monospace;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.datos3 { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #FF3300;
background-color: #A6ECD7;
margin: 4px;
padding: 4px;
border: medium groove #CCCCFF;
}
.go { font-family: "Times New Roman", Times, serif;
font-size: 9px;
font-style: normal;
color: #FF6633;
background-color: #FBDCBD;
padding: 1px;
height: auto;
width: auto;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
.Estilo64 {
font-size: 8px;
font-weight: bold;
color: #000000;
}
.Estilo66 {
font-size: 10px;
font-weight: bold;
}
.label {background-color: #FFFFCC; font-size: 12px; font-family: Arial; color:#0000CC; display: block;}
.Estilo67 {color: #FF0000}
-->
</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 >
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
<div align="center">
<table width="750" border="2" cellpadding="1" cellspacing="1" class="label">
<caption>
<div align="center"><br />
<span class="Estilo2">DATOS BENEFICIARIO </span><br />
</div>
</caption>
<tr>
<td align="right"><strong>Apellidos y Nombres:</strong></td>
<td colspan="3" align="left"><input name="apesben" type="text" class="Estilo66" id="apesben" value="<?php echo $apesben ?>" size="60" maxlength="65" readonly="" />
</td>
<td width="110" height="21"><div align="right"><strong>Cedula No:</strong></div></td>
<td width="182" ><div align="left">
<input name="cedben" type="text" class="Estilo66" id="cedben" value="<?php echo $cedben ?>" size="20" maxlength="20" readonly="" />
</div></td>
</tr>
<tr>
<td><div align="right"><strong>Cuidad :</strong></div></td>
<td><div align="left">
<input name="ciudben" type="text" class="Estilo66" id="ciudben" value="<?php echo $ciudben ?>" size="14" maxlength="20" readonly=""/>
</div></td>
<td><div align="right"><strong>Direccion :</strong></div></td>
<td colspan="2"><div align="left">
<input name="direben" type="text" class="Estilo66" id="direben" value="<?php echo $direben ?>" size="45" maxlength="45" readonly=""/>
</div></td>
</tr>
<tr>
<td><div align="right"><strong>Telefono :</strong></div></td>
<td><div align="left">
<input name="teleben" type="text" class="Estilo66" id="teleben" value="<?php echo $teleben ?>" size="10" maxlength="20" readonly=""/>
</div></td>
<td><div align="right"><strong>Celular :</strong></div></td>
<td><div align="left">
<input name="celulben" type="text" class="Estilo66" id="celulben" value="<?php echo $celulben ?>" size="20" maxlength="20" readonly=""/>
</div></td>
<td><div align="right"><strong>E-mail :</strong></div></td>
<td colspan="2"><div align="left">
<input name="emailben" type="text" class="Estilo66" id="emailben" value="<?php echo $emailben ?>" size="35" maxlength="35" readonly=""/>
</div></td>
</tr>
<tr>
<td><div align="right"><strong>Parentesco :</strong></div></td>
<td ><div align="left">
<input name="parente" type="text" class="Estilo66" id="parente" value="<?php echo $parente ?>" size="35" maxlength="35" readonly=""/>
</div></td>
<td><div align="right"><strong>Causal Retiro:</strong></div></td>
<td ><div align="left">
<input name="causalben" type="text" class="Estilo66" id="causalben" value="<?php echo $causalben ?>" size="35" maxlength="35" readonly=""/>
</div></td>
<td><div align="right"><strong>Fecha Retiro :</strong></div></td>
<td ><div align="left">
<input name="fechareben" type="text" class="Estilo66" id="fechareben" value="<?php echo $fechareben ?>" size="35" maxlength="35" readonly=""/>
</div></td>
</tr>
</table>
<p align="center">
<label>
</div>
</form>
</body>
</html>