MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/acalidad/cobranzas_consulta_car.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,cifin 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, $cifin) = mysql_fetch_row($control);
$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);
}

if ($esta == '1')
{
	$estado = "VIGENTE";
}
else{
	$estado = "HISTORICO";
}

$contrgg = mysql_query('SELECT * FROM  cartera_estado_contable  WHERE cedula = "' . $_GET["ced2"] . '" and contrato  =  "' . $_GET["numcon"] . '" ORDER BY cuota ASC ');
if (!$contrgg) {
	die('Invalid query: ' . mysql_error());
}

while(list($id, $ceduc, $nombrec, $contrato, $tipo, $cuotac, $mescuotac, $anocuotac, $valorcuotac, $fecha_registroc, $fecha_nomina, $codescc, $unidescc) = mysql_fetch_row($contrgg)) 
{
	if ($codescc != 575 and $unidescc != "DEVO")
	{
		if ($cudesc == $cuotac and $contrato == $numcon)
		{
			$mesapl= $mescuotac;
			$anoapl= $anocuotac;
			//$fechaul = $fecha_nomina;
		}
	}
			
}
//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 = "'.$_GET["ced2"].'" and numero_contrato  =  "'.$_GET["numcon"].'" ');
if (!$control) {
	die('Invalid query: ' . mysql_error());
}  
while(list($cedu, $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 ; 
}
				

$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_historicos
 WHERE cedula = "' .$_GET["ced2"].'" and numero_contrato  = "'.$_GET["numcon"].'"  ');
if (!$control) {
	die('Invalid query: ' . mysql_error());
}  
while(list($cedu, $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)) 
{
	$numprohis = $numprohis + 1 ; 
}
				
$bene = 0;		
$cont = mysql_query('SELECT  cedula, cedula_titular FROM  beneficiarios   WHERE cedula_titular = "' . $_GET["ced2"] . '"  and numero_contrato_titular  =  "' . $_GET["numcon"] . '" ');
if (!$cont) {
	die('Invalid query: ' . mysql_error());
}

while(list($ceduc, $cedtiu ) = mysql_fetch_row($cont)) 
{
	$bene = $bene + 1;
}				
					
					
$contgg = mysql_query('SELECT  cedula, cedula_titular FROM  beneficiarios   WHERE cedula_titular = "' . $_GET["ced2"] . '" 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($cedu, $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 ; 
	}
								
					
	$control88 = 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_historicos WHERE cedula = "' .$ceduc. '"  and numero_contrato  =  "' . $_GET["numcon"] . '" ');
	if (!$control88) {
		die('Invalid query: ' . mysql_error());
	}  
	while(list($cedu, $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($control88)) 
  	{
		$numbenhis = $numbenhis + 1 ; 
	}
}
								
			
//AQUI ACABA LA CONSUTA DE PROCESOS JURIDICOS 

//		CONSULTA SI TIENE CREDITO
$con = mysql_query('SELECT cedula, estado FROM creditos_serviasjudinet  WHERE cedula =  "' . $_GET["ced2"] . '" || codigo =  "' . $_GET["ced2"] . '"  ');
if (!$con) {
	die('Invalid query 1: ' . mysql_error());
}
$numcre=mysql_num_rows($con); 
list($cedcre, $estacre) = mysql_fetch_row($con);
		

if ($numcre == '0')
{
	$cre = 'NO';
}else{
		
	if ($estacre == 0)
	{
		$vigente = "H" ; 
		$cre = 'SI';
	}else
	{
		$vigente = "V"; 
		$cre = 'SI';
	}
}
// AQUI ACABA CONSULTA CREDITOS


if(isset($_POST["proce"]))
{
	
	$ced2 =  $_GET["ced2"];
	$numcon =  $_GET["numcon"];

	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='consulta_proc_geren.php?ced2=$ced2&numcon=$numcon'</SCRIPT>";
}

if(isset($_POST["credito"]))
{
	$ced2 =  $_GET["ced2"];
	$numcon =  $_GET["numcon"];
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='cartera_consulta_credito_nom.php?ced2=$ced2&numcon=$numcon'</SCRIPT>";
}



if(isset($_POST["bene"]))
{
	$ced2 =  $_GET["ced2"];
	$numcon =  $_GET["numcon"];
					
	$control = mysql_query('SELECT  cedula, cedula_titular FROM  beneficiarios   WHERE cedula_titular = "' . $_GET["ced2"] . '" and numero_contrato_titular = "' . $_GET["numcon"] . '" ');
	if (!$control) {
		die('Invalid query: ' . mysql_error());
	}
  
	list($ceduc, $cedtiu ) = mysql_fetch_row($control);

	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='consulta_beneficiario_liti.php?ced2=$ced2&cedb=$ceduc&numcon=$numcon'</SCRIPT>";
}


if($codigosu > 0)
{

	$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());
}
			

if ((mysql_num_rows($cont10)== 0)) 
{
	$ven;
}

else {
	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>
<html>
<head>
<title>INGRESAR SOLICITUD CARTERA</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:#EAEAEA;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;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #8A0003;font-size: 15px; text-align: center;font-weight:600;}
    
	td{border:#D6D6D6 solid 1px;}
    .tdizq{background-color: #EEE; padding: 0px 5px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 0px 5px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #EEE; padding: 0px 5px;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:3px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 1px 3px; background-color: #FFFEF4; font-weight:200;}
	
	/*Estilo Complementario*/
	.tdi{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
	.tdc{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
    .tdd{background-color: #F9FBC8; padding: 1px 2px;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: 12px;}
    .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;}
	
	.estilo66{color:red;}
</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">SOLICITUD CARTERA JURIDICA</h3>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>

<form action=""  method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1"  id="form1">

<table width="780" border="8" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">DATOS DEL TITULAR</td>
</tr>    
<tr>
 	<td scope="col">&nbsp;</td>
   	<td class="tdder">Fecha Afiliacion</td>
 	<td class="tdizq"><input name="fechas" type="text"  id="fechas" value="<?php echo $fechafil ?>" size="10" maxlength="10" readonly /></td>
    
  	<td class="tdder">Sucursal</td>
    <td class="tdizq" colspan="3">
    	<input name="codigosu" type="text" class="Estilo66" id="codigosu" value="<?php echo $codigosu ?>" size="20" maxlength="20" readonly /> 
		<strong>CREDITO :</strong>
		<input name="cre" type="text" class="Estilo50" 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" width="74" >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" width="136">Cedula No</td>
    <td class="tdizq" width="180"><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" width="86"><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" width="152"><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="7" maxlength="7" readonly />
    	<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" readonly /></td>
    <td class="tdder">Direccion</td>
    <td class="tdizq" colspan="2"><input name="dire" type="text" class="Estilo66" id="dire" value="<?php echo $dire ?>" size="45" maxlength="45" readonly /></td>
        
    <td class="tdizq">Cifin<input name="fechapl" type="text" class="Estilo66" id="fechapl" value="<?php echo $cifin ?>" size="10" maxlength="14" readonly/></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" readonly /></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" readonly /></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="30" maxlength="30"  readonly=""/></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">Cuenta No</td>
    <td class="tdizq"><input name="cue" type="text" class="Estilo66" 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" class="Estilo66" 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" class="Estilo66" 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" class="Estilo66" id="num_lib" value="<?php echo $num_lib ?>" size="12" maxlength="12" readonly/></td>
    <td class="tdder">Vendedor</td>
    <td class="tdizq"><input name="vendedor" type="text" class="Estilo66" id="ven" value="<?php echo $ven ?>" size="30" maxlength="30" readonly/></td>
</tr>
	  
<tr>
	<td class="tdder">Valor Contrato</td>
    <td class="tdizq"><input name="valcon" type="text" class="Estilo66" id="valcon" value="<?php echo $valcon ?>" size="12" maxlength="10" readonly/></td>
    <td class="tdder">Numero de Cuotas</td>
    <td class="tdizq"><input name="numcuo" type="text" class="Estilo66" id="numcuo" value="<?php echo $numcuo ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Valor Cuota</td>
    <td class="tdizq"><input name="valcuo" type="text" class="Estilo66" id="valcuo" value="<?php echo $valcuo ?>" size="12" maxlength="12" readonly/></td>
</tr>
	  
<tr>
	<td class="tdder">Cuotas Pendientes</td>
    <td class="tdizq"><input name="cupen" type="text" class="Estilo66" id="cupen" value="<?php echo $cupen ?>" size="12" maxlength="10" readonly/></td>
    <td class="tdder">Cuotas Descontadas</td>
    <td class="tdizq"><input name="cudesc" type="text" class="Estilo66" id="cudesc" value="<?php echo $cudesc ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Saldo Anterior</td>
    <td class="tdizq"><input name="salant" type="text" class="Estilo66" id="salant" value="<?php echo $salant ?>" size="12" maxlength="12" readonly/></td>
</tr>
	  
<tr>
	<td class="tdder">Saldo Nuevo</td>
    <td class="tdizq"><input name="salnue" type="text" class="Estilo66" id="salnue" value="<?php echo $salnue ?>" size="12" maxlength="10" readonly/></td>
    <td class="tdder">Numero de Beneficiarios</td>
    <td class="tdizq"><input name="bene" type="text" class="Estilo66" id="bene" value="<?php echo $bene ?>" size="3" maxlength="3" readonly/></td>
	<td class="tdder">Fecha Inicio Pagos</td>
    <td class="tdizq"><input name="iniciopag" type="text" class="Estilo66" id="iniciopag" value="<?php echo $inipag ?>" size="5" maxlength="5" readonly/></td>
</tr>
		
<tr>
	<td class="tdder">Fecha Inicio Contrato</td>
    <td class="tdizq"><input name="fechainicio" type="text" class="Estilo66" id="fechainicio" value="<?php echo $fechainicio ?>" size="10" maxlength="14" readonly/></td>
    <td class="tdder">Fecha Termino Contrato</td>
    <td class="tdizq"><input name="fechatermino" type="text" class="Estilo66" id="fechatermino" value="<?php echo $fechatermino ?>" size="10" maxlength="14" readonly/></td>
	<td class="tdcen">Fecha ultimo pago:<input name="fechaul" type="text" class="Estilo66" id="fechaul" value="<?php echo $fechaul ?>" size="10" maxlength="14" readonly/></td>
	<td class="tdizq">Fecha mes aplicado:<input name="fechapl" type="text" class="Estilo66" id="fechapl" value="<?php echo $mesapl ?>-<?php echo $anoapl ?>" size="10" maxlength="14" readonly/></td>
</tr>


<tr>
	<td class="tdder">Entidad Recaudo</td>
    <td class="tdizq" colspan="3"><input name="entre" type="text" class="Estilo66" id="entre" value="<?php echo $entre ?>" size="60" maxlength="65" readonly/></td>
    <td class="tdder">Unidad y Codigo Descuento</td>
    <td class="tdizq">
    	<input name="unides" type="text" class="Estilo66" id="unides" value="<?php echo $unides ?>" size="5" maxlength="5" readonly/> - 
		<input name="codides" type="text" class="Estilo66" id="codides" value="<?php echo $codides ?>" size="4" maxlength="4" readonly/>
	</td>
</tr>


<tr>
	<td class="tdder" colspan="2">Entidad Laboral</td>
    <td class="tdizq" colspan="2"><input name="enti" type="text" class="Estilo66" id="enti" value="<?php echo $enti ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdder">Director</td>
    <td class="tdizq"><input name="direc" type="text" class="Estilo66" id="direc" value="<?php echo $director ?>" size="30" maxlength="30" readonly/></td>
</tr>
	  
<tr>
	<td class="tdder" colspan="2">Causal Terminacion</td>
    <td class="tdizq" colspan="2" ><input name="causal" type="text" class="Estilo66" id="causal" value="<?php echo $causal ?>" size="40" maxlength="40" readonly/></td>
	<td class="tdder">Fecha Anulaci&oacute;n</td>
    <td class="tdizq"><input name="fechater" type="text" class="Estilo66" id="fechater" value="<?php echo $fechater ?>" size="20" maxlength="20" readonly/></td>
</tr>


<tr>
	<td class="tdder">Renovacion Contrato</td>
    <td class="tdizq"><input name="renova" type="text" class="Estilo50" id="renova" value="<?php echo $renova ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Procesos Juridicos titular Vig</td>
    <td class="tdizq"><input name="numpro" type="text" class="Estilo50" id="numpro" value="<?php echo $numpro ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Procesos Juridicos Beneficiario Vig</td>
    <td class="tdizq"><input name="numben" type="text" class="Estilo50" id="numben" value="<?php echo $numben ?>" size="12" maxlength="12" readonly/></td>
</tr>
	  
<tr>
	<td class="tdder">Contrato</td>
    <td class="tdizq"><input name="estado" type="text" class="Estilo50" id="estado" value="<?php echo $estado ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Procesos Juridicos Titular His</td>
    <td class="tdizq"><input name="numprohis" type="text" class="Estilo50" id="numprohis" value="<?php echo $numprohis ?>" size="12" maxlength="12" readonly/></td>
	<td class="tdder">Procesos Juridicos Beneficiario His</td>
    <td class="tdizq"><input name="numbenhis" type="text" class="Estilo50" id="numbenhis" value="<?php echo $numbenhis ?>" size="12" maxlength="12" readonly/></td>
</tr>
	  
<tr>
	<td colspan="6">
	<?php 
		$ced2 =  $_GET["ced2"];
		$numcon =  $_GET["numcon"];
		$plan =  $_GET["tipo"];
		echo "<input type='button' value='CONSULTA CREDITO' name=boton class='boton1' onClick =window.open('cartera_credito_listado.php?ced2=$ced2&numcon=$numcon&tipo=$plan','','top=50,left=100,toolbar=no,scrollbars=yes,width=810,height=530,status=yes')></a>"; ?>
 		<input name="proce" type="submit"  class="boton1"  value ="PROCESOS TITULAR" >
  		<input name="bene" type="submit"  class="boton1"  value ="CONSULTA BENEFICIARIOS" >
    <?php 
		$ced2 =  $_GET["ced2"];
		$numcon =  $_GET["numcon"];
		$tipo =  $_GET["tipo"];
		echo "<input type='button' value='CONSULTAR CONTACTO' name=boton class='boton1' onClick =window.open('consulta_contacto.php?ced2=$ced2&numcon=$numcon&tipo=$tipo','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=530,status=yes')></a>"; ?>
	</td>
</tr>
</table>

		
  
<p align="center">
	<input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='cartera_procesos_juridicos_gerencia.php'" value="VOLVER AL LISTADO">
</p>

</div>
</form>
</body>
</html>

<br>

<?
echo'<table width="800" border="0" cellspacing="2" cellpadding="2" align = "center">
<tr align="center"> 
	<td colspan="7"><font face="Georgia, Times New Roman, Times, serif" color="#006600"><b align = "center">PAGOS EFECTUADOS</b></font></td>
</tr>
<tr align="center" bgcolor="#DDDDDD"> 
	<td width="90" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Valor cuota</font></td>
    <td bgcolor="#DDDDDD" width="55" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"># cuotas</font></td>
    <td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"  align="center">Mes</font></td>
	<td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"  align="center">Año</font></td>
    <td width="140"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Fecha pago</font></td>
    <td width="300" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Entidad</font></td>
    <td width="140"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Fecha registro</font></td>
</tr>';				  


$control = mysql_query('SELECT * FROM  cartera_estado_contable  WHERE cedula = "' . $_GET["ced2"] . '"  and contrato  =  "' . $_GET["numcon"] . '" ORDER BY cuota ASC  ');
	if (!$control) {
		die('Invalid query: ' . mysql_error());
	}

while(list($id, $cedula, $nombre, $contrato, $tipo, $cuota, $mescuota, $anocuota, $valorcuota, $fecha_registro, $fecha_nomina, $codesc, $unidesc) = mysql_fetch_row($control)) 
{
		
	$control5 = mysql_query('SELECT * FROM descuentos WHERE codigo = "' ."$codesc". '" and unidad = "' ."$unidesc". '" ');
	if (!$control5) {
		die('Invalid query: ' . mysql_error());
	}	 
	list($idr, $codigo, $unidad, $concepto) = mysql_fetch_row($control5);

		
printf ("<tr align='center' bgcolor='#f4f4f4'>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\">$valorcuota</a></td>
<td width='100'> <font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a  window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$cuota</a></td><td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a  window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$mescuota</a></td>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a  window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$anocuota</a></td>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$fecha_nomina</a></td>
<td width='750'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=250,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$concepto</a></td>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$fecha_registro</a></td></tr>");
						            								   
}

echo "</table>";
		
?>