MOON
Server: Apache
System: Linux kvm.asjudinet.com 5.14.0-611.54.6.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 04:23:18 EDT 2026 x86_64
User: asjudine (1001)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/asjudine/www/apostventas/descargar_archivos_novedades.php
<?php
require_once("../Conectarse.php");
global $dbi;



///////////////CONSULTA PARA EL PRIMER ARCHIVO//////////////////////////////////

if ($_GET["valid"]== "1")
{
	$result = mysql_query('SELECT * FROM novedades_diarias WHERE id= "'.$_GET["id"].'" and sucursal= "'.$_GET["sucursal"].'"  ');

	if (!$result) {
		die('Invalid query: ' . mysql_error());
	}
			
			
	if ((mysql_num_rows($result)!=0)) 
	{
	$row = mysql_fetch_row($result);
    $cedula = $row[0];
	$nombre = $row[34];
	$contenido = $row[35];
	$tipo = $row[36];
			
			
	header("Content-type: $tipo");
	header("Content-Disposition: attachment; filename=$nombre");
	print $contenido; 

  	}
}
///////////////CONSULTA PARA EL SEGUNDO ARCHIVO//////////////////////////////////

if ($_GET["valid"]== "2")
{
	$resulta = mysql_query('SELECT * FROM novedades_diarias WHERE id= "'.$_GET["id"].'" and sucursal= "'.$_GET["sucursal"].'"');

	if (!$resulta) {
		die('Invalid query: ' . mysql_error());
	}
	
	if ((mysql_num_rows($resulta)!=0)) 
	{
		$row2 = mysql_fetch_row($resulta);
    	$cedula2 = $row2[0];
		$nombre2 = $row2[37];
		$contenido2 = $row2[38];
		$tipo2 = $row2[39];
			
			
		header("Content-type: $tipo2");
		header("Content-Disposition: attachment; filename=$nombre2");
		print $contenido2; 

  	}
}

///////////////CONSULTA PARA EL TERCER ARCHIVO//////////////////////////////////

if ($_GET["valid"]== "3")
{
	$resultad = mysql_query('SELECT * FROM novedades_diarias WHERE id= "'.$_GET["id"].'" and sucursal= "'.$_GET["sucursal"].'" ');
	if (!$resultad) {
		die('Invalid query: ' . mysql_error());
	}

	if ((mysql_num_rows($resultad)!=0)) 
	{  
		$row3 = mysql_fetch_row($resultad);
        $cedula3 = $row3[0];
		$nombre3 = $row3[40];
		$contenido3 = $row3[41];
		$tipo3= $row3[42];
			
			
		header("Content-type: $tipo3");
		header("Content-Disposition: attachment; filename=$nombre3");
		print $contenido3; 

  	}
}
?>