File: /home/asjudine/www/credito_listado_causales_mc.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$sql5 = mysql_query('SELECT * FROM descuentos WHERE (id = "61" || id = "60" || id = "47" || id = "58" || id = "59" || id = "57" || id = "56" || id = "55" || id = "54") and estado = "0" order by concepto ');
if (!$sql5) {
die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
?>
<!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>Cartera Consulta Morosos</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();
}
.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">
<table width="655" height="86" border="3" cellspacing="3" bgcolor="#CCFFFF">
<tr>
<td colspan="4"><div align="center" class="Estilo50">CONSULTA CAUSALES TERMINACION </div></td>
</tr>
<tr>
<td align="right"><span class="Estilo57">Causales Historicas</span></td>
<th scope="col">
<select name="codidesc1" class="Estilo66" id="codidesc1">
<option value="">----------SELECIONE CAUSAL-------------</option>
<option value="PAZ Y SALVO">PAZ Y SALVO</option>
<option value="CONDONACION">CONDONACION</option>
<option value="CREDITO DE DIFICIL COBRO">CREDITO DE DIFICIL COBRO</option>
<option value="POR PROCESO EJECUTIVO">POR PROCESO EJECUTIVO</option>
<option value="POR NO PAGO OPORTUNO">POR NO PAGO OPORTUNO</option>
<option value="POR NO LEGALIZACION">POR NO LEGALIZACION</option>
<option value="POR FALLECIMIENTO">POR FALLECIMIENTO</option>
</select>
</table>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_creditos_serviasjudinet.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"]))
{
$cont10 = mysql_query('SELECT codigo, unidad, concepto FROM descuentos WHERE id = "' . $_POST[causal] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($codides, $unides, $causals) = mysql_fetch_row($cont10);
$mssql = mysql_query('SELECT * FROM creditos_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, unidad_descuento, codigo_descuento, cuotas_credito, cuotas_pendientes, numero_libranza, cuenta_ahorros, banco, proveedor FROM creditos_serviasjudinet WHERE causal = "' . $_POST[codidesc1] . '" order by causal ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='1300' border='2' align='center' cellpadding='2' cellspacing='1'>
<TR>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>NOMBRE</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>UNIDAD</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>CODIGO</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>No. CUOTAS</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>CUOTAS PEND</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>CUENTA</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>BANCO</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>PROVEEDOR</span></div></TD>
<TD bgcolor='#CCFFCC'><div align='center'><span class='texto'>MES APLICADO</span></div></TD>
<TD bgcolor='#CCFFCC'><div align='center'><span class='texto'>FECHA PAGO</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>JURIDICA</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>PROCESO</span></div></TD>
<TD bgcolor='#CCFFFF'><div align='center'><span class='texto'>BENEFE</span></div></TD>";
while(list($cedula, $nombres , $unidad, $codigo, $cuotas, $cuopend, $nl, $cuenta, $banco, $proveedor) = mysql_fetch_row($control))
{
$fecha = 0000-00-00;
$mese = 00;
$anos = 0000;
$valcuota = 0;
$con = mysql_query('SELECT MAX(id) FROM credito_estado_contable WHERE cedula = "' . "$cedula". '" and numero_libranza = "' . "$nl". '" GROUP BY cedula');
if (!$con) {
die('Invalid query 42: ' . mysql_error());
}
list($id) = mysql_fetch_row($con);
$conf = mysql_query('SELECT id, mes_cuota, ano_cuota , valor_cuota, fecha_nomina FROM credito_estado_contable WHERE cedula = "' . "$cedula". '" and numero_libranza = "' . "$nl". '" and id = "' . "$id". '" ORDER BY numero_cuota');
if (!$conf) {
die('Invalid query 42s: ' . mysql_error());
}
list($id, $mese, $anos, $valcuota, $fecha) = mysql_fetch_row($conf);
if ((mysql_num_rows($conf)==0))
{
$valcuota = $valorcuo;
}
$jur = mysql_query('SELECT * FROM cartera_serviasjudinet WHERE cedula = "' . "$cedula". '" ');
if (!$jur) {
die('Invalid query 42: ' . mysql_error());
}
if ((mysql_num_rows($jur)!=0))
{
$jur = 'TTTULAR';
}
else
{
$jur = mysql_query('SELECT * FROM beneficiarios WHERE cedula = "' . "$cedula". '" ');
if (!$jur) {
die('Invalid query 42: ' . mysql_error());
}
if ((mysql_num_rows($jur)!=0))
{
$jur = 'BENEFICIARIO';
}
else
{
$jur = 'NO';
}
}
$pro = mysql_query('SELECT * FROM procesos WHERE cedula = "' . "$cedula". '" ');
if (!$pro) {
die('Invalid query 42: ' . mysql_error());
}
if ((mysql_num_rows($pro)!=0))
{
$pro = 'SI';
}
else
{
$pro = 'NO';
}
$bene = mysql_query('SELECT * FROM beneficiarios WHERE cedula = "' . "$cedula". '" ');
if (!$bene) {
die('Invalid query 42: ' . mysql_error());
}
if ((mysql_num_rows($bene)!=0))
{
$bene = 'SI';
}
else
{
$bene = 'NO';
}
$sum = $sum + 1;
printf("<tr>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$nombres."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$unidad."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$codigo."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$cuotas."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$cuopend."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$cuenta."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$banco."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$proveedor."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$mese.'-'.$anos."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$fecha."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$jur."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$pro."</span></div></td>
<td bgcolor='#FFFFCC'><div align='center' class='lista'>".$bene."</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>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td></td>");
echo "</table>";
}
}
}
echo "</form>";
}
?>