<?php
//require __DIR__."./../phpJasperXML_2.0.1/autoload.php";
require_once("./../phpJasperXML_2.0.1/autoload.php");

use simitsdk\phpjasperxml\PHPJasperXML;

$filename = __DIR__."/kardexPago.jrxml";

// read parameters
$id_pago = $_SESSION['id_Socio'] ; 	// invoice identification to obtain

// Read record
$data = array();
$rs = DB::Query("

SELECT
	derecho_socios.id_derecho_Propietario,
	derecho_socios.id_Socio,
	derecho_socios.nombre AS gestion,
	derecho_socios.foto_actual,
	derecho_socios.ci,
	derecho_socios.socio,

	derecho_socios.nro_Acciones
FROM
	derecho_socios

where  derecho_socios.id_Socio = $id_pago






	

");
while( $row= $rs->fetchAssoc() )
{
$data[] = $row;
}
$config = [
    'driver'=>'array',
    'data'=> $data
];
$parameters = [];


$type = 'Pdf';
$fileOutput= '';
$creator = 'bi-softnet';
$author = 'xbi-softnet@gmail.com';
$title = 'Recibo pago dividendo';
$keywords = 'PHP';
$format_intl = 'es_ES';

// $temp_file = tempnam(sys_get_temp_dir(), 'pdf');  // Create file temporal
// $fileOutput = $temp_file;

$report = new PHPJasperXML();
$report->load_xml_file($filename)    
    ->setParameter($parameters)
    ->setDataSource($config)
    ->export($type,$fileOutput,$title,$creator,$author,$keywords,$format_intl);

?>
