File: /home/asjudine/www/listado_rech_deb2.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$sql2 = mysql_query('SELECT * FROM causales_rechazo_debitos order by codigo ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
?>
<!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>Listado Causales de Rechazo</title>
<style type="text/css">
<!--
.Estilo2 {color: #FF6633;
font-size: 16px;
}
.Estilo3 {color: #2492FF;
font-weight: bold;
}
.Estilo4 { color: #D94B3C;
font-size: 24px;
}
.Estilo51 { font-size: 22px
}
.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;
}
.est_cont2 { font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #FFFFAA;
height: 18px;
width: auto;
border: thin solid #CC3333;
}
.Estilo52 {font-family: Arial; font-size: 16px; color: #990000;}
.campo { background-color:#FFFFAA;
width: 80px;
border:2px solid #990000;
height: 17px;
}
.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;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<table width="391" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
<div align="center" class="Estilo4 Estilo51">LISTADO CAUSALES DE RECHAZO</div>
</caption>
<tr>
<td colspan="4" bgcolor="#CCCCCC"><div align="center" class="Estilo50">LISTADO CAUSALES DE RECHAZO POR RANGO</div></td>
</tr>
<tr>
<td width="149" align="right" bgcolor="#FFFFFF"><span class="Estilo57">FECHA Desde </span></td>
<th width="147" bgcolor="#FFFFFF" scope="col">
<input name="fecha1" type="text" class="Estilo66" id="fecha1" value="0000-00-00" size="10" maxlength="10" />
</th>
<td width="59" bgcolor="#FFFFFF"><span class="Estilo57">Hasta </span></td>
<th width="247" bgcolor="#FFFFFF" scope="col"><div align="left">
<input name="fecha2" type="text" class="Estilo66" id="fecha2" value="0000-00-00" size="10" maxlength="10" />
</div></th>
</tr>
<tr>
<td colspan="4" bgcolor="#FFFFFF"><div align="center">
<input name="consultar" type="submit" class="Estilo52" id="consultar" value="Consultar" />
</div></td>
</tr>
</table>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_cartera_debito.php'" value="IR AL MENU" />
</p>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$valtota = 0;
$num = 0;
$numto = 0;
$valto = 0;
$mssql = mysql_query('SELECT * FROM debitos ');
if (!$mssql) {
die('Invalid query: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
////////////
$contro3 = mysql_query('SELECT cedula, nombre, causal FROM debitos_estado_contable WHERE causal!= "" order by nombre');
if (!$contro3) {
die('Invalid query jjjjjj: ' . mysql_error());
}
//////////
echo "<TABLE width='1000' 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'>NOMBRE</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR JURIDICA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR CREDITO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CAUSAL RECHAZO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA RECHAZO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>USUARIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>SITUACION</span></div></TD>";
while(list( $ced,$apen,$causal_rechazo) = mysql_fetch_row($contro3))
{
//////////////
//////////
$contro2 = mysql_query('SELECT valor_credito,valor_juridica,fecha_rechazo,usuarios,situacion FROM debitos WHERE fecha_rechazo >= "' . $_POST["fecha1"] . '" and fecha_rechazo <= "' . $_POST["fecha2"] . '" and cedula = "'.$ced.'" ');
list($cre,$jur,$fech,$usuarios,$situacion) = mysql_fetch_row($contro2);
$fil = mysql_num_rows($contro2);
if ($fil!="0")
{
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$ced."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$apen."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$jur."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cre."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$causal_rechazo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fech."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$usuarios."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$situacion."</span></div></td>");
}
}
echo "</table>";
}
}
echo "</form>";
}
?>