File: /home/asjudine/public_html/generar_debitos_general.php
<!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>Generar Debitos General</title>
<style type="text/css">
<!--
.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_cont1 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #4068F4;
background-color: #E6FFF1;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin double #33CC66;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #418BAF;
background-color: #F0F5CF;
height: 15px;
width: auto;
border: thin solid #FABF85;
}
.est_cont3 {
font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #EA261C;
background-color: #DEDDE8;
height: auto;
width: auto;
border: thin outset #FC9F67;
}
.est_cont5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
background-color: #D6ECFE;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.Estilo51 {
font-size: 14px;
font-weight: bold;
}
.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;
}
.est_cont21 { font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.Estilo2 {font-family: Arial; font-size: 16px; color: #990000;}
.campo {
background-color:#FFFFAA;
width: 80px;
border:2px solid #990000;
height: 17px;
}
.Estilo53 {font-family: Arial; font-size: 12px; color: #990000; }
.Estilo54 {
color: #0066FF;
font-weight: bold;
}
body {
background-image: url(ELEMENTOS/gris-blanco.jpg);
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br></br>
<table width="450" border="5" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr bgcolor="#FFFFCC">
<td colspan="4" bgcolor="#FFFFFF" class="titulos"><div align="center"> RESULTADO DEBITOS GENERAL</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td width="309" align="right" bgcolor="#CCCCCC" class="Estilo50"><strong>DESDE:</strong>
<input name="fecha1" type="text" id="fecha1" size="12" maxlength="14" value="0000-00-00" /></td>
<td width="120" align="right" bgcolor="#CCCCCC" class="Estilo50"><strong>HASTA:</strong> </td>
<td width="271" bgcolor="#CCCCCC">
<input name="fecha2" type="text" id="fecha2" size="12" maxlength="14" value="0000-00-00"></td>
</tr>
<tr bgcolor="#FFCC99">
<td colspan="4" bgcolor="#CCCCCC"><div align="center">
<input name="consultar" type="submit" class="Estilo54" id="consultar" value="Consultar" />
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td colspan="4" bgcolor="#CCCCCC"><div align="center">
<input name="menu2" type="button" class="Estilo54" id="menu2" onclick="window.location.href='menu_cartera_debito.php'" value="IR AL MENU" />
<label></label>
</div></td>
</tr>
</table>
<div align="left"></div>
<div align="left"></div>
<div align="right"></div>
</form>
</body>
</html>
<br><br/>
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
if(isset($_POST["consultar"]))
{
$cont = mysql_query('SELECT cedula,nombre,cuota,valor_cuota,fecha_registro,unidad_descuento,causal FROM debitos_estado_contable WHERE fecha_registro >= "' .$_POST[fecha1]. '" and fecha_registro <= "' .$_POST[fecha2]. '"order by nombre');
if (!$cont) {
die('Invalid query aaaa ' . mysql_error());
}
if ((mysql_num_rows($cont)!=0))
{
echo "<table width='400' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5'>
<tr>
<td width='70'><div align='center'><strong>CEDULA</strong></div></td>
<td width='70'><div align='center'><strong>CEDULA</strong></div></td>
<td width='140'><div align='center'><strong>NOMBRE</strong></div></td>
<td width='50'><div align='center'><strong>CONTRATO No</strong></div></td>
<td width='70'><div align='center'><strong>TIPO</strong></div></td>
<td width='70'><div align='center'><strong>TIPO DE DEBITO</strong></div></td>
<td width='70'><div align='center'><strong>BANCO</strong></div></td>
<td width='70'><div align='center'><strong>VALOR DEBITO</strong></div></td>
<td width='70'><div align='center'><strong>CUOTA</strong></div></td>
<td width='70'><div align='center'><strong>CAUSAL RECHAZO</strong></div></td>
<td width='70'><div align='center'><strong>ESTADO</strong></div></td>
<td width='70'><div align='center'><strong>USUARIO</strong></div></td>
<td width='70'><div align='center'><strong>FECHA REGISTRO</strong></div></td>
</tr>";
while(list($cedt, $nombre,$cuo,$val,$fech, $unid,$causal) = mysql_fetch_row($cont))
{
$conta = mysql_query('SELECT numerocontrato,tipocontrato,numerocuotas FROM cartera_serviasjudinet WHERE cedula = "'.$cedt.'" and unidad_descuento= "'.$unid.'" ');
if (!$conta) {
die('Invalid query aaaa ' . mysql_error());
}
list($numcon,$tipoc) = mysql_fetch_row($conta);
$contah = mysql_query('SELECT estado FROM cartera_serviasjudinet WHERE cedula = "'.$cedt.'" and unidad_descuento = "'.$unid.'" and numerocontrato = "'.$numcon.'" ');
if (!$contah) {
die('Invalid query aaaa ' . mysql_error());
}
list($estado) = mysql_fetch_row($contah);
if ($estado=="0")
{
$estado="HISTORICO";
}
else {
$estado="VIGENTE";
}
$contar = mysql_query('SELECT banco,tipo_debito,usuarios FROM debitos WHERE cedula = "'.$cedt.'" ');
if (!$contar) {
die('Invalid query aaaa ' . mysql_error());
}
list($banco,$forma,$usuarios) = mysql_fetch_row($contar);
/* $cont18 = mysql_query('SELECT concepto FROM causales_rechazo_debitos WHERE codigo = "'.$causal.'" ');
if (!$cont18) {
die('Invalid query 42: ' . mysql_error());
}
list($causal) = mysql_fetch_row($cont18); */
$tota = $tota + $val;
$nuer = $nuer + 1 ;
printf("<TR>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'><input type='button' value=$cedt name='cedt' class='lista'onClick =window.open('consultar_debito2.php?ced2=$cedt&numcon=$numcon','','top=50,left=100,toolbar=yes,scrollbars=yes,width=800,height=800,status=yes')></a></span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedt."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$numcon."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipoc."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$forma."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$banco."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$val."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$cuo."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$causal."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$estado."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$usuarios."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$fech."</span></div></TD>
</TR>");
}
echo "</table>";
echo "<width='400' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5' >
<tr>
<td width='70'><div align='center'><strong>TOTAL VALOR CONSIGNACION</strong></div></td>
</tr>";
printf("<TR>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$tota."</span></div></TD> </TR>");
echo "<width='400' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5' >
<tr>
<td width='70'><div align='center'><strong>TOTAL REGISTROS</strong></div></td>
</tr>";
printf("<TR>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$nuer."</span></div></TD> </TR>");
}
echo "</form>";
}
?>