$fechaInicio = $_GET['FechaInicio']; $fechaFin = $_GET['FechaFin']; class PDF extends PPDF { function Cabecera() { } } $titulo = "Reporte General"; $pdf = new PDF("P", "mm", "letter"); //$pdf=new FPDF("L","mm",array(306,396)); $borde = 0; $pdf->AddPage(); $totalpagos = 0; $totalgastos = 0; foreach (rangoFechas($fechaInicio, $fechaFin, "+ 1 month", 1) as $rfechas) { $mespagos = 0; $mesgastos = 0; $mes = date("m", strtotime($rfechas)); $anio = date("Y", strtotime($rfechas)); $gas = $gasto->mostrarTodo(0, "MONTH(FechaGasto)={$mes} and YEAR(FechaGasto)={$anio}"); //print_r($gas); $pag = $pago->mostrarTodo(0, "MONTH(FechaCancelado)={$mes} and YEAR(FechaCancelado)={$anio}"); $pdf->Fuente("", 9); $pdf->Ln(); $pdf->linea(); $pdf->Ln(); $pdf->Fuente("", 9); $pdf->CuadroCuerpoPersonalizado(35, "Pagos - " . ucfirst(strftime("%B %Y ", strtotime($rfechas))), 1, "L", 1, "", 8); $pdf->CuadroCuerpoPersonalizado(27, "Fecha de Pago", 1, "C", 1, "", 8); $pdf->CuadroCuerpoPersonalizado(30, "Fecha Cancelado", 1, "C", 1, "", 8);
$fechaFin = $_POST['f']; $consulta = $_POST['q']; $foto = $_POST['n']; $cont = $_POST['c']; $resultado = dameDenunciasFiltro($consulta); if (count($resultado) > 0) { require_once '../../librerias/PHPExcel/Classes/PHPExcel.php'; $nombreExcel = "Denuncias-" . $fechaInicio . " - " . $fechaFin; // Se crea el objeto PHPExcel $objPHPExcel = new PHPExcel(); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="' . $nombreExcel . '".xls '); header('Cache-Control: max-age=0'); $fechaInicio = cambiarSeparador($fechaInicio, "/", "-"); $fechaFin = cambiarSeparador($fechaFin, "/", "-"); $arrayFechas = rangoFechas($fechaInicio, $fechaFin); $objPHPExcel->getProperties()->setCreator("Edwin Garcia")->setLastModifiedBy("Edwin Garcia")->setTitle("Ivss")->setSubject("Ivss")->setDescription("Estadisticas")->setKeywords("Estadisticass")->setCategory("Estadisticas Excel"); $objPHPExcel->getActiveSheet(0)->setTitle("Estadisticas Denuncias"); /* ESTILOS PARA EL ENCABEZADO DEL REPORTE */ $estiloTituloTexto = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER), 'font' => array('bold' => true, 'size' => 9, 'name' => 'Calibri'), 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FF000000')))); /* ESTILOS PARA LOS TITULOS DEL REPORTE */ $estiloCabecera = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER), 'font' => array('bold' => true, 'size' => 9, 'name' => 'Calibri', 'color' => array('rgb' => 'FFFFFF')), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'FF0000')), 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FF000000')))); $estiloInfo = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER), 'font' => array('bold' => true, 'size' => 9, 'name' => 'Calibri', 'color' => array('rgb' => '000000')), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'FFFFFF')), 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FF000000')))); //ENCABEZADO encabezadoExcel($objPHPExcel, $estiloTituloTexto, $arrayFechas); //ARMA LOS TITULOS titulosExcel($objPHPExcel, $estiloCabecera);
</td><td><?php echo $arren['FechaCancela']; ?> </td></tr> </table> <form action="recibo.php" method="post"><input type="hidden" name="CodArrendatario" value="<?php echo $cod; ?> "/> <table class="tabla"> <tr class="cabecera"><td>Nº</td><td>Fecha de Cancelación</td><td>Estado</td><td>Monto</td><td>Observaciones</td><td>Pagos en Recibo</td></tr> <?php $i = 0; $total = 0; $totalTodo = 0; foreach (rangoFechas($fechaCancela, $fechaHoy) as $fecha) { $i++; $fechaMes = date("m", strtotime($fecha)); $fechaAnio = date("Y", strtotime($fecha)); $pagomes = $pago->mostrarTodo(0, "Mes={$fechaMes} and Anio={$fechaAnio} and CodArrendatario={$cod}"); $pagmes = array_shift($pago->mostrarTodo(0, "Mes={$fechaMes} and Anio={$fechaAnio} and CodArrendatario={$cod}")); $totalTodo += $arren['Monto']; //if(count($pagomes)<1){$total+=$arren['Monto'];} $total += $pagmes['Monto']; ?> <tr class="contenido"> <td><?php echo $i; ?> </td> <td><?php