File: /home/asjudine/public_html/contabilidad_pagadurias.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$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);
?>
<!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=iso-8859-1" />
<title>Contabilidad Pagadurias</title>
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color:#0000CC; display: block;}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.lista {font-family: Arial; font-size: 11px; color: #990000;}
.lista2 {font-family: Arial; font-size: 16px; color: #FF6600;}
.boton2 {
font-family: Verdana;
font-size: 8 pt;
color: #000080;
background-color: #C0C0C0;
border-style: solid;
width:90px;
height:22px;
}
body {
background-image: url(ELEMENTOS/gri06.jpg);
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.Estilo54 {color: #333399; font-family: "Arial Narrow"; font-weight: bold; }
.Estilo57 {color: #006600}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<form action="" method="post" name="form1" class="provd" id="form1">
<div align="center">
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br></br>
<table width="550" border="8" cellpadding="3" cellspacing="3" bgcolor= white>
<tr>
<td colspan="3" bgcolor="#EDEDED"><div align="center" class="Estilo50">CONSULTA CARTERA POR PAGADURIA</div></td>
</tr>
<tr>
<td width="282" bgcolor="#EDEDED"><span class="Estilo54">Seleccione "<span class="Estilo57">PAGADURIA</span>" para continuar</span></td>
<td width="212" bgcolor="#EDEDED"> <select name="paga" class="Estilo66" id="paga">
<option value="">--SELECCIONE PAGADURIA--</option>
<option value="100">NOMINA INPEC COOVEEDURIA</option>
<option value="101">NOMINA INPEC ASJUDINET</option>
<option value="200">CONTRATO DE CORTESIA</option>
<option value="204">PROMOCION</option>
<option value="202">CONVENIO COBRANZAS SERVI</option>
<option value="305">NOMINA CREMIL /COOVEEDURIA</option>
<option value="617">NOMINA POLICIA COOPCREDICOL</option>
<option value="685">CASUR COOVEEDURIA</option>
<option value="288">CASUR ASJUDINET</option>
<option value="948">NOMINA FOPEP / COOVEEDURIA</option>
<option value="967">D.A.S COOVEDURIA</option>
<option value="9802">NOMINA EJERCITO NACIONAL/COOVEEDURIA</option>
<option value="9802">NOMINA FUERZA AEREA/COOVEEDURIA</option>
<option value="9802">NOMINA ARMADA NACIONAL/COOVEEDURIA</option>
<option value="9802">NOMINA PENSIONADOS MINISTERIO DEFENSA</option>
<option value="10199">NOMINA POLICIA COOVEDURIA</option>
<option value="617">NOMINA POLICIA COOPCREDICOL</option>
<option value="204">PROMOCION ESCUELAS</option>
<option value="2013">NOMINA COOVEEDURIA DIRECCION MARITIMA</option>
<option value="DEBITOS">DEBITOS BANCARIOS</option>
<option value="MOROSOS">RECUPERACION CARTERA MOROSA</option>
</select>
</tr>
</table>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_contabilidad.php'" value="IR AL MENU" />
<input name="consultar" id="consultar" type="submit" class="Estilo50" value="CONSULTAR">
</p>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
/////////////adassd//////////
if ($_POST["paga"]=="MOROSOS")
{
$control = mysql_query('SELECT cedula,nombre_completo,numero,tipo,capital_periodo,capital_renovacion,interes_prejuridico,interes_cobroejecutivo,
capital_clausula,deuda_total,oficio_numero,fecha_oficio,cedula_funcionario,unidad,codigo_gestion,fecha_gestion,causal,estado,cuotas_mora,valor_mora,clausula_permanencia,fecha_anulacion FROM cobranzas WHERE unidad != "MCPE" and (estado = "1" || estado ="2") order by nombre_completo');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO CONTRATO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>UNIDAD</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR CUOTA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CUOTAS PENDIENTES</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>SALDO NUEVO </span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO LIBRANZA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>ENTIDAD LABORAL</span></div></TD>";
while(list($cedula,$nombre_completo,$numero,$tipo,$capital_periodo,$capital_renovacion,$interes_prejuridico,$interes_cobroejecutivo,
$capital_clausula,$deuda_total,$oficio_numnero,$fecha_oficio,$cedula_funcionario,$unidad,$codigo_gestion,$fecha_gestion,$causal,$estado,$cuotas_mora,$valor_mora,$clausula_permanencia,$fecha_anulacion ) = mysql_fetch_row($control))
{
if ($tipo > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$tipo". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($tipo) = mysql_fetch_row($cont10);
}
$conta101 = mysql_query('SELECT numerocontrato,numero_libranza,entidad_laboral,tipocontrato,cuotaspendientes,valorcuota,saldonuevo FROM cartera_serviasjudinet WHERE cedula = "'.$cedula.'" ');
if (!$conta101) {
die('Invalid query 42: ' . mysql_error());
}
list($numcon,$numero_libranza,$entidad_laboral,$tipo,$cuotaspendietes,$valorcuota,$saldo_nuevo) = mysql_fetch_row($conta101);
$filas2 = mysql_num_rows($conta101);
$conta10 = mysql_query('SELECT nombre FROM entidad_laboral WHERE codigo = "'.$entidad_laboral.'" ');
if (!$conta10) {
die('Invalid query 42: ' . mysql_error());
}
list($entidad_laboral) = mysql_fetch_row($conta10);
if ($filas2 != "0")
{
$total=$total+$saldo_nuevo;
$sum = $sum + 1;
printf("<tr>
<TD bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=est_cont1 onClick =window.location.href='contabilidad_consulta_titular_nom.php?ced2=$cedula&numcon=$numcon'></a></span></div></TD>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre_completo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$unidad."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$valorcuota."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cuotaspendietes."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$saldo_nuevo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numero_libranza."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$entidad_laboral."</span></div></td> ");
}
}
}
echo "</table>";
echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL REGISTROS</span></div></TD></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR TOTAL</span></div></TD></TD>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$total."</span></div></td></td>
");
echo "</table>";
}
/////////////////////////
else {
if ($_POST["paga"]=="DEBITOS")
{
$control = mysql_query('SELECT cedula,nombres,dirrecion,telefono,celular,ciudad,email,entidad_laboral,
banco,cuenta,tipo_debito,valor_credito,valor_juridica,valor_debitar,valor_cuota_credito,valor_cuota_juridica,unidad_desc,codigo_desc,cuotas,cuotas_desc,cuotas_pend,fecha_registro,causal_rechazo,fecha_debito,causal_terminacion,fecha_terminacion,usuarios,situacion,estado FROM debitos WHERE estado= "1" order by nombres ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='2' align='center' cellpadding='2' cellspacing='1' bgcolor= '#EDEDED'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO CONTRATO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>UNIDAD</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR CUOTA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CUOTAS PENDIENTES</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>SALDO NUEVO </span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO LIBRANZA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>ENTIDAD LABORAL</span></div></TD>";
while(list($cedula,$nombres,$dirrecion,$telefono,$celular,$ciudad,$email,$entidad_labor,$banco,$cuenta,$tipodebito,$valorcred,$valorjur,$valordebits,$valorcuotacred,$valorctajur,$unidaddesc,$codigodes,$cuotastota,$cuotasdesco,$cuotaspendie,$fecharegistro,$causalrechaz,$fechadebito,$causalterminacion,$fechaterminac,$usuarios,$situacion,$estado,$correo) = mysql_fetch_row($control))
{
if ($tipo > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$tipo". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($tipo) = mysql_fetch_row($cont10);
}
$conta101 = mysql_query('SELECT numerocontrato,numero_libranza, tipocontrato,cuotaspendientes,saldonuevo FROM cartera_serviasjudinet WHERE cedula = "'.$cedula.'" ');
if (!$conta101) {
die('Invalid query 42: ' . mysql_error());
}
list($numcon,$numero_libranza,$tipo,$cuotaspendietes,$saldo_nuevo) = mysql_fetch_row($conta101);
$filas2 = mysql_num_rows($conta101);
if ($filas2 != "0")
{
$total=$total+$saldo_nuevo;
$sum = $sum + 1;
printf("<tr>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=est_cont1 onClick =window.location.href='contabilidad_consulta_titular_nom.php?ced2=$cedula&numcon=$numcon'></a></span></div></TD>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombres."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$unidaddesc."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$valorctajur."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cuotaspendietes."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$saldo_nuevo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numero_libranza."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$entidad_labor."</span></div></td> ");
}
}
}
echo "</table>";
echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL REGISTROS</span></div></TD></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR TOTAL</span></div></TD></TD>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$total."</span></div></td></td>
");
echo "</table>";
}
else {
$mssql = mysql_query('SELECT * FROM cartera_serviasjudinet ');
if (!$mssql) {
die('Invalid query 1: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query('SELECT cedula,nombre,numerocontrato,tipocontrato,numero_libranza,entidad_laboral,unidad_descuento,valorcuota,
cuotaspendientes,saldonuevo,estado FROM cartera_serviasjudinet WHERE codigo_descuento = "'.$_POST["paga"].'" and estado= "1" order by nombre ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='2' align='center' cellpadding='2' cellspacing='1' bgcolor='#EDEDED'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO CONTRATO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>UNIDAD</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR CUOTA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CUOTAS PENDIENTES</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>SALDO NUEVO </span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO LIBRANZA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>ENTIDAD LABORAL</span></div></TD>";
while(list($cedula, $nombres , $numcon, $tipo,$numero_libranza, $entidad_laboral,$unidad_descuento,$valorcuota,$cuotaspendientes,$saldonuevo, $estado) = mysql_fetch_row($control))
{
if ($tipo > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$tipo". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($tipo) = mysql_fetch_row($cont10);
}
$conta10 = mysql_query('SELECT nombre FROM entidad_laboral WHERE codigo = "'.$entidad_laboral.'" ');
if (!$conta10) {
die('Invalid query 42: ' . mysql_error());
}
list($entidad_laboral) = mysql_fetch_row($conta10);
$total=$total+$saldonuevo;
$sum = $sum + 1;
printf("<tr>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=est_cont1 onClick =window.location.href='contabilidad_consulta_titular_nom.php?ced2=$cedula&numcon=$numcon'></a></span></div></TD>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombres."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$unidad_descuento."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$valorcuota."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cuotaspendientes."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$saldonuevo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numero_libranza."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$entidad_laboral."</span></div></td>
");
}
echo "</table>";
}
echo "</table>";
echo "<TABLE width='200' border='2' align='center' cellpadding='2' cellspacing='1'>
<br>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL REGISTROS</span></div></TD></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR TOTAL</span></div></TD></TD>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$total."</span></div></td></td>
");
echo "</table>";
}
}
}
echo "</form>";
}
}
?>