<?php
   // Determina que o arquivo é uma planilha do Excel
   header("Content-type: application/vnd.ms-excel");   

   // Força o download do arquivo
   header("Content-type: application/force-download");  

   // Seta o nome do arquivo
   header("Content-Disposition: attachment; filename=lista_newsletter.xls");

   header("Pragma: no-cache");
?>
<?php
error_reporting(E_WARNING);
require_once("funcoes.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php 

	$edit	=	$_GET['cod'];
	$selectnot	=	"SELECT * FROM tb_newsletter";
	$querynot	=	mysql_query($selectnot);
	$sqlnot	=	mysql_fetch_array($querynot);
	
	
echo "Lista de desejos de ".$sqlnot['nome'] ?></title>

<div id="conteudo"> 

	<div id="top_conteudo">
    <form action="gerenciar_clientes.php?pag=1" method="post" enctype="multipart/form-data">
        </div> 
                
        <div id="cadastros">
        
                <div id="tabs"> 
        <div id="geral">
        <?php
        if(isset($_GET['cod'])){
        
		$cod	=	$_GET['cod'];
		$select	=	"SELECT * FROM tb_newsletter";
		$query	=	mysql_query($select);
		echo mysql_error();
		while($sql	=	mysql_fetch_array($query)){
		
		?>

        <?php } } ?>
        
        </div>
        
        <div id="orcamentos">
        
        	<div id="lista_de_desejos">
			<?php
			
            $selectlist	=	"SELECT * FROM tb_newsletter";
			$querylist	=	mysql_query($selectlist);
			if(mysql_num_rows($querylist) <> 0){ ?>

            	 <table bordercolor="#000000" border="1px" cellpadding="4" cellspacing="4"> 
                        
                        <tr>
                            <th width="100" valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;">Nome</th>
                            <th valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;">E-mail</th>
                            <th valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;">Data Cadastro</th>
                        
                        </tr>
			
						<?php while($sqllist	=	mysql_fetch_array($querylist)){
				
								
				
				?>
                    
                    <tr>
                    	<td valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;"><?php echo $sqllist['nome']; ?></td>
                        <td valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;"><?php echo $sqllist['email']; ?></td>
                        <td valign="middle" align="center" style="display: table-cell; vertical-align: middle; position: static;"><?php echo $sqllist['data']; ?></td>
                    
                    </tr>
                
                
               
				
			<?php } } ?>
                
            	</table>


            </div> 
        
        </div>
        
        <script>
        $( "#tabs" ).tabs();
        </script>
        </table>
  
    </div> 
    </div> 
    </div>
    </div>

    </form>


</body>
</html>