I have a system which shows the result of a query. On this page you have the print button, but I need to make clicking the print button print another formatted page without having to open it for it, or if it is the case, do not even download, open and close automatically. I have the following code on the main page (index.php):
<script>
$(function(){
//evnto que deve carregar a janela a ser impressa
$('#imprimir').click(function(){
newWindow = window.open('imprimir.php');
//imprime e fecha a nova janela quando estiver carregada
$(newWindow).ready(function() {
newWindow.print();
newWindow.close();
});
});
});
</script>
<a href="#" style="color: #666666; font-weight: bold" id="imprimir"><i class="fa fa-print"></i> Imprimir Orçamento</a>