<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

include("conexao.php");
$grupo = selectAllos();
var_dump($grupo);

$arqexcel = "<meta charset='UTF-8'>";

$arqexcel .= "<table border='1'>
            <thead>
                <tr>
                    <th>OS Bloco</th>
                    <th>Data Inicial</th>
                    <th>Data Final</th>
                    <th>Produto</th>
                    <th>Defeito</th>
                    <th>Forma de Pgto</th>
					<th>Valor</th>
					<th>Status</th>
                </tr>
            </thead>
            <tbody>";
                
                    foreach ($grupo as $os) { 
           $arqexcel .="        <tr>
                    <td>{$os["OSbloco"]}</td>
                    <td>".formatoData($os["dataInicial"])."</td>
					<td>".formatoData($os["dataFinal"])."</td>
                    <td>{$os["descricaoProduto"]}</td>
                    <td>{$os["laudoTecnico"]}</td>
					<td>{$os["valorTotal"]}</td>
					<td>{$os["status"]}</td>
					</tr>";
                  }
                
          $arqexcel .="  </tbody>
        </table>";
          
          header("Content-Type: application/xls");
          header("Content-Disposition:attachment; filename = relatorio.xls");
          echo $arqexcel;

