// ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff /*----------------------------------------------------------------*/ $modo = $_POST['modo']; if (isset($_POST['idNaviera'])) { $idNav = $_POST['idNaviera']; } switch ($modo) { case "reporte": /* if( empty($fec1) || empty($fec2) ){ $err[] = "<font color='red'><a class='icon-alert'></a> ERROR: Las fechas son incorrectas...</font>"; } if( count($err)>0 ){ showForm($data,$err); } else{ reporteNewExcel(); } break; */ reporteNewExcel($idNav); default: showForm($data); break; } /* } // fin havePerm() else{ $t->set_file("page", "accesoDenegado.html"); $t->pparse("out","page"); } */
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition:attachment;filename="Report.xlsx"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('php://output'); exit; } // ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff /*----------------------------------------------------------------*/ $modo = $_POST['modo']; switch ($modo) { case "reporte": if (empty($fec1) || empty($fec2)) { $err[] = "<font color='red'><a class='icon-alert'></a> ERROR: Las fechas son incorrectas...</font>"; } if (count($err) > 0) { showForm($data, $err); } else { reporteNewExcel(); } break; default: showForm($data); break; } /* } // fin havePerm() else{ $t->set_file("page", "accesoDenegado.html"); $t->pparse("out","page"); } */
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); */ // Opcion2 EXCEL 2007 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="reporte.xlsx"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('php://output'); exit; //} //echo 'a problem has occurred... no data retrieved from the database'; } // ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff /*----------------------------------------------------------------*/ $modo = $_POST['modo']; $fec1 = $_POST['fec1']; $fec2 = $_POST['fec2']; $idNaviera = $_POST['idNaviera']; switch ($modo) { case "reporte": reporteNewExcel($idNaviera, $fec1, $fec2); break; default: showForm($data); break; } } else { $t->set_file("page", "accesoDenegado.html"); $t->pparse("out", "page"); }