<?php
/*
Autor: Lic. Carlos Alberto Vaca Coronado
Version: 3.2.0
*/
session_name('portal_absa');
session_start();
if(!isset($_SESSION['usuario_p_prov_absa']) || trim($_SESSION['usuario_p_prov_absa']) == "" || trim(strtoupper($_SESSION["URL_PORTAL"]."admin.php")) != trim(strtoupper($_SERVER['HTTP_REFERER']))){
	?><script>window.location.href="<?=$_SESSION["URL_PORTAL"]."index.php"?>"</script><?
	exit;
}
error_reporting(E_ALL);
require("Spreadsheet/Excel/Classes/PHPExcel.php");
require "Spreadsheet/Excel/Classes/PHPExcel/IOFactory.php";
require "../conexion/conectar.php";
//require "../libs/funciones.php";


$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Mi.DisXII.com")
							 ->setLastModifiedBy("Mi.DisXII.com")
							 ->setTitle("Office 2003 XLS")
							 ->setSubject("Office 2003 XLS")
							 ->setDescription("Document for Office 2003 XLS")
							 ->setKeywords("office 2003")
							 ->setCategory("Result file");

$conexion = new CONDB();
$conexion->conectar();

include "hojaExcelLayoutPagos.php";

$objPHPExcel->setActiveSheetIndex(0);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename=LayoutPagos.xls');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

$objWriter->save('php://output');
//$objWriter->save('test.xls');
?>