D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
novonote
/
adm
/
Filename :
baixar_contrato_auto.php
back
Copy
<?php $pdfUrl = $this->Dados['pdfUrl'] ?? ''; $docxUrl = $this->Dados['docxUrl'] ?? ''; $urlDestino = $this->Dados['URLADM'] . 'orcamento/listar'; ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Download automático do contrato</title> <style> body { font-family: Arial, sans-serif; text-align: center; padding-top: 50px; background-color: #f9f9f9; } .mensagem { font-size: 18px; color: #333; } #formRedirect { display: none; } </style> </head> <body> <div class="mensagem"> <p>📄 Iniciando download dos arquivos...</p> <p>Você será redirecionado automaticamente.</p> </div> <!-- Formulário invisível para redirecionamento confiável --> <form id="formRedirect" action="<?= $urlDestino ?>" method="get"> <button type="submit">Redirecionar</button> </form> <script> const pdfUrl = "<?= $pdfUrl ?>"; const docxUrl = "<?= $docxUrl ?>"; function abrirArquivo(url) { if (url && url.trim() !== "") { window.open(url, "_blank"); } } window.onload = function () { abrirArquivo(pdfUrl); setTimeout(() => { abrirArquivo(docxUrl); }, 1000); // Redireciona via formulário invisível após 4 segundos setTimeout(() => { document.getElementById('formRedirect').submit(); }, 4000); }; </script> </body> </html>