<?php
echo '<?xml version="1.0" encoding="ISO-8859-1"?>
<?mso-application progid="Excel.Sheet"?>';
$finalRowData = count($data) + 1;
?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Title>Relatório de vencimentos dos pedidos</Title>
<Author>Windel CRM <?php echo VERSAO; ?></Author>
<LastAuthor>Windel CRM <?php echo VERSAO; ?></LastAuthor>
<Created><?php echo date('Y-m-d').'T'.date('H:i:s').'Z';?></Created>
<Company>Windel Sistemas</Company>
<Version>12.00</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>7995</WindowHeight>
<WindowWidth>20115</WindowWidth>
<WindowTopX>240</WindowTopX>
<WindowTopY>45</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Calibri" x:Family="Swiss"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="AlinhaVertical">
<Alignment ss:Vertical="Center"/>
</Style>
<Style ss:ID="Cabecalho">
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Arial" ss:Bold="1"/>
<Interior ss:Color="#BBDBEE" ss:Pattern="Solid"/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="AlinhaVerticalHorizontal">
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
</Style>
<Style ss:ID="AlinhaVerticalHorizontalQuebra">
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
</Style>
<Style ss:ID="AlinhaVerticalQuebra">
<Alignment ss:Vertical="Center" ss:WrapText="1"/>
</Style>
<Style ss:ID="Moeda" ss:Name="Moeda">
<NumberFormat ss:Format="_-&quot;R$&quot;\ * #,##0.00_-;\-&quot;R$&quot;\ * #,##0.00_-;_-&quot;R$&quot;\ * &quot;-&quot;??_-;_-@_-"/>
</Style>
</Styles>
<Worksheet ss:Name="Analítico">
<Names><NamedRange ss:Name="Print_Titles" ss:RefersTo="=Analítico!R1"/><NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=Analítico!R1C1:R<?php echo  $finalRowData; ?>C7" ss:Hidden="1"/></Names>
<Table ss:ExpandedColumnCount="7" ss:ExpandedRowCount="<?php echo $finalRowData; ?>" x:FullColumns="1" x:FullRows="1">
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0"/>
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0" ss:Width="109.5"/>
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0" ss:Width="420.75"/>
<Column ss:StyleID="AlinhaVertical" ss:Width="79.5"/>
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0" ss:Width="231.75"/>
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0" ss:Width="68.25"/>
<Column ss:StyleID="AlinhaVertical" ss:AutoFitWidth="0" ss:Width="69"/>

<Row ss:Height="39">
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Código</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Tipo de pedido</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Razão Social</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">CNPJ/CPF</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Unidade de negócios</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Valor Mensal</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Cabecalho"><Data ss:Type="String">Data do vencimento</Data><NamedCell ss:Name="Print_Titles"/><NamedCell ss:Name="_FilterDatabase"/></Cell>
</Row>
<?php foreach ($data as $row) { ?>
<Row ss:Height="15">
<Cell ss:StyleID="AlinhaVerticalHorizontal"><Data ss:Type="Number"><?php echo $row->COV_IDCONTRATO;?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="AlinhaVerticalQuebra"><Data ss:Type="String"><?php echo Util::cleanForXml($row->getTipoDocumento());?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="AlinhaVerticalQuebra"><Data ss:Type="String"><?php echo Util::cleanForXml($row->getCliente());?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="AlinhaVerticalQuebra"><Data ss:Type="String"><?php echo Util::cleanForXml($row->getCpfCnpj());?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="AlinhaVerticalQuebra"><Data ss:Type="String"><?php echo Util::cleanForXml($row->getRevenda());?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Moeda"><Data ss:Type="Number"><?php echo $row->COV_VALOR;?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="AlinhaVerticalHorizontal"><Data ss:Type="String"><?php echo Util::cleanForXml($row->COV_DATA);?></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
</Row>
<?php } ?>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Layout x:Orientation="Landscape" x:CenterHorizontal="1"/>
<Header x:Margin="7.874015748031496E-2" x:Data="Relatório de vencimentos dos pedidos Analítico - <?php echo date('d/m/Y H:i:s');?>"/>
<Footer x:Margin="0" x:Data="Página &amp;P"/>
<PageMargins x:Bottom="0.2" x:Left="0.1" x:Right="0.1" x:Top="0.3"/>
</PageSetup>
<Selected />
<Print>
<ValidPrinterInfo />
<CommentsLayout>InPlace</CommentsLayout>
<PaperSizeIndex>9</PaperSizeIndex>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<FreezePanes/>
<FrozenNoSplit/>
<SplitHorizontal>1</SplitHorizontal>
<TopRowBottomPane>1</TopRowBottomPane>
<ActivePane>2</ActivePane>
<Panes>
<Pane>
<Number>3</Number>
</Pane>
<Pane>
<Number>2</Number>
<ActiveRow>0</ActiveRow>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
<AutoFilter x:Range="R1C1:R<?php echo $finalRowData; ?>C7" xmlns="urn:schemas-microsoft-com:office:excel"></AutoFilter>
</Worksheet>
</Workbook>