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/descargar_archivos_libranzas.php
<?php

require_once("Conectarse.php");
include ("config.php");
global $dbi;


  



if ($_GET["libranza"]>="0" and  $_GET["libranza"]<="5000")
  {

$result = mysql_query('SELECT * FROM libranzas_5000 WHERE cedula= "'.$_GET["cedula"].'" and clase_contrato= "'.$_GET["tipo"].'" and numero_libranza="'.$_GET["libranza"].'" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
if ((mysql_num_rows($result)!=0)) 
{

			$row = mysql_fetch_row($result);
            $cedula = $row[0];
			$nombre = $row[6];
			$contenido = $row[7];
			$tipo = $row[8];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 

}  
  }
  
  ///// PARTE 2
  
  if ($_GET["libranza"]>"5000" and  $_GET["libranza"]<="10000")
  {

$result = mysql_query('SELECT * FROM libranzas_10000 WHERE cedula= "'.$_GET["cedula"].'" and clase_contrato= "'.$_GET["tipo"].'" and numero_libranza="'.$_GET["libranza"].'" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
if ((mysql_num_rows($result)!=0)) 
{

			$row = mysql_fetch_row($result);
            $cedula = $row[0];
			$nombre = $row[6];
			$contenido = $row[7];
			$tipo = $row[8];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 

}  
  }

 ///// PARTE 3
  
  if ($_GET["libranza"]>"10000" and  $_GET["libranza"]<="15000")
  {

$result = mysql_query('SELECT * FROM libranzas_15000 WHERE cedula= "'.$_GET["cedula"].'" and clase_contrato= "'.$_GET["tipo"].'" and numero_libranza="'.$_GET["libranza"].'" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
if ((mysql_num_rows($result)!=0)) 
{

			$row = mysql_fetch_row($result);
            $cedula = $row[0];
			$nombre = $row[6];
			$contenido = $row[7];
			$tipo = $row[8];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 

}  
  }


 ///// PARTE 4
  
  if ($_GET["libranza"]>"15000" and  $_GET["libranza"]<="20000")
  {

$result = mysql_query('SELECT * FROM libranzas_20000 WHERE cedula= "'.$_GET["cedula"].'" and clase_contrato= "'.$_GET["tipo"].'" and numero_libranza="'.$_GET["libranza"].'" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
if ((mysql_num_rows($result)!=0)) 
{

			$row = mysql_fetch_row($result);
            $cedula = $row[0];
			$nombre = $row[6];
			$contenido = $row[7];
			$tipo = $row[8];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 

}  
  }
  
/// PARTE 5  
  
  if ($_GET["libranza"]>="20000" and  $_GET["libranza"]<="30000")
  {

$result = mysql_query('SELECT * FROM libranzas_30000 WHERE cedula= "'.$_GET["cedula"].'" and clase_contrato= "'.$_GET["tipo"].'" and numero_libranza="'.$_GET["libranza"].'" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
if ((mysql_num_rows($result)!=0)) 
{

			$row = mysql_fetch_row($result);
            $cedula = $row[0];
			$nombre = $row[6];
			$contenido = $row[7];
			$tipo = $row[8];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 

}  
  }
  

  
  

?>