CodeIgniter
- 1 ответ
- 0 вопросов
1
Вклад в тег
<?php
# ....
print("<?xml version=\"1.0\"?><?mso-application progid=\"Excel.Sheet\"?>");
?>
<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">
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<Colors>
<Color>
<Index>2</Index>
<RGB>#E8FDE8</RGB>
</Color>
<Color>
<Index>3</Index>
<RGB>#FDFDE8</RGB>
</Color>
<Color>
<Index>4</Index>
<RGB>#FDE8E8</RGB>
</Color>
</Colors>
</OfficeDocumentSettings>
<Styles>
<Style ss:ID="s16">
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
<Font ss:Size="12" ss:Color="#000000" ss:Bold="1"/>
<Interior/>
<Protection/>
</Style>
<Style ss:ID="s17">
<Alignment ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
</Borders>
<Font ss:Color="#000000"/>
<Interior ss:Color="#E8FDE8" ss:Pattern="Solid"/>
<Protection/>
</Style>
<Style ss:ID="s18">
<Alignment ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
</Borders>
<Font ss:Color="#000000"/>
<Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
<Protection/>
</Style>
<Style ss:ID="s19">
<Alignment ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
</Borders>
<Font ss:Color="#000000"/>
<Interior ss:Color="#FDFDE8" ss:Pattern="Solid"/>
<Protection/>
</Style>
<Style ss:ID="s20">
<Alignment ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#000000"/>
</Borders>
<Font ss:Color="#000000"/>
<Interior ss:Color="#FDE8E8" ss:Pattern="Solid"/>
<Protection/>
</Style>
</Styles>
<Worksheet ss:Name="Пример">
<Table>
<Column ss:Width="210"/>
<Column ss:Width="64"/>
<Column ss:Width="80"/>
<Column ss:Width="210"/>
<Column ss:Width="270"/>
<Row ss:Height="15.75">
<Cell ss:StyleID="s16"><Data ss:Type="String">Столбец 1</Data></Cell>
<Cell ss:StyleID="s16"><Data ss:Type="String">Столбец 2</Data></Cell>
<Cell ss:StyleID="s16"><Data ss:Type="String">Столбец 3</Data></Cell>
<Cell ss:StyleID="s16"><Data ss:Type="String">Столбец 4</Data></Cell>
<Cell ss:StyleID="s16"><Data ss:Type="String">Столбец 5</Data></Cell>
</Row>
<?
while ($row = mysqli_fetch_assoc($res)) {
?>
<Row ss:Height="15.75">
<Cell ss:StyleID="s18"><Data ss:Type="String"><?=$row['str1']?></Data></Cell>
<Cell ss:StyleID="s18"><Data ss:Type="String"><?=$row['str2']?></Data></Cell>
<Cell ss:StyleID="s18"><Data ss:Type="String"><?=$row['str3']?></Data></Cell>
<Cell ss:StyleID="s18"><Data ss:Type="String"><?=$row['str4']?></Data></Cell>
<Cell ss:StyleID="s18"><Data ss:Type="String"><?=$row['str5']?></Data></Cell>
</Row>
<?
}
?>
</Table>
</Worksheet>
</Workbook>
<?