MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/afinanciera/generar_debitos_general.php
<!DOCTYPE html>
<html>
<head>
<title>Generar Debitos General</title>
	<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
<style type="text/css">
	*{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    .cerrarsesion{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 2px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 150px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
    td{border: #969696 solid 1px;}
    .tdizq{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 700; text-align: center;}
    .tdder{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:12px;}
    .boton1{width:150px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:4px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 3px;background-color: #FFFEF4;}
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 1px; text-align: center; font-size: 11px; font-weight: 700}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
    .botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</style>
	
	
</head>


<body>
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">RESULTADO DEBITOS GENERAL</h3>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>	
	
<form id="form1" name="form1" method="post" action="">
<table width="450" border="5" cellpadding="0" cellspacing="0">
    <!--<tr bgcolor="#FFFFCC">  
    <td colspan="4" bgcolor="#FFFFFF" class="titulos"><div align="center"> RESULTADO DEBITOS GENERAL</div></td>
    </tr>-->
        
<tr>
  	<td class="tdcen" width="200" height="40">DESDE:&nbsp;<input name="fecha1" type="text" id="fecha1" size="12" maxlength="14" value="0000-00-00" /></td>
	<td class="tdcen" width="200" height="40">HASTA:&nbsp;<input name="fecha2" type="text" id="fecha2" size="12" maxlength="14" value="0000-00-00"></td>
</tr>
<tr>
   	<td class="tdcen" colspan="4">
      	<input name="consultar" type="submit" class="boton1" id="consultar" value="Consultar"  />
    </td>
</tr>

<tr>
	<td class="tdcen" colspan="4">
       <input name="menu2" type="button" class="irmenu" id="menu2" onclick="window.location.href='menu_cartera_debito.php'" value="IR AL MENU" />
    </td>
</tr>
</table>

</form>
</body>
</html>



<?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 class='tdtitulo' width='70'>CEDULA</td>
		<td class='tdtitulo' width='70'>CEDULA</td>
        <td class='tdtitulo' width='140'>NOMBRE</td>
        <td class='tdtitulo' width='50'>CONTRATO No</td>
       	<td class='tdtitulo' width='70'>TIPO</td>
		<td class='tdtitulo' width='70'>TIPO DE DEBITO</td>
		<td class='tdtitulo' width='70'>BANCO</td>
        <td class='tdtitulo' width='70'>VALOR DEBITO</td>
		<td class='tdtitulo' width='70'>CUOTA</td>
		<td class='tdtitulo' width='70'>CAUSAL RECHAZO</td>
		<td class='tdtitulo' width='70'>ESTADO</td>
		<td class='tdtitulo' width='70'>USUARIO</td>
		<td class='tdtitulo' width='70'>FECHA REGISTRO</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 ><input type='button' value=$cedt name='cedt' class='botonnew' onClick =window.open('consultar_debito2.php?ced2=$cedt&numcon=$numcon','','top=50,left=100,toolbar=yes,scrollbars=yes,width=1100,height=800,status=yes')></a></TD>
			
			<TD class='tdfull'>".$cedt."</TD>	
            <TD class='tdfull'>".$nombre."</TD>
			<TD class='tdfull'>".$numcon."</TD>
			<TD class='tdfull'>".$tipoc."</TD>
			<TD class='tdfull'>".$forma."</TD>
			<TD class='tdfull'>".$banco."</TD>						   
		    <TD class='tdfull'>".$val."</TD>
			<TD class='tdfull'>".$cuo."</TD>
			<TD class='tdfull'>".$causal."</TD>
			<TD class='tdfull'>".$estado."</TD>
			<TD class='tdfull'>".$usuarios."</TD>
			<TD class='tdfull'>".$fech."</TD>
			</TR>");
		}

		echo "</table>";		  
		echo "<width='400' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5' >
        <tr>
        	<td class='tdtitulo' width='70'>TOTAL VALOR CONSIGNACION</td>
		</tr>";	
								   
		printf("<TR>
		<TD class='tdfull'>".$tota."</TD>	</TR>"); 
									 
		echo "<width='400' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5' >
       	<tr>
		<td class='tdtitulo' width='70'>TOTAL REGISTROS</td>
		</tr>";	
								   
		printf("<TR>
		<TD class='tdfull'>".$nuer."</TD>	</TR>"); 
								   

	}

	echo "</form>";

}
?>