30 if (!defined(
'PHPEXCEL_ROOT')) {
34 define(
'PHPEXCEL_ROOT', dirname(__FILE__) .
'/../../../');
38 require_once PHPEXCEL_ROOT .
'PHPExcel.php';
41 require_once PHPEXCEL_ROOT .
'PHPExcel/Writer/Excel2007.php';
44 require_once PHPEXCEL_ROOT .
'PHPExcel/Writer/Excel2007/WriterPart.php';
47 require_once PHPEXCEL_ROOT .
'PHPExcel/Shared/XMLWriter.php';
77 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
80 $objWriter->startElement(
'Properties');
81 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties');
82 $objWriter->writeAttribute(
'xmlns:vt',
'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
85 $objWriter->writeElement(
'Application',
'Microsoft Excel');
88 $objWriter->writeElement(
'DocSecurity',
'0');
91 $objWriter->writeElement(
'ScaleCrop',
'false');
94 $objWriter->startElement(
'HeadingPairs');
97 $objWriter->startElement(
'vt:vector');
98 $objWriter->writeAttribute(
'size',
'2');
99 $objWriter->writeAttribute(
'baseType',
'variant');
103 $objWriter->startElement(
'vt:variant');
104 $objWriter->writeElement(
'vt:lpstr',
'Worksheets');
105 $objWriter->endElement();
108 $objWriter->startElement(
'vt:variant');
109 $objWriter->writeElement(
'vt:i4', $pPHPExcel->getSheetCount());
110 $objWriter->endElement();
112 $objWriter->endElement();
114 $objWriter->endElement();
117 $objWriter->startElement(
'TitlesOfParts');
120 $objWriter->startElement(
'vt:vector');
121 $objWriter->writeAttribute(
'size', $pPHPExcel->getSheetCount());
122 $objWriter->writeAttribute(
'baseType',
'lpstr');
124 $sheetCount = $pPHPExcel->getSheetCount();
125 for ($i = 0; $i < $sheetCount; ++$i) {
126 $objWriter->writeElement(
'vt:lpstr', $pPHPExcel->getSheet($i)->getTitle());
129 $objWriter->endElement();
131 $objWriter->endElement();
134 $objWriter->writeElement(
'Company', $pPHPExcel->getProperties()->getCompany());
137 $objWriter->writeElement(
'LinksUpToDate',
'false');
140 $objWriter->writeElement(
'SharedDoc',
'false');
143 $objWriter->writeElement(
'HyperlinksChanged',
'false');
146 $objWriter->writeElement(
'AppVersion',
'12.0000');
148 $objWriter->endElement();
151 return $objWriter->getData();
172 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
175 $objWriter->startElement(
'cp:coreProperties');
176 $objWriter->writeAttribute(
'xmlns:cp',
'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
177 $objWriter->writeAttribute(
'xmlns:dc',
'http://purl.org/dc/elements/1.1/');
178 $objWriter->writeAttribute(
'xmlns:dcterms',
'http://purl.org/dc/terms/');
179 $objWriter->writeAttribute(
'xmlns:dcmitype',
'http://purl.org/dc/dcmitype/');
180 $objWriter->writeAttribute(
'xmlns:xsi',
'http://www.w3.org/2001/XMLSchema-instance');
183 $objWriter->writeElement(
'dc:creator', $pPHPExcel->getProperties()->getCreator());
186 $objWriter->writeElement(
'cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy());
189 $objWriter->startElement(
'dcterms:created');
190 $objWriter->writeAttribute(
'xsi:type',
'dcterms:W3CDTF');
191 $objWriter->writeRaw(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
192 $objWriter->endElement();
195 $objWriter->startElement(
'dcterms:modified');
196 $objWriter->writeAttribute(
'xsi:type',
'dcterms:W3CDTF');
197 $objWriter->writeRaw(date(DATE_W3C, $pPHPExcel->getProperties()->getModified()));
198 $objWriter->endElement();
201 $objWriter->writeElement(
'dc:title', $pPHPExcel->getProperties()->getTitle());
204 $objWriter->writeElement(
'dc:description', $pPHPExcel->getProperties()->getDescription());
207 $objWriter->writeElement(
'dc:subject', $pPHPExcel->getProperties()->getSubject());
210 $objWriter->writeElement(
'cp:keywords', $pPHPExcel->getProperties()->getKeywords());
213 $objWriter->writeElement(
'cp:category', $pPHPExcel->getProperties()->getCategory());
215 $objWriter->endElement();
218 return $objWriter->getData();