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/consulta_unidad_cprn_debitos.php
<?php 
    // Connect to SQL database
    require_once("mainfile.php");
	 require_once("Conectarse.php");
    include ("config.php");
    global $dbi;	

	// First query to find out how many records we have
    
	
	$result = mysql_query('SELECT * FROM cobranzas WHERE cedula = "' . $_POST[cedula] . '" and estado = "1" and unidad ="CPRN"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
	
	//$sql = "Select * from cobranzas where estado = '1' ";
    //$result = mysql_query($sql, $dbi);	   
    // Number of records found
	$num_record = mysql_num_rows($result);
    // Number of records you want to displayper page
    $display = 45;
    // Message when no records found

    // If there are no records then startrow is 0
    if (empty($startrow)) 
	{
          $startrow=0;
    }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Listado General Morosos Juridica</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
-->
</style>

<style type='text/css'><!--.Estilo6 {color: #000099}
          .Estilo14 {font-family: Arial; font-size: 11px; }--></style>

<style type="text/css">
<!--
body {
	background-image: url();
}
.Estilo20 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12;
}
-->
</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>

<table width="1000" border="0" align="center" cellpadding="3" cellspacing="3">      
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="8" align="right" nowrap><div align="center">  
        <script languaje="JavaScript">Mostrar_Fecha()</script>
      </div></td>
  </tr>
</table>

<table width="1000" border="0" align="center" cellpadding="3" cellspacing="3">      
<tr bgcolor="#3399FF">
           <td width="50" align="right" nowrap><div align="center"><span class="Estilo18">#Reg.</span></div></td>
           <td width="100" align="right" nowrap><div align="center"><span class="Estilo18">C&eacute;dula</span></div></td>
           <td width="73" align="right" nowrap><div align="center"><span class="Estilo18"># carpeta</span></div></td>
           <td width="280" align="right" nowrap><div align="center"><span class="Estilo18">Apellidos y nombres </span></div></td>
           <td width="73" align="right" nowrap><div align="center"><span class="Estilo18">Deuda Total</span></div></td>		   		   
           <td width="73" align="right" nowrap><div align="center"><span class="Estilo18">Capital Periodo</span></div></td>
           <td width="72" align="right" nowrap><div align="center"><span class="Estilo18">Contrato</span></div></td>
           <td width="50" align="right" nowrap><div align="center"><span class="Estilo18">Tipo</span></div></td>
           <td width="50" align="right" nowrap><div align="center"><span class="Estilo18">Valor Mora</span></div></td>
           <td width="40" align="right" nowrap><div align="center"><span class="Estilo18">Unidad</span></div></td>
		   <td width="40" align="right" nowrap><div align="center"><span class="Estilo18">Codigo</span></div></td>
		   <td width="132" colspan="2"><div align="center"><span class="Estilo18">Entidad Laboral </span></div></td>

<?php

$result = mysql_query('SELECT cedula, numero_carpeta, nombre_completo, numero, tipo,capital_periodo, oficio_numero, deuda_total, unidad, fecha_oficio, codigo_gestion,valor_mora FROM cobranzas WHERE  unidad = "CPRN" and estado = "1"   ' );
				if (!$result) {
				   die('Invalid query: ' . mysql_error());
				}

				 
				while(list($cc, $nc, $an, $con, $tip,$capital_periodo, $nof, $deuda, $uni, $fecha, $codigo_gestion,$valor_mora) = mysql_fetch_row($result)) 
                  { 

                     $tres=substr($fecha, 0, 4);
                     $dos=substr($fecha, 5, 2);
                     $uno=substr($fecha, 8, 2);
                     $fecha = ($uno."-".$dos."-".$tres);				  
      		          $startrow = $startrow + 1;	
					  
					  
					  
		$resultad = mysql_query('SELECT entidad_laboral FROM cartera_serviasjudinet WHERE  cedula = "'.$cc.'"  and numerocontrato = "'.$con.'" ' );
				if (!$resultad) {    
				   die('Invalid query: ' . mysql_error());
				}			  
					  
			list($entidad_labora) = mysql_fetch_row($resultad);		  
					  
					  
					  					  
                      printf("<tr>
                     <td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em>".$startrow."</a></span></em></div></td>					 					 
                     <td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em>".$cc."</a></span></em></div></td>					 
                     <td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em><a href=\"consultar_cobranzas.php?id=$cc&carpeta=$nc\"  target='_blank'>".$nc."</span></em></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='left' class='Estilo1 Estilo14'><em>".$an."</span></em></div></td>
		             <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$deuda."</span></em></div></td>					 								                     <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$capital_periodo."</span></em></div></td>
		             <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$con."</span></em></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$tip."</span></em></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$valor_mora."</span></em></div></td>
					 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$uni."</span></em></div></td>
					 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$codigo_gestion."</span></em></div></td>
					 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$entidad_labora."</span></em></div></td>");
				  } //Terminación del ciclo while	
			         echo "</tr></table>";

                    if ($startrow != 0) 
	                 { 
                              $prevrow = $startrow - $display;
                              print("<a href=\"$PHP_SELF?startrow=$prevrow\">Anterior</a> ");
                     } 
                    $pages = intval($num_record / $display);
                    if ($num_record % $display) 
	                 {
                           $pages++;
                     }
                     if ($pages > 1) 
	                 {
                           for ($i=1; $i <= $pages; $i++)
		                    { 
                                     $nextrow = $display * ($i - 1);
                                 print("<a href=\"$PHP_SELF?startrow=$nextrow\">$i</a>  "); 
                            } 
                      }	
                      if (!(($startrow / $display) == $pages) && $pages != 1) 
	                    {
                               $nextrow = $startrow + $display;
                               print("<a href=\"$PHP_SELF?startrow=$nextrow\">Siguiente</a>");
                        }
                      if ($num_record < 1) 
	                    {
                              print("<table border=0 width=795><tr><td>$XX</td></tr></table>");
                        }						
                // } // cierra la condición
?>
<table width="675" align="center">
  <tr>
    <td width="667" bgcolor="#ECE9D8"><div align="center">
      <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onclick="window.location.href='menu_cartera_debito.php'" value="Volver al Men&uacute;">
    </div></td>
  </tr>
</table>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>  
</body>
</html>