芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/Classes.zip
PK ,ZAk,-C C PHPExcel/Worksheet/PageSetup.phpnu W+A * 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) * * * @category PHPExcel * @package PHPExcel_Worksheet * @copyright Copyright (c) 2006 - 2010 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'; /** * Paper size * * @var int */ private $_paperSize; /** * Orientation * * @var string */ private $_orientation; /** * 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; /** * Fit To Page * Whether scale or fitToWith / fitToHeight applies * * @var boolean */ private $_fitToPage; /** * Fit To Height * Number of vertical pages to fit on * * @var int? */ private $_fitToHeight; /** * Fit To Width * Number of horizontal pages to fit on * * @var int? */ private $_fitToWidth; /** * 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() { // Initialise values $this->_paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER; $this->_orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT; $this->_scale = 100; $this->_fitToPage = false; $this->_fitToHeight = 1; $this->_fitToWidth = 1; $this->_columnsToRepeatAtLeft = array('', ''); $this->_rowsToRepeatAtTop = array(0, 0); $this->_horizontalCentered = false; $this->_verticalCentered = false; $this->_printArea = null; $this->_firstPageNumber = null; } /** * 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 * @throws Exception * @return PHPExcel_Worksheet_PageSetup */ 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 * * @return string */ public function getPrintArea() { return $this->_printArea; } /** * Is print area set? * * @return boolean */ public function isPrintAreaSet() { return !is_null($this->_printArea); } /** * Set print area. E.g. 'A1:D10' or 'A1:D10,G5:M20' * * @param string $value * @throws Exception * @return PHPExcel_Worksheet_PageSetup */ public function setPrintArea($value) { if (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.'); } else { $this->_printArea = strtoupper($value); } return $this; } /** * Set print area * * @param int $column1 Column 1 * @param int $row1 Row 1 * @param int $column2 Column 2 * @param int $row2 Row 2 * @return PHPExcel_Worksheet_PageSetup */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2) { return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2); } /** * 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; } } } } PK ,Z{M& & $ PHPExcel/Worksheet/MemoryDrawing.phpnu W+A _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; } } } } PK ,Z" " PHPExcel/Worksheet/RowIterator.phpnu W+A _subject = $subject; } /** * Destructor */ public function __destruct() { unset($this->_subject); } /** * Rewind iterator */ public function rewind() { $this->_position = 1; } /** * Current PHPExcel_Worksheet_Row * * @return PHPExcel_Worksheet_Row */ public function current() { return new PHPExcel_Worksheet_Row($this->_subject, $this->_position); } /** * Current key * * @return int */ public function key() { return $this->_position; } /** * Next value */ public function next() { ++$this->_position; } /** * More PHPExcel_Worksheet_Row instances available? * * @return boolean */ public function valid() { return $this->_position <= $this->_subject->getHighestRow(); } } PK ,Z%%) ) " PHPExcel/Worksheet/BaseDrawing.phpnu W+A _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: *
* $objDrawing->setResizeProportional(true); * $objDrawing->setWidthAndHeight(160,120); *
* * @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; } } } } PK ,Z PHPExcel/Worksheet/SheetView.phpnu W+A _zoomScale = 100; $this->_zoomScaleNormal = 100; } /** * 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) { if (($pValue >= 10 && $pValue <= 400) || is_null($pValue)) { $this->_zoomScale = $pValue; } else { throw new Exception("Valid scale is between 10 and 400."); } 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 >= 10 && $pValue <= 400) || is_null($pValue)) { $this->_zoomScaleNormal = $pValue; } else { throw new Exception("Valid scale is between 10 and 400."); } 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; } } } } PK ,Zʇ PHPExcel/Worksheet/Drawing.phpnu W+A _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; } } } } PK ,Zźq3 3 # PHPExcel/Worksheet/HeaderFooter.phpnu W+A * 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" * * * @category PHPExcel * @package PHPExcel_Worksheet * @copyright Copyright (c) 2006 - 2010 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; /** * Different header for first page, defaults to false * * @var boolean */ private $_differentFirst; /** * Scale with document, defaults to true * * @var boolean */ private $_scaleWithDocument; /** * Align with margins, defaults to true * * @var boolean */ private $_alignWithMargins; /** * Header/footer images * * @var PHPExcel_Worksheet_HeaderFooterDrawing[] */ private $_headerFooterImages = array(); /** * Create a new PHPExcel_Worksheet_HeaderFooter */ public function __construct() { // Initialise values $this->_oddHeader = ''; $this->_oddFooter = ''; $this->_evenHeader = ''; $this->_evenFooter = ''; $this->_firstHeader = ''; $this->_firstFooter = ''; $this->_differentOddEven = false; $this->_differentFirst = false; $this->_scaleWithDocument = true; $this->_alignWithMargins = true; $this->_headerFooterImages = array(); } /** * 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; } } } } PK ,Z.* # PHPExcel/Worksheet/CellIterator.phpnu W+A _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; } /** * 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 loop only existing cells * * @return boolean */ public function setIterateOnlyExistingCells($value = true) { $this->_onlyExistingCells = $value; } } PK ,Z85U " PHPExcel/Worksheet/PageMargins.phpnu W+A _left = 0.7; $this->_right = 0.7; $this->_top = 0.75; $this->_bottom = 0.75; $this->_header = 0.3; $this->_footer = 0.3; } /** * 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; } } } } PK ,Ze$ $ &