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/listar_devolucion.php
<?php 
    // Connect to SQL database
    require_once("mainfile.php");
    include ("config.php");
    global $dbi;	
    // First query to find out how many records we have
    $sql = "Select * from devolucion_carpeta";
  
    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 Devolucion Juridica </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-image: url();
}
.Estilo21 {
	font-weight: bold;
	font-family: "Arial Narrow";
}
.texto {font-size: 11px; font-family: Arial; color:#990000; display: block;}
.titulos {font-size: 11px; font-family: Arial; color: blue; 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>

<table width="950" border="0" align="center" cellpadding="3" cellspacing="3">      
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="8" align="right" nowrap><div align="center" class="Estilo21">LISTADO TOTAL DE DEVOLUCIONES </div></td>
  </tr>
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="8" align="right" nowrap bgcolor="#FFFFCC"><div align="center">
        <script languaje="JavaScript">Mostrar_Fecha()</script>
      </div></td>
  </tr>
</table>

<table width="850" border="0" align="center" cellpadding="3" cellspacing="3">      
<tr bgcolor="#3399FF">
           <td width="30" align="right" nowrap><div align="center"><span class="titulos">#Reg.</span></div></td>
           <td width="55" align="right" nowrap><div align="center"><span class="titulos">C&eacute;dula</span></div></td>
           <td width="187" align="right" nowrap><div align="center"><span class="titulos">Apellidos y Nombres</span></div></td>		   
           <td width="50" align="right" nowrap><div align="center"><span class="titulos"># carpeta</span></div></td>
           <td width="74" align="right" nowrap><div align="center"><span class="titulos">Cuenta cobro</span></div></td>
           <td width="157" align="right" nowrap><div align="center"><span class="titulos">Motivo</span></div></td>
           <td width="106" align="right" nowrap><div align="center"><span class="titulos">Capital Recuperado</span></div></td>
           <td width="47"><div align="center"><span class="titulos">Número Oficio</span></div></td>
           <td width="60" colspan="2"><div align="center"><span class="titulos">Fecha devolución</span></div></td>

<?php

 require_once("Conectarse.php");
	
	
        //   $sql = "select devolucion_carpeta.cuenta_cobro, devolucion_carpeta.numero_carpeta, devolucion_carpeta.cedula, devolucion_carpeta.motivo, devolucion_carpeta.capital_recuperado, devolucion_carpeta.oficio_dev_num, devolucion_carpeta.fecha  from devolucion_carpeta, cobranzas where devolucion_carpeta.cedula = cobranzas.cedula order by cobranzas.nombre_completo LIMIT $startrow, $display";
          // $control = mysql_query($sql, $dbi);
		   
		 $result = mysql_query('SELECT cedula , nombre_completo FROM cobranzas WHERE cedula_funcionario != "52910677"  ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}  
		
           if($result)
              {				
			     $n=0; 
                 while(list($cedy , $nom) = mysql_fetch_row($result)) 
                  { 
				  
				  				 $resu = mysql_query('SELECT cuenta_cobro, numero_carpeta , cedula, motivo, capital_recuperado, oficio_dev_num, fecha FROM devolucion_carpeta  WHERE cedula  = "' ."$cedy". '" ');
			if (!$resu) {
				die('Invalid query: ' . mysql_error());
			} 
			    list($cc, $nc, $ced, $mov, $cr, $odn, $fecha) = mysql_fetch_row($resu);
				
				if ($ced == $cedy)
				{
	
                     //$mssql = "select nombre_completo from cobranzas where cedula = $ced";
                     //$con = mysql_query($mssql, $dbi);
					 
							 $resul = mysql_query('SELECT nombre_completo FROM cobranzas WHERE cedula = "' ."$ced". '" ');
			if (!$resul) {
				die('Invalid query: ' . mysql_error());
			} 
                     if($resul)
					 {
					       list($nom) = mysql_fetch_row($resul);
					 }
                     $tres=substr($fecha, 0, 4);
                     $dos=substr($fecha, 5, 2);
                     $uno=substr($fecha, 8, 2);
                     $fecha = ($uno."-".$dos."-".$tres);				  
      		          $startrow = $startrow + 1;						  
                      printf("<tr>
                     <td bgcolor='#ECE9D8'><div align='center' class='texto'><em>".$startrow."</a></span></em></div></td>
		             <td bgcolor='#C5D6FC'><div align='center' class='texto'>".$cedy."</span></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='left' class='texto'>".$nom."</span></div></td>					 					 
                     <td bgcolor='#ECE9D8'><div align='center' class='texto'><a href=\"consultar_cobranzas.php?id=$ced&carpeta=$nc\"  target='_blank'>".$nc."</a></span></div></td>
                     <td bgcolor='#ECE9D8'><div align='center' class='texto'>".$cc."</span></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='left' class='texto'>".$mov."</span></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='center' class='texto'>".$cr."</span></div></td>					 
		             <td bgcolor='#C5D6FC'><div align='center' class='texto'>".$odn."</span></div></td>
					 <td bgcolor='#C5D6FC'><div align='center' class='texto'>".$fecha."</span></div></td>");
					 
					 }
				  } //Terminación del ciclo while	
			         echo "</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_cobranzas_jur.php'" value="Volver al Men&uacute;">
    </div></td>
  </tr>
</table>