summaryrefslogtreecommitdiffstats
path: root/admin/survey/excel/PHPExcel/Worksheet
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet.php2795
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/AutoFilter.php855
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column.php381
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php462
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/BaseDrawing.php485
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/CellIterator.php161
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/ColumnDimension.php266
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/Drawing.php148
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/Drawing/Shadow.php288
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/HeaderFooter.php465
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/HeaderFooterDrawing.php350
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/MemoryDrawing.php200
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/PageMargins.php220
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/PageSetup.php798
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/Protection.php545
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/Row.php90
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/RowDimension.php265
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/RowIterator.php148
-rw-r--r--admin/survey/excel/PHPExcel/Worksheet/SheetView.php188
-rw-r--r--admin/survey/excel/PHPExcel/WorksheetIterator.php111
20 files changed, 0 insertions, 9221 deletions
diff --git a/admin/survey/excel/PHPExcel/Worksheet.php b/admin/survey/excel/PHPExcel/Worksheet.php
deleted file mode 100644
index 19a346b..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet.php
+++ /dev/null
@@ -1,2795 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet implements PHPExcel_IComparable
-{
- /* Break types */
- const BREAK_NONE = 0;
- const BREAK_ROW = 1;
- const BREAK_COLUMN = 2;
-
- /* Sheet state */
- const SHEETSTATE_VISIBLE = 'visible';
- const SHEETSTATE_HIDDEN = 'hidden';
- const SHEETSTATE_VERYHIDDEN = 'veryHidden';
-
- /**
- * Invalid characters in sheet title
- *
- * @var array
- */
- private static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']');
-
- /**
- * Parent spreadsheet
- *
- * @var PHPExcel
- */
- private $_parent;
-
- /**
- * Cacheable collection of cells
- *
- * @var PHPExcel_CachedObjectStorage_xxx
- */
- private $_cellCollection = null;
-
- /**
- * Collection of row dimensions
- *
- * @var PHPExcel_Worksheet_RowDimension[]
- */
- private $_rowDimensions = array();
-
- /**
- * Default row dimension
- *
- * @var PHPExcel_Worksheet_RowDimension
- */
- private $_defaultRowDimension = null;
-
- /**
- * Collection of column dimensions
- *
- * @var PHPExcel_Worksheet_ColumnDimension[]
- */
- private $_columnDimensions = array();
-
- /**
- * Default column dimension
- *
- * @var PHPExcel_Worksheet_ColumnDimension
- */
- private $_defaultColumnDimension = null;
-
- /**
- * Collection of drawings
- *
- * @var PHPExcel_Worksheet_BaseDrawing[]
- */
- private $_drawingCollection = null;
-
- /**
- * Collection of Chart objects
- *
- * @var PHPExcel_Chart[]
- */
- private $_chartCollection = array();
-
- /**
- * Worksheet title
- *
- * @var string
- */
- private $_title;
-
- /**
- * Sheet state
- *
- * @var string
- */
- private $_sheetState;
-
- /**
- * Page setup
- *
- * @var PHPExcel_Worksheet_PageSetup
- */
- private $_pageSetup;
-
- /**
- * Page margins
- *
- * @var PHPExcel_Worksheet_PageMargins
- */
- private $_pageMargins;
-
- /**
- * Page header/footer
- *
- * @var PHPExcel_Worksheet_HeaderFooter
- */
- private $_headerFooter;
-
- /**
- * Sheet view
- *
- * @var PHPExcel_Worksheet_SheetView
- */
- private $_sheetView;
-
- /**
- * Protection
- *
- * @var PHPExcel_Worksheet_Protection
- */
- private $_protection;
-
- /**
- * Collection of styles
- *
- * @var PHPExcel_Style[]
- */
- private $_styles = array();
-
- /**
- * Conditional styles. Indexed by cell coordinate, e.g. 'A1'
- *
- * @var array
- */
- private $_conditionalStylesCollection = array();
-
- /**
- * Is the current cell collection sorted already?
- *
- * @var boolean
- */
- private $_cellCollectionIsSorted = false;
-
- /**
- * Collection of breaks
- *
- * @var array
- */
- private $_breaks = array();
-
- /**
- * Collection of merged cell ranges
- *
- * @var array
- */
- private $_mergeCells = array();
-
- /**
- * Collection of protected cell ranges
- *
- * @var array
- */
- private $_protectedCells = array();
-
- /**
- * Autofilter Range and selection
- *
- * @var PHPExcel_Worksheet_AutoFilter
- */
- private $_autoFilter = NULL;
-
- /**
- * Freeze pane
- *
- * @var string
- */
- private $_freezePane = '';
-
- /**
- * Show gridlines?
- *
- * @var boolean
- */
- private $_showGridlines = true;
-
- /**
- * Print gridlines?
- *
- * @var boolean
- */
- private $_printGridlines = false;
-
- /**
- * Show row and column headers?
- *
- * @var boolean
- */
- private $_showRowColHeaders = true;
-
- /**
- * Show summary below? (Row/Column outline)
- *
- * @var boolean
- */
- private $_showSummaryBelow = true;
-
- /**
- * Show summary right? (Row/Column outline)
- *
- * @var boolean
- */
- private $_showSummaryRight = true;
-
- /**
- * Collection of comments
- *
- * @var PHPExcel_Comment[]
- */
- private $_comments = array();
-
- /**
- * Active cell. (Only one!)
- *
- * @var string
- */
- private $_activeCell = 'A1';
-
- /**
- * Selected cells
- *
- * @var string
- */
- private $_selectedCells = 'A1';
-
- /**
- * Cached highest column
- *
- * @var string
- */
- private $_cachedHighestColumn = 'A';
-
- /**
- * Cached highest row
- *
- * @var int
- */
- private $_cachedHighestRow = 1;
-
- /**
- * Right-to-left?
- *
- * @var boolean
- */
- private $_rightToLeft = false;
-
- /**
- * Hyperlinks. Indexed by cell coordinate, e.g. 'A1'
- *
- * @var array
- */
- private $_hyperlinkCollection = array();
-
- /**
- * Data validation objects. Indexed by cell coordinate, e.g. 'A1'
- *
- * @var array
- */
- private $_dataValidationCollection = array();
-
- /**
- * Tab color
- *
- * @var PHPExcel_Style_Color
- */
- private $_tabColor;
-
- /**
- * Dirty flag
- *
- * @var boolean
- */
- private $_dirty = true;
-
- /**
- * Hash
- *
- * @var string
- */
- private $_hash = null;
-
- /**
- * Create a new worksheet
- *
- * @param PHPExcel $pParent
- * @param string $pTitle
- */
- public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet')
- {
- // Set parent and title
- $this->_parent = $pParent;
- $this->setTitle($pTitle, FALSE);
- $this->setSheetState(PHPExcel_Worksheet::SHEETSTATE_VISIBLE);
-
- $this->_cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this);
-
- // Set page setup
- $this->_pageSetup = new PHPExcel_Worksheet_PageSetup();
-
- // Set page margins
- $this->_pageMargins = new PHPExcel_Worksheet_PageMargins();
-
- // Set page header/footer
- $this->_headerFooter = new PHPExcel_Worksheet_HeaderFooter();
-
- // Set sheet view
- $this->_sheetView = new PHPExcel_Worksheet_SheetView();
-
- // Drawing collection
- $this->_drawingCollection = new ArrayObject();
-
- // Chart collection
- $this->_chartCollection = new ArrayObject();
-
- // Protection
- $this->_protection = new PHPExcel_Worksheet_Protection();
-
- // Default row dimension
- $this->_defaultRowDimension = new PHPExcel_Worksheet_RowDimension(NULL);
-
- // Default column dimension
- $this->_defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(NULL);
-
- $this->_autoFilter = new PHPExcel_Worksheet_AutoFilter(NULL, $this);
- }
-
-
- /**
- * Disconnect all cells from this PHPExcel_Worksheet object,
- * typically so that the worksheet object can be unset
- *
- */
- public function disconnectCells() {
- $this->_cellCollection->unsetWorksheetCells();
- $this->_cellCollection = null;
-
- // detach ourself from the workbook, so that it can then delete this worksheet successfully
- $this->_parent = null;
- }
-
- /**
- * Return the cache controller for the cell collection
- *
- * @return PHPExcel_CachedObjectStorage_xxx
- */
- public function getCellCacheController() {
- return $this->_cellCollection;
- } // function getCellCacheController()
-
-
- /**
- * Get array of invalid characters for sheet title
- *
- * @return array
- */
- public static function getInvalidCharacters()
- {
- return self::$_invalidCharacters;
- }
-
- /**
- * Check sheet title for valid Excel syntax
- *
- * @param string $pValue The string to check
- * @return string The valid string
- * @throws Exception
- */
- private static function _checkSheetTitle($pValue)
- {
- // Some of the printable ASCII characters are invalid: * : / \ ? [ ]
- if (str_replace(self::$_invalidCharacters, '', $pValue) !== $pValue) {
- throw new Exception('Invalid character found in sheet title');
- }
-
- // Maximum 31 characters allowed for sheet title
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) {
- throw new Exception('Maximum 31 characters allowed in sheet title.');
- }
-
- return $pValue;
- }
-
- /**
- * Get collection of cells
- *
- * @param boolean $pSorted Also sort the cell collection?
- * @return PHPExcel_Cell[]
- */
- public function getCellCollection($pSorted = true)
- {
- if ($pSorted) {
- // Re-order cell collection
- return $this->sortCellCollection();
- }
- if ($this->_cellCollection !== NULL) {
- return $this->_cellCollection->getCellList();
- }
- return array();
- }
-
- /**
- * Sort collection of cells
- *
- * @return PHPExcel_Worksheet
- */
- public function sortCellCollection()
- {
- if ($this->_cellCollection !== NULL) {
- return $this->_cellCollection->getSortedCellList();
- }
- return array();
- }
-
- /**
- * Get collection of row dimensions
- *
- * @return PHPExcel_Worksheet_RowDimension[]
- */
- public function getRowDimensions()
- {
- return $this->_rowDimensions;
- }
-
- /**
- * Get default row dimension
- *
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function getDefaultRowDimension()
- {
- return $this->_defaultRowDimension;
- }
-
- /**
- * Get collection of column dimensions
- *
- * @return PHPExcel_Worksheet_ColumnDimension[]
- */
- public function getColumnDimensions()
- {
- return $this->_columnDimensions;
- }
-
- /**
- * Get default column dimension
- *
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getDefaultColumnDimension()
- {
- return $this->_defaultColumnDimension;
- }
-
- /**
- * Get collection of drawings
- *
- * @return PHPExcel_Worksheet_BaseDrawing[]
- */
- public function getDrawingCollection()
- {
- return $this->_drawingCollection;
- }
-
- /**
- * Get collection of charts
- *
- * @return PHPExcel_Chart[]
- */
- public function getChartCollection()
- {
- return $this->_chartCollection;
- }
-
- /**
- * Add chart
- *
- * @param PHPExcel_Chart $pChart
- * @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last)
- * @return PHPExcel_Chart
- * @throws Exception
- */
- public function addChart(PHPExcel_Chart $pChart = null, $iChartIndex = null)
- {
- $pChart->setWorksheet($this);
- if (is_null($iChartIndex)) {
- $this->_chartCollection[] = $pChart;
- } else {
- // Insert the chart at the requested index
- array_splice($this->_chartCollection, $iChartIndex, 0, array($pChart));
- }
-
- return $pChart;
- }
-
- /**
- * Return the count of charts on this worksheet
- *
- * @return int The number of charts
- * @throws Exception
- */
- public function getChartCount()
- {
- return count($this->_chartCollection);
- }
-
- /**
- * Get a chart by its index position
- *
- * @param string $index Chart index position
- * @return false|PHPExcel_Chart
- * @throws Exception
- */
- public function getChartByIndex($index = null)
- {
- $chartCount = count($this->_chartCollection);
- if ($chartCount == 0) {
- return false;
- }
- if (is_null($index)) {
- $index = --$chartCount;
- }
- if (!isset($this->_chartCollection[$index])) {
- return false;
- }
-
- return $this->_chartCollection[$index];
- }
-
- /**
- * Return an array of the names of charts on this worksheet
- *
- * @return string[] The names of charts
- * @throws Exception
- */
- public function getChartNames()
- {
- $chartNames = array();
- foreach($this->_chartCollection as $chart) {
- $chartNames[] = $chart->getName();
- }
- return $chartNames;
- }
-
- /**
- * Get a chart by name
- *
- * @param string $chartName Chart name
- * @return false|PHPExcel_Chart
- * @throws Exception
- */
- public function getChartByName($chartName = '')
- {
- $chartCount = count($this->_chartCollection);
- if ($chartCount == 0) {
- return false;
- }
- foreach($this->_chartCollection as $index => $chart) {
- if ($chart->getName() == $chartName) {
- return $this->_chartCollection[$index];
- }
- }
- return false;
- }
-
- /**
- * Refresh column dimensions
- *
- * @return PHPExcel_Worksheet
- */
- public function refreshColumnDimensions()
- {
- $currentColumnDimensions = $this->getColumnDimensions();
- $newColumnDimensions = array();
-
- foreach ($currentColumnDimensions as $objColumnDimension) {
- $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
- }
-
- $this->_columnDimensions = $newColumnDimensions;
-
- return $this;
- }
-
- /**
- * Refresh row dimensions
- *
- * @return PHPExcel_Worksheet
- */
- public function refreshRowDimensions()
- {
- $currentRowDimensions = $this->getRowDimensions();
- $newRowDimensions = array();
-
- foreach ($currentRowDimensions as $objRowDimension) {
- $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
- }
-
- $this->_rowDimensions = $newRowDimensions;
-
- return $this;
- }
-
- /**
- * Calculate worksheet dimension
- *
- * @return string String containing the dimension of this worksheet
- */
- public function calculateWorksheetDimension()
- {
- // Return
- return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow();
- }
-
- /**
- * Calculate worksheet data dimension
- *
- * @return string String containing the dimension of this worksheet that actually contain data
- */
- public function calculateWorksheetDataDimension()
- {
- // Return
- return 'A1' . ':' . $this->getHighestDataColumn() . $this->getHighestDataRow();
- }
-
- /**
- * Calculate widths for auto-size columns
- *
- * @param boolean $calculateMergeCells Calculate merge cell width
- * @return PHPExcel_Worksheet;
- */
- public function calculateColumnWidths($calculateMergeCells = false)
- {
- // initialize $autoSizes array
- $autoSizes = array();
- foreach ($this->getColumnDimensions() as $colDimension) {
- if ($colDimension->getAutoSize()) {
- $autoSizes[$colDimension->getColumnIndex()] = -1;
- }
- }
-
- // There is only something to do if there are some auto-size columns
- if (!empty($autoSizes)) {
-
- // build list of cells references that participate in a merge
- $isMergeCell = array();
- foreach ($this->getMergeCells() as $cells) {
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) {
- $isMergeCell[$cellReference] = true;
- }
- }
-
- // loop through all cells in the worksheet
- foreach ($this->getCellCollection(false) as $cellID) {
- $cell = $this->getCell($cellID);
- if (isset($autoSizes[$cell->getColumn()])) {
- // Determine width if cell does not participate in a merge
- if (!isset($isMergeCell[$cell->getCoordinate()])) {
- // Calculated value
- $cellValue = $cell->getCalculatedValue();
-
- // To formatted string
- $cellValue = PHPExcel_Style_NumberFormat::toFormattedString($cellValue, $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode());
-
- $autoSizes[$cell->getColumn()] = max(
- (float)$autoSizes[$cell->getColumn()],
- (float)PHPExcel_Shared_Font::calculateColumnWidth(
- $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
- $cellValue,
- $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
- $this->getDefaultStyle()->getFont()
- )
- );
- }
- }
- }
-
- // adjust column widths
- foreach ($autoSizes as $columnIndex => $width) {
- if ($width == -1) $width = $this->getDefaultColumnDimension()->getWidth();
- $this->getColumnDimension($columnIndex)->setWidth($width);
- }
- }
-
- return $this;
- }
-
- /**
- * Get parent
- *
- * @return PHPExcel
- */
- public function getParent() {
- return $this->_parent;
- }
-
- /**
- * Re-bind parent
- *
- * @param PHPExcel $parent
- * @return PHPExcel_Worksheet
- */
- public function rebindParent(PHPExcel $parent) {
- $namedRanges = $this->_parent->getNamedRanges();
- foreach ($namedRanges as $namedRange) {
- $parent->addNamedRange($namedRange);
- }
-
- $this->_parent->removeSheetByIndex(
- $this->_parent->getIndex($this)
- );
- $this->_parent = $parent;
-
- return $this;
- }
-
- /**
- * Get title
- *
- * @return string
- */
- public function getTitle()
- {
- return $this->_title;
- }
-
- /**
- * Set title
- *
- * @param string $pValue String containing the dimension of this worksheet
- * @param string $updateFormulaCellReferences boolean Flag indicating whether cell references in formulae should
- * be updated to reflect the new sheet name.
- * This should be left as the default true, unless you are
- * certain that no formula cells on any worksheet contain
- * references to this worksheet
- * @return PHPExcel_Worksheet
- */
- public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true)
- {
- // Is this a 'rename' or not?
- if ($this->getTitle() == $pValue) {
- return $this;
- }
-
- // Syntax check
- self::_checkSheetTitle($pValue);
-
- // Old title
- $oldTitle = $this->getTitle();
-
- if ($this->getParent()) {
- // Is there already such sheet name?
- if ($this->getParent()->sheetNameExists($pValue)) {
- // Use name, but append with lowest possible integer
-
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
- $pValue = PHPExcel_Shared_String::Substring($pValue,0,29);
- }
- $i = 1;
- while ($this->getParent()->sheetNameExists($pValue . ' ' . $i)) {
- ++$i;
- if ($i == 10) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
- $pValue = PHPExcel_Shared_String::Substring($pValue,0,28);
- }
- } elseif ($i == 100) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
- $pValue = PHPExcel_Shared_String::Substring($pValue,0,27);
- }
- }
- }
-
- $altTitle = $pValue . ' ' . $i;
- return $this->setTitle($altTitle,$updateFormulaCellReferences);
- }
- }
-
- // Set title
- $this->_title = $pValue;
- $this->_dirty = true;
-
- if ($this->getParent()) {
- // New title
- $newTitle = $this->getTitle();
- if ($updateFormulaCellReferences)
- PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->getParent(), $oldTitle, $newTitle);
- }
-
- return $this;
- }
-
- /**
- * Get sheet state
- *
- * @return string Sheet state (visible, hidden, veryHidden)
- */
- public function getSheetState() {
- return $this->_sheetState;
- }
-
- /**
- * Set sheet state
- *
- * @param string $value Sheet state (visible, hidden, veryHidden)
- * @return PHPExcel_Worksheet
- */
- public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE) {
- $this->_sheetState = $value;
- return $this;
- }
-
- /**
- * Get page setup
- *
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function getPageSetup()
- {
- return $this->_pageSetup;
- }
-
- /**
- * Set page setup
- *
- * @param PHPExcel_Worksheet_PageSetup $pValue
- * @return PHPExcel_Worksheet
- */
- public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue)
- {
- $this->_pageSetup = $pValue;
- return $this;
- }
-
- /**
- * Get page margins
- *
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function getPageMargins()
- {
- return $this->_pageMargins;
- }
-
- /**
- * Set page margins
- *
- * @param PHPExcel_Worksheet_PageMargins $pValue
- * @return PHPExcel_Worksheet
- */
- public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue)
- {
- $this->_pageMargins = $pValue;
- return $this;
- }
-
- /**
- * Get page header/footer
- *
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function getHeaderFooter()
- {
- return $this->_headerFooter;
- }
-
- /**
- * Set page header/footer
- *
- * @param PHPExcel_Worksheet_HeaderFooter $pValue
- * @return PHPExcel_Worksheet
- */
- public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue)
- {
- $this->_headerFooter = $pValue;
- return $this;
- }
-
- /**
- * Get sheet view
- *
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function getSheetView()
- {
- return $this->_sheetView;
- }
-
- /**
- * Set sheet view
- *
- * @param PHPExcel_Worksheet_SheetView $pValue
- * @return PHPExcel_Worksheet
- */
- public function setSheetView(PHPExcel_Worksheet_SheetView $pValue)
- {
- $this->_sheetView = $pValue;
- return $this;
- }
-
- /**
- * Get Protection
- *
- * @return PHPExcel_Worksheet_Protection
- */
- public function getProtection()
- {
- return $this->_protection;
- }
-
- /**
- * Set Protection
- *
- * @param PHPExcel_Worksheet_Protection $pValue
- * @return PHPExcel_Worksheet
- */
- public function setProtection(PHPExcel_Worksheet_Protection $pValue)
- {
- $this->_protection = $pValue;
- $this->_dirty = true;
-
- return $this;
- }
-
- /**
- * Get highest worksheet column
- *
- * @return string Highest column name
- */
- public function getHighestColumn()
- {
- return $this->_cachedHighestColumn;
- }
-
- /**
- * Get highest worksheet column that contains data
- *
- * @return string Highest column name that contains data
- */
- public function getHighestDataColumn()
- {
- return $this->_cellCollection->getHighestColumn();
- }
-
- /**
- * Get highest worksheet row
- *
- * @return int Highest row number
- */
- public function getHighestRow()
- {
- return $this->_cachedHighestRow;
- }
-
- /**
- * Get highest worksheet row that contains data
- *
- * @return string Highest row number that contains data
- */
- public function getHighestDataRow()
- {
- return $this->_cellCollection->getHighestRow();
- }
-
- /**
- * Get highest worksheet column and highest row that have cell records
- *
- * @return array Highest column name and highest row number
- */
- public function getHighestRowAndColumn()
- {
- return $this->_cellCollection->getHighestRowAndColumn();
- }
-
- /**
- * Set a cell value
- *
- * @param string $pCoordinate Coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false)
- {
- $cell = $this->getCell($pCoordinate)->setValue($pValue);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false)
- {
- $cell = $this->getCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow)->setValue($pValue);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value
- *
- * @param string $pCoordinate Coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param string $pDataType Explicit data type
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false)
- {
- // Set value
- $cell = $this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param string $pDataType Explicit data type
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false)
- {
- $cell = $this->getCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow)->setValueExplicit($pValue, $pDataType);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoordinate Coordinate of the cell
- * @throws Exception
- * @return PHPExcel_Cell Cell that was found
- */
- public function getCell($pCoordinate = 'A1')
- {
- // Check cell collection
- if ($this->_cellCollection->isDataSet($pCoordinate)) {
- return $this->_cellCollection->getCacheData($pCoordinate);
- }
-
- // Worksheet reference?
- if (strpos($pCoordinate, '!') !== false) {
- $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
- return $this->getParent()->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]);
- }
-
- // Named range?
- if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
- (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
- $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
- if ($namedRange !== NULL) {
- $pCoordinate = $namedRange->getRange();
- return $namedRange->getWorksheet()->getCell($pCoordinate);
- }
- }
-
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
- throw new Exception('Cell coordinate can not be a range of cells.');
- } elseif (strpos($pCoordinate,'$') !== false) {
- throw new Exception('Cell coordinate must not be absolute.');
- } else {
- // Create new cell object
-
- // Coordinates
- $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
-
- $cell = $this->_cellCollection->addCacheData($pCoordinate,new PHPExcel_Cell($aCoordinates[0], $aCoordinates[1], null, PHPExcel_Cell_DataType::TYPE_NULL, $this));
- $this->_cellCollectionIsSorted = false;
-
- if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0]))
- $this->_cachedHighestColumn = $aCoordinates[0];
-
- $this->_cachedHighestRow = max($this->_cachedHighestRow,$aCoordinates[1]);
-
- // Cell needs appropriate xfIndex
- $rowDimensions = $this->getRowDimensions();
- $columnDimensions = $this->getColumnDimensions();
-
- if ( isset($rowDimensions[$aCoordinates[1]]) && $rowDimensions[$aCoordinates[1]]->getXfIndex() !== null ) {
- // then there is a row dimension with explicit style, assign it to the cell
- $cell->setXfIndex($rowDimensions[$aCoordinates[1]]->getXfIndex());
- } else if ( isset($columnDimensions[$aCoordinates[0]]) ) {
- // then there is a column dimension, assign it to the cell
- $cell->setXfIndex($columnDimensions[$aCoordinates[0]]->getXfIndex());
- } else {
- // set to default index
- $cell->setXfIndex(0);
- }
-
- return $cell;
- }
- }
-
- /**
- * Get cell at a specific coordinate by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @return PHPExcel_Cell Cell that was found
- */
- public function getCellByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn);
- $coordinate = $columnLetter . $pRow;
-
- if (!$this->_cellCollection->isDataSet($coordinate)) {
- $cell = $this->_cellCollection->addCacheData($coordinate, new PHPExcel_Cell($columnLetter, $pRow, null, PHPExcel_Cell_DataType::TYPE_NULL, $this));
- $this->_cellCollectionIsSorted = false;
-
- if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < $pColumn)
- $this->_cachedHighestColumn = $columnLetter;
-
- $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow);
-
- return $cell;
- }
-
- return $this->_cellCollection->getCacheData($coordinate);
- }
-
- /**
- * Cell at a specific coordinate exists?
- *
- * @param string $pCoordinate Coordinate of the cell
- * @throws Exception
- * @return boolean
- */
- public function cellExists($pCoordinate = 'A1')
- {
- // Worksheet reference?
- if (strpos($pCoordinate, '!') !== false) {
- $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
- return $this->getParent()->getSheetByName($worksheetReference[0])->cellExists($worksheetReference[1]);
- }
-
- // Named range?
- if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
- (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
- $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
- if ($namedRange !== NULL) {
- $pCoordinate = $namedRange->getRange();
- if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
- if (!$namedRange->getLocalOnly()) {
- return $namedRange->getWorksheet()->cellExists($pCoordinate);
- } else {
- throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
- }
- }
- }
- }
-
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
- throw new Exception('Cell coordinate can not be a range of cells.');
- } elseif (strpos($pCoordinate,'$') !== false) {
- throw new Exception('Cell coordinate must not be absolute.');
- } else {
- // Coordinates
- $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
-
- // Cell exists?
- return $this->_cellCollection->isDataSet($pCoordinate);
- }
- }
-
- /**
- * Cell at a specific coordinate by using numeric cell coordinates exists?
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @return boolean
- */
- public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get row dimension at a specific row
- *
- * @param int $pRow Numeric index of the row
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function getRowDimension($pRow = 1)
- {
- // Found
- $found = null;
-
- // Get row dimension
- if (!isset($this->_rowDimensions[$pRow])) {
- $this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);
-
- $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow);
- }
- return $this->_rowDimensions[$pRow];
- }
-
- /**
- * Get column dimension at a specific column
- *
- * @param string $pColumn String index of the column
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getColumnDimension($pColumn = 'A')
- {
- // Uppercase coordinate
- $pColumn = strtoupper($pColumn);
-
- // Fetch dimensions
- if (!isset($this->_columnDimensions[$pColumn])) {
- $this->_columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);
-
- if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn))
- $this->_cachedHighestColumn = $pColumn;
- }
- return $this->_columnDimensions[$pColumn];
- }
-
- /**
- * Get column dimension at a specific column by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getColumnDimensionByColumn($pColumn = 0)
- {
- return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn));
- }
-
- /**
- * Get styles
- *
- * @return PHPExcel_Style[]
- */
- public function getStyles()
- {
- return $this->_styles;
- }
-
- /**
- * Get default style of workbork.
- *
- * @deprecated
- * @return PHPExcel_Style
- * @throws Exception
- */
- public function getDefaultStyle()
- {
- return $this->_parent->getDefaultStyle();
- }
-
- /**
- * Set default style - should only be used by PHPExcel_IReader implementations!
- *
- * @deprecated
- * @param PHPExcel_Style $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setDefaultStyle(PHPExcel_Style $pValue)
- {
- $this->_parent->getDefaultStyle()->applyFromArray(array(
- 'font' => array(
- 'name' => $pValue->getFont()->getName(),
- 'size' => $pValue->getFont()->getSize(),
- ),
- ));
- return $this;
- }
-
- /**
- * Get style for cell
- *
- * @param string $pCellCoordinate Cell coordinate to get style for
- * @return PHPExcel_Style
- * @throws Exception
- */
- public function getStyle($pCellCoordinate = 'A1')
- {
- // set this sheet as active
- $this->_parent->setActiveSheetIndex($this->_parent->getIndex($this));
-
- // set cell coordinate as active
- $this->setSelectedCells($pCellCoordinate);
-
- return $this->_parent->getCellXfSupervisor();
- }
-
- /**
- * Get conditional styles for a cell
- *
- * @param string $pCoordinate
- * @return PHPExcel_Style_Conditional[]
- */
- public function getConditionalStyles($pCoordinate = 'A1')
- {
- if (!isset($this->_conditionalStylesCollection[$pCoordinate])) {
- $this->_conditionalStylesCollection[$pCoordinate] = array();
- }
- return $this->_conditionalStylesCollection[$pCoordinate];
- }
-
- /**
- * Do conditional styles exist for this cell?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function conditionalStylesExists($pCoordinate = 'A1')
- {
- if (isset($this->_conditionalStylesCollection[$pCoordinate])) {
- return true;
- }
- return false;
- }
-
- /**
- * Removes conditional styles for a cell
- *
- * @param string $pCoordinate
- * @return PHPExcel_Worksheet
- */
- public function removeConditionalStyles($pCoordinate = 'A1')
- {
- unset($this->_conditionalStylesCollection[$pCoordinate]);
- return $this;
- }
-
- /**
- * Get collection of conditional styles
- *
- * @return array
- */
- public function getConditionalStylesCollection()
- {
- return $this->_conditionalStylesCollection;
- }
-
- /**
- * Set conditional styles
- *
- * @param $pCoordinate string E.g. 'A1'
- * @param $pValue PHPExcel_Style_Conditional[]
- * @return PHPExcel_Worksheet
- */
- public function setConditionalStyles($pCoordinate = 'A1', $pValue)
- {
- $this->_conditionalStylesCollection[$pCoordinate] = $pValue;
- return $this;
- }
-
- /**
- * Get style for cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @return PHPExcel_Style
- */
- public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Set shared cell style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @deprecated
- * @param PHPExcel_Style $pSharedCellStyle Cell style to share
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '')
- {
- $this->duplicateStyle($pSharedCellStyle, $pRange);
- return $this;
- }
-
- /**
- * Duplicate cell style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @param PHPExcel_Style $pCellStyle Cell style to duplicate
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '')
- {
- // make sure we have a real style and not supervisor
- $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
-
- // Add the style to the workbook if necessary
- $workbook = $this->_parent;
- if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
- // there is already such cell Xf in our collection
- $xfIndex = $existingStyle->getIndex();
- } else {
- // we don't have such a cell Xf, need to add
- $workbook->addCellXf($pCellStyle);
- $xfIndex = $pCellStyle->getIndex();
- }
-
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- // Is it a cell range or a single cell?
- $rangeA = '';
- $rangeB = '';
- if (strpos($pRange, ':') === false) {
- $rangeA = $pRange;
- $rangeB = $pRange;
- } else {
- list($rangeA, $rangeB) = explode(':', $pRange);
- }
-
- // Calculate range outer borders
- $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
- $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
-
- // Translate column into index
- $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
- $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
-
- // Make sure we can loop upwards on rows and columns
- if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
- $tmp = $rangeStart;
- $rangeStart = $rangeEnd;
- $rangeEnd = $tmp;
- }
-
- // Loop through cells and apply styles
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row)->setXfIndex($xfIndex);
- }
- }
-
- return $this;
- }
-
- /**
- * Duplicate conditional style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @param array of PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '')
- {
- foreach($pCellStyle as $cellStyle) {
- if (!is_a($cellStyle,'PHPExcel_Style_Conditional')) {
- throw new Exception('Style is not a conditional style');
- }
- }
-
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- // Is it a cell range or a single cell?
- $rangeA = '';
- $rangeB = '';
- if (strpos($pRange, ':') === false) {
- $rangeA = $pRange;
- $rangeB = $pRange;
- } else {
- list($rangeA, $rangeB) = explode(':', $pRange);
- }
-
- // Calculate range outer borders
- $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
- $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
-
- // Translate column into index
- $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
- $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
-
- // Make sure we can loop upwards on rows and columns
- if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
- $tmp = $rangeStart;
- $rangeStart = $rangeEnd;
- $rangeEnd = $tmp;
- }
-
- // Loop through cells and apply styles
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $this->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($col) . $row, $pCellStyle);
- }
- }
-
- return $this;
- }
-
- /**
- * Duplicate cell style array to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range,
- * if they are in the styles array. For example, if you decide to set a range of
- * cells to font bold, only include font bold in the styles array.
- *
- * @deprecated
- * @param array $pStyles Array containing style information
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @param boolean $pAdvanced Advanced mode for setting borders.
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true)
- {
- $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced);
- return $this;
- }
-
- /**
- * Set break on a cell
- *
- * @param string $pCell Cell coordinate (e.g. A1)
- * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE)
- {
- // Uppercase coordinate
- $pCell = strtoupper($pCell);
-
- if ($pCell != '') {
- $this->_breaks[$pCell] = $pBreak;
- } else {
- throw new Exception('No cell coordinate specified.');
- }
-
- return $this;
- }
-
- /**
- * Set break on a cell by using numeric cell coordinates
- *
- * @param integer $pColumn Numeric column coordinate of the cell
- * @param integer $pRow Numeric row coordinate of the cell
- * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE)
- {
- return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
- }
-
- /**
- * Get breaks
- *
- * @return array[]
- */
- public function getBreaks()
- {
- return $this->_breaks;
- }
-
- /**
- * Set merge on a cell range
- *
- * @param string $pRange Cell range (e.g. A1:E1)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function mergeCells($pRange = 'A1:A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (strpos($pRange,':') !== false) {
- $this->_mergeCells[$pRange] = $pRange;
-
- // make sure cells are created
-
- // get the cells in the range
- $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
-
- // create upper left cell if it does not already exist
- $upperLeft = $aReferences[0];
- if (!$this->cellExists($upperLeft)) {
- $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
- }
-
- // create or blank out the rest of the cells in the range
- $count = count($aReferences);
- for ($i = 1; $i < $count; $i++) {
- $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
- }
-
- } else {
- throw new Exception('Merge must be set on a range of cells.');
- }
-
- return $this;
- }
-
- /**
- * Set merge on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->mergeCells($cellRange);
- }
-
- /**
- * Remove merge on a cell range
- *
- * @param string $pRange Cell range (e.g. A1:E1)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function unmergeCells($pRange = 'A1:A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (strpos($pRange,':') !== false) {
- if (isset($this->_mergeCells[$pRange])) {
- unset($this->_mergeCells[$pRange]);
- } else {
- throw new Exception('Cell range ' . $pRange . ' not known as merged.');
- }
- } else {
- throw new Exception('Merge can only be removed from a range of cells.');
- }
-
- return $this;
- }
-
- /**
- * Remove merge on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->unmergeCells($cellRange);
- }
-
- /**
- * Get merge cells array.
- *
- * @return array[]
- */
- public function getMergeCells()
- {
- return $this->_mergeCells;
- }
-
- /**
- * Set merge cells array for the entire sheet. Use instead mergeCells() to merge
- * a single cell range.
- *
- * @param array
- */
- public function setMergeCells($pValue = array())
- {
- $this->_mergeCells = $pValue;
-
- return $this;
- }
-
- /**
- * Set protection on a cell range
- *
- * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false)
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (!$pAlreadyHashed) {
- $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword);
- }
- $this->_protectedCells[$pRange] = $pPassword;
-
- return $this;
- }
-
- /**
- * Set protection on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed);
- }
-
- /**
- * Remove protection on a cell range
- *
- * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function unprotectCells($pRange = 'A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (isset($this->_protectedCells[$pRange])) {
- unset($this->_protectedCells[$pRange]);
- } else {
- throw new Exception('Cell range ' . $pRange . ' not known as protected.');
- }
- return $this;
- }
-
- /**
- * Remove protection on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed);
- }
-
- /**
- * Get protected cells
- *
- * @return array[]
- */
- public function getProtectedCells()
- {
- return $this->_protectedCells;
- }
-
- /**
- * Get Autofilter
- *
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function getAutoFilter()
- {
- return $this->_autoFilter;
- }
-
- /**
- * Set AutoFilter
- *
- * @param PHPExcel_Worksheet_AutoFilter|string $pValue
- * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setAutoFilter($pValue)
- {
- if (is_string($pValue)) {
- $this->_autoFilter->setRange($pValue);
- } elseif(is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) {
- $this->_autoFilter = $pValue;
- }
- return $this;
- }
-
- /**
- * Set Autofilter Range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the second cell
- * @param int $pRow2 Numeric row coordinate of the second cell
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- return $this->setAutoFilter(
- PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1
- . ':' .
- PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2
- );
- }
-
- /**
- * Remove autofilter
- *
- * @return PHPExcel_Worksheet
- */
- public function removeAutoFilter()
- {
- $this->_autoFilter->setRange(NULL);
- return $this;
- }
-
- /**
- * Get Freeze Pane
- *
- * @return string
- */
- public function getFreezePane()
- {
- return $this->_freezePane;
- }
-
- /**
- * Freeze Pane
- *
- * @param string $pCell Cell (i.e. A2)
- * Examples:
- * A2 will freeze the rows above cell A2 (i.e row 1)
- * B1 will freeze the columns to the left of cell B1 (i.e column A)
- * B2 will freeze the rows above and to the left of cell A2
- * (i.e row 1 and column A)
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function freezePane($pCell = '')
- {
- // Uppercase coordinate
- $pCell = strtoupper($pCell);
-
- if (strpos($pCell,':') === false && strpos($pCell,',') === false) {
- $this->_freezePane = $pCell;
- } else {
- throw new Exception('Freeze pane can not be set on a range of cells.');
- }
- return $this;
- }
-
- /**
- * Freeze Pane by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Unfreeze Pane
- *
- * @return PHPExcel_Worksheet
- */
- public function unfreezePane()
- {
- return $this->freezePane('');
- }
-
- /**
- * Insert a new row, updating all possible related data
- *
- * @param int $pBefore Insert before this one
- * @param int $pNumRows Number of rows to insert
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) {
- if ($pBefore >= 1) {
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
- } else {
- throw new Exception("Rows can only be inserted before at least row 1.");
- }
- return $this;
- }
-
- /**
- * Insert a new column, updating all possible related data
- *
- * @param int $pBefore Insert before this one
- * @param int $pNumCols Number of columns to insert
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) {
- if (!is_numeric($pBefore)) {
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
- } else {
- throw new Exception("Column references should not be numeric.");
- }
- return $this;
- }
-
- /**
- * Insert a new column, updating all possible related data
- *
- * @param int $pBefore Insert before this one (numeric column coordinate of the cell)
- * @param int $pNumCols Number of columns to insert
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) {
- if ($pBefore >= 0) {
- return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
- } else {
- throw new Exception("Columns can only be inserted before at least column A (0).");
- }
- }
-
- /**
- * Delete a row, updating all possible related data
- *
- * @param int $pRow Remove starting with this one
- * @param int $pNumRows Number of rows to remove
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function removeRow($pRow = 1, $pNumRows = 1) {
- if ($pRow >= 1) {
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
- } else {
- throw new Exception("Rows to be deleted should at least start from row 1.");
- }
- return $this;
- }
-
- /**
- * Remove a column, updating all possible related data
- *
- * @param int $pColumn Remove starting with this one
- * @param int $pNumCols Number of columns to remove
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function removeColumn($pColumn = 'A', $pNumCols = 1) {
- if (!is_numeric($pColumn)) {
- $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols);
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
- } else {
- throw new Exception("Column references should not be numeric.");
- }
- return $this;
- }
-
- /**
- * Remove a column, updating all possible related data
- *
- * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell)
- * @param int $pNumCols Number of columns to remove
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) {
- if ($pColumn >= 0) {
- return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols);
- } else {
- throw new Exception("Columns to be deleted should at least start from column 0");
- }
- }
-
- /**
- * Show gridlines?
- *
- * @return boolean
- */
- public function getShowGridlines() {
- return $this->_showGridlines;
- }
-
- /**
- * Set show gridlines
- *
- * @param boolean $pValue Show gridlines (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowGridlines($pValue = false) {
- $this->_showGridlines = $pValue;
- return $this;
- }
-
- /**
- * Print gridlines?
- *
- * @return boolean
- */
- public function getPrintGridlines() {
- return $this->_printGridlines;
- }
-
- /**
- * Set print gridlines
- *
- * @param boolean $pValue Print gridlines (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setPrintGridlines($pValue = false) {
- $this->_printGridlines = $pValue;
- return $this;
- }
-
- /**
- * Show row and column headers?
- *
- * @return boolean
- */
- public function getShowRowColHeaders() {
- return $this->_showRowColHeaders;
- }
-
- /**
- * Set show row and column headers
- *
- * @param boolean $pValue Show row and column headers (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowRowColHeaders($pValue = false) {
- $this->_showRowColHeaders = $pValue;
- return $this;
- }
-
- /**
- * Show summary below? (Row/Column outlining)
- *
- * @return boolean
- */
- public function getShowSummaryBelow() {
- return $this->_showSummaryBelow;
- }
-
- /**
- * Set show summary below
- *
- * @param boolean $pValue Show summary below (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowSummaryBelow($pValue = true) {
- $this->_showSummaryBelow = $pValue;
- return $this;
- }
-
- /**
- * Show summary right? (Row/Column outlining)
- *
- * @return boolean
- */
- public function getShowSummaryRight() {
- return $this->_showSummaryRight;
- }
-
- /**
- * Set show summary right
- *
- * @param boolean $pValue Show summary right (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowSummaryRight($pValue = true) {
- $this->_showSummaryRight = $pValue;
- return $this;
- }
-
- /**
- * Get comments
- *
- * @return PHPExcel_Comment[]
- */
- public function getComments()
- {
- return $this->_comments;
- }
-
- /**
- * Set comments array for the entire sheet.
- *
- * @param array of PHPExcel_Comment
- * @return PHPExcel_Worksheet
- */
- public function setComments($pValue = array())
- {
- $this->_comments = $pValue;
-
- return $this;
- }
-
- /**
- * Get comment for cell
- *
- * @param string $pCellCoordinate Cell coordinate to get comment for
- * @return PHPExcel_Comment
- * @throws Exception
- */
- public function getComment($pCellCoordinate = 'A1')
- {
- // Uppercase coordinate
- $pCellCoordinate = strtoupper($pCellCoordinate);
-
- if (strpos($pCellCoordinate,':') !== false || strpos($pCellCoordinate,',') !== false) {
- throw new Exception('Cell coordinate string can not be a range of cells.');
- } else if (strpos($pCellCoordinate,'$') !== false) {
- throw new Exception('Cell coordinate string must not be absolute.');
- } else if ($pCellCoordinate == '') {
- throw new Exception('Cell coordinate can not be zero-length string.');
- } else {
- // Check if we already have a comment for this cell.
- // If not, create a new comment.
- if (isset($this->_comments[$pCellCoordinate])) {
- return $this->_comments[$pCellCoordinate];
- } else {
- $newComment = new PHPExcel_Comment();
- $this->_comments[$pCellCoordinate] = $newComment;
- return $newComment;
- }
- }
- }
-
- /**
- * Get comment for cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @return PHPExcel_Comment
- */
- public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get selected cell
- *
- * @deprecated
- * @return string
- */
- public function getSelectedCell()
- {
- return $this->getSelectedCells();
- }
-
- /**
- * Get active cell
- *
- * @return string Example: 'A1'
- */
- public function getActiveCell()
- {
- return $this->_activeCell;
- }
-
- /**
- * Get selected cells
- *
- * @return string
- */
- public function getSelectedCells()
- {
- return $this->_selectedCells;
- }
-
- /**
- * Selected cell
- *
- * @param string $pCoordinate Cell (i.e. A1)
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCell($pCoordinate = 'A1')
- {
- return $this->setSelectedCells($pCoordinate);
- }
-
- /**
- * Select a range of cells.
- *
- * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCells($pCoordinate = 'A1')
- {
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- // Convert 'A' to 'A:A'
- $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate);
-
- // Convert '1' to '1:1'
- $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate);
-
- // Convert 'A:C' to 'A1:C1048576'
- $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate);
-
- // Convert '1:3' to 'A1:XFD3'
- $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);
-
- if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
- list($first, ) = PHPExcel_Cell::splitRange($pCoordinate);
- $this->_activeCell = $first[0];
- } else {
- $this->_activeCell = $pCoordinate;
- }
- $this->_selectedCells = $pCoordinate;
- return $this;
- }
-
- /**
- * Selected cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get right-to-left
- *
- * @return boolean
- */
- public function getRightToLeft() {
- return $this->_rightToLeft;
- }
-
- /**
- * Set right-to-left
- *
- * @param boolean $value Right-to-left true/false
- * @return PHPExcel_Worksheet
- */
- public function setRightToLeft($value = false) {
- $this->_rightToLeft = $value;
- return $this;
- }
-
- /**
- * Fill worksheet from values in array
- *
- * @param array $source Source array
- * @param mixed $nullValue Value in source array that stands for blank cell
- * @param string $startCell Insert array starting from this cell address as the top left coordinate
- * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array
- * @throws Exception
- * @return PHPExcel_Worksheet
- */
- public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) {
- if (is_array($source)) {
- // Convert a 1-D array to 2-D (for ease of looping)
- if (!is_array(end($source))) {
- $source = array($source);
- }
-
- // start coordinate
- list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell);
-
- // Loop through $source
- foreach ($source as $rowData) {
- $currentColumn = $startColumn;
- foreach($rowData as $cellValue) {
- if ($strictNullComparison) {
- if ($cellValue !== $nullValue) {
- // Set cell value
- $this->getCell($currentColumn . $startRow)->setValue($cellValue);
- }
- } else {
- if ($cellValue != $nullValue) {
- // Set cell value
- $this->getCell($currentColumn . $startRow)->setValue($cellValue);
- }
- }
- ++$currentColumn;
- }
- ++$startRow;
- }
- } else {
- throw new Exception("Parameter \$source should be an array.");
- }
- return $this;
- }
-
- /**
- * Create array from a range of cells
- *
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- */
- public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
- // Returnvalue
- $returnValue = array();
-
- // Identify the range that we need to extract from the worksheet
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange);
- $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1);
- $minRow = $rangeStart[1];
- $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1);
- $maxRow = $rangeEnd[1];
-
- $maxCol++;
-
- // Loop through rows
- $r = -1;
- for ($row = $minRow; $row <= $maxRow; ++$row) {
- $rRef = ($returnCellRef) ? $row : ++$r;
- $c = -1;
- // Loop through columns in the current row
- for ($col = $minCol; $col != $maxCol; ++$col) {
- $cRef = ($returnCellRef) ? $col : ++$c;
- // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen
- // so we test and retrieve directly against _cellCollection
- if ($this->_cellCollection->isDataSet($col.$row)) {
- // Cell exists
- $cell = $this->_cellCollection->getCacheData($col.$row);
- if ($cell->getValue() !== null) {
- if ($cell->getValue() instanceof PHPExcel_RichText) {
- $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText();
- } else {
- if ($calculateFormulas) {
- $returnValue[$rRef][$cRef] = $cell->getCalculatedValue();
- } else {
- $returnValue[$rRef][$cRef] = $cell->getValue();
- }
- }
-
- if ($formatData) {
- $style = $this->_parent->getCellXfByIndex($cell->getXfIndex());
- $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString($returnValue[$rRef][$cRef], $style->getNumberFormat()->getFormatCode());
- }
- } else {
- // Cell holds a NULL
- $returnValue[$rRef][$cRef] = $nullValue;
- }
- } else {
- // Cell doesn't exist
- $returnValue[$rRef][$cRef] = $nullValue;
- }
- }
- }
-
- // Return
- return $returnValue;
- }
-
-
- /**
- * Create array from a range of cells
- *
- * @param string $pNamedRange Name of the Named Range
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- * @throws Exception
- */
- public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
- $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this);
- if ($namedRange !== NULL) {
- $pWorkSheet = $namedRange->getWorksheet();
- $pCellRange = $namedRange->getRange();
-
- return $pWorkSheet->rangeToArray( $pCellRange,
- $nullValue, $calculateFormulas, $formatData, $returnCellRef);
- }
-
- throw new Exception('Named Range '.$pNamedRange.' does not exist.');
- }
-
-
- /**
- * Create array from worksheet
- *
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- */
- public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
- // Garbage collect...
- $this->garbageCollect();
-
- // Identify the range that we need to extract from the worksheet
- $maxCol = $this->getHighestColumn();
- $maxRow = $this->getHighestRow();
- // Return
- return $this->rangeToArray( 'A1:'.$maxCol.$maxRow,
- $nullValue, $calculateFormulas, $formatData, $returnCellRef);
- }
-
- /**
- * Get row iterator
- *
- * @param integer $startRow The row number at which to start iterating
- * @return PHPExcel_Worksheet_RowIterator
- */
- public function getRowIterator($startRow = 1) {
- return new PHPExcel_Worksheet_RowIterator($this,$startRow);
- }
-
- /**
- * Run PHPExcel garabage collector.
- *
- * @return PHPExcel_Worksheet
- */
- public function garbageCollect() {
- // Build a reference table from images
-// $imageCoordinates = array();
-// $iterator = $this->getDrawingCollection()->getIterator();
-// while ($iterator->valid()) {
-// $imageCoordinates[$iterator->current()->getCoordinates()] = true;
-//
-// $iterator->next();
-// }
-//
- // Lookup highest column and highest row if cells are cleaned
- $colRow = $this->_cellCollection->getHighestRowAndColumn();
- $highestRow = $colRow['row'];
- $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']);
-
- // Loop through column dimensions
- foreach ($this->_columnDimensions as $dimension) {
- $highestColumn = max($highestColumn,PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex()));
- }
-
- // Loop through row dimensions
- foreach ($this->_rowDimensions as $dimension) {
- $highestRow = max($highestRow,$dimension->getRowIndex());
- }
-
- // Cache values
- if ($highestColumn < 0) {
- $this->_cachedHighestColumn = 'A';
- } else {
- $this->_cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn);
- }
- $this->_cachedHighestRow = $highestRow;
-
- // Return
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- if ($this->_dirty) {
- $this->_hash = md5( $this->_title .
- $this->_autoFilter .
- ($this->_protection->isProtectionEnabled() ? 't' : 'f') .
- __CLASS__
- );
- $this->_dirty = false;
- }
- return $this->_hash;
- }
-
- /**
- * Extract worksheet title from range.
- *
- * Example: extractSheetTitle("testSheet!A1") ==> 'A1'
- * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1');
- *
- * @param string $pRange Range to extract title from
- * @param bool $returnRange Return range? (see example)
- * @return mixed
- */
- public static function extractSheetTitle($pRange, $returnRange = false) {
- // Sheet title included?
- if (($sep = strpos($pRange, '!')) === false) {
- return '';
- }
-
- if ($returnRange) {
- return array( trim(substr($pRange, 0, $sep),"'"),
- substr($pRange, $sep + 1)
- );
- }
-
- return substr($pRange, $sep + 1);
- }
-
- /**
- * Get hyperlink
- *
- * @param string $pCellCoordinate Cell coordinate to get hyperlink for
- */
- public function getHyperlink($pCellCoordinate = 'A1')
- {
- // return hyperlink if we already have one
- if (isset($this->_hyperlinkCollection[$pCellCoordinate])) {
- return $this->_hyperlinkCollection[$pCellCoordinate];
- }
-
- // else create hyperlink
- $this->_hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink();
- return $this->_hyperlinkCollection[$pCellCoordinate];
- }
-
- /**
- * Set hyperlnk
- *
- * @param string $pCellCoordinate Cell coordinate to insert hyperlink
- * @param PHPExcel_Cell_Hyperlink $pHyperlink
- * @return PHPExcel_Worksheet
- */
- public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null)
- {
- if ($pHyperlink === null) {
- unset($this->_hyperlinkCollection[$pCellCoordinate]);
- } else {
- $this->_hyperlinkCollection[$pCellCoordinate] = $pHyperlink;
- }
- return $this;
- }
-
- /**
- * Hyperlink at a specific coordinate exists?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function hyperlinkExists($pCoordinate = 'A1')
- {
- return isset($this->_hyperlinkCollection[$pCoordinate]);
- }
-
- /**
- * Get collection of hyperlinks
- *
- * @return PHPExcel_Cell_Hyperlink[]
- */
- public function getHyperlinkCollection()
- {
- return $this->_hyperlinkCollection;
- }
-
- /**
- * Get data validation
- *
- * @param string $pCellCoordinate Cell coordinate to get data validation for
- */
- public function getDataValidation($pCellCoordinate = 'A1')
- {
- // return data validation if we already have one
- if (isset($this->_dataValidationCollection[$pCellCoordinate])) {
- return $this->_dataValidationCollection[$pCellCoordinate];
- }
-
- // else create data validation
- $this->_dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation();
- return $this->_dataValidationCollection[$pCellCoordinate];
- }
-
- /**
- * Set data validation
- *
- * @param string $pCellCoordinate Cell coordinate to insert data validation
- * @param PHPExcel_Cell_DataValidation $pDataValidation
- * @return PHPExcel_Worksheet
- */
- public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null)
- {
- if ($pDataValidation === null) {
- unset($this->_dataValidationCollection[$pCellCoordinate]);
- } else {
- $this->_dataValidationCollection[$pCellCoordinate] = $pDataValidation;
- }
- return $this;
- }
-
- /**
- * Data validation at a specific coordinate exists?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function dataValidationExists($pCoordinate = 'A1')
- {
- return isset($this->_dataValidationCollection[$pCoordinate]);
- }
-
- /**
- * Get collection of data validations
- *
- * @return PHPExcel_Cell_DataValidation[]
- */
- public function getDataValidationCollection()
- {
- return $this->_dataValidationCollection;
- }
-
- /**
- * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet
- *
- * @param string $range
- * @return string Adjusted range value
- */
- public function shrinkRangeToFit($range) {
- $maxCol = $this->getHighestColumn();
- $maxRow = $this->getHighestRow();
- $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol);
-
- $rangeBlocks = explode(' ',$range);
- foreach ($rangeBlocks as &$rangeSet) {
- $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet);
-
- if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); }
- if ($rangeBoundaries[0][1] > $maxRow) { $rangeBoundaries[0][1] = $maxRow; }
- if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); }
- if ($rangeBoundaries[1][1] > $maxRow) { $rangeBoundaries[1][1] = $maxRow; }
- $rangeSet = $rangeBoundaries[0][0].$rangeBoundaries[0][1].':'.$rangeBoundaries[1][0].$rangeBoundaries[1][1];
- }
- unset($rangeSet);
- $stRange = implode(' ',$rangeBlocks);
-
- return $stRange;
- }
-
-
- /**
- * Get tab color
- *
- * @return PHPExcel_Style_Color
- */
- public function getTabColor()
- {
- if ($this->_tabColor === NULL)
- $this->_tabColor = new PHPExcel_Style_Color();
-
- return $this->_tabColor;
- }
-
- /**
- * Reset tab color
- *
- * @return PHPExcel_Worksheet
- */
- public function resetTabColor()
- {
- $this->_tabColor = null;
- unset($this->_tabColor);
-
- return $this;
- }
-
- /**
- * Tab color set?
- *
- * @return boolean
- */
- public function isTabColorSet()
- {
- return ($this->_tabColor !== NULL);
- }
-
- /**
- * Copy worksheet (!= clone!)
- *
- * @return PHPExcel_Worksheet
- */
- public function copy() {
- $copied = clone $this;
-
- return $copied;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- foreach ($this as $key => $val) {
- if ($key == '_parent') {
- continue;
- }
-
- if (is_object($val) || (is_array($val))) {
- if ($key == '_cellCollection') {
- $newCollection = clone $this->_cellCollection;
- $newCollection->copyCellCollection($this);
- $this->_cellCollection = $newCollection;
- } elseif ($key == '_drawingCollection') {
- $newCollection = clone $this->_drawingCollection;
- $this->_drawingCollection = $newCollection;
- } elseif (($key == '_autoFilter') && (is_a($this->_autoFilter,'PHPExcel_Worksheet_AutoFilter'))) {
- $newAutoFilter = clone $this->_autoFilter;
- $this->_autoFilter = $newAutoFilter;
- $this->_autoFilter->setParent($this);
- } else {
- $this->{$key} = unserialize(serialize($val));
- }
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter.php b/admin/survey/excel/PHPExcel/Worksheet/AutoFilter.php
deleted file mode 100644
index 509aeed..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter.php
+++ /dev/null
@@ -1,855 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_AutoFilter
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_AutoFilter
-{
- /**
- * Autofilter Worksheet
- *
- * @var PHPExcel_Worksheet
- */
- private $_workSheet = NULL;
-
-
- /**
- * Autofilter Range
- *
- * @var string
- */
- private $_range = '';
-
-
- /**
- * Autofilter Column Ruleset
- *
- * @var array of PHPExcel_Worksheet_AutoFilter_Column
- */
- private $_columns = array();
-
-
- /**
- * Create a new PHPExcel_Worksheet_AutoFilter
- */
- public function __construct($pRange = '', PHPExcel_Worksheet $pSheet = NULL)
- {
- $this->_range = $pRange;
- $this->_workSheet = $pSheet;
- }
-
- /**
- * Get AutoFilter Parent Worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function getParent() {
- return $this->_workSheet;
- }
-
- /**
- * Set AutoFilter Parent Worksheet
- *
- * @param PHPExcel_Worksheet
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setParent(PHPExcel_Worksheet $pSheet = NULL) {
- $this->_workSheet = $pSheet;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Range
- *
- * @return string
- */
- public function getRange() {
- return $this->_range;
- }
-
- /**
- * Set AutoFilter Range
- *
- * @param string $pRange Cell range (i.e. A1:E10)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setRange($pRange = '') {
- // Uppercase coordinate
- $cellAddress = explode('!',strtoupper($pRange));
- if (count($cellAddress) > 1) {
- list($worksheet,$pRange) = $cellAddress;
- }
-
- if (strpos($pRange,':') !== FALSE) {
- $this->_range = $pRange;
- } elseif(empty($pRange)) {
- $this->_range = '';
- } else {
- throw new PHPExcel_Exception('Autofilter must be set on a range of cells.');
- }
-
- if (empty($pRange)) {
- // Discard all column rules
- $this->_columns = array();
- } else {
- // Discard any column rules that are no longer valid within this range
- list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
- foreach($this->_columns as $key => $value) {
- $colIndex = PHPExcel_Cell::columnIndexFromString($key);
- if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
- unset($this->_columns[$key]);
- }
- }
- }
-
- return $this;
- }
-
- /**
- * Get all AutoFilter Columns
- *
- * @throws PHPExcel_Exception
- * @return array of PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumns() {
- return $this->_columns;
- }
-
- /**
- * Validate that the specified column is in the AutoFilter range
- *
- * @param string $column Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return integer The column offset within the autofilter range
- */
- public function testColumnInRange($column) {
- if (empty($this->_range)) {
- throw new PHPExcel_Exception("No autofilter range is defined.");
- }
-
- $columnIndex = PHPExcel_Cell::columnIndexFromString($column);
- list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
- if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
- throw new PHPExcel_Exception("Column is outside of current autofilter range.");
- }
-
- return $columnIndex - $rangeStart[0];
- }
-
- /**
- * Get a specified AutoFilter Column Offset within the defined AutoFilter range
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return integer The offset of the specified column within the autofilter range
- */
- public function getColumnOffset($pColumn) {
- return $this->testColumnInRange($pColumn);
- }
-
- /**
- * Get a specified AutoFilter Column
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumn($pColumn) {
- $this->testColumnInRange($pColumn);
-
- if (!isset($this->_columns[$pColumn])) {
- $this->_columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
- }
-
- return $this->_columns[$pColumn];
- }
-
- /**
- * Get a specified AutoFilter Column by it's offset
- *
- * @param integer $pColumnOffset Column offset within range (starting from 0)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumnByOffset($pColumnOffset = 0) {
- list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
- $pColumn = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
-
- return $this->getColumn($pColumn);
- }
-
- /**
- * Set AutoFilter
- *
- * @param PHPExcel_Worksheet_AutoFilter_Column|string $pColumn
- * A simple string containing a Column ID like 'A' is permitted
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setColumn($pColumn)
- {
- if ((is_string($pColumn)) && (!empty($pColumn))) {
- $column = $pColumn;
- } elseif(is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
- $column = $pColumn->getColumnIndex();
- } else {
- throw new PHPExcel_Exception("Column is not within the autofilter range.");
- }
- $this->testColumnInRange($column);
-
- if (is_string($pColumn)) {
- $this->_columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
- } elseif(is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
- $pColumn->setParent($this);
- $this->_columns[$column] = $pColumn;
- }
- ksort($this->_columns);
-
- return $this;
- }
-
- /**
- * Clear a specified AutoFilter Column
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function clearColumn($pColumn) {
- $this->testColumnInRange($pColumn);
-
- if (isset($this->_columns[$pColumn])) {
- unset($this->_columns[$pColumn]);
- }
-
- return $this;
- }
-
- /**
- * Shift an AutoFilter Column Rule to a different column
- *
- * Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
- * Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value.
- * Use with caution.
- *
- * @param string $fromColumn Column name (e.g. A)
- * @param string $toColumn Column name (e.g. B)
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function shiftColumn($fromColumn=NULL,$toColumn=NULL) {
- $fromColumn = strtoupper($fromColumn);
- $toColumn = strtoupper($toColumn);
-
- if (($fromColumn !== NULL) && (isset($this->_columns[$fromColumn])) && ($toColumn !== NULL)) {
- $this->_columns[$fromColumn]->setParent();
- $this->_columns[$fromColumn]->setColumnIndex($toColumn);
- $this->_columns[$toColumn] = $this->_columns[$fromColumn];
- $this->_columns[$toColumn]->setParent($this);
- unset($this->_columns[$fromColumn]);
-
- ksort($this->_columns);
- }
-
- return $this;
- }
-
-
- /**
- * Test if cell value is in the defined set of values
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function _filterTestInSimpleDataSet($cellValue,$dataSet)
- {
- $dataSetValues = $dataSet['filterValues'];
- $blanks = $dataSet['blanks'];
- if (($cellValue == '') || ($cellValue === NULL)) {
- return $blanks;
- }
- return in_array($cellValue,$dataSetValues);
- }
-
- /**
- * Test if cell value is in the defined set of Excel date values
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function _filterTestInDateGroupSet($cellValue,$dataSet)
- {
- $dateSet = $dataSet['filterValues'];
- $blanks = $dataSet['blanks'];
- if (($cellValue == '') || ($cellValue === NULL)) {
- return $blanks;
- }
-
- if (is_numeric($cellValue)) {
- $dateValue = PHPExcel_Shared_Date::ExcelToPHP($cellValue);
- if ($cellValue < 1) {
- // Just the time part
- $dtVal = date('His',$dateValue);
- $dateSet = $dateSet['time'];
- } elseif($cellValue == floor($cellValue)) {
- // Just the date part
- $dtVal = date('Ymd',$dateValue);
- $dateSet = $dateSet['date'];
- } else {
- // date and time parts
- $dtVal = date('YmdHis',$dateValue);
- $dateSet = $dateSet['dateTime'];
- }
- foreach($dateSet as $dateValue) {
- // Use of substr to extract value at the appropriate group level
- if (substr($dtVal,0,strlen($dateValue)) == $dateValue)
- return TRUE;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Test if cell value is within a set of values defined by a ruleset
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function _filterTestInCustomDataSet($cellValue,$ruleSet)
- {
- $dataSet = $ruleSet['filterRules'];
- $join = $ruleSet['join'];
- $customRuleForBlanks = isset($ruleSet['customRuleForBlanks']) ? $ruleSet['customRuleForBlanks'] : FALSE;
-
- if (!$customRuleForBlanks) {
- // Blank cells are always ignored, so return a FALSE
- if (($cellValue == '') || ($cellValue === NULL)) {
- return FALSE;
- }
- }
- $returnVal = ($join == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
- foreach($dataSet as $rule) {
- if (is_numeric($rule['value'])) {
- // Numeric values are tested using the appropriate operator
- switch ($rule['operator']) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL :
- $retVal = ($cellValue == $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL :
- $retVal = ($cellValue != $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN :
- $retVal = ($cellValue > $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL :
- $retVal = ($cellValue >= $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN :
- $retVal = ($cellValue < $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL :
- $retVal = ($cellValue <= $rule['value']);
- break;
- }
- } elseif($rule['value'] == '') {
- switch ($rule['operator']) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL :
- $retVal = (($cellValue == '') || ($cellValue === NULL));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL :
- $retVal = (($cellValue != '') && ($cellValue !== NULL));
- break;
- default :
- $retVal = TRUE;
- break;
- }
- } else {
- // String values are always tested for equality, factoring in for wildcards (hence a regexp test)
- $retVal = preg_match('/^'.$rule['value'].'$/i',$cellValue);
- }
- // If there are multiple conditions, then we need to test both using the appropriate join operator
- switch ($join) {
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR :
- $returnVal = $returnVal || $retVal;
- // Break as soon as we have a TRUE match for OR joins,
- // to avoid unnecessary additional code execution
- if ($returnVal)
- return $returnVal;
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND :
- $returnVal = $returnVal && $retVal;
- break;
- }
- }
-
- return $returnVal;
- }
-
- /**
- * Test if cell date value is matches a set of values defined by a set of months
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function _filterTestInPeriodDateSet($cellValue,$monthSet)
- {
- // Blank cells are always ignored, so return a FALSE
- if (($cellValue == '') || ($cellValue === NULL)) {
- return FALSE;
- }
-
- if (is_numeric($cellValue)) {
- $dateValue = date('m',PHPExcel_Shared_Date::ExcelToPHP($cellValue));
- if (in_array($dateValue,$monthSet)) {
- return TRUE;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching
- *
- * @var array
- */
- private static $_fromReplace = array('\*', '\?', '~~', '~.*', '~.?');
- private static $_toReplace = array('.*', '.', '~', '\*', '\?');
-
-
- /**
- * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation
- *
- * @param string $dynamicRuleType
- * @param PHPExcel_Worksheet_AutoFilter_Column $filterColumn
- * @return mixed[]
- */
- private function _dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
- {
- $rDateType = PHPExcel_Calculation_Functions::getReturnDateType();
- PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
- $val = $maxVal = NULL;
-
- $ruleValues = array();
- $baseDate = PHPExcel_Calculation_DateTime::DATENOW();
- // Calculate start/end dates for the required date range based on current date
- switch ($dynamicRuleType) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK :
- $baseDate = strtotime('-7 days',$baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK :
- $baseDate = strtotime('-7 days',$baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH :
- $baseDate = strtotime('-1 month',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH :
- $baseDate = strtotime('+1 month',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER :
- $baseDate = strtotime('-3 month',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER :
- $baseDate = strtotime('+3 month',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR :
- $baseDate = strtotime('-1 year',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR :
- $baseDate = strtotime('+1 year',gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- }
-
- switch ($dynamicRuleType) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW :
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day',$baseDate));
- $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE :
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day',$baseDate));
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0,0,0,1,1,date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR :
- $maxVal = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0,0,0,31,12,date('Y',$baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0,0,0,1,1,date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER :
- $thisMonth = date('m',$baseDate);
- $thisQuarter = floor(--$thisMonth / 3);
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0,0,0,date('t',$baseDate),(1+$thisQuarter)*3,date('Y',$baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0,0,0,1,1+$thisQuarter*3,date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH :
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0,0,0,date('t',$baseDate),date('m',$baseDate),date('Y',$baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0,0,0,1,date('m',$baseDate),date('Y',$baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK :
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK :
- $dayOfWeek = date('w',$baseDate);
- $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate) - $dayOfWeek;
- $maxVal = $val + 7;
- break;
- }
-
- switch ($dynamicRuleType) {
- // Adjust Today dates for Yesterday and Tomorrow
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY :
- --$maxVal;
- --$val;
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW :
- ++$maxVal;
- ++$val;
- break;
- }
-
- // Set the filter column rule attributes ready for writing
- $filterColumn->setAttributes(array( 'val' => $val,
- 'maxVal' => $maxVal
- )
- );
-
- // Set the rules for identifying rows for hide/show
- $ruleValues[] = array( 'operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL,
- 'value' => $val
- );
- $ruleValues[] = array( 'operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN,
- 'value' => $maxVal
- );
- PHPExcel_Calculation_Functions::setReturnDateType($rDateType);
-
- return array(
- 'method' => '_filterTestInCustomDataSet',
- 'arguments' => array( 'filterRules' => $ruleValues,
- 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND
- )
- );
- }
-
- private function _calculateTopTenValue($columnID,$startRow,$endRow,$ruleType,$ruleValue) {
- $range = $columnID.$startRow.':'.$columnID.$endRow;
- $dataValues = PHPExcel_Calculation_Functions::flattenArray(
- $this->_workSheet->rangeToArray($range,NULL,TRUE,FALSE)
- );
-
- $dataValues = array_filter($dataValues);
- if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) {
- rsort($dataValues);
- } else {
- sort($dataValues);
- }
-
- return array_pop(array_slice($dataValues,0,$ruleValue));
- }
-
- /**
- * Apply the AutoFilter rules to the AutoFilter Range
- *
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function showHideRows()
- {
- list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
-
- // The heading row should always be visible
-// echo 'AutoFilter Heading Row ',$rangeStart[1],' is always SHOWN',PHP_EOL;
- $this->_workSheet->getRowDimension($rangeStart[1])->setVisible(TRUE);
-
- $columnFilterTests = array();
- foreach($this->_columns as $columnID => $filterColumn) {
- $rules = $filterColumn->getRules();
- switch ($filterColumn->getFilterType()) {
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER :
- $ruleValues = array();
- // Build a list of the filter value selections
- foreach($rules as $rule) {
- $ruleType = $rule->getRuleType();
- $ruleValues[] = $rule->getValue();
- }
- // Test if we want to include blanks in our filter criteria
- $blanks = FALSE;
- $ruleDataSet = array_filter($ruleValues);
- if (count($ruleValues) != count($ruleDataSet))
- $blanks = TRUE;
- if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER) {
- // Filter on absolute values
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInSimpleDataSet',
- 'arguments' => array( 'filterValues' => $ruleDataSet,
- 'blanks' => $blanks
- )
- );
- } else {
- // Filter on date group values
- $arguments = array();
- foreach($ruleDataSet as $ruleValue) {
- $date = $time = '';
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== ''))
- $date .= sprintf('%04d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]);
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != ''))
- $date .= sprintf('%02d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]);
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== ''))
- $date .= sprintf('%02d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]);
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== ''))
- $time .= sprintf('%02d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]);
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== ''))
- $time .= sprintf('%02d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]);
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== ''))
- $time .= sprintf('%02d',$ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]);
- $dateTime = $date . $time;
- $arguments['date'][] = $date;
- $arguments['time'][] = $time;
- $arguments['dateTime'][] = $dateTime;
- }
- // Remove empty elements
- $arguments['date'] = array_filter($arguments['date']);
- $arguments['time'] = array_filter($arguments['time']);
- $arguments['dateTime'] = array_filter($arguments['dateTime']);
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInDateGroupSet',
- 'arguments' => array( 'filterValues' => $arguments,
- 'blanks' => $blanks
- )
- );
- }
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER :
- $customRuleForBlanks = FALSE;
- $ruleValues = array();
- // Build a list of the filter value selections
- foreach($rules as $rule) {
- $ruleType = $rule->getRuleType();
- $ruleValue = $rule->getValue();
- if (!is_numeric($ruleValue)) {
- // Convert to a regexp allowing for regexp reserved characters, wildcards and escaped wildcards
- $ruleValue = preg_quote($ruleValue);
- $ruleValue = str_replace(self::$_fromReplace,self::$_toReplace,$ruleValue);
- if (trim($ruleValue) == '') {
- $customRuleForBlanks = TRUE;
- $ruleValue = trim($ruleValue);
- }
- }
- $ruleValues[] = array( 'operator' => $rule->getOperator(),
- 'value' => $ruleValue
- );
- }
- $join = $filterColumn->getJoin();
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInCustomDataSet',
- 'arguments' => array( 'filterRules' => $ruleValues,
- 'join' => $join,
- 'customRuleForBlanks' => $customRuleForBlanks
- )
- );
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER :
- $ruleValues = array();
- foreach($rules as $rule) {
- // We should only ever have one Dynamic Filter Rule anyway
- $dynamicRuleType = $rule->getGrouping();
- if (($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ||
- ($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
- // Number (Average) based
- // Calculate the average
- $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')';
- $average = PHPExcel_Calculation::getInstance()->calculateFormula($averageFormula,NULL,$this->_workSheet->getCell('A1'));
- // Set above/below rule based on greaterThan or LessTan
- $operator = ($dynamicRuleType === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
- $ruleValues[] = array( 'operator' => $operator,
- 'value' => $average
- );
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInCustomDataSet',
- 'arguments' => array( 'filterRules' => $ruleValues,
- 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR
- )
- );
- } else {
- // Date based
- if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') {
- // Month or Quarter
- list($periodType,$period) = sscanf($dynamicRuleType,'%[A-Z]%d');
- if ($periodType == 'M') {
- $ruleValues = array($period);
- } else {
- --$period;
- $periodEnd = (1+$period)*3;
- $periodStart = 1+$period*3;
- $ruleValues = range($periodStart,periodEnd);
- }
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInPeriodDateSet',
- 'arguments' => $ruleValues
- );
- $filterColumn->setAttributes(array());
- } else {
- // Date Range
- $columnFilterTests[$columnID] = $this->_dynamicFilterDateRange($dynamicRuleType, $filterColumn);
- break;
- }
- }
- }
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER :
- $ruleValues = array();
- $dataRowCount = $rangeEnd[1] - $rangeStart[1];
- foreach($rules as $rule) {
- // We should only ever have one Dynamic Filter Rule anyway
- $toptenRuleType = $rule->getGrouping();
- $ruleValue = $rule->getValue();
- $ruleOperator = $rule->getOperator();
- }
- if ($ruleOperator === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
- $ruleValue = floor($ruleValue * ($dataRowCount / 100));
- }
- if ($ruleValue < 1) $ruleValue = 1;
- if ($ruleValue > 500) $ruleValue = 500;
-
- $maxVal = $this->_calculateTopTenValue($columnID,$rangeStart[1]+1,$rangeEnd[1],$toptenRuleType,$ruleValue);
-
- $operator = ($toptenRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL;
- $ruleValues[] = array( 'operator' => $operator,
- 'value' => $maxVal
- );
- $columnFilterTests[$columnID] = array(
- 'method' => '_filterTestInCustomDataSet',
- 'arguments' => array( 'filterRules' => $ruleValues,
- 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR
- )
- );
- $filterColumn->setAttributes(
- array('maxVal' => $maxVal)
- );
- break;
- }
- }
-
-// echo 'Column Filter Test CRITERIA',PHP_EOL;
-// var_dump($columnFilterTests);
-//
- // Execute the column tests for each row in the autoFilter range to determine show/hide,
- for ($row = $rangeStart[1]+1; $row <= $rangeEnd[1]; ++$row) {
-// echo 'Testing Row = ',$row,PHP_EOL;
- $result = TRUE;
- foreach($columnFilterTests as $columnID => $columnFilterTest) {
-// echo 'Testing cell ',$columnID.$row,PHP_EOL;
- $cellValue = $this->_workSheet->getCell($columnID.$row)->getCalculatedValue();
-// echo 'Value is ',$cellValue,PHP_EOL;
- // Execute the filter test
- $result = $result &&
- call_user_func_array(
- array('PHPExcel_Worksheet_AutoFilter',$columnFilterTest['method']),
- array(
- $cellValue,
- $columnFilterTest['arguments']
- )
- );
-// echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL;
- // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests
- if (!$result)
- break;
- }
- // Set show/hide for the row based on the result of the autoFilter result
-// echo (($result) ? 'SHOW' : 'HIDE'),PHP_EOL;
- $this->_workSheet->getRowDimension($row)->setVisible($result);
- }
-
- return $this;
- }
-
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- if ($key == '_workSheet') {
- // Detach from worksheet
- $this->$key = NULL;
- } else {
- $this->$key = clone $value;
- }
- } elseif ((is_array($value)) && ($key == '_columns')) {
- // The columns array of PHPExcel_Worksheet_AutoFilter objects
- $this->$key = array();
- foreach ($value as $k => $v) {
- $this->$key[$k] = clone $v;
- // attach the new cloned Column to this new cloned Autofilter object
- $this->$key[$k]->setParent($this);
- }
- } else {
- $this->$key = $value;
- }
- }
- }
-
- /**
- * toString method replicates previous behavior by returning the range if object is
- * referenced as a property of its parent.
- */
- public function __toString() {
- return (string) $this->_range;
- }
-
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column.php b/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column.php
deleted file mode 100644
index d16fbe9..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column.php
+++ /dev/null
@@ -1,381 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_AutoFilter_Column
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_AutoFilter_Column
-{
- const AUTOFILTER_FILTERTYPE_FILTER = 'filters';
- const AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters';
- // Supports no more than 2 rules, with an And/Or join criteria
- // if more than 1 rule is defined
- const AUTOFILTER_FILTERTYPE_DYNAMICFILTER = 'dynamicFilter';
- // Even though the filter rule is constant, the filtered data can vary
- // e.g. filtered by date = TODAY
- const AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10';
-
- private static $_filterTypes = array(
- // Currently we're not handling
- // colorFilter
- // extLst
- // iconFilter
- self::AUTOFILTER_FILTERTYPE_FILTER,
- self::AUTOFILTER_FILTERTYPE_CUSTOMFILTER,
- self::AUTOFILTER_FILTERTYPE_DYNAMICFILTER,
- self::AUTOFILTER_FILTERTYPE_TOPTENFILTER,
- );
-
- /* Multiple Rule Connections */
- const AUTOFILTER_COLUMN_JOIN_AND = 'and';
- const AUTOFILTER_COLUMN_JOIN_OR = 'or';
-
- private static $_ruleJoins = array(
- self::AUTOFILTER_COLUMN_JOIN_AND,
- self::AUTOFILTER_COLUMN_JOIN_OR,
- );
-
- /**
- * Autofilter
- *
- * @var PHPExcel_Worksheet_AutoFilter
- */
- private $_parent = NULL;
-
-
- /**
- * Autofilter Column Index
- *
- * @var string
- */
- private $_columnIndex = '';
-
-
- /**
- * Autofilter Column Filter Type
- *
- * @var string
- */
- private $_filterType = self::AUTOFILTER_FILTERTYPE_FILTER;
-
-
- /**
- * Autofilter Multiple Rules And/Or
- *
- * @var string
- */
- private $_join = self::AUTOFILTER_COLUMN_JOIN_OR;
-
-
- /**
- * Autofilter Column Rules
- *
- * @var array of PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- private $_ruleset = array();
-
-
- /**
- * Autofilter Column Dynamic Attributes
- *
- * @var array of mixed
- */
- private $_attributes = array();
-
-
- /**
- * Create a new PHPExcel_Worksheet_AutoFilter_Column
- */
- public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = NULL)
- {
- $this->_columnIndex = $pColumn;
- $this->_parent = $pParent;
- }
-
- /**
- * Get AutoFilter Column Index
- *
- * @return string
- */
- public function getColumnIndex() {
- return $this->_columnIndex;
- }
-
- /**
- * Set AutoFilter Column Index
- *
- * @param string $pColumn Column (e.g. A)
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setColumnIndex($pColumn) {
- // Uppercase coordinate
- $pColumn = strtoupper($pColumn);
- if ($this->_parent !== NULL) {
- $this->_parent->testColumnInRange($pColumn);
- }
-
- $this->_columnIndex = $pColumn;
-
- return $this;
- }
-
- /**
- * Get this Column's AutoFilter Parent
- *
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function getParent() {
- return $this->_parent;
- }
-
- /**
- * Set this Column's AutoFilter Parent
- *
- * @param PHPExcel_Worksheet_AutoFilter
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = NULL) {
- $this->_parent = $pParent;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Type
- *
- * @return string
- */
- public function getFilterType() {
- return $this->_filterType;
- }
-
- /**
- * Set AutoFilter Type
- *
- * @param string $pFilterType
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) {
- if (!in_array($pFilterType,self::$_filterTypes)) {
- throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
- }
-
- $this->_filterType = $pFilterType;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Multiple Rules And/Or Join
- *
- * @return string
- */
- public function getJoin() {
- return $this->_join;
- }
-
- /**
- * Set AutoFilter Multiple Rules And/Or
- *
- * @param string $pJoin And/Or
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) {
- // Lowercase And/Or
- $pJoin = strtolower($pJoin);
- if (!in_array($pJoin,self::$_ruleJoins)) {
- throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.');
- }
-
- $this->_join = $pJoin;
-
- return $this;
- }
-
- /**
- * Set AutoFilter Attributes
- *
- * @param string[] $pAttributes
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setAttributes($pAttributes = array()) {
- $this->_attributes = $pAttributes;
-
- return $this;
- }
-
- /**
- * Set An AutoFilter Attribute
- *
- * @param string $pName Attribute Name
- * @param string $pValue Attribute Value
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setAttribute($pName, $pValue) {
- $this->_attributes[$pName] = $pValue;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Column Attributes
- *
- * @return string
- */
- public function getAttributes() {
- return $this->_attributes;
- }
-
- /**
- * Get specific AutoFilter Column Attribute
- *
- * @param string $pName Attribute Name
- * @return string
- */
- public function getAttribute($pName) {
- if (isset($this->_attributes[$pName]))
- return $this->_attributes[$pName];
- return NULL;
- }
-
- /**
- * Get all AutoFilter Column Rules
- *
- * @throws PHPExcel_Exception
- * @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function getRules() {
- return $this->_ruleset;
- }
-
- /**
- * Get a specified AutoFilter Column Rule
- *
- * @param integer $pIndex Rule index in the ruleset array
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function getRule($pIndex) {
- if (!isset($this->_ruleset[$pIndex])) {
- $this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
- }
- return $this->_ruleset[$pIndex];
- }
-
- /**
- * Create a new AutoFilter Column Rule in the ruleset
- *
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function createRule() {
- $this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
-
- return end($this->_ruleset);
- }
-
- /**
- * Add a new AutoFilter Column Rule to the ruleset
- *
- * @param PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule
- * @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned
- * @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule=TRUE) {
- $pRule->setParent($this);
- $this->_ruleset[] = $pRule;
-
- return ($returnRule) ? $pRule : $this;
- }
-
- /**
- * Delete a specified AutoFilter Column Rule
- * If the number of rules is reduced to 1, then we reset And/Or logic to Or
- *
- * @param integer $pIndex Rule index in the ruleset array
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function deleteRule($pIndex) {
- if (isset($this->_ruleset[$pIndex])) {
- unset($this->_ruleset[$pIndex]);
- // If we've just deleted down to a single rule, then reset And/Or joining to Or
- if (count($this->_ruleset) <= 1) {
- $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
- }
- }
-
- return $this;
- }
-
- /**
- * Delete all AutoFilter Column Rules
- *
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function clearRules() {
- $this->_ruleset = array();
- $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
-
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- if ($key == '_parent') {
- // Detach from autofilter parent
- $this->$key = NULL;
- } else {
- $this->$key = clone $value;
- }
- } elseif ((is_array($value)) && ($key == '_ruleset')) {
- // The columns array of PHPExcel_Worksheet_AutoFilter objects
- $this->$key = array();
- foreach ($value as $k => $v) {
- $this->$key[$k] = clone $v;
- // attach the new cloned Rule to this new cloned Autofilter Cloned object
- $this->$key[$k]->setParent($this);
- }
- } else {
- $this->$key = $value;
- }
- }
- }
-
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php b/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
deleted file mode 100644
index b779ede..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
+++ /dev/null
@@ -1,462 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_AutoFilter_Column_Rule
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_AutoFilter_Column_Rule
-{
- const AUTOFILTER_RULETYPE_FILTER = 'filter';
- const AUTOFILTER_RULETYPE_DATEGROUP = 'dateGroupItem';
- const AUTOFILTER_RULETYPE_CUSTOMFILTER = 'customFilter';
- const AUTOFILTER_RULETYPE_DYNAMICFILTER = 'dynamicFilter';
- const AUTOFILTER_RULETYPE_TOPTENFILTER = 'top10Filter';
-
- private static $_ruleTypes = array(
- // Currently we're not handling
- // colorFilter
- // extLst
- // iconFilter
- self::AUTOFILTER_RULETYPE_FILTER,
- self::AUTOFILTER_RULETYPE_DATEGROUP,
- self::AUTOFILTER_RULETYPE_CUSTOMFILTER,
- self::AUTOFILTER_RULETYPE_DYNAMICFILTER,
- self::AUTOFILTER_RULETYPE_TOPTENFILTER,
- );
-
- const AUTOFILTER_RULETYPE_DATEGROUP_YEAR = 'year';
- const AUTOFILTER_RULETYPE_DATEGROUP_MONTH = 'month';
- const AUTOFILTER_RULETYPE_DATEGROUP_DAY = 'day';
- const AUTOFILTER_RULETYPE_DATEGROUP_HOUR = 'hour';
- const AUTOFILTER_RULETYPE_DATEGROUP_MINUTE = 'minute';
- const AUTOFILTER_RULETYPE_DATEGROUP_SECOND = 'second';
-
- private static $_dateTimeGroups = array(
- self::AUTOFILTER_RULETYPE_DATEGROUP_YEAR,
- self::AUTOFILTER_RULETYPE_DATEGROUP_MONTH,
- self::AUTOFILTER_RULETYPE_DATEGROUP_DAY,
- self::AUTOFILTER_RULETYPE_DATEGROUP_HOUR,
- self::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE,
- self::AUTOFILTER_RULETYPE_DATEGROUP_SECOND,
- );
-
- const AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY = 'yesterday';
- const AUTOFILTER_RULETYPE_DYNAMIC_TODAY = 'today';
- const AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW = 'tomorrow';
- const AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE = 'yearToDate';
- const AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR = 'thisYear';
- const AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER = 'thisQuarter';
- const AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH = 'thisMonth';
- const AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK = 'thisWeek';
- const AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR = 'lastYear';
- const AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER = 'lastQuarter';
- const AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH = 'lastMonth';
- const AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK = 'lastWeek';
- const AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR = 'nextYear';
- const AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER = 'nextQuarter';
- const AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH = 'nextMonth';
- const AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK = 'nextWeek';
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1 = 'M1';
- const AUTOFILTER_RULETYPE_DYNAMIC_JANUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2 = 'M2';
- const AUTOFILTER_RULETYPE_DYNAMIC_FEBRUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3 = 'M3';
- const AUTOFILTER_RULETYPE_DYNAMIC_MARCH = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4 = 'M4';
- const AUTOFILTER_RULETYPE_DYNAMIC_APRIL = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5 = 'M5';
- const AUTOFILTER_RULETYPE_DYNAMIC_MAY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6 = 'M6';
- const AUTOFILTER_RULETYPE_DYNAMIC_JUNE = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7 = 'M7';
- const AUTOFILTER_RULETYPE_DYNAMIC_JULY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8 = 'M8';
- const AUTOFILTER_RULETYPE_DYNAMIC_AUGUST = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9 = 'M9';
- const AUTOFILTER_RULETYPE_DYNAMIC_SEPTEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10 = 'M10';
- const AUTOFILTER_RULETYPE_DYNAMIC_OCTOBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11 = 'M11';
- const AUTOFILTER_RULETYPE_DYNAMIC_NOVEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11;
- const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12 = 'M12';
- const AUTOFILTER_RULETYPE_DYNAMIC_DECEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12;
- const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1 = 'Q1';
- const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2 = 'Q2';
- const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3 = 'Q3';
- const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4 = 'Q4';
- const AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE = 'aboveAverage';
- const AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE = 'belowAverage';
-
- private static $_dynamicTypes = array(
- self::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY,
- self::AUTOFILTER_RULETYPE_DYNAMIC_TODAY,
- self::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW,
- self::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE,
- self::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR,
- self::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER,
- self::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH,
- self::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK,
- self::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR,
- self::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER,
- self::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH,
- self::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK,
- self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR,
- self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER,
- self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH,
- self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11,
- self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12,
- self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1,
- self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2,
- self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3,
- self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4,
- self::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE,
- self::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE,
- );
-
- /*
- * The only valid filter rule operators for filter and customFilter types are:
- * <xsd:enumeration value="equal"/>
- * <xsd:enumeration value="lessThan"/>
- * <xsd:enumeration value="lessThanOrEqual"/>
- * <xsd:enumeration value="notEqual"/>
- * <xsd:enumeration value="greaterThanOrEqual"/>
- * <xsd:enumeration value="greaterThan"/>
- */
- const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal';
- const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual';
- const AUTOFILTER_COLUMN_RULE_GREATERTHAN = 'greaterThan';
- const AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL = 'greaterThanOrEqual';
- const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan';
- const AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL = 'lessThanOrEqual';
-
- private static $_operators = array(
- self::AUTOFILTER_COLUMN_RULE_EQUAL,
- self::AUTOFILTER_COLUMN_RULE_NOTEQUAL,
- self::AUTOFILTER_COLUMN_RULE_GREATERTHAN,
- self::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL,
- self::AUTOFILTER_COLUMN_RULE_LESSTHAN,
- self::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL,
- );
-
- const AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE = 'byValue';
- const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent';
-
- private static $_topTenValue = array(
- self::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE,
- self::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT,
- );
-
- const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top';
- const AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM = 'bottom';
-
- private static $_topTenType = array(
- self::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP,
- self::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM,
- );
-
-
- /* Rule Operators (Numeric, Boolean etc) */
-// const AUTOFILTER_COLUMN_RULE_BETWEEN = 'between'; // greaterThanOrEqual 1 && lessThanOrEqual 2
- /* Rule Operators (Numeric Special) which are translated to standard numeric operators with calculated values */
-// const AUTOFILTER_COLUMN_RULE_TOPTEN = 'topTen'; // greaterThan calculated value
-// const AUTOFILTER_COLUMN_RULE_TOPTENPERCENT = 'topTenPercent'; // greaterThan calculated value
-// const AUTOFILTER_COLUMN_RULE_ABOVEAVERAGE = 'aboveAverage'; // Value is calculated as the average
-// const AUTOFILTER_COLUMN_RULE_BELOWAVERAGE = 'belowAverage'; // Value is calculated as the average
- /* Rule Operators (String) which are set as wild-carded values */
-// const AUTOFILTER_COLUMN_RULE_BEGINSWITH = 'beginsWith'; // A*
-// const AUTOFILTER_COLUMN_RULE_ENDSWITH = 'endsWith'; // *Z
-// const AUTOFILTER_COLUMN_RULE_CONTAINS = 'contains'; // *B*
-// const AUTOFILTER_COLUMN_RULE_DOESNTCONTAIN = 'notEqual'; // notEqual *B*
- /* Rule Operators (Date Special) which are translated to standard numeric operators with calculated values */
-// const AUTOFILTER_COLUMN_RULE_BEFORE = 'lessThan';
-// const AUTOFILTER_COLUMN_RULE_AFTER = 'greaterThan';
-// const AUTOFILTER_COLUMN_RULE_YESTERDAY = 'yesterday';
-// const AUTOFILTER_COLUMN_RULE_TODAY = 'today';
-// const AUTOFILTER_COLUMN_RULE_TOMORROW = 'tomorrow';
-// const AUTOFILTER_COLUMN_RULE_LASTWEEK = 'lastWeek';
-// const AUTOFILTER_COLUMN_RULE_THISWEEK = 'thisWeek';
-// const AUTOFILTER_COLUMN_RULE_NEXTWEEK = 'nextWeek';
-// const AUTOFILTER_COLUMN_RULE_LASTMONTH = 'lastMonth';
-// const AUTOFILTER_COLUMN_RULE_THISMONTH = 'thisMonth';
-// const AUTOFILTER_COLUMN_RULE_NEXTMONTH = 'nextMonth';
-// const AUTOFILTER_COLUMN_RULE_LASTQUARTER = 'lastQuarter';
-// const AUTOFILTER_COLUMN_RULE_THISQUARTER = 'thisQuarter';
-// const AUTOFILTER_COLUMN_RULE_NEXTQUARTER = 'nextQuarter';
-// const AUTOFILTER_COLUMN_RULE_LASTYEAR = 'lastYear';
-// const AUTOFILTER_COLUMN_RULE_THISYEAR = 'thisYear';
-// const AUTOFILTER_COLUMN_RULE_NEXTYEAR = 'nextYear';
-// const AUTOFILTER_COLUMN_RULE_YEARTODATE = 'yearToDate'; // <dynamicFilter val="40909" type="yearToDate" maxVal="41113"/>
-// const AUTOFILTER_COLUMN_RULE_ALLDATESINMONTH = 'allDatesInMonth'; // <dynamicFilter type="M2"/> for Month/February
-// const AUTOFILTER_COLUMN_RULE_ALLDATESINQUARTER = 'allDatesInQuarter'; // <dynamicFilter type="Q2"/> for Quarter 2
-
- /**
- * Autofilter Column
- *
- * @var PHPExcel_Worksheet_AutoFilter_Column
- */
- private $_parent = NULL;
-
-
- /**
- * Autofilter Rule Type
- *
- * @var string
- */
- private $_ruleType = self::AUTOFILTER_RULETYPE_FILTER;
-
-
- /**
- * Autofilter Rule Value
- *
- * @var string
- */
- private $_value = '';
-
- /**
- * Autofilter Rule Operator
- *
- * @var string
- */
- private $_operator = '';
-
- /**
- * DateTimeGrouping Group Value
- *
- * @var string
- */
- private $_grouping = '';
-
-
- /**
- * Create a new PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL)
- {
- $this->_parent = $pParent;
- }
-
- /**
- * Get AutoFilter Rule Type
- *
- * @return string
- */
- public function getRuleType() {
- return $this->_ruleType;
- }
-
- /**
- * Set AutoFilter Rule Type
- *
- * @param string $pRuleType
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) {
- if (!in_array($pRuleType,self::$_ruleTypes)) {
- throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
- }
-
- $this->_ruleType = $pRuleType;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Rule Value
- *
- * @return string
- */
- public function getValue() {
- return $this->_value;
- }
-
- /**
- * Set AutoFilter Rule Value
- *
- * @param string|string[] $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function setValue($pValue = '') {
- if (is_array($pValue)) {
- $grouping = -1;
- foreach($pValue as $key => $value) {
- // Validate array entries
- if (!in_array($key,self::$_dateTimeGroups)) {
- // Remove any invalid entries from the value array
- unset($pValue[$key]);
- } else {
- // Work out what the dateTime grouping will be
- $grouping = max($grouping,array_search($key,self::$_dateTimeGroups));
- }
- }
- if (count($pValue) == 0) {
- throw new PHPExcel_Exception('Invalid rule value for column AutoFilter Rule.');
- }
- // Set the dateTime grouping that we've anticipated
- $this->setGrouping(self::$_dateTimeGroups[$grouping]);
- }
- $this->_value = $pValue;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Rule Operator
- *
- * @return string
- */
- public function getOperator() {
- return $this->_operator;
- }
-
- /**
- * Set AutoFilter Rule Operator
- *
- * @param string $pOperator
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) {
- if (empty($pOperator))
- $pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
- if ((!in_array($pOperator,self::$_operators)) &&
- (!in_array($pOperator,self::$_topTenValue))) {
- throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
- }
- $this->_operator = $pOperator;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Rule Grouping
- *
- * @return string
- */
- public function getGrouping() {
- return $this->_grouping;
- }
-
- /**
- * Set AutoFilter Rule Grouping
- *
- * @param string $pGrouping
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function setGrouping($pGrouping = NULL) {
- if (($pGrouping !== NULL) &&
- (!in_array($pGrouping,self::$_dateTimeGroups)) &&
- (!in_array($pGrouping,self::$_dynamicTypes)) &&
- (!in_array($pGrouping,self::$_topTenType))) {
- throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
- }
-
- $this->_grouping = $pGrouping;
-
- return $this;
- }
-
- /**
- * Set AutoFilter Rule
- *
- * @param string $pOperator
- * @param string|string[] $pValue
- * @param string $pGrouping
- * @throws Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = NULL) {
- $this->setOperator($pOperator);
- $this->setValue($pValue);
- // Only set grouping if it's been passed in as a user-supplied argument,
- // otherwise we're calculating it when we setValue() and don't want to overwrite that
- // If the user supplies an argumnet for grouping, then on their own head be it
- if ($pGrouping !== NULL)
- $this->setGrouping($pGrouping);
-
- return $this;
- }
-
- /**
- * Get this Rule's AutoFilter Column Parent
- *
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getParent() {
- return $this->_parent;
- }
-
- /**
- * Set this Rule's AutoFilter Column Parent
- *
- * @param PHPExcel_Worksheet_AutoFilter_Column
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL) {
- $this->_parent = $pParent;
-
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- if ($key == '_parent') {
- // Detach from autofilter column parent
- $this->$key = NULL;
- } else {
- $this->$key = clone $value;
- }
- } else {
- $this->$key = $value;
- }
- }
- }
-
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/BaseDrawing.php b/admin/survey/excel/PHPExcel/Worksheet/BaseDrawing.php
deleted file mode 100644
index 8f3d9cb..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/BaseDrawing.php
+++ /dev/null
@@ -1,485 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_BaseDrawing
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
-{
- /**
- * Image counter
- *
- * @var int
- */
- private static $_imageCounter = 0;
-
- /**
- * Image index
- *
- * @var int
- */
- private $_imageIndex = 0;
-
- /**
- * Name
- *
- * @var string
- */
- protected $_name;
-
- /**
- * Description
- *
- * @var string
- */
- protected $_description;
-
- /**
- * Worksheet
- *
- * @var PHPExcel_Worksheet
- */
- protected $_worksheet;
-
- /**
- * Coordinates
- *
- * @var string
- */
- protected $_coordinates;
-
- /**
- * Offset X
- *
- * @var int
- */
- protected $_offsetX;
-
- /**
- * Offset Y
- *
- * @var int
- */
- protected $_offsetY;
-
- /**
- * Width
- *
- * @var int
- */
- protected $_width;
-
- /**
- * Height
- *
- * @var int
- */
- protected $_height;
-
- /**
- * Proportional resize
- *
- * @var boolean
- */
- protected $_resizeProportional;
-
- /**
- * Rotation
- *
- * @var int
- */
- protected $_rotation;
-
- /**
- * Shadow
- *
- * @var PHPExcel_Worksheet_Drawing_Shadow
- */
- protected $_shadow;
-
- /**
- * Create a new PHPExcel_Worksheet_BaseDrawing
- */
- public function __construct()
- {
- // Initialise values
- $this->_name = '';
- $this->_description = '';
- $this->_worksheet = null;
- $this->_coordinates = 'A1';
- $this->_offsetX = 0;
- $this->_offsetY = 0;
- $this->_width = 0;
- $this->_height = 0;
- $this->_resizeProportional = true;
- $this->_rotation = 0;
- $this->_shadow = new PHPExcel_Worksheet_Drawing_Shadow();
-
- // Set image index
- self::$_imageCounter++;
- $this->_imageIndex = self::$_imageCounter;
- }
-
- /**
- * Get image index
- *
- * @return int
- */
- public function getImageIndex() {
- return $this->_imageIndex;
- }
-
- /**
- * Get Name
- *
- * @return string
- */
- public function getName() {
- return $this->_name;
- }
-
- /**
- * Set Name
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setName($pValue = '') {
- $this->_name = $pValue;
- return $this;
- }
-
- /**
- * Get Description
- *
- * @return string
- */
- public function getDescription() {
- return $this->_description;
- }
-
- /**
- * Set Description
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setDescription($pValue = '') {
- $this->_description = $pValue;
- return $this;
- }
-
- /**
- * Get Worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function getWorksheet() {
- return $this->_worksheet;
- }
-
- /**
- * Set Worksheet
- *
- * @param PHPExcel_Worksheet $pValue
- * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
- * @throws Exception
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) {
- if (is_null($this->_worksheet)) {
- // Add drawing to PHPExcel_Worksheet
- $this->_worksheet = $pValue;
- $this->_worksheet->getCell($this->_coordinates);
- $this->_worksheet->getDrawingCollection()->append($this);
- } else {
- if ($pOverrideOld) {
- // Remove drawing from old PHPExcel_Worksheet
- $iterator = $this->_worksheet->getDrawingCollection()->getIterator();
-
- while ($iterator->valid()) {
- if ($iterator->current()->getHashCode() == $this->getHashCode()) {
- $this->_worksheet->getDrawingCollection()->offsetUnset( $iterator->key() );
- $this->_worksheet = null;
- break;
- }
- }
-
- // Set new PHPExcel_Worksheet
- $this->setWorksheet($pValue);
- } else {
- throw new Exception("A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet.");
- }
- }
- return $this;
- }
-
- /**
- * Get Coordinates
- *
- * @return string
- */
- public function getCoordinates() {
- return $this->_coordinates;
- }
-
- /**
- * Set Coordinates
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setCoordinates($pValue = 'A1') {
- $this->_coordinates = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetX
- *
- * @return int
- */
- public function getOffsetX() {
- return $this->_offsetX;
- }
-
- /**
- * Set OffsetX
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setOffsetX($pValue = 0) {
- $this->_offsetX = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetY
- *
- * @return int
- */
- public function getOffsetY() {
- return $this->_offsetY;
- }
-
- /**
- * Set OffsetY
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setOffsetY($pValue = 0) {
- $this->_offsetY = $pValue;
- return $this;
- }
-
- /**
- * Get Width
- *
- * @return int
- */
- public function getWidth() {
- return $this->_width;
- }
-
- /**
- * Set Width
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setWidth($pValue = 0) {
- // Resize proportional?
- if ($this->_resizeProportional && $pValue != 0) {
- $ratio = $this->_height / $this->_width;
- $this->_height = round($ratio * $pValue);
- }
-
- // Set width
- $this->_width = $pValue;
-
- return $this;
- }
-
- /**
- * Get Height
- *
- * @return int
- */
- public function getHeight() {
- return $this->_height;
- }
-
- /**
- * Set Height
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setHeight($pValue = 0) {
- // Resize proportional?
- if ($this->_resizeProportional && $pValue != 0) {
- $ratio = $this->_width / $this->_height;
- $this->_width = round($ratio * $pValue);
- }
-
- // Set height
- $this->_height = $pValue;
-
- return $this;
- }
-
- /**
- * Set width and height with proportional resize
- * Example:
- * <code>
- * $objDrawing->setResizeProportional(true);
- * $objDrawing->setWidthAndHeight(160,120);
- * </code>
- *
- * @author Vincent@luo MSN:kele_100@hotmail.com
- * @param int $width
- * @param int $height
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setWidthAndHeight($width = 0, $height = 0) {
- $xratio = $width / $this->_width;
- $yratio = $height / $this->_height;
- if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
- if (($xratio * $this->_height) < $height) {
- $this->_height = ceil($xratio * $this->_height);
- $this->_width = $width;
- } else {
- $this->_width = ceil($yratio * $this->_width);
- $this->_height = $height;
- }
- }
- return $this;
- }
-
- /**
- * Get ResizeProportional
- *
- * @return boolean
- */
- public function getResizeProportional() {
- return $this->_resizeProportional;
- }
-
- /**
- * Set ResizeProportional
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setResizeProportional($pValue = true) {
- $this->_resizeProportional = $pValue;
- return $this;
- }
-
- /**
- * Get Rotation
- *
- * @return int
- */
- public function getRotation() {
- return $this->_rotation;
- }
-
- /**
- * Set Rotation
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setRotation($pValue = 0) {
- $this->_rotation = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow
- *
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function getShadow() {
- return $this->_shadow;
- }
-
- /**
- * Set Shadow
- *
- * @param PHPExcel_Worksheet_Drawing_Shadow $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_BaseDrawing
- */
- public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) {
- $this->_shadow = $pValue;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- return md5(
- $this->_name
- . $this->_description
- . $this->_worksheet->getHashCode()
- . $this->_coordinates
- . $this->_offsetX
- . $this->_offsetY
- . $this->_width
- . $this->_height
- . $this->_rotation
- . $this->_shadow->getHashCode()
- . __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/CellIterator.php b/admin/survey/excel/PHPExcel/Worksheet/CellIterator.php
deleted file mode 100644
index 3f3f2d9..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/CellIterator.php
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_CellIterator
- *
- * Used to iterate rows in a PHPExcel_Worksheet
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_CellIterator implements Iterator
-{
- /**
- * PHPExcel_Worksheet to iterate
- *
- * @var PHPExcel_Worksheet
- */
- private $_subject;
-
- /**
- * Row index
- *
- * @var int
- */
- private $_rowIndex;
-
- /**
- * Current iterator position
- *
- * @var int
- */
- private $_position = 0;
-
- /**
- * Loop only existing cells
- *
- * @var boolean
- */
- private $_onlyExistingCells = true;
-
- /**
- * Create a new cell iterator
- *
- * @param PHPExcel_Worksheet $subject
- * @param int $rowIndex
- */
- public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1) {
- // Set subject and row index
- $this->_subject = $subject;
- $this->_rowIndex = $rowIndex;
- }
-
- /**
- * Destructor
- */
- public function __destruct() {
- unset($this->_subject);
- }
-
- /**
- * Rewind iterator
- */
- public function rewind() {
- $this->_position = 0;
- }
-
- /**
- * Current PHPExcel_Cell
- *
- * @return PHPExcel_Cell
- */
- public function current() {
- return $this->_subject->getCellByColumnAndRow($this->_position, $this->_rowIndex);
- }
-
- /**
- * Current key
- *
- * @return int
- */
- public function key() {
- return $this->_position;
- }
-
- /**
- * Next value
- */
- public function next() {
- ++$this->_position;
- }
-
- /**
- * Are there any more PHPExcel_Cell instances available?
- *
- * @return boolean
- */
- public function valid() {
- // columnIndexFromString() returns an index based at one,
- // treat it as a count when comparing it to the base zero
- // position.
- $columnCount = PHPExcel_Cell::columnIndexFromString($this->_subject->getHighestColumn());
-
- if ($this->_onlyExistingCells) {
- // If we aren't looking at an existing cell, either
- // because the first column doesn't exist or next() has
- // been called onto a nonexistent cell, then loop until we
- // find one, or pass the last column.
- while ($this->_position < $columnCount &&
- !$this->_subject->cellExistsByColumnAndRow($this->_position, $this->_rowIndex)) {
- ++$this->_position;
- }
- }
-
- return $this->_position < $columnCount;
- }
-
- /**
- * Get loop only existing cells
- *
- * @return boolean
- */
- public function getIterateOnlyExistingCells() {
- return $this->_onlyExistingCells;
- }
-
- /**
- * Set the iterator to loop only existing cells
- *
- * @param boolean $value
- */
- public function setIterateOnlyExistingCells($value = true) {
- $this->_onlyExistingCells = $value;
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/ColumnDimension.php b/admin/survey/excel/PHPExcel/Worksheet/ColumnDimension.php
deleted file mode 100644
index a95cd1f..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/ColumnDimension.php
+++ /dev/null
@@ -1,266 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_ColumnDimension
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_ColumnDimension
-{
- /**
- * Column index
- *
- * @var int
- */
- private $_columnIndex;
-
- /**
- * Column width
- *
- * When this is set to a negative value, the column width should be ignored by IWriter
- *
- * @var double
- */
- private $_width = -1;
-
- /**
- * Auto size?
- *
- * @var bool
- */
- private $_autoSize = false;
-
- /**
- * Visible?
- *
- * @var bool
- */
- private $_visible = true;
-
- /**
- * Outline level
- *
- * @var int
- */
- private $_outlineLevel = 0;
-
- /**
- * Collapsed
- *
- * @var bool
- */
- private $_collapsed = false;
-
- /**
- * Index to cellXf
- *
- * @var int
- */
- private $_xfIndex;
-
- /**
- * Create a new PHPExcel_Worksheet_ColumnDimension
- *
- * @param string $pIndex Character column index
- */
- public function __construct($pIndex = 'A')
- {
- // Initialise values
- $this->_columnIndex = $pIndex;
-
- // set default index to cellXf
- $this->_xfIndex = 0;
- }
-
- /**
- * Get ColumnIndex
- *
- * @return string
- */
- public function getColumnIndex() {
- return $this->_columnIndex;
- }
-
- /**
- * Set ColumnIndex
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setColumnIndex($pValue) {
- $this->_columnIndex = $pValue;
- return $this;
- }
-
- /**
- * Get Width
- *
- * @return double
- */
- public function getWidth() {
- return $this->_width;
- }
-
- /**
- * Set Width
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setWidth($pValue = -1) {
- $this->_width = $pValue;
- return $this;
- }
-
- /**
- * Get Auto Size
- *
- * @return bool
- */
- public function getAutoSize() {
- return $this->_autoSize;
- }
-
- /**
- * Set Auto Size
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setAutoSize($pValue = false) {
- $this->_autoSize = $pValue;
- return $this;
- }
-
- /**
- * Get Visible
- *
- * @return bool
- */
- public function getVisible() {
- return $this->_visible;
- }
-
- /**
- * Set Visible
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setVisible($pValue = true) {
- $this->_visible = $pValue;
- return $this;
- }
-
- /**
- * Get Outline Level
- *
- * @return int
- */
- public function getOutlineLevel() {
- return $this->_outlineLevel;
- }
-
- /**
- * Set Outline Level
- *
- * Value must be between 0 and 7
- *
- * @param int $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setOutlineLevel($pValue) {
- if ($pValue < 0 || $pValue > 7) {
- throw new Exception("Outline level must range between 0 and 7.");
- }
-
- $this->_outlineLevel = $pValue;
- return $this;
- }
-
- /**
- * Get Collapsed
- *
- * @return bool
- */
- public function getCollapsed() {
- return $this->_collapsed;
- }
-
- /**
- * Set Collapsed
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setCollapsed($pValue = true) {
- $this->_collapsed = $pValue;
- return $this;
- }
-
- /**
- * Get index to cellXf
- *
- * @return int
- */
- public function getXfIndex()
- {
- return $this->_xfIndex;
- }
-
- /**
- * Set index to cellXf
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setXfIndex($pValue = 0)
- {
- $this->_xfIndex = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/Drawing.php b/admin/survey/excel/PHPExcel/Worksheet/Drawing.php
deleted file mode 100644
index 0e1d62e..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/Drawing.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet_Drawing
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_Drawing
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet_Drawing
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
-{
- /**
- * Path
- *
- * @var string
- */
- private $_path;
-
- /**
- * Create a new PHPExcel_Worksheet_Drawing
- */
- public function __construct()
- {
- // Initialise values
- $this->_path = '';
-
- // Initialize parent
- parent::__construct();
- }
-
- /**
- * Get Filename
- *
- * @return string
- */
- public function getFilename() {
- return basename($this->_path);
- }
-
- /**
- * Get indexed filename (using image index)
- *
- * @return string
- */
- public function getIndexedFilename() {
- $fileName = $this->getFilename();
- $fileName = str_replace(' ', '_', $fileName);
- return str_replace('.' . $this->getExtension(), '', $fileName) . $this->getImageIndex() . '.' . $this->getExtension();
- }
-
- /**
- * Get Extension
- *
- * @return string
- */
- public function getExtension() {
- $exploded = explode(".", basename($this->_path));
- return $exploded[count($exploded) - 1];
- }
-
- /**
- * Get Path
- *
- * @return string
- */
- public function getPath() {
- return $this->_path;
- }
-
- /**
- * Set Path
- *
- * @param string $pValue File path
- * @param boolean $pVerifyFile Verify file
- * @throws Exception
- * @return PHPExcel_Worksheet_Drawing
- */
- public function setPath($pValue = '', $pVerifyFile = true) {
- if ($pVerifyFile) {
- if (file_exists($pValue)) {
- $this->_path = $pValue;
-
- if ($this->_width == 0 && $this->_height == 0) {
- // Get width/height
- list($this->_width, $this->_height) = getimagesize($pValue);
- }
- } else {
- throw new Exception("File $pValue not found!");
- }
- } else {
- $this->_path = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- return md5(
- $this->_path
- . parent::getHashCode()
- . __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/Drawing/Shadow.php b/admin/survey/excel/PHPExcel/Worksheet/Drawing/Shadow.php
deleted file mode 100644
index 50696d6..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/Drawing/Shadow.php
+++ /dev/null
@@ -1,288 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet_Drawing
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_Drawing_Shadow
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet_Drawing
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
-{
- /* Shadow alignment */
- const SHADOW_BOTTOM = 'b';
- const SHADOW_BOTTOM_LEFT = 'bl';
- const SHADOW_BOTTOM_RIGHT = 'br';
- const SHADOW_CENTER = 'ctr';
- const SHADOW_LEFT = 'l';
- const SHADOW_TOP = 't';
- const SHADOW_TOP_LEFT = 'tl';
- const SHADOW_TOP_RIGHT = 'tr';
-
- /**
- * Visible
- *
- * @var boolean
- */
- private $_visible;
-
- /**
- * Blur radius
- *
- * Defaults to 6
- *
- * @var int
- */
- private $_blurRadius;
-
- /**
- * Shadow distance
- *
- * Defaults to 2
- *
- * @var int
- */
- private $_distance;
-
- /**
- * Shadow direction (in degrees)
- *
- * @var int
- */
- private $_direction;
-
- /**
- * Shadow alignment
- *
- * @var int
- */
- private $_alignment;
-
- /**
- * Color
- *
- * @var PHPExcel_Style_Color
- */
- private $_color;
-
- /**
- * Alpha
- *
- * @var int
- */
- private $_alpha;
-
- /**
- * Create a new PHPExcel_Worksheet_Drawing_Shadow
- */
- public function __construct()
- {
- // Initialise values
- $this->_visible = false;
- $this->_blurRadius = 6;
- $this->_distance = 2;
- $this->_direction = 0;
- $this->_alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT;
- $this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
- $this->_alpha = 50;
- }
-
- /**
- * Get Visible
- *
- * @return boolean
- */
- public function getVisible() {
- return $this->_visible;
- }
-
- /**
- * Set Visible
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setVisible($pValue = false) {
- $this->_visible = $pValue;
- return $this;
- }
-
- /**
- * Get Blur radius
- *
- * @return int
- */
- public function getBlurRadius() {
- return $this->_blurRadius;
- }
-
- /**
- * Set Blur radius
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setBlurRadius($pValue = 6) {
- $this->_blurRadius = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow distance
- *
- * @return int
- */
- public function getDistance() {
- return $this->_distance;
- }
-
- /**
- * Set Shadow distance
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setDistance($pValue = 2) {
- $this->_distance = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow direction (in degrees)
- *
- * @return int
- */
- public function getDirection() {
- return $this->_direction;
- }
-
- /**
- * Set Shadow direction (in degrees)
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setDirection($pValue = 0) {
- $this->_direction = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow alignment
- *
- * @return int
- */
- public function getAlignment() {
- return $this->_alignment;
- }
-
- /**
- * Set Shadow alignment
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setAlignment($pValue = 0) {
- $this->_alignment = $pValue;
- return $this;
- }
-
- /**
- * Get Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getColor() {
- return $this->_color;
- }
-
- /**
- * Set Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setColor(PHPExcel_Style_Color $pValue = null) {
- $this->_color = $pValue;
- return $this;
- }
-
- /**
- * Get Alpha
- *
- * @return int
- */
- public function getAlpha() {
- return $this->_alpha;
- }
-
- /**
- * Set Alpha
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setAlpha($pValue = 0) {
- $this->_alpha = $pValue;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- return md5(
- ($this->_visible ? 't' : 'f')
- . $this->_blurRadius
- . $this->_distance
- . $this->_direction
- . $this->_alignment
- . $this->_color->getHashCode()
- . $this->_alpha
- . __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/HeaderFooter.php b/admin/survey/excel/PHPExcel/Worksheet/HeaderFooter.php
deleted file mode 100644
index ad1424b..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/HeaderFooter.php
+++ /dev/null
@@ -1,465 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_HeaderFooter
- *
- * <code>
- * Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:
- *
- * There are a number of formatting codes that can be written inline with the actual header / footer text, which
- * affect the formatting in the header or footer.
- *
- * Example: This example shows the text "Center Bold Header" on the first line (center section), and the date on
- * the second line (center section).
- * &CCenter &"-,Bold"Bold&"-,Regular"Header_x000A_&D
- *
- * General Rules:
- * There is no required order in which these codes must appear.
- *
- * The first occurrence of the following codes turns the formatting ON, the second occurrence turns it OFF again:
- * - strikethrough
- * - superscript
- * - subscript
- * Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored,
- * while the first is ON.
- * &L - code for "left section" (there are three header / footer locations, "left", "center", and "right"). When
- * two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the
- * order of appearance, and placed into the left section.
- * &P - code for "current page #"
- * &N - code for "total pages"
- * &font size - code for "text font size", where font size is a font size in points.
- * &K - code for "text font color"
- * RGB Color is specified as RRGGBB
- * Theme Color is specifed as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade
- * value, NN is the tint/shade value.
- * &S - code for "text strikethrough" on / off
- * &X - code for "text super script" on / off
- * &Y - code for "text subscript" on / off
- * &C - code for "center section". When two or more occurrences of this section marker exist, the contents
- * from all markers are concatenated, in the order of appearance, and placed into the center section.
- *
- * &D - code for "date"
- * &T - code for "time"
- * &G - code for "picture as background"
- * &U - code for "text single underline"
- * &E - code for "double underline"
- * &R - code for "right section". When two or more occurrences of this section marker exist, the contents
- * from all markers are concatenated, in the order of appearance, and placed into the right section.
- * &Z - code for "this workbook's file path"
- * &F - code for "this workbook's file name"
- * &A - code for "sheet tab name"
- * &+ - code for add to page #.
- * &- - code for subtract from page #.
- * &"font name,font type" - code for "text font name" and "text font type", where font name and font type
- * are strings specifying the name and type of the font, separated by a comma. When a hyphen appears in font
- * name, it means "none specified". Both of font name and font type can be localized values.
- * &"-,Bold" - code for "bold font style"
- * &B - also means "bold font style".
- * &"-,Regular" - code for "regular font style"
- * &"-,Italic" - code for "italic font style"
- * &I - also means "italic font style"
- * &"-,Bold Italic" code for "bold italic font style"
- * &O - code for "outline style"
- * &H - code for "shadow style"
- * </code>
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_HeaderFooter
-{
- /* Header/footer image location */
- const IMAGE_HEADER_LEFT = 'LH';
- const IMAGE_HEADER_CENTER = 'CH';
- const IMAGE_HEADER_RIGHT = 'RH';
- const IMAGE_FOOTER_LEFT = 'LF';
- const IMAGE_FOOTER_CENTER = 'CF';
- const IMAGE_FOOTER_RIGHT = 'RF';
-
- /**
- * OddHeader
- *
- * @var string
- */
- private $_oddHeader = '';
-
- /**
- * OddFooter
- *
- * @var string
- */
- private $_oddFooter = '';
-
- /**
- * EvenHeader
- *
- * @var string
- */
- private $_evenHeader = '';
-
- /**
- * EvenFooter
- *
- * @var string
- */
- private $_evenFooter = '';
-
- /**
- * FirstHeader
- *
- * @var string
- */
- private $_firstHeader = '';
-
- /**
- * FirstFooter
- *
- * @var string
- */
- private $_firstFooter = '';
-
- /**
- * Different header for Odd/Even, defaults to false
- *
- * @var boolean
- */
- private $_differentOddEven = false;
-
- /**
- * Different header for first page, defaults to false
- *
- * @var boolean
- */
- private $_differentFirst = false;
-
- /**
- * Scale with document, defaults to true
- *
- * @var boolean
- */
- private $_scaleWithDocument = true;
-
- /**
- * Align with margins, defaults to true
- *
- * @var boolean
- */
- private $_alignWithMargins = true;
-
- /**
- * Header/footer images
- *
- * @var PHPExcel_Worksheet_HeaderFooterDrawing[]
- */
- private $_headerFooterImages = array();
-
- /**
- * Create a new PHPExcel_Worksheet_HeaderFooter
- */
- public function __construct()
- {
- }
-
- /**
- * Get OddHeader
- *
- * @return string
- */
- public function getOddHeader() {
- return $this->_oddHeader;
- }
-
- /**
- * Set OddHeader
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setOddHeader($pValue) {
- $this->_oddHeader = $pValue;
- return $this;
- }
-
- /**
- * Get OddFooter
- *
- * @return string
- */
- public function getOddFooter() {
- return $this->_oddFooter;
- }
-
- /**
- * Set OddFooter
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setOddFooter($pValue) {
- $this->_oddFooter = $pValue;
- return $this;
- }
-
- /**
- * Get EvenHeader
- *
- * @return string
- */
- public function getEvenHeader() {
- return $this->_evenHeader;
- }
-
- /**
- * Set EvenHeader
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setEvenHeader($pValue) {
- $this->_evenHeader = $pValue;
- return $this;
- }
-
- /**
- * Get EvenFooter
- *
- * @return string
- */
- public function getEvenFooter() {
- return $this->_evenFooter;
- }
-
- /**
- * Set EvenFooter
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setEvenFooter($pValue) {
- $this->_evenFooter = $pValue;
- return $this;
- }
-
- /**
- * Get FirstHeader
- *
- * @return string
- */
- public function getFirstHeader() {
- return $this->_firstHeader;
- }
-
- /**
- * Set FirstHeader
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setFirstHeader($pValue) {
- $this->_firstHeader = $pValue;
- return $this;
- }
-
- /**
- * Get FirstFooter
- *
- * @return string
- */
- public function getFirstFooter() {
- return $this->_firstFooter;
- }
-
- /**
- * Set FirstFooter
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setFirstFooter($pValue) {
- $this->_firstFooter = $pValue;
- return $this;
- }
-
- /**
- * Get DifferentOddEven
- *
- * @return boolean
- */
- public function getDifferentOddEven() {
- return $this->_differentOddEven;
- }
-
- /**
- * Set DifferentOddEven
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setDifferentOddEven($pValue = false) {
- $this->_differentOddEven = $pValue;
- return $this;
- }
-
- /**
- * Get DifferentFirst
- *
- * @return boolean
- */
- public function getDifferentFirst() {
- return $this->_differentFirst;
- }
-
- /**
- * Set DifferentFirst
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setDifferentFirst($pValue = false) {
- $this->_differentFirst = $pValue;
- return $this;
- }
-
- /**
- * Get ScaleWithDocument
- *
- * @return boolean
- */
- public function getScaleWithDocument() {
- return $this->_scaleWithDocument;
- }
-
- /**
- * Set ScaleWithDocument
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setScaleWithDocument($pValue = true) {
- $this->_scaleWithDocument = $pValue;
- return $this;
- }
-
- /**
- * Get AlignWithMargins
- *
- * @return boolean
- */
- public function getAlignWithMargins() {
- return $this->_alignWithMargins;
- }
-
- /**
- * Set AlignWithMargins
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setAlignWithMargins($pValue = true) {
- $this->_alignWithMargins = $pValue;
- return $this;
- }
-
- /**
- * Add header/footer image
- *
- * @param PHPExcel_Worksheet_HeaderFooterDrawing $image
- * @param string $location
- * @throws Exception
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) {
- $this->_headerFooterImages[$location] = $image;
- return $this;
- }
-
- /**
- * Remove header/footer image
- *
- * @param string $location
- * @throws Exception
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function removeImage($location = self::IMAGE_HEADER_LEFT) {
- if (isset($this->_headerFooterImages[$location])) {
- unset($this->_headerFooterImages[$location]);
- }
- return $this;
- }
-
- /**
- * Set header/footer images
- *
- * @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images
- * @throws Exception
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setImages($images) {
- if (!is_array($images)) {
- throw new Exception('Invalid parameter!');
- }
-
- $this->_headerFooterImages = $images;
- return $this;
- }
-
- /**
- * Get header/footer images
- *
- * @return PHPExcel_Worksheet_HeaderFooterDrawing[]
- */
- public function getImages() {
- // Sort array
- $images = array();
- if (isset($this->_headerFooterImages[self::IMAGE_HEADER_LEFT])) $images[self::IMAGE_HEADER_LEFT] = $this->_headerFooterImages[self::IMAGE_HEADER_LEFT];
- if (isset($this->_headerFooterImages[self::IMAGE_HEADER_CENTER])) $images[self::IMAGE_HEADER_CENTER] = $this->_headerFooterImages[self::IMAGE_HEADER_CENTER];
- if (isset($this->_headerFooterImages[self::IMAGE_HEADER_RIGHT])) $images[self::IMAGE_HEADER_RIGHT] = $this->_headerFooterImages[self::IMAGE_HEADER_RIGHT];
- if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_LEFT])) $images[self::IMAGE_FOOTER_LEFT] = $this->_headerFooterImages[self::IMAGE_FOOTER_LEFT];
- if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_CENTER])) $images[self::IMAGE_FOOTER_CENTER] = $this->_headerFooterImages[self::IMAGE_FOOTER_CENTER];
- if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT])) $images[self::IMAGE_FOOTER_RIGHT] = $this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT];
- $this->_headerFooterImages = $images;
-
- return $this->_headerFooterImages;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/HeaderFooterDrawing.php b/admin/survey/excel/PHPExcel/Worksheet/HeaderFooterDrawing.php
deleted file mode 100644
index 1074dc4..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/HeaderFooterDrawing.php
+++ /dev/null
@@ -1,350 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_HeaderFooterDrawing
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing implements PHPExcel_IComparable
-{
- /**
- * Path
- *
- * @var string
- */
- private $_path;
-
- /**
- * Name
- *
- * @var string
- */
- protected $_name;
-
- /**
- * Offset X
- *
- * @var int
- */
- protected $_offsetX;
-
- /**
- * Offset Y
- *
- * @var int
- */
- protected $_offsetY;
-
- /**
- * Width
- *
- * @var int
- */
- protected $_width;
-
- /**
- * Height
- *
- * @var int
- */
- protected $_height;
-
- /**
- * Proportional resize
- *
- * @var boolean
- */
- protected $_resizeProportional;
-
- /**
- * Create a new PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function __construct()
- {
- // Initialise values
- $this->_path = '';
- $this->_name = '';
- $this->_offsetX = 0;
- $this->_offsetY = 0;
- $this->_width = 0;
- $this->_height = 0;
- $this->_resizeProportional = true;
- }
-
- /**
- * Get Name
- *
- * @return string
- */
- public function getName() {
- return $this->_name;
- }
-
- /**
- * Set Name
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setName($pValue = '') {
- $this->_name = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetX
- *
- * @return int
- */
- public function getOffsetX() {
- return $this->_offsetX;
- }
-
- /**
- * Set OffsetX
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setOffsetX($pValue = 0) {
- $this->_offsetX = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetY
- *
- * @return int
- */
- public function getOffsetY() {
- return $this->_offsetY;
- }
-
- /**
- * Set OffsetY
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setOffsetY($pValue = 0) {
- $this->_offsetY = $pValue;
- return $this;
- }
-
- /**
- * Get Width
- *
- * @return int
- */
- public function getWidth() {
- return $this->_width;
- }
-
- /**
- * Set Width
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setWidth($pValue = 0) {
- // Resize proportional?
- if ($this->_resizeProportional && $pValue != 0) {
- $ratio = $this->_width / $this->_height;
- $this->_height = round($ratio * $pValue);
- }
-
- // Set width
- $this->_width = $pValue;
-
- return $this;
- }
-
- /**
- * Get Height
- *
- * @return int
- */
- public function getHeight() {
- return $this->_height;
- }
-
- /**
- * Set Height
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setHeight($pValue = 0) {
- // Resize proportional?
- if ($this->_resizeProportional && $pValue != 0) {
- $ratio = $this->_width / $this->_height;
- $this->_width = round($ratio * $pValue);
- }
-
- // Set height
- $this->_height = $pValue;
-
- return $this;
- }
-
- /**
- * Set width and height with proportional resize
- * Example:
- * <code>
- * $objDrawing->setResizeProportional(true);
- * $objDrawing->setWidthAndHeight(160,120);
- * </code>
- *
- * @author Vincent@luo MSN:kele_100@hotmail.com
- * @param int $width
- * @param int $height
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setWidthAndHeight($width = 0, $height = 0) {
- $xratio = $width / $this->_width;
- $yratio = $height / $this->_height;
- if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
- if (($xratio * $this->_height) < $height) {
- $this->_height = ceil($xratio * $this->_height);
- $this->_width = $width;
- } else {
- $this->_width = ceil($yratio * $this->_width);
- $this->_height = $height;
- }
- }
- return $this;
- }
-
- /**
- * Get ResizeProportional
- *
- * @return boolean
- */
- public function getResizeProportional() {
- return $this->_resizeProportional;
- }
-
- /**
- * Set ResizeProportional
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setResizeProportional($pValue = true) {
- $this->_resizeProportional = $pValue;
- return $this;
- }
-
- /**
- * Get Filename
- *
- * @return string
- */
- public function getFilename() {
- return basename($this->_path);
- }
-
- /**
- * Get Extension
- *
- * @return string
- */
- public function getExtension() {
- $parts = explode(".", basename($this->_path));
- return end($parts);
- }
-
- /**
- * Get Path
- *
- * @return string
- */
- public function getPath() {
- return $this->_path;
- }
-
- /**
- * Set Path
- *
- * @param string $pValue File path
- * @param boolean $pVerifyFile Verify file
- * @throws Exception
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setPath($pValue = '', $pVerifyFile = true) {
- if ($pVerifyFile) {
- if (file_exists($pValue)) {
- $this->_path = $pValue;
-
- if ($this->_width == 0 && $this->_height == 0) {
- // Get width/height
- list($this->_width, $this->_height) = getimagesize($pValue);
- }
- } else {
- throw new Exception("File $pValue not found!");
- }
- } else {
- $this->_path = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- return md5(
- $this->_path
- . $this->_name
- . $this->_offsetX
- . $this->_offsetY
- . $this->_width
- . $this->_height
- . __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/MemoryDrawing.php b/admin/survey/excel/PHPExcel/Worksheet/MemoryDrawing.php
deleted file mode 100644
index 8dc4be7..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/MemoryDrawing.php
+++ /dev/null
@@ -1,200 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_MemoryDrawing
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
-{
- /* Rendering functions */
- const RENDERING_DEFAULT = 'imagepng';
- const RENDERING_PNG = 'imagepng';
- const RENDERING_GIF = 'imagegif';
- const RENDERING_JPEG = 'imagejpeg';
-
- /* MIME types */
- const MIMETYPE_DEFAULT = 'image/png';
- const MIMETYPE_PNG = 'image/png';
- const MIMETYPE_GIF = 'image/gif';
- const MIMETYPE_JPEG = 'image/jpeg';
-
- /**
- * Image resource
- *
- * @var resource
- */
- private $_imageResource;
-
- /**
- * Rendering function
- *
- * @var string
- */
- private $_renderingFunction;
-
- /**
- * Mime type
- *
- * @var string
- */
- private $_mimeType;
-
- /**
- * Unique name
- *
- * @var string
- */
- private $_uniqueName;
-
- /**
- * Create a new PHPExcel_Worksheet_MemoryDrawing
- */
- public function __construct()
- {
- // Initialise values
- $this->_imageResource = null;
- $this->_renderingFunction = self::RENDERING_DEFAULT;
- $this->_mimeType = self::MIMETYPE_DEFAULT;
- $this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
-
- // Initialize parent
- parent::__construct();
- }
-
- /**
- * Get image resource
- *
- * @return resource
- */
- public function getImageResource() {
- return $this->_imageResource;
- }
-
- /**
- * Set image resource
- *
- * @param $value resource
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setImageResource($value = null) {
- $this->_imageResource = $value;
-
- if (!is_null($this->_imageResource)) {
- // Get width/height
- $this->_width = imagesx($this->_imageResource);
- $this->_height = imagesy($this->_imageResource);
- }
- return $this;
- }
-
- /**
- * Get rendering function
- *
- * @return string
- */
- public function getRenderingFunction() {
- return $this->_renderingFunction;
- }
-
- /**
- * Set rendering function
- *
- * @param string $value
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT) {
- $this->_renderingFunction = $value;
- return $this;
- }
-
- /**
- * Get mime type
- *
- * @return string
- */
- public function getMimeType() {
- return $this->_mimeType;
- }
-
- /**
- * Set mime type
- *
- * @param string $value
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT) {
- $this->_mimeType = $value;
- return $this;
- }
-
- /**
- * Get indexed filename (using image index)
- *
- * @return string
- */
- public function getIndexedFilename() {
- $extension = strtolower($this->getMimeType());
- $extension = explode('/', $extension);
- $extension = $extension[1];
-
- return $this->_uniqueName . $this->getImageIndex() . '.' . $extension;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode() {
- return md5(
- $this->_renderingFunction
- . $this->_mimeType
- . $this->_uniqueName
- . parent::getHashCode()
- . __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/PageMargins.php b/admin/survey/excel/PHPExcel/Worksheet/PageMargins.php
deleted file mode 100644
index c288fd8..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/PageMargins.php
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_PageMargins
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_PageMargins
-{
- /**
- * Left
- *
- * @var double
- */
- private $_left = 0.7;
-
- /**
- * Right
- *
- * @var double
- */
- private $_right = 0.7;
-
- /**
- * Top
- *
- * @var double
- */
- private $_top = 0.75;
-
- /**
- * Bottom
- *
- * @var double
- */
- private $_bottom = 0.75;
-
- /**
- * Header
- *
- * @var double
- */
- private $_header = 0.3;
-
- /**
- * Footer
- *
- * @var double
- */
- private $_footer = 0.3;
-
- /**
- * Create a new PHPExcel_Worksheet_PageMargins
- */
- public function __construct()
- {
- }
-
- /**
- * Get Left
- *
- * @return double
- */
- public function getLeft() {
- return $this->_left;
- }
-
- /**
- * Set Left
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setLeft($pValue) {
- $this->_left = $pValue;
- return $this;
- }
-
- /**
- * Get Right
- *
- * @return double
- */
- public function getRight() {
- return $this->_right;
- }
-
- /**
- * Set Right
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setRight($pValue) {
- $this->_right = $pValue;
- return $this;
- }
-
- /**
- * Get Top
- *
- * @return double
- */
- public function getTop() {
- return $this->_top;
- }
-
- /**
- * Set Top
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setTop($pValue) {
- $this->_top = $pValue;
- return $this;
- }
-
- /**
- * Get Bottom
- *
- * @return double
- */
- public function getBottom() {
- return $this->_bottom;
- }
-
- /**
- * Set Bottom
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setBottom($pValue) {
- $this->_bottom = $pValue;
- return $this;
- }
-
- /**
- * Get Header
- *
- * @return double
- */
- public function getHeader() {
- return $this->_header;
- }
-
- /**
- * Set Header
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setHeader($pValue) {
- $this->_header = $pValue;
- return $this;
- }
-
- /**
- * Get Footer
- *
- * @return double
- */
- public function getFooter() {
- return $this->_footer;
- }
-
- /**
- * Set Footer
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setFooter($pValue) {
- $this->_footer = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/PageSetup.php b/admin/survey/excel/PHPExcel/Worksheet/PageSetup.php
deleted file mode 100644
index eede154..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/PageSetup.php
+++ /dev/null
@@ -1,798 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_PageSetup
- *
- * <code>
- * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:
- *
- * 1 = Letter paper (8.5 in. by 11 in.)
- * 2 = Letter small paper (8.5 in. by 11 in.)
- * 3 = Tabloid paper (11 in. by 17 in.)
- * 4 = Ledger paper (17 in. by 11 in.)
- * 5 = Legal paper (8.5 in. by 14 in.)
- * 6 = Statement paper (5.5 in. by 8.5 in.)
- * 7 = Executive paper (7.25 in. by 10.5 in.)
- * 8 = A3 paper (297 mm by 420 mm)
- * 9 = A4 paper (210 mm by 297 mm)
- * 10 = A4 small paper (210 mm by 297 mm)
- * 11 = A5 paper (148 mm by 210 mm)
- * 12 = B4 paper (250 mm by 353 mm)
- * 13 = B5 paper (176 mm by 250 mm)
- * 14 = Folio paper (8.5 in. by 13 in.)
- * 15 = Quarto paper (215 mm by 275 mm)
- * 16 = Standard paper (10 in. by 14 in.)
- * 17 = Standard paper (11 in. by 17 in.)
- * 18 = Note paper (8.5 in. by 11 in.)
- * 19 = #9 envelope (3.875 in. by 8.875 in.)
- * 20 = #10 envelope (4.125 in. by 9.5 in.)
- * 21 = #11 envelope (4.5 in. by 10.375 in.)
- * 22 = #12 envelope (4.75 in. by 11 in.)
- * 23 = #14 envelope (5 in. by 11.5 in.)
- * 24 = C paper (17 in. by 22 in.)
- * 25 = D paper (22 in. by 34 in.)
- * 26 = E paper (34 in. by 44 in.)
- * 27 = DL envelope (110 mm by 220 mm)
- * 28 = C5 envelope (162 mm by 229 mm)
- * 29 = C3 envelope (324 mm by 458 mm)
- * 30 = C4 envelope (229 mm by 324 mm)
- * 31 = C6 envelope (114 mm by 162 mm)
- * 32 = C65 envelope (114 mm by 229 mm)
- * 33 = B4 envelope (250 mm by 353 mm)
- * 34 = B5 envelope (176 mm by 250 mm)
- * 35 = B6 envelope (176 mm by 125 mm)
- * 36 = Italy envelope (110 mm by 230 mm)
- * 37 = Monarch envelope (3.875 in. by 7.5 in.).
- * 38 = 6 3/4 envelope (3.625 in. by 6.5 in.)
- * 39 = US standard fanfold (14.875 in. by 11 in.)
- * 40 = German standard fanfold (8.5 in. by 12 in.)
- * 41 = German legal fanfold (8.5 in. by 13 in.)
- * 42 = ISO B4 (250 mm by 353 mm)
- * 43 = Japanese double postcard (200 mm by 148 mm)
- * 44 = Standard paper (9 in. by 11 in.)
- * 45 = Standard paper (10 in. by 11 in.)
- * 46 = Standard paper (15 in. by 11 in.)
- * 47 = Invite envelope (220 mm by 220 mm)
- * 50 = Letter extra paper (9.275 in. by 12 in.)
- * 51 = Legal extra paper (9.275 in. by 15 in.)
- * 52 = Tabloid extra paper (11.69 in. by 18 in.)
- * 53 = A4 extra paper (236 mm by 322 mm)
- * 54 = Letter transverse paper (8.275 in. by 11 in.)
- * 55 = A4 transverse paper (210 mm by 297 mm)
- * 56 = Letter extra transverse paper (9.275 in. by 12 in.)
- * 57 = SuperA/SuperA/A4 paper (227 mm by 356 mm)
- * 58 = SuperB/SuperB/A3 paper (305 mm by 487 mm)
- * 59 = Letter plus paper (8.5 in. by 12.69 in.)
- * 60 = A4 plus paper (210 mm by 330 mm)
- * 61 = A5 transverse paper (148 mm by 210 mm)
- * 62 = JIS B5 transverse paper (182 mm by 257 mm)
- * 63 = A3 extra paper (322 mm by 445 mm)
- * 64 = A5 extra paper (174 mm by 235 mm)
- * 65 = ISO B5 extra paper (201 mm by 276 mm)
- * 66 = A2 paper (420 mm by 594 mm)
- * 67 = A3 transverse paper (297 mm by 420 mm)
- * 68 = A3 extra transverse paper (322 mm by 445 mm)
- * </code>
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_PageSetup
-{
- /* Paper size */
- const PAPERSIZE_LETTER = 1;
- const PAPERSIZE_LETTER_SMALL = 2;
- const PAPERSIZE_TABLOID = 3;
- const PAPERSIZE_LEDGER = 4;
- const PAPERSIZE_LEGAL = 5;
- const PAPERSIZE_STATEMENT = 6;
- const PAPERSIZE_EXECUTIVE = 7;
- const PAPERSIZE_A3 = 8;
- const PAPERSIZE_A4 = 9;
- const PAPERSIZE_A4_SMALL = 10;
- const PAPERSIZE_A5 = 11;
- const PAPERSIZE_B4 = 12;
- const PAPERSIZE_B5 = 13;
- const PAPERSIZE_FOLIO = 14;
- const PAPERSIZE_QUARTO = 15;
- const PAPERSIZE_STANDARD_1 = 16;
- const PAPERSIZE_STANDARD_2 = 17;
- const PAPERSIZE_NOTE = 18;
- const PAPERSIZE_NO9_ENVELOPE = 19;
- const PAPERSIZE_NO10_ENVELOPE = 20;
- const PAPERSIZE_NO11_ENVELOPE = 21;
- const PAPERSIZE_NO12_ENVELOPE = 22;
- const PAPERSIZE_NO14_ENVELOPE = 23;
- const PAPERSIZE_C = 24;
- const PAPERSIZE_D = 25;
- const PAPERSIZE_E = 26;
- const PAPERSIZE_DL_ENVELOPE = 27;
- const PAPERSIZE_C5_ENVELOPE = 28;
- const PAPERSIZE_C3_ENVELOPE = 29;
- const PAPERSIZE_C4_ENVELOPE = 30;
- const PAPERSIZE_C6_ENVELOPE = 31;
- const PAPERSIZE_C65_ENVELOPE = 32;
- const PAPERSIZE_B4_ENVELOPE = 33;
- const PAPERSIZE_B5_ENVELOPE = 34;
- const PAPERSIZE_B6_ENVELOPE = 35;
- const PAPERSIZE_ITALY_ENVELOPE = 36;
- const PAPERSIZE_MONARCH_ENVELOPE = 37;
- const PAPERSIZE_6_3_4_ENVELOPE = 38;
- const PAPERSIZE_US_STANDARD_FANFOLD = 39;
- const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40;
- const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41;
- const PAPERSIZE_ISO_B4 = 42;
- const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43;
- const PAPERSIZE_STANDARD_PAPER_1 = 44;
- const PAPERSIZE_STANDARD_PAPER_2 = 45;
- const PAPERSIZE_STANDARD_PAPER_3 = 46;
- const PAPERSIZE_INVITE_ENVELOPE = 47;
- const PAPERSIZE_LETTER_EXTRA_PAPER = 48;
- const PAPERSIZE_LEGAL_EXTRA_PAPER = 49;
- const PAPERSIZE_TABLOID_EXTRA_PAPER = 50;
- const PAPERSIZE_A4_EXTRA_PAPER = 51;
- const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52;
- const PAPERSIZE_A4_TRANSVERSE_PAPER = 53;
- const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54;
- const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55;
- const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56;
- const PAPERSIZE_LETTER_PLUS_PAPER = 57;
- const PAPERSIZE_A4_PLUS_PAPER = 58;
- const PAPERSIZE_A5_TRANSVERSE_PAPER = 59;
- const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60;
- const PAPERSIZE_A3_EXTRA_PAPER = 61;
- const PAPERSIZE_A5_EXTRA_PAPER = 62;
- const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63;
- const PAPERSIZE_A2_PAPER = 64;
- const PAPERSIZE_A3_TRANSVERSE_PAPER = 65;
- const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66;
-
- /* Page orientation */
- const ORIENTATION_DEFAULT = 'default';
- const ORIENTATION_LANDSCAPE = 'landscape';
- const ORIENTATION_PORTRAIT = 'portrait';
-
- /* Print Range Set Method */
- const SETPRINTRANGE_OVERWRITE = 'O';
- const SETPRINTRANGE_INSERT = 'I';
-
-
- /**
- * Paper size
- *
- * @var int
- */
- private $_paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER;
-
- /**
- * Orientation
- *
- * @var string
- */
- private $_orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT;
-
- /**
- * Scale (Print Scale)
- *
- * Print scaling. Valid values range from 10 to 400
- * This setting is overridden when fitToWidth and/or fitToHeight are in use
- *
- * @var int?
- */
- private $_scale = 100;
-
- /**
- * Fit To Page
- * Whether scale or fitToWith / fitToHeight applies
- *
- * @var boolean
- */
- private $_fitToPage = FALSE;
-
- /**
- * Fit To Height
- * Number of vertical pages to fit on
- *
- * @var int?
- */
- private $_fitToHeight = 1;
-
- /**
- * Fit To Width
- * Number of horizontal pages to fit on
- *
- * @var int?
- */
- private $_fitToWidth = 1;
-
- /**
- * Columns to repeat at left
- *
- * @var array Containing start column and end column, empty array if option unset
- */
- private $_columnsToRepeatAtLeft = array('', '');
-
- /**
- * Rows to repeat at top
- *
- * @var array Containing start row number and end row number, empty array if option unset
- */
- private $_rowsToRepeatAtTop = array(0, 0);
-
- /**
- * Center page horizontally
- *
- * @var boolean
- */
- private $_horizontalCentered = FALSE;
-
- /**
- * Center page vertically
- *
- * @var boolean
- */
- private $_verticalCentered = FALSE;
-
- /**
- * Print area
- *
- * @var string
- */
- private $_printArea = NULL;
-
- /**
- * First page number
- *
- * @var int
- */
- private $_firstPageNumber = NULL;
-
- /**
- * Create a new PHPExcel_Worksheet_PageSetup
- */
- public function __construct()
- {
- }
-
- /**
- * Get Paper Size
- *
- * @return int
- */
- public function getPaperSize() {
- return $this->_paperSize;
- }
-
- /**
- * Set Paper Size
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) {
- $this->_paperSize = $pValue;
- return $this;
- }
-
- /**
- * Get Orientation
- *
- * @return string
- */
- public function getOrientation() {
- return $this->_orientation;
- }
-
- /**
- * Set Orientation
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) {
- $this->_orientation = $pValue;
- return $this;
- }
-
- /**
- * Get Scale
- *
- * @return int?
- */
- public function getScale() {
- return $this->_scale;
- }
-
- /**
- * Set Scale
- *
- * Print scaling. Valid values range from 10 to 400
- * This setting is overridden when fitToWidth and/or fitToHeight are in use
- *
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
- * @return PHPExcel_Worksheet_PageSetup
- * @throws Exception
- */
- public function setScale($pValue = 100, $pUpdate = true) {
- // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
- // but it is apparently still able to handle any scale >= 0, where 0 results in 100
- if (($pValue >= 0) || is_null($pValue)) {
- $this->_scale = $pValue;
- if ($pUpdate) {
- $this->_fitToPage = false;
- }
- } else {
- throw new Exception("Scale must not be negative");
- }
- return $this;
- }
-
- /**
- * Get Fit To Page
- *
- * @return boolean
- */
- public function getFitToPage() {
- return $this->_fitToPage;
- }
-
- /**
- * Set Fit To Page
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setFitToPage($pValue = TRUE) {
- $this->_fitToPage = $pValue;
- return $this;
- }
-
- /**
- * Get Fit To Height
- *
- * @return int?
- */
- public function getFitToHeight() {
- return $this->_fitToHeight;
- }
-
- /**
- * Set Fit To Height
- *
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setFitToHeight($pValue = 1, $pUpdate = TRUE) {
- $this->_fitToHeight = $pValue;
- if ($pUpdate) {
- $this->_fitToPage = TRUE;
- }
- return $this;
- }
-
- /**
- * Get Fit To Width
- *
- * @return int?
- */
- public function getFitToWidth() {
- return $this->_fitToWidth;
- }
-
- /**
- * Set Fit To Width
- *
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setFitToWidth($pValue = 1, $pUpdate = TRUE) {
- $this->_fitToWidth = $pValue;
- if ($pUpdate) {
- $this->_fitToPage = TRUE;
- }
- return $this;
- }
-
- /**
- * Is Columns to repeat at left set?
- *
- * @return boolean
- */
- public function isColumnsToRepeatAtLeftSet() {
- if (is_array($this->_columnsToRepeatAtLeft)) {
- if ($this->_columnsToRepeatAtLeft[0] != '' && $this->_columnsToRepeatAtLeft[1] != '') {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Get Columns to repeat at left
- *
- * @return array Containing start column and end column, empty array if option unset
- */
- public function getColumnsToRepeatAtLeft() {
- return $this->_columnsToRepeatAtLeft;
- }
-
- /**
- * Set Columns to repeat at left
- *
- * @param array $pValue Containing start column and end column, empty array if option unset
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setColumnsToRepeatAtLeft($pValue = null) {
- if (is_array($pValue)) {
- $this->_columnsToRepeatAtLeft = $pValue;
- }
- return $this;
- }
-
- /**
- * Set Columns to repeat at left by start and end
- *
- * @param string $pStart
- * @param string $pEnd
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') {
- $this->_columnsToRepeatAtLeft = array($pStart, $pEnd);
- return $this;
- }
-
- /**
- * Is Rows to repeat at top set?
- *
- * @return boolean
- */
- public function isRowsToRepeatAtTopSet() {
- if (is_array($this->_rowsToRepeatAtTop)) {
- if ($this->_rowsToRepeatAtTop[0] != 0 && $this->_rowsToRepeatAtTop[1] != 0) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Get Rows to repeat at top
- *
- * @return array Containing start column and end column, empty array if option unset
- */
- public function getRowsToRepeatAtTop() {
- return $this->_rowsToRepeatAtTop;
- }
-
- /**
- * Set Rows to repeat at top
- *
- * @param array $pValue Containing start column and end column, empty array if option unset
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setRowsToRepeatAtTop($pValue = null) {
- if (is_array($pValue)) {
- $this->_rowsToRepeatAtTop = $pValue;
- }
- return $this;
- }
-
- /**
- * Set Rows to repeat at top by start and end
- *
- * @param int $pStart
- * @param int $pEnd
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) {
- $this->_rowsToRepeatAtTop = array($pStart, $pEnd);
- return $this;
- }
-
- /**
- * Get center page horizontally
- *
- * @return bool
- */
- public function getHorizontalCentered() {
- return $this->_horizontalCentered;
- }
-
- /**
- * Set center page horizontally
- *
- * @param bool $value
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setHorizontalCentered($value = false) {
- $this->_horizontalCentered = $value;
- return $this;
- }
-
- /**
- * Get center page vertically
- *
- * @return bool
- */
- public function getVerticalCentered() {
- return $this->_verticalCentered;
- }
-
- /**
- * Set center page vertically
- *
- * @param bool $value
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function setVerticalCentered($value = false) {
- $this->_verticalCentered = $value;
- return $this;
- }
-
- /**
- * Get print area
- *
- * @param int $index Identifier for a specific print area range if several ranges have been set
- * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
- * Otherwise, the specific range identified by the value of $index will be returned
- * Print areas are numbered from 1
- * @throws Exception
- * @return string
- */
- public function getPrintArea($index = 0) {
- if ($index == 0) {
- return $this->_printArea;
- }
- $printAreas = explode(',',$this->_printArea);
- if (isset($printAreas[$index-1])) {
- return $printAreas[$index-1];
- }
- throw new Exception("Requested Print Area does not exist");
- }
-
- /**
- * Is print area set?
- *
- * @param int $index Identifier for a specific print area range if several ranges have been set
- * Default behaviour, or an index value of 0, will identify whether any print range is set
- * Otherwise, existence of the range identified by the value of $index will be returned
- * Print areas are numbered from 1
- * @return boolean
- */
- public function isPrintAreaSet($index = 0) {
- if ($index == 0) {
- return !is_null($this->_printArea);
- }
- $printAreas = explode(',',$this->_printArea);
- return isset($printAreas[$index-1]);
- }
-
- /**
- * Clear a print area
- *
- * @param int $index Identifier for a specific print area range if several ranges have been set
- * Default behaviour, or an index value of 0, will clear all print ranges that are set
- * Otherwise, the range identified by the value of $index will be removed from the series
- * Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function clearPrintArea($index = 0) {
- if ($index == 0) {
- $this->_printArea = NULL;
- } else {
- $printAreas = explode(',',$this->_printArea);
- if (isset($printAreas[$index-1])) {
- unset($printAreas[$index-1]);
- $this->_printArea = implode(',',$printAreas);
- }
- }
-
- return $this;
- }
-
- /**
- * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'
- *
- * @param string $value
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
- * When the method is "O"verwrite, then a positive integer index will overwrite that indexed
- * entry in the print areas list; a negative index value will identify which entry to
- * overwrite working bacward through the print area to the list, with the last entry as -1.
- * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges.
- * When the method is "I"nsert, then a positive index will insert after that indexed entry in
- * the print areas list, while a negative index will insert before the indexed entry.
- * Specifying an index value of 0, will always append the new print range at the end of the
- * list.
- * Print areas are numbered from 1
- * @param string $method Determines the method used when setting multiple print areas
- * Default behaviour, or the "O" method, overwrites existing print area
- * The "I" method, inserts the new print area before any specified index, or at the end of the list
- * @return PHPExcel_Worksheet_PageSetup
- * @throws Exception
- */
- public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) {
- if (strpos($value,'!') !== false) {
- throw new Exception('Cell coordinate must not specify a worksheet.');
- } elseif (strpos($value,':') === false) {
- throw new Exception('Cell coordinate must be a range of cells.');
- } elseif (strpos($value,'$') !== false) {
- throw new Exception('Cell coordinate must not be absolute.');
- }
- $value = strtoupper($value);
-
- if ($method == self::SETPRINTRANGE_OVERWRITE) {
- if ($index == 0) {
- $this->_printArea = $value;
- } else {
- $printAreas = explode(',',$this->_printArea);
- if($index < 0) {
- $index = count($printAreas) - abs($index) + 1;
- }
- if (($index <= 0) || ($index > count($printAreas))) {
- throw new Exception('Invalid index for setting print range.');
- }
- $printAreas[$index-1] = $value;
- $this->_printArea = implode(',',$printAreas);
- }
- } elseif($method == self::SETPRINTRANGE_INSERT) {
- if ($index == 0) {
- $this->_printArea .= ($this->_printArea == '') ? $value : ','.$value;
- } else {
- $printAreas = explode(',',$this->_printArea);
- if($index < 0) {
- $index = abs($index) - 1;
- }
- if ($index > count($printAreas)) {
- throw new Exception('Invalid index for setting print range.');
- }
- $printAreas = array_merge(array_slice($printAreas,0,$index),array($value),array_slice($printAreas,$index));
- $this->_printArea = implode(',',$printAreas);
- }
- } else {
- throw new Exception('Invalid method for setting print range.');
- }
-
- return $this;
- }
-
- /**
- * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas
- *
- * @param string $value
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
- * A positive index will insert after that indexed entry in the print areas list, while a
- * negative index will insert before the indexed entry.
- * Specifying an index value of 0, will always append the new print range at the end of the
- * list.
- * Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
- * @throws Exception
- */
- public function addPrintArea($value, $index = -1) {
- return $this->setPrintArea($value, $index, self::SETPRINTRANGE_INSERT);
- }
-
- /**
- * Set print area
- *
- * @param int $column1 Column 1
- * @param int $row1 Row 1
- * @param int $column2 Column 2
- * @param int $row2 Row 2
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
- * When the method is "O"verwrite, then a positive integer index will overwrite that indexed
- * entry in the print areas list; a negative index value will identify which entry to
- * overwrite working bacward through the print area to the list, with the last entry as -1.
- * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges.
- * When the method is "I"nsert, then a positive index will insert after that indexed entry in
- * the print areas list, while a negative index will insert before the indexed entry.
- * Specifying an index value of 0, will always append the new print range at the end of the
- * list.
- * Print areas are numbered from 1
- * @param string $method Determines the method used when setting multiple print areas
- * Default behaviour, or the "O" method, overwrites existing print area
- * The "I" method, inserts the new print area before any specified index, or at the end of the list
- * @return PHPExcel_Worksheet_PageSetup
- * @throws Exception
- */
- public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
- {
- return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, $method);
- }
-
- /**
- * Add a new print area to the list of print areas
- *
- * @param int $column1 Start Column for the print area
- * @param int $row1 Start Row for the print area
- * @param int $column2 End Column for the print area
- * @param int $row2 End Row for the print area
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
- * A positive index will insert after that indexed entry in the print areas list, while a
- * negative index will insert before the indexed entry.
- * Specifying an index value of 0, will always append the new print range at the end of the
- * list.
- * Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
- * @throws Exception
- */
- public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
- {
- return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT);
- }
-
- /**
- * Get first page number
- *
- * @return int
- */
- public function getFirstPageNumber() {
- return $this->_firstPageNumber;
- }
-
- /**
- * Set first page number
- *
- * @param int $value
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function setFirstPageNumber($value = null) {
- $this->_firstPageNumber = $value;
- return $this;
- }
-
- /**
- * Reset first page number
- *
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function resetFirstPageNumber() {
- return $this->setFirstPageNumber(null);
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/Protection.php b/admin/survey/excel/PHPExcel/Worksheet/Protection.php
deleted file mode 100644
index 68e665e..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/Protection.php
+++ /dev/null
@@ -1,545 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_Protection
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_Protection
-{
- /**
- * Sheet
- *
- * @var boolean
- */
- private $_sheet = false;
-
- /**
- * Objects
- *
- * @var boolean
- */
- private $_objects = false;
-
- /**
- * Scenarios
- *
- * @var boolean
- */
- private $_scenarios = false;
-
- /**
- * Format cells
- *
- * @var boolean
- */
- private $_formatCells = false;
-
- /**
- * Format columns
- *
- * @var boolean
- */
- private $_formatColumns = false;
-
- /**
- * Format rows
- *
- * @var boolean
- */
- private $_formatRows = false;
-
- /**
- * Insert columns
- *
- * @var boolean
- */
- private $_insertColumns = false;
-
- /**
- * Insert rows
- *
- * @var boolean
- */
- private $_insertRows = false;
-
- /**
- * Insert hyperlinks
- *
- * @var boolean
- */
- private $_insertHyperlinks = false;
-
- /**
- * Delete columns
- *
- * @var boolean
- */
- private $_deleteColumns = false;
-
- /**
- * Delete rows
- *
- * @var boolean
- */
- private $_deleteRows = false;
-
- /**
- * Select locked cells
- *
- * @var boolean
- */
- private $_selectLockedCells = false;
-
- /**
- * Sort
- *
- * @var boolean
- */
- private $_sort = false;
-
- /**
- * AutoFilter
- *
- * @var boolean
- */
- private $_autoFilter = false;
-
- /**
- * Pivot tables
- *
- * @var boolean
- */
- private $_pivotTables = false;
-
- /**
- * Select unlocked cells
- *
- * @var boolean
- */
- private $_selectUnlockedCells = false;
-
- /**
- * Password
- *
- * @var string
- */
- private $_password = '';
-
- /**
- * Create a new PHPExcel_Worksheet_Protection
- */
- public function __construct()
- {
- }
-
- /**
- * Is some sort of protection enabled?
- *
- * @return boolean
- */
- function isProtectionEnabled() {
- return $this->_sheet ||
- $this->_objects ||
- $this->_scenarios ||
- $this->_formatCells ||
- $this->_formatColumns ||
- $this->_formatRows ||
- $this->_insertColumns ||
- $this->_insertRows ||
- $this->_insertHyperlinks ||
- $this->_deleteColumns ||
- $this->_deleteRows ||
- $this->_selectLockedCells ||
- $this->_sort ||
- $this->_autoFilter ||
- $this->_pivotTables ||
- $this->_selectUnlockedCells;
- }
-
- /**
- * Get Sheet
- *
- * @return boolean
- */
- function getSheet() {
- return $this->_sheet;
- }
-
- /**
- * Set Sheet
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setSheet($pValue = false) {
- $this->_sheet = $pValue;
- return $this;
- }
-
- /**
- * Get Objects
- *
- * @return boolean
- */
- function getObjects() {
- return $this->_objects;
- }
-
- /**
- * Set Objects
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setObjects($pValue = false) {
- $this->_objects = $pValue;
- return $this;
- }
-
- /**
- * Get Scenarios
- *
- * @return boolean
- */
- function getScenarios() {
- return $this->_scenarios;
- }
-
- /**
- * Set Scenarios
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setScenarios($pValue = false) {
- $this->_scenarios = $pValue;
- return $this;
- }
-
- /**
- * Get FormatCells
- *
- * @return boolean
- */
- function getFormatCells() {
- return $this->_formatCells;
- }
-
- /**
- * Set FormatCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setFormatCells($pValue = false) {
- $this->_formatCells = $pValue;
- return $this;
- }
-
- /**
- * Get FormatColumns
- *
- * @return boolean
- */
- function getFormatColumns() {
- return $this->_formatColumns;
- }
-
- /**
- * Set FormatColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setFormatColumns($pValue = false) {
- $this->_formatColumns = $pValue;
- return $this;
- }
-
- /**
- * Get FormatRows
- *
- * @return boolean
- */
- function getFormatRows() {
- return $this->_formatRows;
- }
-
- /**
- * Set FormatRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setFormatRows($pValue = false) {
- $this->_formatRows = $pValue;
- return $this;
- }
-
- /**
- * Get InsertColumns
- *
- * @return boolean
- */
- function getInsertColumns() {
- return $this->_insertColumns;
- }
-
- /**
- * Set InsertColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setInsertColumns($pValue = false) {
- $this->_insertColumns = $pValue;
- return $this;
- }
-
- /**
- * Get InsertRows
- *
- * @return boolean
- */
- function getInsertRows() {
- return $this->_insertRows;
- }
-
- /**
- * Set InsertRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setInsertRows($pValue = false) {
- $this->_insertRows = $pValue;
- return $this;
- }
-
- /**
- * Get InsertHyperlinks
- *
- * @return boolean
- */
- function getInsertHyperlinks() {
- return $this->_insertHyperlinks;
- }
-
- /**
- * Set InsertHyperlinks
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setInsertHyperlinks($pValue = false) {
- $this->_insertHyperlinks = $pValue;
- return $this;
- }
-
- /**
- * Get DeleteColumns
- *
- * @return boolean
- */
- function getDeleteColumns() {
- return $this->_deleteColumns;
- }
-
- /**
- * Set DeleteColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setDeleteColumns($pValue = false) {
- $this->_deleteColumns = $pValue;
- return $this;
- }
-
- /**
- * Get DeleteRows
- *
- * @return boolean
- */
- function getDeleteRows() {
- return $this->_deleteRows;
- }
-
- /**
- * Set DeleteRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setDeleteRows($pValue = false) {
- $this->_deleteRows = $pValue;
- return $this;
- }
-
- /**
- * Get SelectLockedCells
- *
- * @return boolean
- */
- function getSelectLockedCells() {
- return $this->_selectLockedCells;
- }
-
- /**
- * Set SelectLockedCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setSelectLockedCells($pValue = false) {
- $this->_selectLockedCells = $pValue;
- return $this;
- }
-
- /**
- * Get Sort
- *
- * @return boolean
- */
- function getSort() {
- return $this->_sort;
- }
-
- /**
- * Set Sort
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setSort($pValue = false) {
- $this->_sort = $pValue;
- return $this;
- }
-
- /**
- * Get AutoFilter
- *
- * @return boolean
- */
- function getAutoFilter() {
- return $this->_autoFilter;
- }
-
- /**
- * Set AutoFilter
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setAutoFilter($pValue = false) {
- $this->_autoFilter = $pValue;
- return $this;
- }
-
- /**
- * Get PivotTables
- *
- * @return boolean
- */
- function getPivotTables() {
- return $this->_pivotTables;
- }
-
- /**
- * Set PivotTables
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setPivotTables($pValue = false) {
- $this->_pivotTables = $pValue;
- return $this;
- }
-
- /**
- * Get SelectUnlockedCells
- *
- * @return boolean
- */
- function getSelectUnlockedCells() {
- return $this->_selectUnlockedCells;
- }
-
- /**
- * Set SelectUnlockedCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- function setSelectUnlockedCells($pValue = false) {
- $this->_selectUnlockedCells = $pValue;
- return $this;
- }
-
- /**
- * Get Password (hashed)
- *
- * @return string
- */
- function getPassword() {
- return $this->_password;
- }
-
- /**
- * Set Password
- *
- * @param string $pValue
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @return PHPExcel_Worksheet_Protection
- */
- function setPassword($pValue = '', $pAlreadyHashed = false) {
- if (!$pAlreadyHashed) {
- $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
- }
- $this->_password = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/Row.php b/admin/survey/excel/PHPExcel/Worksheet/Row.php
deleted file mode 100644
index 8d1aea0..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/Row.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_Row
- *
- * Represents a row in PHPExcel_Worksheet, used by PHPExcel_Worksheet_RowIterator
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_Row
-{
- /**
- * PHPExcel_Worksheet
- *
- * @var PHPExcel_Worksheet
- */
- private $_parent;
-
- /**
- * Row index
- *
- * @var int
- */
- private $_rowIndex = 0;
-
- /**
- * Create a new row
- *
- * @param PHPExcel_Worksheet $parent
- * @param int $rowIndex
- */
- public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1) {
- // Set parent and row index
- $this->_parent = $parent;
- $this->_rowIndex = $rowIndex;
- }
-
- /**
- * Destructor
- */
- public function __destruct() {
- unset($this->_parent);
- }
-
- /**
- * Get row index
- *
- * @return int
- */
- public function getRowIndex() {
- return $this->_rowIndex;
- }
-
- /**
- * Get cell iterator
- *
- * @return PHPExcel_Worksheet_CellIterator
- */
- public function getCellIterator() {
- return new PHPExcel_Worksheet_CellIterator($this->_parent, $this->_rowIndex);
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/RowDimension.php b/admin/survey/excel/PHPExcel/Worksheet/RowDimension.php
deleted file mode 100644
index 6f19957..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/RowDimension.php
+++ /dev/null
@@ -1,265 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_RowDimension
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_RowDimension
-{
- /**
- * Row index
- *
- * @var int
- */
- private $_rowIndex;
-
- /**
- * Row height (in pt)
- *
- * When this is set to a negative value, the row height should be ignored by IWriter
- *
- * @var double
- */
- private $_rowHeight = -1;
-
- /**
- * ZeroHeight for Row?
- *
- * @var bool
- */
- private $_zeroHeight = false;
-
- /**
- * Visible?
- *
- * @var bool
- */
- private $_visible = true;
-
- /**
- * Outline level
- *
- * @var int
- */
- private $_outlineLevel = 0;
-
- /**
- * Collapsed
- *
- * @var bool
- */
- private $_collapsed = false;
-
- /**
- * Index to cellXf. Null value means row has no explicit cellXf format.
- *
- * @var int|null
- */
- private $_xfIndex;
-
- /**
- * Create a new PHPExcel_Worksheet_RowDimension
- *
- * @param int $pIndex Numeric row index
- */
- public function __construct($pIndex = 0)
- {
- // Initialise values
- $this->_rowIndex = $pIndex;
-
- // set row dimension as unformatted by default
- $this->_xfIndex = null;
- }
-
- /**
- * Get Row Index
- *
- * @return int
- */
- public function getRowIndex() {
- return $this->_rowIndex;
- }
-
- /**
- * Set Row Index
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setRowIndex($pValue) {
- $this->_rowIndex = $pValue;
- return $this;
- }
-
- /**
- * Get Row Height
- *
- * @return double
- */
- public function getRowHeight() {
- return $this->_rowHeight;
- }
-
- /**
- * Set Row Height
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setRowHeight($pValue = -1) {
- $this->_rowHeight = $pValue;
- return $this;
- }
-
- /**
- * Get ZeroHeight
- *
- * @return bool
- */
- public function getzeroHeight() {
- return $this->_zeroHeight;
- }
-
- /**
- * Set ZeroHeight
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setzeroHeight($pValue = false) {
- $this->_zeroHeight = $pValue;
- return $this;
- }
-
- /**
- * Get Visible
- *
- * @return bool
- */
- public function getVisible() {
- return $this->_visible;
- }
-
- /**
- * Set Visible
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setVisible($pValue = true) {
- $this->_visible = $pValue;
- return $this;
- }
-
- /**
- * Get Outline Level
- *
- * @return int
- */
- public function getOutlineLevel() {
- return $this->_outlineLevel;
- }
-
- /**
- * Set Outline Level
- *
- * Value must be between 0 and 7
- *
- * @param int $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setOutlineLevel($pValue) {
- if ($pValue < 0 || $pValue > 7) {
- throw new Exception("Outline level must range between 0 and 7.");
- }
-
- $this->_outlineLevel = $pValue;
- return $this;
- }
-
- /**
- * Get Collapsed
- *
- * @return bool
- */
- public function getCollapsed() {
- return $this->_collapsed;
- }
-
- /**
- * Set Collapsed
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setCollapsed($pValue = true) {
- $this->_collapsed = $pValue;
- return $this;
- }
-
- /**
- * Get index to cellXf
- *
- * @return int
- */
- public function getXfIndex()
- {
- return $this->_xfIndex;
- }
-
- /**
- * Set index to cellXf
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setXfIndex($pValue = 0)
- {
- $this->_xfIndex = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/RowIterator.php b/admin/survey/excel/PHPExcel/Worksheet/RowIterator.php
deleted file mode 100644
index 598508d..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/RowIterator.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_RowIterator
- *
- * Used to iterate rows in a PHPExcel_Worksheet
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_RowIterator implements Iterator
-{
- /**
- * PHPExcel_Worksheet to iterate
- *
- * @var PHPExcel_Worksheet
- */
- private $_subject;
-
- /**
- * Current iterator position
- *
- * @var int
- */
- private $_position = 1;
-
- /**
- * Start position
- *
- * @var int
- */
- private $_startRow = 1;
-
-
- /**
- * Create a new row iterator
- *
- * @param PHPExcel_Worksheet $subject The worksheet to iterate over
- * @param integer $startRow The row number at which to start iterating
- */
- public function __construct(PHPExcel_Worksheet $subject = null, $startRow = 1) {
- // Set subject
- $this->_subject = $subject;
- $this->resetStart($startRow);
- }
-
- /**
- * Destructor
- */
- public function __destruct() {
- unset($this->_subject);
- }
-
- /**
- * (Re)Set the start row and the current row pointer
- *
- * @param integer $startRow The row number at which to start iterating
- */
- public function resetStart($startRow = 1) {
- $this->_startRow = $startRow;
- $this->seek($startRow);
- }
-
- /**
- * Set the row pointer to the selected row
- *
- * @param integer $row The row number to set the current pointer at
- */
- public function seek($row = 1) {
- $this->_position = $row;
- }
-
- /**
- * Rewind the iterator to the starting row
- */
- public function rewind() {
- $this->_position = $this->_startRow;
- }
-
- /**
- * Return the current row in this worksheet
- *
- * @return PHPExcel_Worksheet_Row
- */
- public function current() {
- return new PHPExcel_Worksheet_Row($this->_subject, $this->_position);
- }
-
- /**
- * Return the current iterator key
- *
- * @return int
- */
- public function key() {
- return $this->_position;
- }
-
- /**
- * Set the iterator to its next value
- */
- public function next() {
- ++$this->_position;
- }
-
- /**
- * Set the iterator to its previous value
- */
- public function prev() {
- if ($this->_position > 1)
- --$this->_position;
- }
-
- /**
- * Indicate if more rows exist in the worksheet
- *
- * @return boolean
- */
- public function valid() {
- return $this->_position <= $this->_subject->getHighestRow();
- }
-}
diff --git a/admin/survey/excel/PHPExcel/Worksheet/SheetView.php b/admin/survey/excel/PHPExcel/Worksheet/SheetView.php
deleted file mode 100644
index 7b4413a..0000000
--- a/admin/survey/excel/PHPExcel/Worksheet/SheetView.php
+++ /dev/null
@@ -1,188 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_Worksheet_SheetView
- *
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Worksheet_SheetView
-{
-
- /* Sheet View types */
- const SHEETVIEW_NORMAL = 'normal';
- const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
- const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
-
- private static $_sheetViewTypes = array(
- self::SHEETVIEW_NORMAL,
- self::SHEETVIEW_PAGE_LAYOUT,
- self::SHEETVIEW_PAGE_BREAK_PREVIEW,
- );
-
- /**
- * ZoomScale
- *
- * Valid values range from 10 to 400.
- *
- * @var int
- */
- private $_zoomScale = 100;
-
- /**
- * ZoomScaleNormal
- *
- * Valid values range from 10 to 400.
- *
- * @var int
- */
- private $_zoomScaleNormal = 100;
-
- /**
- * View
- *
- * Valid values range from 10 to 400.
- *
- * @var string
- */
- private $_sheetviewType = self::SHEETVIEW_NORMAL;
-
- /**
- * Create a new PHPExcel_Worksheet_SheetView
- */
- public function __construct()
- {
- }
-
- /**
- * Get ZoomScale
- *
- * @return int
- */
- public function getZoomScale() {
- return $this->_zoomScale;
- }
-
- /**
- * Set ZoomScale
- *
- * Valid values range from 10 to 400.
- *
- * @param int $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_SheetView
- */
- public function setZoomScale($pValue = 100) {
- // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
- // but it is apparently still able to handle any scale >= 1
- if (($pValue >= 1) || is_null($pValue)) {
- $this->_zoomScale = $pValue;
- } else {
- throw new Exception("Scale must be greater than or equal to 1.");
- }
- return $this;
- }
-
- /**
- * Get ZoomScaleNormal
- *
- * @return int
- */
- public function getZoomScaleNormal() {
- return $this->_zoomScaleNormal;
- }
-
- /**
- * Set ZoomScale
- *
- * Valid values range from 10 to 400.
- *
- * @param int $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_SheetView
- */
- public function setZoomScaleNormal($pValue = 100) {
- if (($pValue >= 1) || is_null($pValue)) {
- $this->_zoomScaleNormal = $pValue;
- } else {
- throw new Exception("Scale must be greater than or equal to 1.");
- }
- return $this;
- }
-
- /**
- * Get View
- *
- * @return string
- */
- public function getView() {
- return $this->_sheetviewType;
- }
-
- /**
- * Set View
- *
- * Valid values are
- * 'normal' self::SHEETVIEW_NORMAL
- * 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
- * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
- *
- * @param string $pValue
- * @throws Exception
- * @return PHPExcel_Worksheet_SheetView
- */
- public function setView($pValue = NULL) {
- // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview'
- // via the user interface
- if ($pValue === NULL)
- $pValue = self::SHEETVIEW_NORMAL;
- if (in_array($pValue, self::$_sheetViewTypes)) {
- $this->_sheetviewType = $pValue;
- } else {
- throw new Exception("Invalid sheetview layout type.");
- }
-
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone() {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/admin/survey/excel/PHPExcel/WorksheetIterator.php b/admin/survey/excel/PHPExcel/WorksheetIterator.php
deleted file mode 100644
index ad09e76..0000000
--- a/admin/survey/excel/PHPExcel/WorksheetIterator.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2012 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 1.7.8, 2012-10-12
- */
-
-
-/**
- * PHPExcel_WorksheetIterator
- *
- * Used to iterate worksheets in PHPExcel
- *
- * @category PHPExcel
- * @package PHPExcel
- * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_WorksheetIterator implements Iterator
-{
- /**
- * Spreadsheet to iterate
- *
- * @var PHPExcel
- */
- private $_subject;
-
- /**
- * Current iterator position
- *
- * @var int
- */
- private $_position = 0;
-
- /**
- * Create a new worksheet iterator
- *
- * @param PHPExcel $subject
- */
- public function __construct(PHPExcel $subject = null) {
- // Set subject
- $this->_subject = $subject;
- }
-
- /**
- * Destructor
- */
- public function __destruct() {
- unset($this->_subject);
- }
-
- /**
- * Rewind iterator
- */
- public function rewind() {
- $this->_position = 0;
- }
-
- /**
- * Current PHPExcel_Worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function current() {
- return $this->_subject->getSheet($this->_position);
- }
-
- /**
- * Current key
- *
- * @return int
- */
- public function key() {
- return $this->_position;
- }
-
- /**
- * Next value
- */
- public function next() {
- ++$this->_position;
- }
-
- /**
- * More PHPExcel_Worksheet instances available?
- *
- * @return boolean
- */
- public function valid() {
- return $this->_position < $this->_subject->getSheetCount();
- }
-}