"; $tipos .= ""; $tipos .= ""; $tipos .= ""; $tipos .= ""; $tipos .= ""; $tipos .= ""; $tipos .= ""; $html1 = "AULA"; $html2 = "
Restrições do relatorio"; $html2 .= ""; $html2 .= ""; $html2 .= ""; $html2 .= " "; $html2 .= " "; $html2 .= " "; $html2 .= " "; $html2 .= " "; $html2 .= "
NomeEmailFoneSaida
$tipos
"; $html2 .= "
"; $html = ""; $SQL = " select * from nomes where 1=1 "; if (strlen($rnome) > 0) { $SQL .= " and ds_nome like '%".$rnome."%' "; } if (strlen($remail) > 0) { $SQL .= " and ds_email like '%".$remail."%' "; } if (strlen($rfone) > 0) { $SQL .= " and ds_fone like '%".$rfone."%' "; } $SQL .= " order by ds_nome"; $RSS = mysql_query($SQL, $conexao) or print($SQL); while($RS = mysql_fetch_array($RSS)) { $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; $xx = $xx + 1; } $html .= "
".$RS["cd_nome"]."".$RS["ds_nome"]."".$RS["ds_fone"]."".$RS["ds_email"]."
"; $html .= ""; $html .= ""; If ($saida == "XLS") { $arquivo = "Relatorio_em_".date("d_m_Y__H_i_s").".xls"; header ("Expires: Mon, 26 Jul 2025 05:00:00 GMT"); header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); header ("Content-type: application/x-msexcel"); header ("Content-Disposition: attachment;filename=\"{$arquivo}\""); header ("Content-Description: PHP Generated Data" ); $html = str_replace(",","",$html); $html = str_replace(".",",",$html); echo $html; } If ($saida == "DOC") { $arquivo = "Relatorio_em_".date("d_m_Y_H_i_s").".doc"; header ("Expires: Mon, 26 Jul 2025 05:00:00 GMT"); header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); header ("Content-type: application/x-msword"); header ("Content-Disposition: attachment;filename=\"{$arquivo}\""); header ("Content-Description: PHP Generated Data" ); echo $html; } If ( $saida == "HTML" ) {echo $html1.$html2.$html;} If ( $saida == "IMP" ) { echo $html; echo "
"; echo ""; } If ( $saida == "PDF"){ require_once("dompdf/dompdf_config.inc.php"); $dompdf = new DOMPDF(); $dompdf->load_html($html); if ($qual != "Declaracao") { $dompdf->set_paper('letter', 'landscape'); } else { $dompdf->set_paper('letter', 'portrait'); } $dompdf->render(); $dompdf->stream("Relatorio.pdf"); } mysql_free_result($RSS); ?>