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/www/acreditos/credito_listado_causales_mc.php
<?php 

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>
<html>
<head>
<title>Consulta Procesos</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: 600; 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:10px;}
    .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;}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
</style>


<script languaje="JavaScript">
function Mostrar_Fecha()
{
  	var mydate=new Date()
   	var year=mydate.getYear()
    if (year < 1000)
        year+=1900
        var day=mydate.getday()
        var month=mydate.getMonth()
    	var daym=mydate.getdate()
   		if (daym<10)
            daym="0"+daym
          	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
            var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
            document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}					
</script>

<script language="javascript">
function AbreGral()
{ 
    var menu;   
	menu=window.open("mostrar_ingreso.php","","toolbar=no,scrollbars=no,width=800,height=500,status=yes");  
	menu.focus();  
	var ventana = window.self;  
	ventana.opener = window.self;  
	ventana.close();
}
</script>

</head>
<body onLoad="document.formulario.cedula.focus()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo"><span class="Estilo50">CONSULTA CAUSALES TERMINACION </span></h3>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>

<form name="formulario" action="" method="post">
<table width="671" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
   <tr>
        
  <td class="tdcen">Causales Historicas</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>  
  </tr>
  
  <tr>
    <td colspan="2"><div align="center" class="Estilo51">
      <input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='menu_creditos_serviasjudinet.php'" value="IR AL MENU">
     <input name="consultar" id="consultar" type="submit" class="irmenu" value="CONSULTAR">
	 
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>
</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);



		$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 class='tdtitulo'>CEDULA</td>
							     <td class='tdtitulo'>NOMBRE</td>
							     <td class='tdtitulo'>UNIDAD</td>
							     <td class='tdtitulo'>CODIGO</td>
								 <td class='tdtitulo'>No. CUOTAS</td>
							 	 <td class='tdtitulo'>CUOTAS PEND</td>
							     <td class='tdtitulo'>CUENTA</td>
								 <td class='tdtitulo'>BANCO</td>
							 	 <td class='tdtitulo'>PROVEEDOR</td>
								 <td class='tdtitulo'>MES APLICADO</td>
							 	 <td class='tdtitulo'>FECHA PAGO</td>
							 	 <td class='tdtitulo'>JURIDICA</td>
								 <td class='tdtitulo'>PROCESO</td>
								 <td class='tdtitulo'>BENEFE</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 class='tdfull'>".$cedula."</td>    
								  	 <td class='tdfull'>".$nombres."</td>
								   	 <td class='tdfull'>".$unidad."</td>	
								   	 <td class='tdfull'>".$codigo."</td>
									 <td class='tdfull'>".$cuotas."</td>
									 <td class='tdfull'>".$cuopend."</td>
								     <td class='tdfull'>".$cuenta."</td>
								     <td class='tdfull'>".$banco."</td>
								     <td class='tdfull'>".$proveedor."</td>
									 <td class='tdfull'>".$mese.'-'.$anos."</td>
								   	 <td class='tdfull'>".$fecha."</td>
								     <td class='tdfull'>".$jur."</td>
									 <td class='tdfull'>".$pro."</td>
									 <td class='tdfull'>".$bene."</td>");              								   
                               }
								   echo "</table>";		  
								    echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
                              <TR>
                              <td class='tdtitulo'>TOTAL REGISTROS</td>";	
							  
							   printf("<tr>
                                 
                                   <td class='tdfull'>".$sum."</td>"); 
								   echo "</table>";	 
                        }

    

echo "</form>";

}
?>