File: /home/asjudine/www/listado_rech_deb.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>
<th colspan="4" scope="col"><label>Seleccione Causal de Rechazo</label></th>
</tr>
<tr>
<td width="110"><div align="right"><span class="Estilo52">Causal: </span></div></td>
<td width="256" colspan="3">
<div align="left">
<select name="unidt2" class="est_cont2" id="unidt2">
<option value="">--SELECCIONE HISTORICO--</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['codigo'];?>"><?php echo $row_sql2['concepto']?></option>
<?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
$rows2 = mysql_num_rows($sql2);
if($rows2 > 0) {
mysql_data_seek($sql2, 0);
$row_sql2 = mysql_fetch_assoc($sql2);
}
?>
</select>
</div></td>
</tr>
<tr>
<td colspan="4"><div align="center">
<input name="consultar" type="submit" class="col_cre2" 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)
{
////////////
$contro03 = mysql_query('SELECT concepto FROM causales_rechazo_debitos WHERE codigo = "' .$_POST[unidt2].'" ');
if (!$contro03) {
die('Invalid query jjjjjj: ' . mysql_error());
}
list($causas) = mysql_fetch_row($contro03);
$contro2 = mysql_query('SELECT cedula, nombre,fecha_registro,usuarios FROM debitos_estado_contable WHERE causal = "' .$causas.'" order by nombre');
if (!$contro2) {
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 CREDITO</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 DEBITAR</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 REGISTRO</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, $fech,$usuarios) = mysql_fetch_row($contro2))
{
$contro3 = mysql_query('SELECT valor_credito, valor_juridica, valor_debitar, situacion,causal_rechazo FROM debitos WHERE cedula="'.$ced.'" ');
if (!$contro3) {
die('Invalid query jjjjjj: ' . mysql_error());
}
list($valor_credito, $valor_juridica, $valor_debitar,$situacion,$causal_rechazo) = mysql_fetch_row($contro3);
if ($causal_rechazo==$causas)
{
}
else {
$causal_rechazo==$causas;
}
$tota = $tota + 1 ;
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'>".$valor_credito."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$valor_juridica."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$valor_debitar."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$causas."</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 "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL</span></div></TD>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tota."</span></div></td>");
}
}
echo "</form>";
}
?>