Last active
January 24, 2019 13:28
-
-
Save caionorder/3411d51bb78474d2c45ed9f6a829316e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$avaliacoes = $this->relatoriosM->desempenho_consolidado($_POST); | |
$zip = new ZipArchive(); | |
$zip->open($_SERVER['DOCUMENT_ROOT'].'/uploads/relatorio.zip', ZipArchive::CREATE); | |
if($zip->open($_SERVER['DOCUMENT_ROOT'].'/uploads/relatorio.zip')){ | |
foreach ($avaliacoes as $key => $avaliacao) { | |
$ava = array(); | |
$ava[] = $avaliacao; | |
$html = (desempenho_consolidado($ava)); | |
$content = $this->export->exportar_relatorio($html, $frase, $_POST['formato']); | |
$test = $zip->addFile($_SERVER['DOCUMENT_ROOT'].$content,'/file'.$key.'pdf'); | |
} | |
} | |
$zip->close(); | |
$archfilename = 'relatorio.zip'; | |
header("Content-type: application/zip"); | |
header("Content-Disposition: attachment; filename = $archfilename"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
readfile($_SERVER['DOCUMENT_ROOT'].'/uploads/relatorio.zip'); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment