Jelajahi Sumber

Clean code. Removed phpexcel library.

Laurent Destailleur 4 tahun lalu
induk
melakukan
acb73966f7
100 mengubah file dengan 341 tambahan dan 34396 penghapusan
  1. 1 1
      .travis.yml
  2. 0 1
      COPYRIGHT
  3. 97 0
      ChangeLog
  4. 1 1
      build/debian/README.howto
  5. 4 51
      build/debian/copyright
  6. 0 1
      build/debian/dolibarr.postinst
  7. 0 1
      build/debian/install.forced.php.install
  8. 0 3
      build/debian/rules
  9. 1 1
      build/exe/doliwamp/doliwamp.iss
  10. 0 7
      build/makepack-dolibarr.pl
  11. 0 1
      build/rpm/dolibarr_fedora.spec
  12. 0 1
      build/rpm/dolibarr_generic.spec
  13. 0 1
      build/rpm/dolibarr_mandriva.spec
  14. 0 1
      build/rpm/dolibarr_opensuse.spec
  15. 0 1
      build/rpm/install.forced.php.fedora
  16. 0 1
      build/rpm/install.forced.php.mandriva
  17. 0 1
      build/rpm/install.forced.php.opensuse
  18. 0 62
      composer.lock
  19. 0 8
      dev/dolibarr_changes.txt
  20. 1 1
      htdocs/accountancy/class/accountancyexport.class.php
  21. 0 2
      htdocs/admin/system/constall.php
  22. 0 1
      htdocs/admin/system/dolibarr.php
  23. 2 2
      htdocs/commande/card.php
  24. 0 1
      htdocs/conf/conf.php.example
  25. 1 2
      htdocs/core/lib/functions.lib.php
  26. 5 12
      htdocs/core/modules/export/export_excel2007new.modules.php
  27. 2 2
      htdocs/core/modules/modSociete.class.php
  28. 77 54
      htdocs/core/modules/modStock.class.php
  29. 5 1
      htdocs/exports/class/export.class.php
  30. 41 39
      htdocs/exports/export.php
  31. 0 1
      htdocs/filefunc.inc.php
  32. 103 36
      htdocs/imports/import.php
  33. 0 4
      htdocs/includes/phpoffice/phpexcel/.gitattributes
  34. 0 9
      htdocs/includes/phpoffice/phpexcel/.gitignore
  35. 0 20
      htdocs/includes/phpoffice/phpexcel/.travis.yml
  36. 0 1139
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel.php
  37. 0 89
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Autoloader.php
  38. 0 295
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/APC.php
  39. 0 376
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php
  40. 0 219
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php
  41. 0 112
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/ICache.php
  42. 0 152
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Igbinary.php
  43. 0 312
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Memcache.php
  44. 0 125
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Memory.php
  45. 0 137
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/MemoryGZip.php
  46. 0 137
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/MemorySerialized.php
  47. 0 206
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php
  48. 0 306
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/SQLite.php
  49. 0 345
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/SQLite3.php
  50. 0 294
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Wincache.php
  51. 0 251
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorageFactory.php
  52. 0 98
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php
  53. 0 153
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CalcEngine/Logger.php
  54. 0 3952
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
  55. 0 725
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
  56. 0 1485
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php
  57. 0 2505
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php
  58. 0 52
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Exception.php
  59. 0 49
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/ExceptionHandler.php
  60. 0 2292
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php
  61. 0 614
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/FormulaParser.php
  62. 0 176
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/FormulaToken.php
  63. 0 149
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Function.php
  64. 0 725
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php
  65. 0 288
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Logical.php
  66. 0 876
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php
  67. 0 1376
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
  68. 0 3651
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
  69. 0 630
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php
  70. 0 115
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Token/Stack.php
  71. 0 351
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/functionlist.txt
  72. 0 1022
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell.php
  73. 0 192
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/AdvancedValueBinder.php
  74. 0 122
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataType.php
  75. 0 472
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataValidation.php
  76. 0 110
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
  77. 0 126
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/Hyperlink.php
  78. 0 46
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/IValueBinder.php
  79. 0 635
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart.php
  80. 0 584
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Axis.php
  81. 0 370
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/DataSeries.php
  82. 0 327
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/DataSeriesValues.php
  83. 0 52
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Exception.php
  84. 0 458
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/GridLines.php
  85. 0 445
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Layout.php
  86. 0 171
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Legend.php
  87. 0 128
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/PlotArea.php
  88. 0 359
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Properties.php
  89. 0 17
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt
  90. 0 855
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php
  91. 0 92
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Title.php
  92. 0 327
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Comment.php
  93. 0 587
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/DocumentProperties.php
  94. 0 218
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/DocumentSecurity.php
  95. 0 52
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Exception.php
  96. 0 202
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/HashTable.php
  97. 0 762
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Helper/HTML.php
  98. 0 43
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/IComparable.php
  99. 0 288
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/IOFactory.php
  100. 0 246
      htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/NamedRange.php

+ 1 - 1
.travis.yml

@@ -269,7 +269,7 @@ script:
   set -e
   #parallel-lint --exclude htdocs/includes --blame .
   parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
-  	--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
+  	--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
   	--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
   	--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
   	--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .

+ 0 - 1
COPYRIGHT

@@ -23,7 +23,6 @@ PEAR Mail_MIME         1.8.9         BSD                         Yes
 ParseDown              1.6           MIT License                 Yes             Markdown parser
 PCLZip                 2.8.4         LGPL-3+                     Yes             Library to zip/unzip files             
 PHPDebugBar            1.15.1        MIT License	             Yes             Used only by the module "debugbar" for developers
-PHPExcel               1.8.1         LGPL-2.1+                   Yes             Read/Write XLS files, read ODS files
 PHPSpreadSheet         ?             LGPL-2.1+                   Yes             Read/Write XLS files, read ODS files
 php-iban               1.4.7         LGPL-3+                     Yes             Parse and validate IBAN (and IIBAN) bank account information in PHP
 PHPoAuthLib            0.8.2         MIT License                 Yes             Library to provide oauth1 and oauth2 to different service

+ 97 - 0
ChangeLog

@@ -248,6 +248,103 @@ Following changes may create regressions for some external modules, but were nec
 * Depreciate all methods with name ->valide(). Use instead methods ->validate().
 * Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
 * Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
+* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
+
+
+***** ChangeLog for 12.0.4 compared to 12.0.3 *****
+FIX: make formConfirm an addreplace-type hook
+FIX: regex to remove 'action' parameter: taking feedback from PR#15213 into account
+FIX: remove 'action' parameter from redirect URL when reordering lines on a document
+FIX: error when displaying lines on order after adding a line if both MAIN_MULTILANGS and MAIN_DISABLE_PDF_AUTOUPDATE are activated
+FIX: on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
+FIX: set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity
+FIX: the stringent XSS protection provided by 'alphanohtml' causes problems with some clients who used basic tags (bold, italic, underline) in product labels. Using 'restricthtml' instead could be a good compromise.
+FIX: third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order)
+FIX: when the cronjob 'params' field is empty, the cron method is called with one empty string param instead of no params at all
+FIX: XSS protection too stringent -> replace 'alphanohtml' with 'restricthtml'
+FIX: #13067 including opening balance in calculation of displayed balance
+FIX: #14326
+FIX: #14649
+FIX: #14901
+FIX: #14927 Change ContratLigne property type to product_type
+FIX: #14979
+FIX: #15074
+FIX: #15111 Fix special characters output in PDF
+FIX: #15161 MO translation conflict
+FIX: #15163
+FIX: #15199
+FIX: #15208
+FIX: #15303
+FIX: #15365 export of extrafields for user and resources
+FIX: #15374 : "New" doesn't clear total amounts
+FIX: #15501
+FIX: #15572
+FIX: #15590
+FIX: #15618
+FIX: supplier proposals as linked objects of events are not correctly fetched
+FIX: when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
+FIX: Accountancy - Some ajustments on length of the account (general & auxiliary)
+FIX: admin conf selected
+FIX: also check if there is a method $object->fetch_thirdparty() before calling it
+FIX: autofocus on first setup
+FIX: Bad rigths to send contract
+FIX: Better error message with IMAP when connection fails
+FIX: Can create user but not update user with activedirectory
+FIX: Can receipt of a product that required lot after disabling stock and
+FIX: Can't create shipment for virtual product. Add
+FIX: cant empty action comm desc
+FIX: CA report by product/service : subcategory filter
+FIX: Clean orphan records in llx_ecm_files into repair script.
+FIX: default accountancy values and posted values
+FIX: Deletion of expensereport + other generated object not complete.
+FIX: disabled users must not be available in sales representative list on societe edit mode
+FIX: Dol print error : conf usage thirdparty propagate extrafields to
+FIX: Don't display inactive users in birthday box and company card
+FIX: empty value is needed on filter list
+FIX: enable HTML in product labels depending on conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML
+FIX: error 500 on cash closure
+FIX: excess comma
+FIX: Export FEC - Remove line at zero
+FIX: extrafield required error after submit
+FIX: filter on project list
+FIX: force payment mode to withdraw
+FIX: formating of prices with foreign languages
+FIX: handling $heightforinfotot when he's superior to a page height
+FIX: if no PDF default model in admin for expense report, do not create a PDF
+FIX: invoice payment terms edition: error management
+FIX: list of fields in list of recurring invoices was empty
+FIX: load default linked options for linked sellist extra fields
+FIX: Loan - Return on list when you cancel create form or delete a loan
+FIX: Missing lang trans
+FIX: no empty value in required extrafield
+FIX: Param joinfiles not sanitized
+FIX: Payment by BankTransfer
+FIX: pdf_getlinetotalwithtax must show total incl tax
+FIX: Problem on supplier payment card
+FIX: product auto volume calculation
+FIX: product customer prices: missing triggers in CRUD class
+FIX: Request on purchase orders in timeout even on very small databases
+FIX: set paid on total discount of a product in cash desk
+FIX: several warning with the barcode use in ODT templates
+FIX: SHIP MODE install v12 bug insert
+FIX: stripe for connect mode
+FIX: subcat filter
+FIX: supplier invoice: automatically calculate payment term when modifying payment condition
+FIX: SUPPLIER PROPOSAL v12 bug add
+FIX: table making extrafield input too small on advance target mailing
+FIX: table making extrafield too small advtagertmailing
+FIX: Unable to edit extrafields in expense report
+FIX: update margins rates on object line edit
+FIX: uses price2numjs
+FIX: various payments: bad data handling for subledger account + useless db commit/rollback
+FIX: virtual products: displayed value is by unit
+FIX: virtual products: supplier discount was not applied in component list
+FIX: warning for purchase order delivery late.
+FIX: Warning on late purchase order delivery
+FIX: WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty
+FIX: wrong tab
+FIX: Yogosha report 4425 (backport)
+FIX: Yogosha report 4434 (backport)
 
 ***** ChangeLog for 12.0.3 compared to 12.0.2 *****
 FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename

+ 1 - 1
build/debian/README.howto

@@ -306,7 +306,7 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
 - htdocs/includes/jquery/plugins/datatables
 - htdocs/includes/jszip
 - htdocs/includes/mike42
-- htdocs/includes/phpexcel or htdocs/includes/phpoffice
+- htdocs/includes/phpoffice
 - htdocs/includes/restler/framework/Luracast/Restler/explorer
 - htdocs/includes/swiftmailer
 - htdocs/includes/tcpdf or htdocs/includes/tecnickcom

+ 4 - 51
build/debian/copyright

@@ -37,7 +37,7 @@ Copyright: 2002-2009, Rodolphe Quiedeville   <rodolphe@quiedeville.org>
            2010, Servitux Servicios Informaticos <info@servitux.es>
            2011, Herve Prot                  <herve.prot@symeos.com>
            2011, Remy Younes                 <ryounes@gmail.com>
-           2012-2013, Christophe Battarel         <christophe.battarel@altairis.fr>
+           2012-2013, Christophe Battarel    <christophe.battarel@altairis.fr>
 	   
 License: GPL-3+
  This program is free software; you can redistribute it
@@ -189,36 +189,12 @@ License: CC-BY-SA-3.0
  For more information, see https://creativecommons.org/licenses/by-sa/3.0/
 
 
-------------------------------------------------------------
-
-Files: htdocs/includes/fpdfi/*
-Copyright: 2004-2011 Setasign - Jan Slabon
-License: GPL-2+
- This program is free software; you can redistribute it
- and/or modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later
- version.
- .
- This program 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 General Public License for more
- details.
- .
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- .
- On Debian systems, the full text of the GNU General Public
- License version 2 can be found in the file
- '/usr/share/common-licenses/GPL-2'.
-
 
 ------------------------------------------------------------
 
-Files: htdocs/includes/geoip/*
+Files: htdocs/includes/geoip2/*
 Copyright: 2007 MaxMind LLC
-License: LGPL-2.1+
+License: CC-By-SA
  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
@@ -380,30 +356,7 @@ License: GPL-2+
 
 ------------------------------------------------------------
 
-Files: htdocs/includes/phpexcel/*
-Copyright: 2006-2011 PHPExcel (http://www.codeplex.com/PHPExcel)
-License: LGPL-2.1+
- 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 program. If not, see <https://www.gnu.org/licenses/>.
- .
- On Debian systems, the full text of the GNU Lesser General Public
- License version 2.1 can be found in the file
- '/usr/share/common-licenses/LGPL-2.1'.
-
-
-------------------------------------------------------------
-
-Files: htdocs/includes/tcpdf/*
+Files: htdocs/includes/tecnickcom/*
 Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
 License: LGPL-3.0+
  TCPDF is free software: you can redistribute it and/or modify it

+ 0 - 1
build/debian/dolibarr.postinst

@@ -150,7 +150,6 @@ case "$1" in
 			##grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
 			#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config   || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
 			#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
-			##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
 			##grep -q -c "dolibarr_lib_TCPDF_PATH" $config    || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
 			#grep -q -c "dolibarr_js_CKEDITOR" $config       || [ ! -d "/usr/share/javascript/ckeditor" ]  || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
 			#grep -q -c "dolibarr_js_JQUERY" $config         || [ ! -d "/usr/share/javascript/jquery" ]    || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

+ 0 - 1
build/debian/install.forced.php.install

@@ -35,7 +35,6 @@ $force_install_distrib='debian';
 //$force_dolibarr_lib_GEOIP_PATH='';
 //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
 //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
-//$force_dolibarr_lib_PHPEXCEL_PATH='';	// Use '' or 'disabled'
 //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';	// Use '/javascript/ckeditor' or 'disabled'
 //$force_dolibarr_js_JQUERY='/javascript/jquery';
 //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';

+ 0 - 3
build/debian/rules

@@ -103,8 +103,6 @@ override_dh_install:
 
 	# clean from useless files
 	rm -fr htdocs/includes/jquery/plugins/multiselect
-	rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
-	rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
 	rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
 	rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
 	rm -fr htdocs/includes/tcpdf/fonts/utils
@@ -113,7 +111,6 @@ override_dh_install:
 
 	# Licence files are already included into copyright file.
 	rm -f  htdocs/includes/jquery/plugins/flot/LICENSE.txt
-	rm -f  htdocs/includes/phpexcel/license.txt
 	rm -f  htdocs/includes/tcpdf/LICENSE.TXT
 
 	# Drop unwanted executable permissions

+ 1 - 1
build/exe/doliwamp/doliwamp.iss

@@ -118,7 +118,7 @@ Source: "C:\wamp64\bin\mariadb\mariadb10.4.10\*.*"; DestDir: "{app}\bin\mariadb\
 ;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
 
 ; Dolibarr
-Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
+Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
 Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
 Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
 Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"

+ 0 - 7
build/makepack-dolibarr.pl

@@ -616,13 +616,6 @@ if ($nboftargetok) {
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PDF`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;

+ 0 - 1
build/rpm/dolibarr_fedora.spec

@@ -274,7 +274,6 @@ then
   #grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_lib_NUSOAP_PATH" $config    || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
   grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
-  #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
   #grep -q -c "dolibarr_lib_TCPDF_PATH" $config    || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_js_CKEDITOR" $config        || [ ! -d "/usr/share/javascript/ckeditor" ]  || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
   grep -q -c "dolibarr_js_JQUERY" $config          || [ ! -d "/usr/share/javascript/jquery" ]    || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

+ 0 - 1
build/rpm/dolibarr_generic.spec

@@ -424,7 +424,6 @@ then
   #grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_lib_NUSOAP_PATH" $config    || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
   grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
-  #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
   #grep -q -c "dolibarr_lib_TCPDF_PATH" $config    || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_js_CKEDITOR" $config        || [ ! -d "/usr/share/javascript/ckeditor" ]  || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
   grep -q -c "dolibarr_js_JQUERY" $config          || [ ! -d "/usr/share/javascript/jquery" ]    || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

+ 0 - 1
build/rpm/dolibarr_mandriva.spec

@@ -271,7 +271,6 @@ then
   #grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_lib_NUSOAP_PATH" $config    || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
   grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
-  #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
   #grep -q -c "dolibarr_lib_TCPDF_PATH" $config    || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_js_CKEDITOR" $config        || [ ! -d "/usr/share/javascript/ckeditor" ]  || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
   grep -q -c "dolibarr_js_JQUERY" $config          || [ ! -d "/usr/share/javascript/jquery" ]    || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

+ 0 - 1
build/rpm/dolibarr_opensuse.spec

@@ -282,7 +282,6 @@ then
   #grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_lib_NUSOAP_PATH" $config    || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
   grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
-  #grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
   #grep -q -c "dolibarr_lib_TCPDF_PATH" $config    || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
   grep -q -c "dolibarr_js_CKEDITOR" $config        || [ ! -d "/usr/share/javascript/ckeditor" ]  || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
   grep -q -c "dolibarr_js_JQUERY" $config          || [ ! -d "/usr/share/javascript/jquery" ]    || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

+ 0 - 1
build/rpm/install.forced.php.fedora

@@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
 //$force_dolibarr_lib_GEOIP_PATH='';
 $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
 //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
-$force_dolibarr_lib_PHPEXCEL_PATH='';
 $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
 //$force_dolibarr_js_JQUERY='/javascript/jquery';

+ 0 - 1
build/rpm/install.forced.php.mandriva

@@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
 //$force_dolibarr_lib_GEOIP_PATH='';
 $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
 //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
-$force_dolibarr_lib_PHPEXCEL_PATH='';
 $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
 //$force_dolibarr_js_JQUERY='/javascript/jquery';

+ 0 - 1
build/rpm/install.forced.php.opensuse

@@ -25,7 +25,6 @@ $force_install_distrib='rpmopensuse';
 //$force_dolibarr_lib_GEOIP_PATH='';
 //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
 //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
-$force_dolibarr_lib_PHPEXCEL_PATH='';
 $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
 //$force_dolibarr_js_JQUERY='/javascript/jquery';

+ 0 - 62
composer.lock

@@ -278,68 +278,6 @@
             },
             "time": "2020-10-19T12:22:11+00:00"
         },
-        {
-            "name": "phpoffice/phpexcel",
-            "version": "1.8.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/PHPOffice/PHPExcel.git",
-                "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
-                "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
-                "shasum": ""
-            },
-            "require": {
-                "ext-xml": "*",
-                "ext-xmlwriter": "*",
-                "php": ">=5.2.0"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-0": {
-                    "PHPExcel": "Classes/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "LGPL"
-            ],
-            "authors": [
-                {
-                    "name": "Maarten Balliauw",
-                    "homepage": "http://blog.maartenballiauw.be"
-                },
-                {
-                    "name": "Mark Baker"
-                },
-                {
-                    "name": "Franck Lefevre",
-                    "homepage": "http://blog.rootslabs.net"
-                },
-                {
-                    "name": "Erik Tilt"
-                }
-            ],
-            "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
-            "homepage": "http://phpexcel.codeplex.com",
-            "keywords": [
-                "OpenXML",
-                "excel",
-                "php",
-                "spreadsheet",
-                "xls",
-                "xlsx"
-            ],
-            "support": {
-                "issues": "https://github.com/PHPOffice/PHPExcel/issues",
-                "source": "https://github.com/PHPOffice/PHPExcel/tree/master"
-            },
-            "abandoned": "phpoffice/phpspreadsheet",
-            "time": "2015-05-01T07:00:55+00:00"
-        },
         {
             "name": "psr/log",
             "version": "1.1.3",

+ 0 - 8
dev/dolibarr_changes.txt

@@ -218,14 +218,6 @@ JQUERYFILETREE:
 * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
 
 
-PHPEXCEL:
----------
-* Replace in htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
-    continue;
-with:
-    continue 2;
-
-
 RESTLER:
 --------
 Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html

+ 1 - 1
htdocs/accountancy/class/accountancyexport.class.php

@@ -801,7 +801,7 @@ class AccountancyExport
 	public function exportFEC($objectLines)
 	{
 		$separator = "\t";
-		$end_line = "\n";
+		$end_line = "\r\n";
 
 		print "JournalCode".$separator;
 		print "JournalLib".$separator;

+ 0 - 2
htdocs/admin/system/constall.php

@@ -77,7 +77,6 @@ $configfileparameters = array(
 							'?dolibarr_lib_FPDI_PATH',
 							'?dolibarr_lib_TCPDI_PATH',
 							'?dolibarr_lib_NUSOAP_PATH',
-							'?dolibarr_lib_PHPEXCEL_PATH',
 							'?dolibarr_lib_GEOIP_PATH',
 							'?dolibarr_lib_ODTPHP_PATH',
 							'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
@@ -124,7 +123,6 @@ $configfilelib = array(
 					'dolibarr_lib_TCPDF_PATH',
 					'dolibarr_lib_FPDI_PATH',
 					'dolibarr_lib_NUSOAP_PATH',
-					'dolibarr_lib_PHPEXCEL_PATH',
 					'dolibarr_lib_GEOIP_PATH',
 					'dolibarr_lib_ODTPHP_PATH',
 					'dolibarr_lib_ODTPHP_PATHTOPCLZIP',

+ 0 - 1
htdocs/admin/system/dolibarr.php

@@ -319,7 +319,6 @@ $configfileparameters = array(
 		'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
 		'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
 		'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
-		'?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
 		'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
 		'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
 		'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',

+ 2 - 2
htdocs/commande/card.php

@@ -644,8 +644,8 @@ if (empty($reshook))
 			$tva_tx = '';
 		}
 
-		$qty = GETPOST('qty'.$predef);
-		$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'));
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
 
 		// Extrafields
 		$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);

+ 0 - 1
htdocs/conf/conf.php.example

@@ -335,7 +335,6 @@ $dolibarr_cron_allow_cli='0';
 //$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
 //$dolibarr_lib_GEOIP_PATH='';
 //$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
-//$dolibarr_lib_PHPEXCEL_PATH='';
 //$dolibarr_lib_ODTPHP_PATH='';
 //$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip";
 // Value to overwrite path to use shared javascript instead of embedded one

+ 1 - 2
htdocs/core/lib/functions.lib.php

@@ -7090,8 +7090,7 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
 			$temp = array();
 			foreach (array_keys($array) as $key)
 			{
-				if (is_object($array[$key]))
-				{
+				if (is_object($array[$key])) {
 					$temp[$key] = $array[$key]->$index;
 				} else {
 					$temp[$key] = $array[$key][$index];

+ 5 - 12
htdocs/core/modules/export/export_excel2007new.modules.php

@@ -87,16 +87,13 @@ class ExportExcel2007new extends ModeleExports
 		$this->version = '1.30'; // Driver version
 		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
 
-		$this->disabled = (in_array(constant('PHPEXCEL_PATH'), array('disabled', 'disabled/')) ? 1 : 0); // A condition to disable module (used for native debian packages)
+		$this->disabled = 0;
 
 		if (empty($this->disabled))
 		{
-				//require_once PHPEXCEL_PATH.'PHPExcel.php';
-				//require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
-				//$this->label_lib='PhpExcel';
-				require_once PHPEXCELNEW_PATH.'Spreadsheet.php';
-				$this->label_lib = 'PhpSpreadSheet';
-				$this->version_lib = '1.6.0'; // No way to get info from library
+			require_once PHPEXCELNEW_PATH.'Spreadsheet.php';
+			$this->label_lib = 'PhpSpreadSheet';
+			$this->version_lib = '1.6.0'; // No way to get info from library
 		}
 
 		$this->row = 0;
@@ -198,15 +195,13 @@ class ExportExcel2007new extends ModeleExports
 
 		$outputlangs->load("exports");
 
-		//require_once PHPEXCEL_PATH.'PHPExcel.php';
-		//require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
 		require_once DOL_DOCUMENT_ROOT.'/includes/phpoffice/autoloader.php';
 		require_once DOL_DOCUMENT_ROOT.'/includes/Psr/autoloader.php';
 		require_once PHPEXCELNEW_PATH.'Spreadsheet.php';
 
 		if ($this->id == 'excel2007new')
 		{
-			if (!class_exists('ZipArchive'))	// For Excel2007, PHPExcel need ZipArchive
+			if (!class_exists('ZipArchive'))	// For Excel2007, PHPSpreadSheet may need ZipArchive
 			{
 				$langs->load("errors");
 				$this->error = $langs->trans('ErrorPHPNeedModule', 'zip');
@@ -214,7 +209,6 @@ class ExportExcel2007new extends ModeleExports
 			}
 		}
 
-		//$this->workbook = new PHPExcel();
 		$this->workbook = new Spreadsheet();
 		$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - '.DOL_APPLICATION_TITLE.' '.DOL_VERSION);
 		//$this->workbook->getProperties()->setLastModifiedBy('Dolibarr '.DOL_VERSION);
@@ -352,7 +346,6 @@ class ExportExcel2007new extends ModeleExports
 			} else {
 				if ($typefield == 'Text' || $typefield == 'TextAuto')
 				{
-					//$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
 					$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, (string) $newvalue);
 					$coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
 					$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');

+ 2 - 2
htdocs/core/modules/modSociete.class.php

@@ -490,7 +490,7 @@ class modSociete extends DolibarrModules
 				'classfile' => '/core/class/cstate.class.php',
 				'class' => 'Cstate',
 				'method' => 'fetch',
-				'dict' => 'DictionaryState'
+				'dict' => 'DictionaryStateCode'
 			),
 			's.fk_pays' => array(
 				'rule' => 'fetchidfromcodeid',
@@ -670,7 +670,7 @@ class modSociete extends DolibarrModules
 				'classfile' => '/core/class/cstate.class.php',
 				'class' => 'Cstate',
 				'method' => 'fetch',
-				'dict' => 'DictionaryState'
+				'dict' => 'DictionaryStateCode'
 			),
 			's.fk_pays' => array(
 				'rule' => 'fetchidfromcodeid',

+ 77 - 54
htdocs/core/modules/modStock.class.php

@@ -190,7 +190,7 @@ class modStock extends DolibarrModules
 
 		// Export warehouses
 		$r++;
-		$this->export_code[$r] = $this->rights_class.'_warehouses';
+		$this->export_code[$r] = $this->rights_class.'_emplacement';
 		$this->export_label[$r] = "Warehouses"; // Translation key (used only if key ExportDataset_xxx_z not found)
 		$this->export_icon[$r] = "warehouse";
 		$this->export_permission[$r] = array(array("stock", "lire"));
@@ -217,28 +217,31 @@ class modStock extends DolibarrModules
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot_extrafields as extra ON extra.fk_object = e.rowid';
 		$this->export_sql_end[$r] .= ' WHERE e.entity IN ('.getEntity('stock').')';
 
+		// Export stock (without batch number)
 		$r++;
-		$this->export_code[$r] = $this->rights_class;
-		$this->export_label[$r] = "WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found)
+		$this->export_code[$r] = $this->rights_class.'_emplacement_product';
+		$this->export_label[$r] = "Stocks"; // Translation key (used only if key ExportDataset_xxx_z not found)
+		$this->export_icon[$r] = "warehouse";
 		$this->export_permission[$r] = array(array("stock", "lire"));
 		$this->export_fields_array[$r] = array(
-			'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address',
-			'e.zip'=>'Zip', 'e.town'=>'Town', 'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description",
-			'p.note'=>"Note", 'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation',
-			'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice'
+			'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address', 'e.zip'=>'Zip', 'e.town'=>'Town',
+			'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note",
+			'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration",
+			'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice',
 		);
 		$this->export_TypeFields_array[$r] = array(
-			'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text', 'p.rowid'=>"List:product:label::product",
-			'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text", 'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric',
-			'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric',
+			'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
+			'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
+			'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree",
+			'p.datec'=>'Date', 'p.tms'=>'Date', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric',
 			'ps.reel'=>'Numeric'
 		);
 		$this->export_entities_array[$r] = array(
-			'e.rowid'=>'warehouse', 'e.ref'=>'warehouse', 'e.description'=>'warehouse', 'e.lieu'=>'warehouse', 'e.address'=>'warehouse', 'e.zip'=>'warehouse',
-			'e.town'=>'warehouse', 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product",
-			'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product",
-			'p.datec'=>'product', 'p.tms'=>'product', 'p.pmp'=>'product', 'p.cost_price'=>'product', 'ps.reel'=>'stock'
-		);
+			'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
+			'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product",
+			'p.datec'=>'product', 'p.tms'=>'product', 'p.pmp'=>'product', 'p.cost_price'=>'product',
+			'ps.reel'=>'stock'
+		);	// We define here only fields that use another icon that the one defined into export_icon
 		$this->export_aggregate_array[$r] = array('ps.reel'=>'SUM'); // TODO Not used yet
 		$this->export_dependencies_array[$r] = array('stock'=>array('p.rowid', 'e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them.
 		$keyforselect = 'product'; $keyforelement = 'product'; $keyforaliasextra = 'extra';
@@ -249,73 +252,78 @@ class modStock extends DolibarrModules
 		$this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'product as p LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON extra.fk_object = p.rowid, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e';
 		$this->export_sql_end[$r] .= ' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid';
 		$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
+
+		// Export stock including batch number
 		if ($conf->productbatch->enabled)
 		{
-			// Export of stock including lot number
 			$langs->load("productbatch");
 
 			// This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch
 			$r++;
 
-			$this->export_code[$r] = $this->rights_class.'_lot';
-			$this->export_label[$r] = "WarehousesAndProductsBatchDetail"; // Translation key (used only if key ExportDataset_xxx_z not found)
+			$this->export_code[$r] = $this->rights_class.'_emplacement_product_lot';
+			$this->export_label[$r] = "StocksWithBatch"; // Translation key (used only if key ExportDataset_xxx_z not found)
+			$this->export_icon[$r] = "warehouse";
 			$this->export_permission[$r] = array(array("stock", "lire"));
 			$this->export_fields_array[$r] = array(
-				'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address',
-				'e.zip'=>'Zip', 'e.town'=>'Town', 'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description",
-				'p.note'=>"Note", 'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation',
-				'p.tms'=>'DateModification', 'pb.rowid'=>'Id', 'pb.batch'=>'Batch', 'pb.qty'=>'Qty', 'pl.eatby'=>'EatByDate', 'pl.sellby'=>'SellByDate'
+				'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address', 'e.zip'=>'Zip', 'e.town'=>'Town',
+				'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note",
+				'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration",
+				'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice',
+				'pb.rowid'=>'Id', 'pb.batch'=>'Batch', 'pb.qty'=>'Qty',
+				'pl.eatby'=>'EatByDate', 'pl.sellby'=>'SellByDate'
 			);
 			$this->export_TypeFields_array[$r] = array(
 				'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.description'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
 				'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
-				'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date',
-				'pb.batch'=>'Text', 'pb.qty'=>'Numeric', 'pl.eatby'=>'Date', 'pl.sellby'=>'Date'
+				'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree",
+				'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice',
+				'pb.batch'=>'Text', 'pb.qty'=>'Numeric',
+				'pl.eatby'=>'Date', 'pl.sellby'=>'Date'
 			);
 			$this->export_entities_array[$r] = array(
-				'e.rowid'=>'warehouse', 'e.ref'=>'warehouse', 'e.description'=>'warehouse', 'e.lieu'=>'warehouse', 'e.address'=>'warehouse', 'e.zip'=>'warehouse',
-				'e.town'=>'warehouse', 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product",
-				'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product",
-				'p.datec'=>'product', 'p.tms'=>'product', 'pb.rowid'=>'stockbatch', 'pb.batch'=>'stockbatch', 'pb.qty'=>'stockbatch', 'pl.eatby'=>'batch',
-				'pl.sellby'=>'batch'
-			);
+				'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
+				'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product",
+				'p.datec'=>'product', 'p.tms'=>'product', 'p.pmp'=>'product', 'p.cost_price'=>'product',
+				'pb.rowid'=>'batch', 'pb.batch'=>'batch', 'pb.qty'=>'batch',
+				'pl.eatby'=>'batch', 'pl.sellby'=>'batch'
+			);	// We define here only fields that use another icon that the one defined into export_icon
 			$this->export_aggregate_array[$r] = array('ps.reel'=>'SUM'); // TODO Not used yet
 			$this->export_dependencies_array[$r] = array('stockbatch'=>array('pb.rowid'), 'batch'=>array('pb.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
 			$keyforselect = 'product_lot'; $keyforelement = 'batch'; $keyforaliasextra = 'extra';
 			include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
+
 			$this->export_sql_start[$r] = 'SELECT DISTINCT ';
 			$this->export_sql_end[$r]  = ' FROM ('.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'product_batch as pb)';
 			$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl ON pl.fk_product = p.rowid AND pl.batch = pb.batch';
 			$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot_extrafields as extra ON extra.fk_object = pl.rowid,';
 			$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'entrepot as e';
 			$this->export_sql_end[$r] .= ' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid AND ps.rowid = pb.fk_product_stock';
-			$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
-		}
+			$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';		}
 
-		// Export of stock movement
+		// Export of stock movements
 		$r++;
 		$this->export_code[$r] = $this->rights_class.'_movement';
 		$this->export_label[$r] = "StockMovements"; // Translation key (used only if key ExportDataset_xxx_z not found)
+		$this->export_icon[$r] = "movement";
 		$this->export_permission[$r] = array(array("stock", "lire"));
 		$this->export_fields_array[$r] = array(
-			'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address', 'e.zip'=>'Zip',
-			'e.town'=>'Town', 'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note",
-			'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation',
-			'p.tms'=>'DateModification', 'sm.rowid'=>'MovementId', 'sm.value'=>'Qty', 'sm.datem'=>'DateMovement', 'sm.label'=>'MovementLabel',
-			'sm.inventorycode'=>'InventoryCode'
+			'sm.rowid'=>'MovementId', 'sm.value'=>'Qty', 'sm.datem'=>'DateMovement', 'sm.label'=>'MovementLabel', 'sm.inventorycode'=>'InventoryCode',
+			'e.rowid'=>'IdWarehouse', 'e.ref'=>'LocationSummary', 'e.description'=>'DescWareHouse', 'e.lieu'=>'LieuWareHouse', 'e.address'=>'Address', 'e.zip'=>'Zip', 'e.town'=>'Town',
+			'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note",
+			'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification'
 		);
 		$this->export_TypeFields_array[$r] = array(
+			'sm.rowid'=>'Numeric', 'sm.value'=>'Numeric', 'sm.datem'=>'Date', 'sm.batch'=>'Text', 'sm.label'=>'Text', 'sm.inventorycode'=>'Text',
 			'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.description'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text',
 			'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text",
-			'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date',
-			'sm.rowid'=>'Numeric', 'sm.value'=>'Numeric', 'sm.datem'=>'Date', 'sm.batch'=>'Text', 'sm.label'=>'Text', 'sm.inventorycode'=>'Text'
+			'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date'
 		);
 		$this->export_entities_array[$r] = array(
-			'e.rowid'=>'warehouse', 'e.ref'=>'warehouse', 'e.description'=>'warehouse', 'e.lieu'=>'warehouse', 'e.address'=>'warehouse', 'e.zip'=>'warehouse',
-			'e.town'=>'warehouse', 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product",
-			'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product',
-			'p.tms'=>'product', 'sm.rowid'=>'movement', 'sm.value'=>'movement', 'sm.datem'=>'movement', 'sm.label'=>'movement', 'sm.inventorycode'=>'movement'
-		);
+			'e.rowid'=>'warehouse', 'e.ref'=>'warehouse', 'e.description'=>'warehouse', 'e.lieu'=>'warehouse', 'e.address'=>'warehouse', 'e.zip'=>'warehouse', 'e.town'=>'warehouse',
+			'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
+			'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product'
+		);	// We define here only fields that use another icon that the one defined into export_icon
 		if ($conf->productbatch->enabled)
 		{
 			$this->export_fields_array[$r]['sm.batch'] = 'Batch';
@@ -324,6 +332,7 @@ class modStock extends DolibarrModules
 		}
 		$this->export_aggregate_array[$r] = array('sm.value'=>'SUM'); // TODO Not used yet
 		$this->export_dependencies_array[$r] = array('movement'=>array('sm.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
+
 		$this->export_sql_start[$r] = 'SELECT DISTINCT ';
 		$this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'stock_mouvement as sm, '.MAIN_DB_PREFIX.'entrepot as e';
 		$this->export_sql_end[$r] .= ' WHERE p.rowid = sm.fk_product AND sm.fk_entrepot = e.rowid';
@@ -338,34 +347,48 @@ class modStock extends DolibarrModules
 		$r++;
 		$this->import_code[$r] = $this->rights_class.'_'.$r;
 		$this->import_label[$r] = "Warehouses"; // Translation key
-		$this->import_icon[$r] = $this->picto;
+		$this->import_icon[$r] = "warehouse";
 		$this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
 		$this->import_tables_array[$r] = array('e'=>MAIN_DB_PREFIX.'entrepot');
 		$this->import_tables_creator_array[$r] = array('e'=>'fk_user_author');
 		$this->import_fields_array[$r] = array('e.ref'=>"LocationSummary*",
-				'e.description'=>"DescWareHouse", 'e.lieu'=>"LieuWareHouse",
-				'e.address'=>"Address", 'e.zip'=>'Zip', 'e.fk_pays'=>'CountryCode',
+				'e.description'=>"DescWareHouse",
+				'e.lieu'=>"LieuWareHouse",
+				'e.address'=>"Address",
+				'e.zip'=>'Zip',
+				'e.fk_departement'=>'StateCode',
+				'e.fk_pays'=>'CountryCode',
+				'e.phone'=>'Phone',
+				'e.fax'=>'Fax',
 				'e.statut'=>'Status',
 				'e.fk_parent'=>'ParentWarehouse'
 		);
 
 		$this->import_convertvalue_array[$r] = array(
+				'e.fk_departement'=>array('rule'=>'fetchidfromcodeid', 'classfile'=>'/core/class/cstate.class.php', 'class'=>'Cstate', 'method'=>'fetch', 'dict'=>'DictionaryStateCode'),
 				'e.fk_pays'=>array('rule'=>'fetchidfromcodeid', 'classfile'=>'/core/class/ccountry.class.php', 'class'=>'Ccountry', 'method'=>'fetch', 'dict'=>'DictionaryCountry'),
 				'e.fk_parent'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/stock/class/entrepot.class.php', 'class'=>'Entrepot', 'method'=>'fetch', 'element'=>'ref')
 		);
 		$this->import_regex_array[$r] = array('e.statut'=>'^[0|1]');
 		$this->import_examplevalues_array[$r] = array('e.ref'=>"ALM001",
-				'e.description'=>"Central Warehouse", 'e.lieu'=>"Central",
-				'e.address'=>"Route 66", 'e.zip'=>'28080', 'e.fk_pays'=>'US',
+				'e.description'=>"Central Warehouse",
+				'e.lieu'=>"Central",
+				'e.address'=>"Route 66",
+				'e.zip'=>'28080',
+				'e.fk_departement'=>'matches field "code_departement" in table "'.MAIN_DB_PREFIX.'c_departements"',
+				'e.fk_pays'=>'US/FR/DE etc. matches field "code" in table "'.MAIN_DB_PREFIX.'c_country"',
+				'e.phone'=>'(+33)(0)123456789',
+				'e.fax'=>'(+33)(0)123456790',
 				'e.statut'=>'1',
-				'e.fk_parent'=>''
-		);
+                'e.fk_parent'=>'id or ref of warehouse'
+        );
+        $this->import_updatekeys_array[$r] = array('p.ref'=>'Ref');
 
 		// Import stocks
 		$r++;
 		$this->import_code[$r] = $this->rights_class.'_'.$r;
 		$this->import_label[$r] = "Stocks"; // Translation key
-		$this->import_icon[$r] = $this->picto;
+		$this->import_icon[$r] = "stock";
 		$this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
 		$this->import_tables_array[$r] = array('ps'=>MAIN_DB_PREFIX.'product_stock');
 		$this->import_fields_array[$r] = array('ps.fk_product'=>"Product*", 'ps.fk_entrepot'=>"Warehouse*", 'ps.reel'=>"Stock*");
@@ -375,7 +398,7 @@ class modStock extends DolibarrModules
 			'ps.fk_entrepot'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/stock/class/entrepot.class.php', 'class'=>'Entrepot', 'method'=>'fetch', 'element'=>'ref')
 		  );
 		$this->import_examplevalues_array[$r] = array(
-			'ps.fk_product'=>"PREF123456", 'ps.fk_entrepot'=>"ALM001", 'ps.reel'=>"10"
+		    'ps.fk_product'=>"id or ref of product", 'ps.fk_entrepot'=>"id or ref of warehouse", 'ps.reel'=>"10"
 		);
 		$this->import_updatekeys_array[$r] = array('ps.fk_product'=>'Product', 'ps.fk_entrepot'=>"Warehouse");
 		$this->import_run_sql_after_array[$r] = array(    // Because we may change data that are denormalized, we must update dernormalized data after.

+ 5 - 1
htdocs/exports/class/export.class.php

@@ -37,7 +37,8 @@ class Export
 
 	public $error;
 
-	public $array_export_code = array(); // Tableau de "idmodule_numlot"
+	public $array_export_code = array(); // Tableau de "idmodule_numexportprofile"
+	public $array_export_code_for_sort = array(); // Tableau de "idmodule_numexportprofile"
 	public $array_export_module = array(); // Tableau de "nom de modules"
 	public $array_export_label = array(); // Tableau de "libelle de lots"
 	public $array_export_sql_start = array(); // Tableau des "requetes sql"
@@ -165,6 +166,7 @@ class Export
 										}
 									}
 
+
 									// Module
 									$this->array_export_module[$i] = $module;
 									// Permission
@@ -173,6 +175,8 @@ class Export
 									$this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto);
 									// Code du dataset export
 									$this->array_export_code[$i] = $module->export_code[$r];
+									// Define a key for sort
+									$this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r];	// Add a key into the module
 									// Libelle du dataset export
 									$this->array_export_label[$i] = $module->getExportDatasetLabel($r);
 									// Tableau des champ a exporter (cle=champ, valeur=libelle)

+ 41 - 39
htdocs/exports/export.php

@@ -39,6 +39,7 @@ $langs->loadlangs(array('admin', 'exports', 'other', 'users', 'companies', 'proj
 //if (! $user->admin)
 //  accessforbidden();
 
+// Map icons, array duplicated in import.php, was not synchronized, TODO put it somewhere only once
 $entitytoicon = array(
 	'invoice'      => 'bill',
 	'invoice_line' => 'bill',
@@ -53,14 +54,14 @@ $entitytoicon = array(
 	'subscription' => 'payment',
 	'payment'      => 'payment',
 	'tax'          => 'generic',
-	'tax_type'     => 'generic',
-	'stock'        => 'generic',
-	'other'        => 'generic',
+    'tax_type'     => 'generic',
+    'other'        => 'generic',
 	'account'      => 'account',
 	'product'      => 'product',
 	'virtualproduct'=>'product',
 	'subproduct'   => 'product',
 	'product_supplier_ref'      => 'product',
+    'stock'        => 'stock',
 	'warehouse'    => 'stock',
 	'batch'        => 'stock',
 	'stockbatch'   => 'stock',
@@ -78,7 +79,7 @@ $entitytoicon = array(
 	'bomline'      => 'bom'
 );
 
-// Translation code
+// Translation code, array duplicated in import.php, was not synchronized, TODO put it somewhere only once
 $entitytolang = array(
 	'user'         => 'User',
 	'company'      => 'Company',
@@ -444,21 +445,23 @@ if ($step == 1 || !$datatoexport)
 
 	if (count($objexport->array_export_module))
 	{
-		$sortedarrayofmodules = dol_sort_array($objexport->array_export_module, 'module_position', 'asc', 0, 0, 1);
-		foreach ($sortedarrayofmodules as $key => $value)
+		asort($objexport->array_export_code_for_sort);
+		//var_dump($objexport->array_export_code_for_sort);
+		//$sortedarrayofmodules = dol_sort_array($objexport->array_export_module, 'module_position', 'asc', 0, 0, 1);
+		foreach ($objexport->array_export_code_for_sort as $key => $value)
 		{
 			print '<tr class="oddeven"><td nospan="nospan">';
 			//print img_object($objexport->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' ';
 			print $objexport->array_export_module[$key]->getName();
 			print '</td><td>';
-			$icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[$key]);
+			$entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[$key]);
+			$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
 			$label = $objexport->array_export_label[$key];
 			//print $value.'-'.$icon.'-'.$label."<br>";
-			print img_object($objexport->array_export_module[$key]->getName(), $icon).' ';
+			print img_object($objexport->array_export_module[$key]->getName(), $entityicon).' ';
 			print $label;
 			print '</td><td class="right">';
-			if ($objexport->array_export_perms[$key])
-			{
+			if ($objexport->array_export_perms[$key]) {
 				print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').'</a>';
 			} else {
 				print $langs->trans("NotEnoughPermissions");
@@ -499,19 +502,17 @@ if ($step == 2 && $datatoexport)
 	// Module
 	print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
 	print '<td>';
-	//print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
 	print $objexport->array_export_module[0]->getName();
 	print '</td></tr>';
 
-	// Lot de donnees a exporter
-	print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
-	print '<td>';
-	$icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
-	$label = $objexport->array_export_label[0];
-	//print $value.'-'.$icon.'-'.$label."<br>";
-	print img_object($objexport->array_export_module[0]->getName(), $icon).' ';
-	print $label;
-	print '</td></tr>';
+    // Lot de donnees a exporter
+    print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
+    print '<td>';
+    $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+    $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+    print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
+    print $objexport->array_export_label[0];
+    print '</td></tr>';
 
 	print '</table>';
 	print '</div>';
@@ -703,11 +704,10 @@ if ($step == 3 && $datatoexport)
 	// Lot de donnees a exporter
 	print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
 	print '<td>';
-	$icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
-	$label = $objexport->array_export_label[0];
-	//print $value.'-'.$icon.'-'.$label."<br>";
-	print img_object($objexport->array_export_module[0]->getName(), $icon).' ';
-	print $label;
+	$entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
+	print $objexport->array_export_label[0];
 	print '</td></tr>';
 
 	// Nbre champs exportes
@@ -888,13 +888,14 @@ if ($step == 4 && $datatoexport)
 	print $objexport->array_export_module[0]->getName();
 	print '</td></tr>';
 
-	// Lot de donnees a exporter
-	print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
-	print '<td>';
-	$icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
-	print img_object($objexport->array_export_module[0]->getName(), $icon).' ';
-	print $objexport->array_export_label[0];
-	print '</td></tr>';
+    // Lot de donnees a exporter
+    print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
+    print '<td>';
+	$entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+    print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
+    print $objexport->array_export_label[0];
+    print '</td></tr>';
 
 	// List of exported fields
 	print '<tr><td>'.$langs->trans("ExportedFields").'</td>';
@@ -1155,13 +1156,14 @@ if ($step == 5 && $datatoexport)
 	print $objexport->array_export_module[0]->getName();
 	print '</td></tr>';
 
-	// Dataset to export
-	print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
-	print '<td>';
-	$icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
-	print img_object($objexport->array_export_module[0]->getName(), $icon).' ';
-	print $objexport->array_export_label[0];
-	print '</td></tr>';
+    // Dataset to export
+    print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
+    print '<td>';
+    $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+    $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+    print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
+    print $objexport->array_export_label[0];
+    print '</td></tr>';
 
 	// List of exported fields
 	print '<tr><td>'.$langs->trans("ExportedFields").'</td>';

+ 0 - 1
htdocs/filefunc.inc.php

@@ -245,7 +245,6 @@ if (!defined('ADODB_PATH')) { define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_P
 if (!defined('TCPDF_PATH')) { define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH.'/'); }
 if (!defined('TCPDI_PATH')) { define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/tcpdi/' : $dolibarr_lib_TCPDI_PATH.'/'); }
 if (!defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/' : (empty($dolibarr_lib_NUSOAP_PATH) ? '' : $dolibarr_lib_NUSOAP_PATH.'/')); }
-if (!defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpexcel/Classes/' : (empty($dolibarr_lib_PHPEXCEL_PATH) ? '' : $dolibarr_lib_PHPEXCEL_PATH.'/')); }
 if (!defined('PHPEXCELNEW_PATH')) { define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/phpoffice/PhpSpreadsheet/' : (empty($dolibarr_lib_PHPEXCELNEW_PATH) ? '' : $dolibarr_lib_PHPEXCELNEW_PATH.'/')); }
 if (!defined('ODTPHP_PATH')) { define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/odtphp/' : (empty($dolibarr_lib_ODTPHP_PATH) ? '' : $dolibarr_lib_ODTPHP_PATH.'/')); }
 if (!defined('ODTPHP_PATHTOPCLZIP')) { define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP)) ?DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/' : (empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP) ? '' : $dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/')); }

+ 103 - 36
htdocs/imports/import.php

@@ -38,31 +38,93 @@ $langs->loadLangs(array('exports', 'compta', 'errors'));
 // Security check
 $result = restrictedArea($user, 'import');
 
+// Map icons, array duplicated in export.php, was not synchronized, TODO put it somewhere only once
 $entitytoicon = array(
-	'invoice'=>'bill', 'invoice_line'=>'bill',
-	'order'=>'order', 'order_line'=>'order',
-	'intervention'=>'intervention', 'inter_line'=>'intervention',
-	'member'=>'user', 'member_type'=>'group', 'subscription'=>'payment',
-	'tax'=>'bill', 'tax_type'=>'generic',
-	'account'=>'account',
-	'payment'=>'payment',
-	'product'=>'product', 'stock'=>'generic', 'warehouse'=>'stock',
-	'category'=>'generic',
-	'other'=>'generic'
+	'invoice'      => 'bill',
+    'invoice_line' => 'bill',
+	'order'        => 'order',
+    'order_line'   => 'order',
+	'propal'       => 'propal',
+    'propal_line'  => 'propal',
+	'intervention' => 'intervention',
+    'inter_line'   => 'intervention',
+	'member'       => 'user',
+    'member_type'  => 'group',
+    'subscription' => 'payment',
+    'payment'      => 'payment',
+	'tax'          => 'bill',
+    'tax_type'     => 'generic',
+    'other'        => 'generic',
+	'account'      => 'account',
+	'product'      => 'product',
+    'virtualproduct'=>'product',
+	'subproduct'   => 'product',
+	'product_supplier_ref'      => 'product',
+    'stock'        => 'stock',
+	'warehouse'    => 'stock',
+	'batch'        => 'stock',
+	'stockbatch'   => 'stock',
+	'category'     => 'category',
+	'shipment'     => 'sending',
+    'shipment_line'=> 'sending',
+    'reception'=> 'sending',
+    'reception_line'=> 'sending',
+	'expensereport'=> 'trip',
+    'expensereport_line'=> 'trip',
+	'holiday'      => 'holiday',
+    'contract_line' => 'contract',
+    'translation'  => 'generic',
+    'bomm'         => 'bom',
+    'bomline'      => 'bom'
 );
-$entitytolang = array(		// Translation code
-	'user'=>'User',
-	'company'=>'Company', 'contact'=>'Contact',
-	'invoice'=>'Bill', 'invoice_line'=>'InvoiceLine',
-	'order'=>'Order', 'order_line'=>'OrderLine',
-	'intervention'=>'Intervention', 'inter_line'=>'InterLine',
-	'member'=>'Member', 'member_type'=>'MemberType', 'subscription'=>'Subscription',
-	'tax'=>'SocialContribution', 'tax_type'=>'DictionarySocialContributions',
-	'account'=>'BankTransactions',
-	'payment'=>'Payment',
-	'product'=>'Product', 'stock'=>'Stock', 'warehouse'=>'Warehouse',
-	'category'=>'Category',
-	'other'=>'Other'
+
+// Translation code, array duplicated in export.php, was not synchronized, TODO put it somewhere only once
+$entitytolang = array(
+	'user'         => 'User',
+	'company'      => 'Company',
+    'contact'      => 'Contact',
+	'invoice'      => 'Bill',
+    'invoice_line' => 'InvoiceLine',
+	'order'        => 'Order',
+    'order_line'   => 'OrderLine',
+    'propal'       => 'Proposal',
+    'propal_line'  => 'ProposalLine',
+	'intervention' => 'Intervention',
+    'inter_line'   => 'InterLine',
+	'member'       => 'Member',
+    'member_type'  => 'MemberType',
+    'subscription' => 'Subscription',
+	'tax'          => 'SocialContribution',
+    'tax_type'     => 'DictionarySocialContributions',
+	'account'      => 'BankTransactions',
+	'payment'      => 'Payment',
+	'product'      => 'Product',
+	'virtualproduct'  => 'AssociatedProducts',
+	'subproduct'      => 'SubProduct',
+	'product_supplier_ref'      => 'SupplierPrices',
+	'service'      => 'Service',
+    'stock'        => 'Stock',
+	'movement'	   => 'StockMovement',
+	'batch'        => 'Batch',
+	'stockbatch'   => 'StockDetailPerBatch',
+	'warehouse'    => 'Warehouse',
+	'category'     => 'Category',
+	'other'        => 'Other',
+    'trip'         => 'TripsAndExpenses',
+    'shipment'     => 'Shipments',
+    'shipment_line'=> 'ShipmentLine',
+    'project'      => 'Projects',
+    'projecttask'  => 'Tasks',
+    'task_time'    => 'TaskTimeSpent',
+	'action'       => 'Event',
+	'expensereport'=> 'ExpenseReport',
+	'expensereport_line'=> 'ExpenseReportLine',
+	'holiday'      => 'TitreRequestCP',
+	'contract'     => 'Contract',
+    'contract_line'=> 'ContractLine',
+    'translation'  => 'Translation',
+    'bom'          => 'BOM',
+    'bomline'      => 'BOMLine'
 );
 
 $datatoimport		= GETPOST('datatoimport');
@@ -356,7 +418,9 @@ if ($step == 1 || !$datatoimport)
 			if (in_array($objimport->array_import_code[$key], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
 			print $titleofmodule;
 			print '</td><td>';
-			print img_object($objimport->array_import_module[$key]['module']->getName(), $objimport->array_import_icon[$key]).' ';
+			$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[$key]);
+			$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+			print img_object($objimport->array_import_module[$key]['module']->getName(), $entityicon).' ';
 			print $objimport->array_import_label[$key];
 			print '</td><td style="text-align: right">';
 			if ($objimport->array_import_perms[$key])
@@ -409,17 +473,17 @@ if ($step == 2 && $datatoimport)
 	// Lot de donnees a importer
 	print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
 	print '<td>';
-	print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
+	$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objimport->array_import_module[0]['module']->getName(), $entityicon).' ';
 	print $objimport->array_import_label[0];
 	print '</td></tr>';
 
 	print '</table>';
-
 	print '</div>';
 
 	print dol_get_fiche_end();
 
-
 	print '<form name="userfile" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data" METHOD="POST">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
 	print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
@@ -503,17 +567,17 @@ if ($step == 3 && $datatoimport)
 	// Lot de donnees a importer
 	print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
 	print '<td>';
-	print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
+	$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objimport->array_import_module[0]['module']->getName(), $entityicon).' ';
 	print $objimport->array_import_label[0];
 	print '</td></tr>';
 
 	print '</table>';
 	print '</div>';
 
-
 	print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', '');
 
-
 	print '<div class="underbanner clearboth"></div>';
 	print '<div class="fichecenter">';
 	print '<table width="100%" class="border tableforfield">';
@@ -790,14 +854,15 @@ if ($step == 4 && $datatoimport)
 	// Lot de donnees a importer
 	print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
 	print '<td>';
-	print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
+	$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objimport->array_import_module[0]['module']->getName(), $entityicon).' ';
 	print $objimport->array_import_label[0];
 	print '</td></tr>';
 
 	print '</table>';
 	print '</div>';
 
-
 	print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', '');
 
 	print '<div class="underbanner clearboth"></div>';
@@ -1260,14 +1325,15 @@ if ($step == 5 && $datatoimport)
 	// Lot de donnees a importer
 	print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
 	print '<td>';
-	print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
+	$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objimport->array_import_module[0]['module']->getName(), $entityicon).' ';
 	print $objimport->array_import_label[0];
 	print '</td></tr>';
 
 	print '</table>';
 	print '</div>';
 
-
 	print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', '');
 
 	print '<div class="underbanner clearboth"></div>';
@@ -1683,14 +1749,15 @@ if ($step == 6 && $datatoimport)
 	// Lot de donnees a importer
 	print '<tr><td>'.$langs->trans("DatasetToImport").'</td>';
 	print '<td>';
-	print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
+	$entity = preg_replace('/:.*$/', '', $objimport->array_import_icon[0]);
+	$entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+	print img_object($objimport->array_import_module[0]['module']->getName(), $entityicon).' ';
 	print $objimport->array_import_label[0];
 	print '</td></tr>';
 
 	print '</table>';
 	print '</div>';
 
-
 	print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', '');
 
 	print '<div class="underbanner clearboth"></div>';

+ 0 - 4
htdocs/includes/phpoffice/phpexcel/.gitattributes

@@ -1,4 +0,0 @@
-/Build export-ignore
-/Documentation export-ignore
-/Tests export-ignore
-README.md export-ignore

+ 0 - 9
htdocs/includes/phpoffice/phpexcel/.gitignore

@@ -1,9 +0,0 @@
-build/PHPExcel.phar
-unitTests/codeCoverage
-analysis
-
-## IDE support
-*.buildpath
-*.project
-/.settings
-/.idea

+ 0 - 20
htdocs/includes/phpoffice/phpexcel/.travis.yml

@@ -1,20 +0,0 @@
-language: php
-
-php:
-  - 5.2
-  - 5.3.3
-  - 5.3
-  - 5.4
-  - 5.5
-  - 5.6
-  - hhvm
- 
-matrix:
-    allow_failures:
-        - php: hhvm
-
-script:
- - phpunit -c ./unitTests/
-
-notifications:
-  email: false

+ 0 - 1139
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel.php

@@ -1,1139 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/');
-    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel
-{
-    /**
-     * Unique ID
-     *
-     * @var string
-     */
-    private $_uniqueID;
-
-    /**
-     * Document properties
-     *
-     * @var PHPExcel_DocumentProperties
-     */
-    private $_properties;
-
-    /**
-     * Document security
-     *
-     * @var PHPExcel_DocumentSecurity
-     */
-    private $_security;
-
-    /**
-     * Collection of Worksheet objects
-     *
-     * @var PHPExcel_Worksheet[]
-     */
-    private $_workSheetCollection = array();
-
-    /**
-	 * Calculation Engine
-	 *
-	 * @var PHPExcel_Calculation
-	 */
-	private $_calculationEngine = NULL;
-
-    /**
-     * Active sheet index
-     *
-     * @var int
-     */
-    private $_activeSheetIndex = 0;
-
-    /**
-     * Named ranges
-     *
-     * @var PHPExcel_NamedRange[]
-     */
-    private $_namedRanges = array();
-
-    /**
-     * CellXf supervisor
-     *
-     * @var PHPExcel_Style
-     */
-    private $_cellXfSupervisor;
-
-    /**
-     * CellXf collection
-     *
-     * @var PHPExcel_Style[]
-     */
-    private $_cellXfCollection = array();
-
-    /**
-     * CellStyleXf collection
-     *
-     * @var PHPExcel_Style[]
-     */
-    private $_cellStyleXfCollection = array();
-
-	/**
-	* _hasMacros : this workbook have macros ?
-	*
-	* @var bool
-	*/
-	private $_hasMacros = FALSE;
-
-	/**
-	* _macrosCode : all macros code (the vbaProject.bin file, this include form, code,  etc.), NULL if no macro
-	*
-	* @var binary
-	*/
-	private $_macrosCode=NULL;
-	/**
-	* _macrosCertificate : if macros are signed, contains vbaProjectSignature.bin file, NULL if not signed
-	*
-	* @var binary
-	*/
-	private $_macrosCertificate=NULL;
-
-	/**
-	* _ribbonXMLData : NULL if workbook is'nt Excel 2007 or not contain a customized UI
-	*
-	* @var NULL|string
-	*/
-	private $_ribbonXMLData=NULL;
-
-	/**
-	* _ribbonBinObjects : NULL if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements
-	* ignored if $_ribbonXMLData is null
-	*
-	* @var NULL|array
-	*/
-	private $_ribbonBinObjects=NULL;
-
-	/**
-	* The workbook has macros ?
-	*
-	* @return true if workbook has macros, false if not
-	*/
-	public function hasMacros(){
-		return $this->_hasMacros;
-	}
-
-	/**
-	* Define if a workbook has macros
-	*
-	* @param true|false
-	*/
-	public function setHasMacros($hasMacros=false){
-		$this->_hasMacros=(bool)$hasMacros;
-	}
-
-	/**
-	* Set the macros code
-	*
-	* @param binary string|null
-	*/
-	public function setMacrosCode($MacrosCode){
-		$this->_macrosCode=$MacrosCode;
-		$this->setHasMacros(!is_null($MacrosCode));
-	}
-
-	/**
-	* Return the macros code
-	*
-	* @return binary|null
-	*/
-	public function getMacrosCode(){
-		return $this->_macrosCode;
-	}
-
-	/**
-	* Set the macros certificate
-	*
-	* @param binary|null
-	*/
-	public function setMacrosCertificate($Certificate=NULL){
-		$this->_macrosCertificate=$Certificate;
-	}
-
-	/**
-	* Is the project signed ?
-	*
-	* @return true|false
-	*/
-	public function hasMacrosCertificate(){
-		return !is_null($this->_macrosCertificate);
-	}
-
-	/**
-	* Return the macros certificate
-	*
-	* @return binary|null
-	*/
-	public function getMacrosCertificate(){
-		return $this->_macrosCertificate;
-	}
-
-	/**
-	* Remove all macros, certificate from spreadsheet
-	*
-	* @param none
-	* @return void
-	*/
-	public function discardMacros(){
-		$this->_hasMacros=false;
-		$this->_macrosCode=NULL;
-		$this->_macrosCertificate=NULL;
-	}
-
-	/**
-	* set ribbon XML data
-	*
-	*/
-	public function setRibbonXMLData($Target=NULL, $XMLData=NULL){
-		if(!is_null($Target) && !is_null($XMLData)){
-			$this->_ribbonXMLData=array('target'=>$Target, 'data'=>$XMLData);
-		}else{
-			$this->_ribbonXMLData=NULL;
-		}
-	}
-
-	/**
-	* retrieve ribbon XML Data
-	*
-	* return string|null|array
-	*/
-	public function getRibbonXMLData($What='all'){//we need some constants here...
-		$ReturnData=NULL;
-		$What=strtolower($What);
-		switch($What){
-		case 'all':
-			$ReturnData=$this->_ribbonXMLData;
-			break;
-		case 'target':
-		case 'data':
-			if(is_array($this->_ribbonXMLData) && array_key_exists($What,$this->_ribbonXMLData)){
-				$ReturnData=$this->_ribbonXMLData[$What];
-			}//else $ReturnData stay at null
-			break;
-		}//default: $ReturnData at null
-		return $ReturnData;
-	}
-
-	/**
-	* store binaries ribbon objects (pictures)
-	*
-	*/
-	public function setRibbonBinObjects($BinObjectsNames=NULL, $BinObjectsData=NULL){
-		if(!is_null($BinObjectsNames) && !is_null($BinObjectsData)){
-			$this->_ribbonBinObjects=array('names'=>$BinObjectsNames, 'data'=>$BinObjectsData);
-		}else{
-			$this->_ribbonBinObjects=NULL;
-		}
-	}
-	/**
-	* return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function)
-	*
-	*/
-	private function _getExtensionOnly($ThePath){
-		return pathinfo($ThePath, PATHINFO_EXTENSION);
-	}
-
-	/**
-	* retrieve Binaries Ribbon Objects
-	*
-	*/
-	public function getRibbonBinObjects($What='all'){
-		$ReturnData=NULL;
-		$What=strtolower($What);
-		switch($What){
-		case 'all':
-			return $this->_ribbonBinObjects;
-			break;
-		case 'names':
-		case 'data':
-			if(is_array($this->_ribbonBinObjects) && array_key_exists($What, $this->_ribbonBinObjects)){
-				$ReturnData=$this->_ribbonBinObjects[$What];
-			}
-			break;
-		case 'types':
-			if(is_array($this->_ribbonBinObjects) && array_key_exists('data', $this->_ribbonBinObjects) && is_array($this->_ribbonBinObjects['data'])){
-				$tmpTypes=array_keys($this->_ribbonBinObjects['data']);
-				$ReturnData=array_unique(array_map(array($this,'_getExtensionOnly'), $tmpTypes));
-			}else
-				$ReturnData=array();//the caller want an array... not null if empty
-			break;
-		}
-		return $ReturnData;
-	}
-
-	/**
-	* This workbook have a custom UI ?
-	*
-	* @return true|false
-	*/
-	public function hasRibbon(){
-		return !is_null($this->_ribbonXMLData);
-	}
-
-	/**
-	* This workbook have additionnal object for the ribbon ?
-	*
-	* @return true|false
-	*/
-	public function hasRibbonBinObjects(){
-		return !is_null($this->_ribbonBinObjects);
-	}
-
-	/**
-     * Check if a sheet with a specified code name already exists
-     *
-     * @param string $pSheetCodeName  Name of the worksheet to check
-     * @return boolean
-     */
-    public function sheetCodeNameExists($pSheetCodeName)
-    {
-		return ($this->getSheetByCodeName($pSheetCodeName) !== NULL);
-    }
-
-	/**
-	 * Get sheet by code name. Warning : sheet don't have always a code name !
-	 *
-	 * @param string $pName Sheet name
-	 * @return PHPExcel_Worksheet
-	 */
-	public function getSheetByCodeName($pName = '')
-	{
-		$worksheetCount = count($this->_workSheetCollection);
-		for ($i = 0; $i < $worksheetCount; ++$i) {
-			if ($this->_workSheetCollection[$i]->getCodeName() == $pName) {
-				return $this->_workSheetCollection[$i];
-			}
-		}
-
-		return null;
-	}
-
-	 /**
-	 * Create a new PHPExcel with one Worksheet
-	 */
-	public function __construct()
-	{
-		$this->_uniqueID = uniqid();
-		$this->_calculationEngine	= PHPExcel_Calculation::getInstance($this);
-
-		// Initialise worksheet collection and add one worksheet
-		$this->_workSheetCollection = array();
-		$this->_workSheetCollection[] = new PHPExcel_Worksheet($this);
-		$this->_activeSheetIndex = 0;
-
-        // Create document properties
-        $this->_properties = new PHPExcel_DocumentProperties();
-
-        // Create document security
-        $this->_security = new PHPExcel_DocumentSecurity();
-
-        // Set named ranges
-        $this->_namedRanges = array();
-
-        // Create the cellXf supervisor
-        $this->_cellXfSupervisor = new PHPExcel_Style(true);
-        $this->_cellXfSupervisor->bindParent($this);
-
-        // Create the default style
-        $this->addCellXf(new PHPExcel_Style);
-        $this->addCellStyleXf(new PHPExcel_Style);
-    }
-
-    /**
-     * Code to execute when this worksheet is unset()
-     *
-     */
-    public function __destruct() {
-        PHPExcel_Calculation::unsetInstance($this);
-        $this->disconnectWorksheets();
-    }    //    function __destruct()
-
-    /**
-     * Disconnect all worksheets from this PHPExcel workbook object,
-     *    typically so that the PHPExcel object can be unset
-     *
-     */
-    public function disconnectWorksheets()
-    {
-    	$worksheet = NULL;
-        foreach($this->_workSheetCollection as $k => &$worksheet) {
-            $worksheet->disconnectCells();
-            $this->_workSheetCollection[$k] = null;
-        }
-        unset($worksheet);
-        $this->_workSheetCollection = array();
-    }
-
-	/**
-	 * Return the calculation engine for this worksheet
-	 *
-	 * @return PHPExcel_Calculation
-	 */
-	public function getCalculationEngine()
-	{
-		return $this->_calculationEngine;
-	}	//	function getCellCacheController()
-
-    /**
-     * Get properties
-     *
-     * @return PHPExcel_DocumentProperties
-     */
-    public function getProperties()
-    {
-        return $this->_properties;
-    }
-
-    /**
-     * Set properties
-     *
-     * @param PHPExcel_DocumentProperties    $pValue
-     */
-    public function setProperties(PHPExcel_DocumentProperties $pValue)
-    {
-        $this->_properties = $pValue;
-    }
-
-    /**
-     * Get security
-     *
-     * @return PHPExcel_DocumentSecurity
-     */
-    public function getSecurity()
-    {
-        return $this->_security;
-    }
-
-    /**
-     * Set security
-     *
-     * @param PHPExcel_DocumentSecurity    $pValue
-     */
-    public function setSecurity(PHPExcel_DocumentSecurity $pValue)
-    {
-        $this->_security = $pValue;
-    }
-
-    /**
-     * Get active sheet
-     *
-     * @return PHPExcel_Worksheet
-     *
-     * @throws PHPExcel_Exception
-     */
-    public function getActiveSheet()
-    {
-        return $this->getSheet($this->_activeSheetIndex);
-    }
-
-    /**
-     * Create sheet and add it to this workbook
-     *
-     * @param  int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
-     * @return PHPExcel_Worksheet
-     * @throws PHPExcel_Exception
-     */
-    public function createSheet($iSheetIndex = NULL)
-    {
-        $newSheet = new PHPExcel_Worksheet($this);
-        $this->addSheet($newSheet, $iSheetIndex);
-        return $newSheet;
-    }
-
-    /**
-     * Check if a sheet with a specified name already exists
-     *
-     * @param  string $pSheetName  Name of the worksheet to check
-     * @return boolean
-     */
-    public function sheetNameExists($pSheetName)
-    {
-        return ($this->getSheetByName($pSheetName) !== NULL);
-    }
-
-    /**
-     * Add sheet
-     *
-     * @param  PHPExcel_Worksheet $pSheet
-     * @param  int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
-     * @return PHPExcel_Worksheet
-     * @throws PHPExcel_Exception
-     */
-    public function addSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = NULL)
-    {
-        if ($this->sheetNameExists($pSheet->getTitle())) {
-            throw new PHPExcel_Exception(
-            	"Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename this worksheet first."
-            );
-        }
-
-        if($iSheetIndex === NULL) {
-            if ($this->_activeSheetIndex < 0) {
-                $this->_activeSheetIndex = 0;
-            }
-            $this->_workSheetCollection[] = $pSheet;
-        } else {
-            // Insert the sheet at the requested index
-            array_splice(
-                $this->_workSheetCollection,
-                $iSheetIndex,
-                0,
-                array($pSheet)
-                );
-
-            // Adjust active sheet index if necessary
-            if ($this->_activeSheetIndex >= $iSheetIndex) {
-                ++$this->_activeSheetIndex;
-            }
-        }
-
-        if ($pSheet->getParent() === null) {
-            $pSheet->rebindParent($this);
-        }
-
-        return $pSheet;
-    }
-
-    /**
-     * Remove sheet by index
-     *
-     * @param  int $pIndex Active sheet index
-     * @throws PHPExcel_Exception
-     */
-    public function removeSheetByIndex($pIndex = 0)
-    {
-
-        $numSheets = count($this->_workSheetCollection);
-
-        if ($pIndex > $numSheets - 1) {
-            throw new PHPExcel_Exception(
-            	"You tried to remove a sheet by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
-            );
-        } else {
-            array_splice($this->_workSheetCollection, $pIndex, 1);
-        }
-        // Adjust active sheet index if necessary
-        if (($this->_activeSheetIndex >= $pIndex) &&
-            ($pIndex > count($this->_workSheetCollection) - 1)) {
-            --$this->_activeSheetIndex;
-        }
-
-    }
-
-    /**
-     * Get sheet by index
-     *
-     * @param  int $pIndex Sheet index
-     * @return PHPExcel_Worksheet
-     * @throws PHPExcel_Exception
-     */
-    public function getSheet($pIndex = 0)
-    {
-        if (!isset($this->_workSheetCollection[$pIndex])) {
-            $numSheets = $this->getSheetCount();
-            throw new PHPExcel_Exception(
-                "Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}."
-            );
-        }
-
-        return $this->_workSheetCollection[$pIndex];
-    }
-
-    /**
-     * Get all sheets
-     *
-     * @return PHPExcel_Worksheet[]
-     */
-    public function getAllSheets()
-    {
-        return $this->_workSheetCollection;
-    }
-
-    /**
-     * Get sheet by name
-     *
-     * @param  string $pName Sheet name
-     * @return PHPExcel_Worksheet
-     */
-    public function getSheetByName($pName = '')
-    {
-        $worksheetCount = count($this->_workSheetCollection);
-        for ($i = 0; $i < $worksheetCount; ++$i) {
-            if ($this->_workSheetCollection[$i]->getTitle() === $pName) {
-                return $this->_workSheetCollection[$i];
-            }
-        }
-
-        return NULL;
-    }
-
-    /**
-     * Get index for sheet
-     *
-     * @param  PHPExcel_Worksheet $pSheet
-     * @return Sheet index
-     * @throws PHPExcel_Exception
-     */
-    public function getIndex(PHPExcel_Worksheet $pSheet)
-    {
-        foreach ($this->_workSheetCollection as $key => $value) {
-            if ($value->getHashCode() == $pSheet->getHashCode()) {
-                return $key;
-            }
-        }
-
-        throw new PHPExcel_Exception("Sheet does not exist.");
-    }
-
-    /**
-     * Set index for sheet by sheet name.
-     *
-     * @param  string $sheetName Sheet name to modify index for
-     * @param  int $newIndex New index for the sheet
-     * @return New sheet index
-     * @throws PHPExcel_Exception
-     */
-    public function setIndexByName($sheetName, $newIndex)
-    {
-        $oldIndex = $this->getIndex($this->getSheetByName($sheetName));
-        $pSheet = array_splice(
-            $this->_workSheetCollection,
-            $oldIndex,
-            1
-        );
-        array_splice(
-            $this->_workSheetCollection,
-            $newIndex,
-            0,
-            $pSheet
-        );
-        return $newIndex;
-    }
-
-    /**
-     * Get sheet count
-     *
-     * @return int
-     */
-    public function getSheetCount()
-    {
-        return count($this->_workSheetCollection);
-    }
-
-    /**
-     * Get active sheet index
-     *
-     * @return int Active sheet index
-     */
-    public function getActiveSheetIndex()
-    {
-        return $this->_activeSheetIndex;
-    }
-
-    /**
-     * Set active sheet index
-     *
-     * @param  int $pIndex Active sheet index
-     * @throws PHPExcel_Exception
-     * @return PHPExcel_Worksheet
-     */
-    public function setActiveSheetIndex($pIndex = 0)
-    {
-        $numSheets = count($this->_workSheetCollection);
-
-        if ($pIndex > $numSheets - 1) {
-            throw new PHPExcel_Exception(
-            	"You tried to set a sheet active by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
-            );
-        } else {
-            $this->_activeSheetIndex = $pIndex;
-        }
-        return $this->getActiveSheet();
-    }
-
-    /**
-     * Set active sheet index by name
-     *
-     * @param  string $pValue Sheet title
-     * @return PHPExcel_Worksheet
-     * @throws PHPExcel_Exception
-     */
-    public function setActiveSheetIndexByName($pValue = '')
-    {
-        if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) {
-            $this->setActiveSheetIndex($this->getIndex($worksheet));
-            return $worksheet;
-        }
-
-        throw new PHPExcel_Exception('Workbook does not contain sheet:' . $pValue);
-    }
-
-    /**
-     * Get sheet names
-     *
-     * @return string[]
-     */
-    public function getSheetNames()
-    {
-        $returnValue = array();
-        $worksheetCount = $this->getSheetCount();
-        for ($i = 0; $i < $worksheetCount; ++$i) {
-            $returnValue[] = $this->getSheet($i)->getTitle();
-        }
-
-        return $returnValue;
-    }
-
-    /**
-     * Add external sheet
-     *
-     * @param  PHPExcel_Worksheet $pSheet External sheet to add
-     * @param  int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
-     * @throws PHPExcel_Exception
-     * @return PHPExcel_Worksheet
-     */
-    public function addExternalSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null) {
-        if ($this->sheetNameExists($pSheet->getTitle())) {
-            throw new PHPExcel_Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first.");
-        }
-
-        // count how many cellXfs there are in this workbook currently, we will need this below
-        $countCellXfs = count($this->_cellXfCollection);
-
-        // copy all the shared cellXfs from the external workbook and append them to the current
-        foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) {
-            $this->addCellXf(clone $cellXf);
-        }
-
-        // move sheet to this workbook
-        $pSheet->rebindParent($this);
-
-        // update the cellXfs
-        foreach ($pSheet->getCellCollection(false) as $cellID) {
-            $cell = $pSheet->getCell($cellID);
-            $cell->setXfIndex( $cell->getXfIndex() + $countCellXfs );
-        }
-
-        return $this->addSheet($pSheet, $iSheetIndex);
-    }
-
-    /**
-     * Get named ranges
-     *
-     * @return PHPExcel_NamedRange[]
-     */
-    public function getNamedRanges() {
-        return $this->_namedRanges;
-    }
-
-    /**
-     * Add named range
-     *
-     * @param  PHPExcel_NamedRange $namedRange
-     * @return PHPExcel
-     */
-    public function addNamedRange(PHPExcel_NamedRange $namedRange) {
-        if ($namedRange->getScope() == null) {
-            // global scope
-            $this->_namedRanges[$namedRange->getName()] = $namedRange;
-        } else {
-            // local scope
-            $this->_namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange;
-        }
-        return true;
-    }
-
-    /**
-     * Get named range
-     *
-     * @param  string $namedRange
-     * @param  PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope
-     * @return PHPExcel_NamedRange|null
-     */
-    public function getNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) {
-        $returnValue = null;
-
-        if ($namedRange != '' && ($namedRange !== NULL)) {
-            // first look for global defined name
-            if (isset($this->_namedRanges[$namedRange])) {
-                $returnValue = $this->_namedRanges[$namedRange];
-            }
-
-            // then look for local defined name (has priority over global defined name if both names exist)
-            if (($pSheet !== NULL) && isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
-                $returnValue = $this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange];
-            }
-        }
-
-        return $returnValue;
-    }
-
-    /**
-     * Remove named range
-     *
-     * @param  string  $namedRange
-     * @param  PHPExcel_Worksheet|null  $pSheet  Scope: use null for global scope.
-     * @return PHPExcel
-     */
-    public function removeNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) {
-        if ($pSheet === NULL) {
-            if (isset($this->_namedRanges[$namedRange])) {
-                unset($this->_namedRanges[$namedRange]);
-            }
-        } else {
-            if (isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
-                unset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange]);
-            }
-        }
-        return $this;
-    }
-
-    /**
-     * Get worksheet iterator
-     *
-     * @return PHPExcel_WorksheetIterator
-     */
-    public function getWorksheetIterator() {
-        return new PHPExcel_WorksheetIterator($this);
-    }
-
-    /**
-     * Copy workbook (!= clone!)
-     *
-     * @return PHPExcel
-     */
-    public function copy() {
-        $copied = clone $this;
-
-        $worksheetCount = count($this->_workSheetCollection);
-        for ($i = 0; $i < $worksheetCount; ++$i) {
-            $this->_workSheetCollection[$i] = $this->_workSheetCollection[$i]->copy();
-            $this->_workSheetCollection[$i]->rebindParent($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 (is_object($val) || (is_array($val))) {
-                $this->{$key} = unserialize(serialize($val));
-            }
-        }
-    }
-
-    /**
-     * Get the workbook collection of cellXfs
-     *
-     * @return PHPExcel_Style[]
-     */
-    public function getCellXfCollection()
-    {
-        return $this->_cellXfCollection;
-    }
-
-    /**
-     * Get cellXf by index
-     *
-     * @param  int $pIndex
-     * @return PHPExcel_Style
-     */
-    public function getCellXfByIndex($pIndex = 0)
-    {
-        return $this->_cellXfCollection[$pIndex];
-    }
-
-    /**
-     * Get cellXf by hash code
-     *
-     * @param  string $pValue
-     * @return PHPExcel_Style|false
-     */
-    public function getCellXfByHashCode($pValue = '')
-    {
-        foreach ($this->_cellXfCollection as $cellXf) {
-            if ($cellXf->getHashCode() == $pValue) {
-                return $cellXf;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Check if style exists in style collection
-     *
-     * @param  PHPExcel_Style $pCellStyle
-     * @return boolean
-     */
-    public function cellXfExists($pCellStyle = null)
-    {
-        return in_array($pCellStyle, $this->_cellXfCollection, true);
-    }
-
-    /**
-     * Get default style
-     *
-     * @return PHPExcel_Style
-     * @throws PHPExcel_Exception
-     */
-    public function getDefaultStyle()
-    {
-        if (isset($this->_cellXfCollection[0])) {
-            return $this->_cellXfCollection[0];
-        }
-        throw new PHPExcel_Exception('No default style found for this workbook');
-    }
-
-    /**
-     * Add a cellXf to the workbook
-     *
-     * @param PHPExcel_Style $style
-     */
-    public function addCellXf(PHPExcel_Style $style)
-    {
-        $this->_cellXfCollection[] = $style;
-        $style->setIndex(count($this->_cellXfCollection) - 1);
-    }
-
-    /**
-     * Remove cellXf by index. It is ensured that all cells get their xf index updated.
-     *
-     * @param  int $pIndex Index to cellXf
-     * @throws PHPExcel_Exception
-     */
-    public function removeCellXfByIndex($pIndex = 0)
-    {
-        if ($pIndex > count($this->_cellXfCollection) - 1) {
-            throw new PHPExcel_Exception("CellXf index is out of bounds.");
-        } else {
-            // first remove the cellXf
-            array_splice($this->_cellXfCollection, $pIndex, 1);
-
-            // then update cellXf indexes for cells
-            foreach ($this->_workSheetCollection as $worksheet) {
-                foreach ($worksheet->getCellCollection(false) as $cellID) {
-                    $cell = $worksheet->getCell($cellID);
-                    $xfIndex = $cell->getXfIndex();
-                    if ($xfIndex > $pIndex ) {
-                        // decrease xf index by 1
-                        $cell->setXfIndex($xfIndex - 1);
-                    } else if ($xfIndex == $pIndex) {
-                        // set to default xf index 0
-                        $cell->setXfIndex(0);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Get the cellXf supervisor
-     *
-     * @return PHPExcel_Style
-     */
-    public function getCellXfSupervisor()
-    {
-        return $this->_cellXfSupervisor;
-    }
-
-    /**
-     * Get the workbook collection of cellStyleXfs
-     *
-     * @return PHPExcel_Style[]
-     */
-    public function getCellStyleXfCollection()
-    {
-        return $this->_cellStyleXfCollection;
-    }
-
-    /**
-     * Get cellStyleXf by index
-     *
-     * @param  int $pIndex
-     * @return PHPExcel_Style
-     */
-    public function getCellStyleXfByIndex($pIndex = 0)
-    {
-        return $this->_cellStyleXfCollection[$pIndex];
-    }
-
-    /**
-     * Get cellStyleXf by hash code
-     *
-     * @param  string $pValue
-     * @return PHPExcel_Style|false
-     */
-    public function getCellStyleXfByHashCode($pValue = '')
-    {
-        foreach ($this->_cellStyleXfCollection as $cellStyleXf) {
-            if ($cellStyleXf->getHashCode() == $pValue) {
-                return $cellStyleXf;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Add a cellStyleXf to the workbook
-     *
-     * @param PHPExcel_Style $pStyle
-     */
-    public function addCellStyleXf(PHPExcel_Style $pStyle)
-    {
-        $this->_cellStyleXfCollection[] = $pStyle;
-        $pStyle->setIndex(count($this->_cellStyleXfCollection) - 1);
-    }
-
-    /**
-     * Remove cellStyleXf by index
-     *
-     * @param int $pIndex
-     * @throws PHPExcel_Exception
-     */
-    public function removeCellStyleXfByIndex($pIndex = 0)
-    {
-        if ($pIndex > count($this->_cellStyleXfCollection) - 1) {
-            throw new PHPExcel_Exception("CellStyleXf index is out of bounds.");
-        } else {
-            array_splice($this->_cellStyleXfCollection, $pIndex, 1);
-        }
-    }
-
-    /**
-     * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells
-     * and columns in the workbook
-     */
-    public function garbageCollect()
-    {
-        // how many references are there to each cellXf ?
-        $countReferencesCellXf = array();
-        foreach ($this->_cellXfCollection as $index => $cellXf) {
-            $countReferencesCellXf[$index] = 0;
-        }
-
-        foreach ($this->getWorksheetIterator() as $sheet) {
-
-            // from cells
-            foreach ($sheet->getCellCollection(false) as $cellID) {
-                $cell = $sheet->getCell($cellID);
-                ++$countReferencesCellXf[$cell->getXfIndex()];
-            }
-
-            // from row dimensions
-            foreach ($sheet->getRowDimensions() as $rowDimension) {
-                if ($rowDimension->getXfIndex() !== null) {
-                    ++$countReferencesCellXf[$rowDimension->getXfIndex()];
-                }
-            }
-
-            // from column dimensions
-            foreach ($sheet->getColumnDimensions() as $columnDimension) {
-                ++$countReferencesCellXf[$columnDimension->getXfIndex()];
-            }
-        }
-
-        // remove cellXfs without references and create mapping so we can update xfIndex
-        // for all cells and columns
-        $countNeededCellXfs = 0;
-        foreach ($this->_cellXfCollection as $index => $cellXf) {
-            if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf
-                ++$countNeededCellXfs;
-            } else {
-                unset($this->_cellXfCollection[$index]);
-            }
-            $map[$index] = $countNeededCellXfs - 1;
-        }
-        $this->_cellXfCollection = array_values($this->_cellXfCollection);
-
-        // update the index for all cellXfs
-        foreach ($this->_cellXfCollection as $i => $cellXf) {
-            $cellXf->setIndex($i);
-        }
-
-        // make sure there is always at least one cellXf (there should be)
-        if (empty($this->_cellXfCollection)) {
-            $this->_cellXfCollection[] = new PHPExcel_Style();
-        }
-
-        // update the xfIndex for all cells, row dimensions, column dimensions
-        foreach ($this->getWorksheetIterator() as $sheet) {
-
-            // for all cells
-            foreach ($sheet->getCellCollection(false) as $cellID) {
-                $cell = $sheet->getCell($cellID);
-                $cell->setXfIndex( $map[$cell->getXfIndex()] );
-            }
-
-            // for all row dimensions
-            foreach ($sheet->getRowDimensions() as $rowDimension) {
-                if ($rowDimension->getXfIndex() !== null) {
-                    $rowDimension->setXfIndex( $map[$rowDimension->getXfIndex()] );
-                }
-            }
-
-            // for all column dimensions
-            foreach ($sheet->getColumnDimensions() as $columnDimension) {
-                $columnDimension->setXfIndex( $map[$columnDimension->getXfIndex()] );
-            }
-
-			// also do garbage collection for all the sheets
-            $sheet->garbageCollect();
-        }
-    }
-
-    /**
-     * Return the unique ID value assigned to this spreadsheet workbook
-     *
-     * @return string
-     */
-    public function getID() {
-        return $this->_uniqueID;
-    }
-
-}

+ 0 - 89
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Autoloader.php

@@ -1,89 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-PHPExcel_Autoloader::Register();
-//    As we always try to run the autoloader before anything else, we can use it to do a few
-//        simple checks and initialisations
-//PHPExcel_Shared_ZipStreamWrapper::register();
-// check mbstring.func_overload
-if (ini_get('mbstring.func_overload') & 2) {
-    throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
-}
-PHPExcel_Shared_String::buildCharacterSets();
-
-
-/**
- * PHPExcel_Autoloader
- *
- * @category    PHPExcel
- * @package     PHPExcel
- * @copyright   Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Autoloader
-{
-    /**
-     * Register the Autoloader with SPL
-     *
-     */
-    public static function Register() {
-        if (function_exists('__autoload')) {
-            //    Register any existing autoloader function with SPL, so we don't get any clashes
-            spl_autoload_register('__autoload');
-        }
-        //    Register ourselves with SPL
-        if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
-            return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'), true, true);
-        } else {
-            return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
-        }
-    }   //    function Register()
-
-
-    /**
-     * Autoload a class identified by name
-     *
-     * @param    string    $pClassName        Name of the object to load
-     */
-    public static function Load($pClassName){
-        if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) {
-            //    Either already loaded, or not a PHPExcel class request
-            return FALSE;
-        }
-
-        $pClassFilePath = PHPEXCEL_ROOT .
-                          str_replace('_',DIRECTORY_SEPARATOR,$pClassName) .
-                          '.php';
-
-        if ((file_exists($pClassFilePath) === FALSE) || (is_readable($pClassFilePath) === FALSE)) {
-            //    Can't load
-            return FALSE;
-        }
-
-        require($pClassFilePath);
-    }   //    function Load()
-
-}

+ 0 - 295
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/APC.php

@@ -1,295 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_APC
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-    /**
-     * Prefix used to uniquely identify cache data for this worksheet
-     *
-     * @access    private
-     * @var string
-     */
-    private $_cachePrefix = null;
-
-    /**
-     * Cache timeout
-     *
-     * @access    private
-     * @var integer
-     */
-    private $_cacheTime = 600;
-
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-     * @access  private
-     * @return  void
-     * @throws  PHPExcel_Exception
-     */
-    protected function _storeData() {
-        if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-            $this->_currentObject->detach();
-
-            if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
-                $this->__destruct();
-                throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in APC');
-            }
-            $this->_currentCellIsDirty = false;
-        }
-        $this->_currentObjectID = $this->_currentObject = null;
-    }    //    function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @access  public
-     * @param   string         $pCoord  Coordinate address of the cell to update
-     * @param   PHPExcel_Cell  $cell    Cell to update
-     * @return  PHPExcel_Cell
-     * @throws  PHPExcel_Exception
-     */
-    public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-        if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-            $this->_storeData();
-        }
-        $this->_cellCache[$pCoord] = true;
-
-        $this->_currentObjectID = $pCoord;
-        $this->_currentObject = $cell;
-        $this->_currentCellIsDirty = true;
-
-        return $cell;
-    }    //    function addCacheData()
-
-
-    /**
-     * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
-     *
-     * @access  public
-     * @param   string  $pCoord  Coordinate address of the cell to check
-     * @throws  PHPExcel_Exception
-     * @return  boolean
-     */
-    public function isDataSet($pCoord) {
-        //    Check if the requested entry is the current object, or exists in the cache
-        if (parent::isDataSet($pCoord)) {
-            if ($this->_currentObjectID == $pCoord) {
-                return true;
-            }
-            //    Check if the requested entry still exists in apc
-            $success = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
-            if ($success === FALSE) {
-                //    Entry no longer exists in APC, so clear it from the cache array
-                parent::deleteCacheData($pCoord);
-                throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
-            }
-            return true;
-        }
-        return false;
-    }    //    function isDataSet()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @access  public
-     * @param   string         $pCoord  Coordinate of the cell
-     * @throws  PHPExcel_Exception
-     * @return  PHPExcel_Cell  Cell that was found, or null if not found
-     */
-    public function getCacheData($pCoord) {
-        if ($pCoord === $this->_currentObjectID) {
-            return $this->_currentObject;
-        }
-        $this->_storeData();
-
-        //    Check if the entry that has been requested actually exists
-        if (parent::isDataSet($pCoord)) {
-            $obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
-            if ($obj === FALSE) {
-                //    Entry no longer exists in APC, so clear it from the cache array
-                parent::deleteCacheData($pCoord);
-                throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
-            }
-        } else {
-            //    Return null if requested entry doesn't exist in cache
-            return null;
-        }
-
-        //    Set current entry to the requested entry
-        $this->_currentObjectID = $pCoord;
-        $this->_currentObject = unserialize($obj);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-        //    Return requested entry
-        return $this->_currentObject;
-    }    //    function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-    /**
-     * Delete a cell in cache identified by coordinate address
-     *
-     * @access  public
-     * @param   string  $pCoord  Coordinate address of the cell to delete
-     * @throws  PHPExcel_Exception
-     */
-    public function deleteCacheData($pCoord) {
-        //    Delete the entry from APC
-        apc_delete($this->_cachePrefix.$pCoord.'.cache');
-
-        //    Delete the entry from our cell address array
-        parent::deleteCacheData($pCoord);
-    }    //    function deleteCacheData()
-
-
-    /**
-     * Clone the cell collection
-     *
-     * @access  public
-     * @param   PHPExcel_Worksheet  $parent  The new worksheet
-     * @throws  PHPExcel_Exception
-     * @return  void
-     */
-    public function copyCellCollection(PHPExcel_Worksheet $parent) {
-        parent::copyCellCollection($parent);
-        //    Get a new id for the new file name
-        $baseUnique = $this->_getUniqueID();
-        $newCachePrefix = substr(md5($baseUnique),0,8).'.';
-        $cacheList = $this->getCellList();
-        foreach($cacheList as $cellID) {
-            if ($cellID != $this->_currentObjectID) {
-                $obj = apc_fetch($this->_cachePrefix.$cellID.'.cache');
-                if ($obj === FALSE) {
-                    //    Entry no longer exists in APC, so clear it from the cache array
-                    parent::deleteCacheData($cellID);
-                    throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in APC');
-                }
-                if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) {
-                    $this->__destruct();
-                    throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in APC');
-                }
-            }
-        }
-        $this->_cachePrefix = $newCachePrefix;
-    }    //    function copyCellCollection()
-
-
-    /**
-     * Clear the cell collection and disconnect from our parent
-     *
-     * @return  void
-     */
-    public function unsetWorksheetCells() {
-        if ($this->_currentObject !== NULL) {
-            $this->_currentObject->detach();
-            $this->_currentObject = $this->_currentObjectID = null;
-        }
-
-        //    Flush the APC cache
-        $this->__destruct();
-
-        $this->_cellCache = array();
-
-        //    detach ourself from the worksheet, so that it can then delete this object successfully
-        $this->_parent = null;
-    }    //    function unsetWorksheetCells()
-
-
-    /**
-     * Initialise this new cell collection
-     *
-     * @param  PHPExcel_Worksheet  $parent     The worksheet for this cell collection
-     * @param  array of mixed      $arguments  Additional initialisation arguments
-     */
-    public function __construct(PHPExcel_Worksheet $parent, $arguments) {
-        $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
-
-        if ($this->_cachePrefix === NULL) {
-            $baseUnique = $this->_getUniqueID();
-            $this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
-            $this->_cacheTime = $cacheTime;
-
-            parent::__construct($parent);
-        }
-    }    //    function __construct()
-
-
-    /**
-     * Destroy this cell collection
-     */
-    public function __destruct() {
-        $cacheList = $this->getCellList();
-        foreach($cacheList as $cellID) {
-            apc_delete($this->_cachePrefix.$cellID.'.cache');
-        }
-    }    //    function __destruct()
-
-
-    /**
-     * Identify whether the caching method is currently available
-     * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-     *
-     * @return  boolean
-     */
-    public static function cacheMethodIsAvailable() {
-        if (!function_exists('apc_store')) {
-            return FALSE;
-        }
-        if (apc_sma_info() === FALSE) {
-            return FALSE;
-        }
-
-        return TRUE;
-    }
-
-}

+ 0 - 376
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php

@@ -1,376 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_CacheBase
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-abstract class PHPExcel_CachedObjectStorage_CacheBase {
-
-	/**
-	 * Parent worksheet
-	 *
-	 * @var PHPExcel_Worksheet
-	 */
-	protected $_parent;
-
-	/**
-	 * The currently active Cell
-	 *
-	 * @var PHPExcel_Cell
-	 */
-	protected $_currentObject = null;
-
-	/**
-	 * Coordinate address of the currently active Cell
-	 *
-	 * @var string
-	 */
-	protected $_currentObjectID = null;
-
-
-	/**
-	 * Flag indicating whether the currently active Cell requires saving
-	 *
-	 * @var boolean
-	 */
-	protected $_currentCellIsDirty = true;
-
-	/**
-	 * An array of cells or cell pointers for the worksheet cells held in this cache,
-	 *		and indexed by their coordinate address within the worksheet
-	 *
-	 * @var array of mixed
-	 */
-	protected $_cellCache = array();
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 */
-	public function __construct(PHPExcel_Worksheet $parent) {
-		//	Set our parent worksheet.
-		//	This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when
-		//		they are woken from a serialized state
-		$this->_parent = $parent;
-	}	//	function __construct()
-
-
-	/**
-	 * Return the parent worksheet for this cell collection
-	 *
-	 * @return	PHPExcel_Worksheet
-	 */
-	public function getParent()
-	{
-		return $this->_parent;
-	}
-
-	/**
-	 * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return true;
-		}
-		//	Check if the requested entry exists in the cache
-		return isset($this->_cellCache[$pCoord]);
-	}	//	function isDataSet()
-
-
-	/**
-	 * Move a cell object from one address to another
-	 *
-	 * @param	string		$fromAddress	Current address of the cell to move
-	 * @param	string		$toAddress		Destination address of the cell to move
-	 * @return	boolean
-	 */
-	public function moveCell($fromAddress, $toAddress) {
-		if ($fromAddress === $this->_currentObjectID) {
-			$this->_currentObjectID = $toAddress;
-		}
-		$this->_currentCellIsDirty = true;
-		if (isset($this->_cellCache[$fromAddress])) {
-			$this->_cellCache[$toAddress] = &$this->_cellCache[$fromAddress];
-			unset($this->_cellCache[$fromAddress]);
-		}
-
-		return TRUE;
-	}	//	function moveCell()
-
-
-    /**
-     * Add or Update a cell in cache
-     *
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function updateCacheData(PHPExcel_Cell $cell) {
-		return $this->addCacheData($cell->getCoordinate(),$cell);
-	}	//	function updateCacheData()
-
-
-    /**
-     * Delete a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to delete
-     * @throws	PHPExcel_Exception
-     */
-	public function deleteCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID && !is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObjectID = $this->_currentObject = null;
-		}
-
-		if (is_object($this->_cellCache[$pCoord])) {
-			$this->_cellCache[$pCoord]->detach();
-			unset($this->_cellCache[$pCoord]);
-		}
-		$this->_currentCellIsDirty = false;
-	}	//	function deleteCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return	string[]
-	 */
-	public function getCellList() {
-		return array_keys($this->_cellCache);
-	}	//	function getCellList()
-
-
-	/**
-	 * Sort the list of all cell addresses currently held in cache by row and column
-	 *
-	 * @return	string[]
-	 */
-	public function getSortedCellList() {
-		$sortKeys = array();
-		foreach ($this->getCellList() as $coord) {
-			sscanf($coord,'%[A-Z]%d', $column, $row);
-			$sortKeys[sprintf('%09d%3s',$row,$column)] = $coord;
-		}
-		ksort($sortKeys);
-
-		return array_values($sortKeys);
-	}	//	function sortCellList()
-
-
-
-	/**
-	 * Get highest worksheet column and highest row that have cell records
-	 *
-	 * @return array Highest column name and highest row number
-	 */
-	public function getHighestRowAndColumn()
-	{
-		// Lookup highest column and highest row
-		$col = array('A' => '1A');
-		$row = array(1);
-		foreach ($this->getCellList() as $coord) {
-			sscanf($coord,'%[A-Z]%d', $c, $r);
-			$row[$r] = $r;
-			$col[$c] = strlen($c).$c;
- 		}
-		if (!empty($row)) {
-			// Determine highest column and row
-			$highestRow = max($row);
-			$highestColumn = substr(max($col),1);
-		}
-
-		return array( 'row'	   => $highestRow,
-					  'column' => $highestColumn
-					);
-	}
-
-
-	/**
-	 * Return the cell address of the currently active cell object
-	 *
-	 * @return	string
-	 */
-	public function getCurrentAddress()
-	{
-		return $this->_currentObjectID;
-	}
-
-	/**
-	 * Return the column address of the currently active cell object
-	 *
-	 * @return	string
-	 */
-	public function getCurrentColumn()
-	{
-		sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row);
-		return $column;
-	}
-
-	/**
-	 * Return the row address of the currently active cell object
-	 *
-	 * @return	integer
-	 */
-	public function getCurrentRow()
-	{
-		sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row);
-		return (integer) $row;
-	}
-
-	/**
-	 * Get highest worksheet column
-	 *
-     * @param   string     $row        Return the highest column for the specified row,
-     *                                     or the highest column of any row if no row number is passed
-	 * @return  string     Highest column name
-	 */
-	public function getHighestColumn($row = null)
-	{
-        if ($row == null) {
-    		$colRow = $this->getHighestRowAndColumn();
-	    	return $colRow['column'];
-        }
-
-        $columnList = array(1);
-        foreach ($this->getCellList() as $coord) {
-            sscanf($coord,'%[A-Z]%d', $c, $r);
-            if ($r != $row) {
-                continue;
-            }
-            $columnList[] = PHPExcel_Cell::columnIndexFromString($c);
-        }
-        return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1);
-    }
-
-	/**
-	 * Get highest worksheet row
-	 *
-     * @param   string     $column     Return the highest row for the specified column,
-     *                                     or the highest row of any column if no column letter is passed
-	 * @return  int        Highest row number
-	 */
-	public function getHighestRow($column = null)
-	{
-        if ($column == null) {
-	    	$colRow = $this->getHighestRowAndColumn();
-    		return $colRow['row'];
-        }
-
-        $rowList = array(0);
-        foreach ($this->getCellList() as $coord) {
-            sscanf($coord,'%[A-Z]%d', $c, $r);
-            if ($c != $column) {
-                continue;
-            }
-            $rowList[] = $r;
-        }
-
-        return max($rowList);
-	}
-
-
-	/**
-	 * Generate a unique ID for cache referencing
-	 *
-	 * @return string Unique Reference
-	 */
-	protected function _getUniqueID() {
-		if (function_exists('posix_getpid')) {
-			$baseUnique = posix_getpid();
-		} else {
-			$baseUnique = mt_rand();
-		}
-		return uniqid($baseUnique,true);
-	}
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		$this->_currentCellIsDirty;
-        $this->_storeData();
-
-		$this->_parent = $parent;
-		if (($this->_currentObject !== NULL) && (is_object($this->_currentObject))) {
-			$this->_currentObject->attach($this);
-		}
-	}	//	function copyCellCollection()
-
-    /**
-     * Remove a row, deleting all cells in that row
-     *
-     * @param string    $row    Row number to remove
-     * @return void
-     */
-    public function removeRow($row) {
-        foreach ($this->getCellList() as $coord) {
-            sscanf($coord,'%[A-Z]%d', $c, $r);
-            if ($r == $row) {
-                $this->deleteCacheData($coord);
-            }
-        }
-    }
-
-    /**
-     * Remove a column, deleting all cells in that column
-     *
-     * @param string    $column    Column ID to remove
-     * @return void
-     */
-    public function removeColumn($column) {
-        foreach ($this->getCellList() as $coord) {
-            sscanf($coord,'%[A-Z]%d', $c, $r);
-            if ($c == $column) {
-                $this->deleteCacheData($coord);
-            }
-        }
-    }
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		return true;
-	}
-
-}

+ 0 - 219
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php

@@ -1,219 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_DiscISAM
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Name of the file for this cache
-	 *
-	 * @var string
-	 */
-	private $_fileName = NULL;
-
-	/**
-	 * File handle for this cache file
-	 *
-	 * @var resource
-	 */
-	private $_fileHandle = NULL;
-
-	/**
-	 * Directory/Folder where the cache file is located
-	 *
-	 * @var string
-	 */
-	private $_cacheDirectory = NULL;
-
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			fseek($this->_fileHandle,0,SEEK_END);
-
-			$this->_cellCache[$this->_currentObjectID] = array(
-                'ptr' => ftell($this->_fileHandle),
-				'sz'  => fwrite($this->_fileHandle, serialize($this->_currentObject))
-			);
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		fseek($this->_fileHandle, $this->_cellCache[$pCoord]['ptr']);
-		$this->_currentObject = unserialize(fread($this->_fileHandle, $this->_cellCache[$pCoord]['sz']));
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		parent::copyCellCollection($parent);
-		//	Get a new id for the new file name
-		$baseUnique = $this->_getUniqueID();
-		$newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
-		//	Copy the existing cell cache file
-		copy ($this->_fileName,$newFileName);
-		$this->_fileName = $newFileName;
-		//	Open the copied cell cache file
-		$this->_fileHandle = fopen($this->_fileName,'a+');
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-
-		//	Close down the temporary cache file
-		$this->__destruct();
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 * @param	array of mixed		$arguments	Additional initialisation arguments
-	 */
-	public function __construct(PHPExcel_Worksheet $parent, $arguments) {
-		$this->_cacheDirectory	= ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL))
-									? $arguments['dir']
-									: PHPExcel_Shared_File::sys_get_temp_dir();
-
-		parent::__construct($parent);
-		if (is_null($this->_fileHandle)) {
-			$baseUnique = $this->_getUniqueID();
-			$this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
-			$this->_fileHandle = fopen($this->_fileName,'a+');
-		}
-	}	//	function __construct()
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		if (!is_null($this->_fileHandle)) {
-			fclose($this->_fileHandle);
-			unlink($this->_fileName);
-		}
-		$this->_fileHandle = null;
-	}	//	function __destruct()
-
-}

+ 0 - 112
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/ICache.php

@@ -1,112 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_ICache
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-interface PHPExcel_CachedObjectStorage_ICache
-{
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell);
-
-    /**
-     * Add or Update a cell in cache
-     *
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function updateCacheData(PHPExcel_Cell $cell);
-
-    /**
-     * Fetch a cell from cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to retrieve
-     * @return PHPExcel_Cell 	Cell that was found, or null if not found
-     * @throws	PHPExcel_Exception
-     */
-	public function getCacheData($pCoord);
-
-    /**
-     * Delete a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to delete
-     * @throws	PHPExcel_Exception
-     */
-	public function deleteCacheData($pCoord);
-
-	/**
-	 * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord);
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return	string[]
-	 */
-	public function getCellList();
-
-	/**
-	 * Get the list of all cell addresses currently held in cache sorted by column and row
-	 *
-	 * @return	string[]
-	 */
-	public function getSortedCellList();
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent);
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable();
-
-}

+ 0 - 152
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Igbinary.php

@@ -1,152 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_Igbinary
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = igbinary_unserialize($this->_cellCache[$pCoord]);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		if (!function_exists('igbinary_serialize')) {
-			return false;
-		}
-
-		return true;
-	}
-
-}

+ 0 - 312
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Memcache.php

@@ -1,312 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_Memcache
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Prefix used to uniquely identify cache data for this worksheet
-	 *
-	 * @var string
-	 */
-	private $_cachePrefix = null;
-
-	/**
-	 * Cache timeout
-	 *
-	 * @var integer
-	 */
-	private $_cacheTime = 600;
-
-	/**
-	 * Memcache interface
-	 *
-	 * @var resource
-	 */
-	private $_memcache = null;
-
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$obj = serialize($this->_currentObject);
-			if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
-				if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
-					$this->__destruct();
-					throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache');
-				}
-			}
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-		$this->_cellCache[$pCoord] = true;
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-	/**
-	 * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord) {
-		//	Check if the requested entry is the current object, or exists in the cache
-		if (parent::isDataSet($pCoord)) {
-			if ($this->_currentObjectID == $pCoord) {
-				return true;
-			}
-			//	Check if the requested entry still exists in Memcache
-			$success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
-			if ($success === false) {
-				//	Entry no longer exists in Memcache, so clear it from the cache array
-				parent::deleteCacheData($pCoord);
-				throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
-			}
-			return true;
-		}
-		return false;
-	}	//	function isDataSet()
-
-
-	/**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (parent::isDataSet($pCoord)) {
-			$obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
-			if ($obj === false) {
-				//	Entry no longer exists in Memcache, so clear it from the cache array
-				parent::deleteCacheData($pCoord);
-				throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
-			}
-		} else {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = unserialize($obj);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-    /**
-     * Delete a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to delete
-     * @throws	PHPExcel_Exception
-     */
-	public function deleteCacheData($pCoord) {
-		//	Delete the entry from Memcache
-		$this->_memcache->delete($this->_cachePrefix.$pCoord.'.cache');
-
-		//	Delete the entry from our cell address array
-		parent::deleteCacheData($pCoord);
-	}	//	function deleteCacheData()
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		parent::copyCellCollection($parent);
-		//	Get a new id for the new file name
-		$baseUnique = $this->_getUniqueID();
-		$newCachePrefix = substr(md5($baseUnique),0,8).'.';
-		$cacheList = $this->getCellList();
-		foreach($cacheList as $cellID) {
-			if ($cellID != $this->_currentObjectID) {
-				$obj = $this->_memcache->get($this->_cachePrefix.$cellID.'.cache');
-				if ($obj === false) {
-					//	Entry no longer exists in Memcache, so clear it from the cache array
-					parent::deleteCacheData($cellID);
-					throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in MemCache');
-				}
-				if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) {
-					$this->__destruct();
-					throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in MemCache');
-				}
-			}
-		}
-		$this->_cachePrefix = $newCachePrefix;
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-
-		//	Flush the Memcache cache
-		$this->__destruct();
-
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 * @param	array of mixed		$arguments	Additional initialisation arguments
-	 */
-	public function __construct(PHPExcel_Worksheet $parent, $arguments) {
-		$memcacheServer	= (isset($arguments['memcacheServer']))	? $arguments['memcacheServer']	: 'localhost';
-		$memcachePort	= (isset($arguments['memcachePort']))	? $arguments['memcachePort']	: 11211;
-		$cacheTime		= (isset($arguments['cacheTime']))		? $arguments['cacheTime']		: 600;
-
-		if (is_null($this->_cachePrefix)) {
-			$baseUnique = $this->_getUniqueID();
-			$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
-
-			//	Set a new Memcache object and connect to the Memcache server
-			$this->_memcache = new Memcache();
-			if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) {
-				throw new PHPExcel_Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort);
-			}
-			$this->_cacheTime = $cacheTime;
-
-			parent::__construct($parent);
-		}
-	}	//	function __construct()
-
-
-	/**
-	 * Memcache error handler
-	 *
-	 * @param	string	$host		Memcache server
-	 * @param	integer	$port		Memcache port
-     * @throws	PHPExcel_Exception
-	 */
-	public function failureCallback($host, $port) {
-		throw new PHPExcel_Exception('memcache '.$host.':'.$port.' failed');
-	}
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		$cacheList = $this->getCellList();
-		foreach($cacheList as $cellID) {
-			$this->_memcache->delete($this->_cachePrefix.$cellID.'.cache');
-		}
-	}	//	function __destruct()
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		if (!function_exists('memcache_add')) {
-			return false;
-		}
-
-		return true;
-	}
-
-}

+ 0 - 125
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Memory.php

@@ -1,125 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_Memory
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-    /**
-     * Dummy method callable from CacheBase, but unused by Memory cache
-     *
-	 * @return	void
-     */
-	protected function _storeData() {
-	}	//	function _storeData()
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		$this->_cellCache[$pCoord] = $cell;
-
-		//	Set current entry to the new/updated entry
-		$this->_currentObjectID = $pCoord;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			$this->_currentObjectID = NULL;
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-
-		//	Return requested entry
-		return $this->_cellCache[$pCoord];
-	}	//	function getCacheData()
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		parent::copyCellCollection($parent);
-
-		$newCollection = array();
-		foreach($this->_cellCache as $k => &$cell) {
-			$newCollection[$k] = clone $cell;
-			$newCollection[$k]->attach($this);
-		}
-
-		$this->_cellCache = $newCollection;
-	}
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		//	Because cells are all stored as intact objects in memory, we need to detach each one from the parent
-		foreach($this->_cellCache as $k => &$cell) {
-			$cell->detach();
-			$this->_cellCache[$k] = null;
-		}
-		unset($cell);
-
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-}

+ 0 - 137
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/MemoryGZip.php

@@ -1,137 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_MemoryGZip
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-}

+ 0 - 137
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/MemorySerialized.php

@@ -1,137 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_MemorySerialized
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = unserialize($this->_cellCache[$pCoord]);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-}

+ 0 - 206
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php

@@ -1,206 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_PHPTemp
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Name of the file for this cache
-	 *
-	 * @var string
-	 */
-	private $_fileHandle = null;
-
-	/**
-	 * Memory limit to use before reverting to file cache
-	 *
-	 * @var integer
-	 */
-	private $_memoryCacheSize = null;
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			fseek($this->_fileHandle,0,SEEK_END);
-
-			$this->_cellCache[$this->_currentObjectID] = array(
-                'ptr' => ftell($this->_fileHandle),
-				'sz'  => fwrite($this->_fileHandle, serialize($this->_currentObject))
-			);
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		if (!isset($this->_cellCache[$pCoord])) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
-		$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		parent::copyCellCollection($parent);
-		//	Open a new stream for the cell cache data
-		$newFileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
-		//	Copy the existing cell cache data to the new stream
-		fseek($this->_fileHandle,0);
-		while (!feof($this->_fileHandle)) {
-			fwrite($newFileHandle,fread($this->_fileHandle, 1024));
-		}
-		$this->_fileHandle = $newFileHandle;
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-
-		//	Close down the php://temp file
-		$this->__destruct();
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 * @param	array of mixed		$arguments	Additional initialisation arguments
-	 */
-	public function __construct(PHPExcel_Worksheet $parent, $arguments) {
-		$this->_memoryCacheSize	= (isset($arguments['memoryCacheSize']))	? $arguments['memoryCacheSize']	: '1MB';
-
-		parent::__construct($parent);
-		if (is_null($this->_fileHandle)) {
-			$this->_fileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
-		}
-	}	//	function __construct()
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		if (!is_null($this->_fileHandle)) {
-			fclose($this->_fileHandle);
-		}
-		$this->_fileHandle = null;
-	}	//	function __destruct()
-
-}

+ 0 - 306
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/SQLite.php

@@ -1,306 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_SQLite
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Database table name
-	 *
-	 * @var string
-	 */
-	private $_TableName = null;
-
-	/**
-	 * Database handle
-	 *
-	 * @var resource
-	 */
-	private $_DBHandle = null;
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')"))
-				throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		$query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
-		$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
-		if ($cellResultSet === false) {
-			throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-		} elseif ($cellResultSet->numRows() == 0) {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-
-		$cellResult = $cellResultSet->fetchSingle();
-		$this->_currentObject = unserialize($cellResult);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Is a value set for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return true;
-		}
-
-		//	Check if the requested entry exists in the cache
-		$query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
-		$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
-		if ($cellResultSet === false) {
-			throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-		} elseif ($cellResultSet->numRows() == 0) {
-			//	Return null if requested entry doesn't exist in cache
-			return false;
-		}
-		return true;
-	}	//	function isDataSet()
-
-
-    /**
-     * Delete a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to delete
-     * @throws	PHPExcel_Exception
-     */
-	public function deleteCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			$this->_currentObject->detach();
-			$this->_currentObjectID = $this->_currentObject = null;
-		}
-
-		//	Check if the requested entry exists in the cache
-		$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
-		if (!$this->_DBHandle->queryExec($query))
-			throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-
-		$this->_currentCellIsDirty = false;
-	}	//	function deleteCacheData()
-
-
-	/**
-	 * Move a cell object from one address to another
-	 *
-	 * @param	string		$fromAddress	Current address of the cell to move
-	 * @param	string		$toAddress		Destination address of the cell to move
-	 * @return	boolean
-	 */
-	public function moveCell($fromAddress, $toAddress) {
-		if ($fromAddress === $this->_currentObjectID) {
-			$this->_currentObjectID = $toAddress;
-		}
-
-		$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$toAddress."'";
-		$result = $this->_DBHandle->exec($query);
-		if ($result === false)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		$query = "UPDATE kvp_".$this->_TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'";
-		$result = $this->_DBHandle->exec($query);
-		if ($result === false)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		return TRUE;
-	}	//	function moveCell()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return	string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		$query = "SELECT id FROM kvp_".$this->_TableName;
-		$cellIdsResult = $this->_DBHandle->unbufferedQuery($query,SQLITE_ASSOC);
-		if ($cellIdsResult === false)
-			throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-
-		$cellKeys = array();
-		foreach($cellIdsResult as $row) {
-			$cellKeys[] = $row['id'];
-		}
-
-		return $cellKeys;
-	}	//	function getCellList()
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		$this->_currentCellIsDirty;
-        $this->_storeData();
-
-		//	Get a new id for the new table name
-		$tableName = str_replace('.','_',$this->_getUniqueID());
-		if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
-													AS SELECT * FROM kvp_'.$this->_TableName))
-			throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-
-		//	Copy the existing cell cache file
-		$this->_TableName = $tableName;
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-
-		//	Close down the temporary cache file
-		$this->__destruct();
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 */
-	public function __construct(PHPExcel_Worksheet $parent) {
-		parent::__construct($parent);
-		if (is_null($this->_DBHandle)) {
-			$this->_TableName = str_replace('.','_',$this->_getUniqueID());
-			$_DBName = ':memory:';
-
-			$this->_DBHandle = new SQLiteDatabase($_DBName);
-			if ($this->_DBHandle === false)
-				throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-			if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
-				throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
-		}
-	}	//	function __construct()
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		if (!is_null($this->_DBHandle)) {
-			$this->_DBHandle->queryExec('DROP TABLE kvp_'.$this->_TableName);
-		}
-		$this->_DBHandle = null;
-	}	//	function __destruct()
-
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		if (!function_exists('sqlite_open')) {
-			return false;
-		}
-
-		return true;
-	}
-
-}

+ 0 - 345
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/SQLite3.php

@@ -1,345 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_SQLite3
- *
- * @category   PHPExcel
- * @package    PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Database table name
-	 *
-	 * @var string
-	 */
-	private $_TableName = null;
-
-	/**
-	 * Database handle
-	 *
-	 * @var resource
-	 */
-	private $_DBHandle = null;
-
-	/**
-	 * Prepared statement for a SQLite3 select query
-	 *
-	 * @var SQLite3Stmt
-	 */
-	private $_selectQuery;
-
-	/**
-	 * Prepared statement for a SQLite3 insert query
-	 *
-	 * @var SQLite3Stmt
-	 */
-	private $_insertQuery;
-
-	/**
-	 * Prepared statement for a SQLite3 update query
-	 *
-	 * @var SQLite3Stmt
-	 */
-	private $_updateQuery;
-
-	/**
-	 * Prepared statement for a SQLite3 delete query
-	 *
-	 * @var SQLite3Stmt
-	 */
-	private $_deleteQuery;
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$this->_insertQuery->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT);
-			$this->_insertQuery->bindValue('data',serialize($this->_currentObject),SQLITE3_BLOB);
-			$result = $this->_insertQuery->execute();
-			if ($result === false)
-				throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-			$this->_currentCellIsDirty = false;
-		}
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-    /**
-     * Add or Update a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to update
-     * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-     * @throws	PHPExcel_Exception
-     */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-    /**
-     * Get cell at a specific coordinate
-     *
-     * @param 	string 			$pCoord		Coordinate of the cell
-     * @throws 	PHPExcel_Exception
-     * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
-     */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		$this->_selectQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
-		$cellResult = $this->_selectQuery->execute();
-		if ($cellResult === FALSE) {
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-		}
-		$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
-		if ($cellData === FALSE) {
-			//	Return null if requested entry doesn't exist in cache
-			return NULL;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-
-		$this->_currentObject = unserialize($cellData['value']);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 *	Is a value set for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return TRUE;
-		}
-
-		//	Check if the requested entry exists in the cache
-		$this->_selectQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
-		$cellResult = $this->_selectQuery->execute();
-		if ($cellResult === FALSE) {
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-		}
-		$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
-
-		return ($cellData === FALSE) ? FALSE : TRUE;
-	}	//	function isDataSet()
-
-
-    /**
-     *	Delete a cell in cache identified by coordinate address
-     *
-     * @param	string			$pCoord		Coordinate address of the cell to delete
-     * @throws	PHPExcel_Exception
-     */
-	public function deleteCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			$this->_currentObject->detach();
-			$this->_currentObjectID = $this->_currentObject = NULL;
-		}
-
-		//	Check if the requested entry exists in the cache
-		$this->_deleteQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
-		$result = $this->_deleteQuery->execute();
-		if ($result === FALSE)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		$this->_currentCellIsDirty = FALSE;
-	}	//	function deleteCacheData()
-
-
-	/**
-	 * Move a cell object from one address to another
-	 *
-	 * @param	string		$fromAddress	Current address of the cell to move
-	 * @param	string		$toAddress		Destination address of the cell to move
-	 * @return	boolean
-	 */
-	public function moveCell($fromAddress, $toAddress) {
-		if ($fromAddress === $this->_currentObjectID) {
-			$this->_currentObjectID = $toAddress;
-		}
-
-		$this->_deleteQuery->bindValue('id',$toAddress,SQLITE3_TEXT);
-		$result = $this->_deleteQuery->execute();
-		if ($result === false)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		$this->_updateQuery->bindValue('toid',$toAddress,SQLITE3_TEXT);
-		$this->_updateQuery->bindValue('fromid',$fromAddress,SQLITE3_TEXT);
-		$result = $this->_updateQuery->execute();
-		if ($result === false)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		return TRUE;
-	}	//	function moveCell()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return	string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		$query = "SELECT id FROM kvp_".$this->_TableName;
-		$cellIdsResult = $this->_DBHandle->query($query);
-		if ($cellIdsResult === false)
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		$cellKeys = array();
-		while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) {
-			$cellKeys[] = $row['id'];
-		}
-
-		return $cellKeys;
-	}	//	function getCellList()
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		$this->_currentCellIsDirty;
-        $this->_storeData();
-
-		//	Get a new id for the new table name
-		$tableName = str_replace('.','_',$this->_getUniqueID());
-		if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
-		                                       AS SELECT * FROM kvp_'.$this->_TableName))
-			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-
-		//	Copy the existing cell cache file
-		$this->_TableName = $tableName;
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-
-		//	Close down the temporary cache file
-		$this->__destruct();
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 */
-	public function __construct(PHPExcel_Worksheet $parent) {
-		parent::__construct($parent);
-		if (is_null($this->_DBHandle)) {
-			$this->_TableName = str_replace('.','_',$this->_getUniqueID());
-			$_DBName = ':memory:';
-
-			$this->_DBHandle = new SQLite3($_DBName);
-			if ($this->_DBHandle === false)
-				throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-			if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
-				throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
-		}
-
-		$this->_selectQuery = $this->_DBHandle->prepare("SELECT value FROM kvp_".$this->_TableName." WHERE id = :id");
-		$this->_insertQuery = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES(:id,:data)");
-		$this->_updateQuery = $this->_DBHandle->prepare("UPDATE kvp_".$this->_TableName." SET id=:toId WHERE id=:fromId");
-		$this->_deleteQuery = $this->_DBHandle->prepare("DELETE FROM kvp_".$this->_TableName." WHERE id = :id");
-	}	//	function __construct()
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		if (!is_null($this->_DBHandle)) {
-			$this->_DBHandle->exec('DROP TABLE kvp_'.$this->_TableName);
-			$this->_DBHandle->close();
-		}
-		$this->_DBHandle = null;
-	}	//	function __destruct()
-
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		if (!class_exists('SQLite3',FALSE)) {
-			return false;
-		}
-
-		return true;
-	}
-
-}

+ 0 - 294
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Wincache.php

@@ -1,294 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorage_Wincache
- *
- * @category   PHPExcel
- * @package	PHPExcel_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
-
-	/**
-	 * Prefix used to uniquely identify cache data for this worksheet
-	 *
-	 * @var string
-	 */
-	private $_cachePrefix = null;
-
-	/**
-	 * Cache timeout
-	 *
-	 * @var integer
-	 */
-	private $_cacheTime = 600;
-
-
-    /**
-     * Store cell data in cache for the current cell object if it's "dirty",
-     *     and the 'nullify' the current cell object
-     *
-	 * @return	void
-     * @throws	PHPExcel_Exception
-     */
-	protected function _storeData() {
-		if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
-			$this->_currentObject->detach();
-
-			$obj = serialize($this->_currentObject);
-			if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) {
-				if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
-					$this->__destruct();
-					throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
-				}
-			} else {
-				if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
-					$this->__destruct();
-					throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
-				}
-			}
-			$this->_currentCellIsDirty = false;
-		}
-
-		$this->_currentObjectID = $this->_currentObject = null;
-	}	//	function _storeData()
-
-
-	/**
-	 * Add or Update a cell in cache identified by coordinate address
-	 *
-	 * @param	string			$pCoord		Coordinate address of the cell to update
-	 * @param	PHPExcel_Cell	$cell		Cell to update
-	 * @return	PHPExcel_Cell
-	 * @throws	PHPExcel_Exception
-	 */
-	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
-		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
-			$this->_storeData();
-		}
-		$this->_cellCache[$pCoord] = true;
-
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = $cell;
-		$this->_currentCellIsDirty = true;
-
-		return $cell;
-	}	//	function addCacheData()
-
-
-	/**
-	 * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
-	 *
-	 * @param	string		$pCoord		Coordinate address of the cell to check
-	 * @return	boolean
-	 */
-	public function isDataSet($pCoord) {
-		//	Check if the requested entry is the current object, or exists in the cache
-		if (parent::isDataSet($pCoord)) {
-			if ($this->_currentObjectID == $pCoord) {
-				return true;
-			}
-			//	Check if the requested entry still exists in cache
-			$success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache');
-			if ($success === false) {
-				//	Entry no longer exists in Wincache, so clear it from the cache array
-				parent::deleteCacheData($pCoord);
-				throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
-			}
-			return true;
-		}
-		return false;
-	}	//	function isDataSet()
-
-
-	/**
-	 * Get cell at a specific coordinate
-	 *
-	 * @param	string			$pCoord		Coordinate of the cell
-	 * @throws	PHPExcel_Exception
-	 * @return	PHPExcel_Cell	Cell that was found, or null if not found
-	 */
-	public function getCacheData($pCoord) {
-		if ($pCoord === $this->_currentObjectID) {
-			return $this->_currentObject;
-		}
-		$this->_storeData();
-
-		//	Check if the entry that has been requested actually exists
-		$obj = null;
-		if (parent::isDataSet($pCoord)) {
-			$success = false;
-			$obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success);
-			if ($success === false) {
-				//	Entry no longer exists in WinCache, so clear it from the cache array
-				parent::deleteCacheData($pCoord);
-				throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
-			}
-		} else {
-			//	Return null if requested entry doesn't exist in cache
-			return null;
-		}
-
-		//	Set current entry to the requested entry
-		$this->_currentObjectID = $pCoord;
-		$this->_currentObject = unserialize($obj);
-        //    Re-attach this as the cell's parent
-        $this->_currentObject->attach($this);
-
-		//	Return requested entry
-		return $this->_currentObject;
-	}	//	function getCacheData()
-
-
-	/**
-	 * Get a list of all cell addresses currently held in cache
-	 *
-	 * @return  string[]
-	 */
-	public function getCellList() {
-		if ($this->_currentObjectID !== null) {
-			$this->_storeData();
-		}
-
-		return parent::getCellList();
-	}
-
-
-	/**
-	 * Delete a cell in cache identified by coordinate address
-	 *
-	 * @param	string			$pCoord		Coordinate address of the cell to delete
-	 * @throws	PHPExcel_Exception
-	 */
-	public function deleteCacheData($pCoord) {
-		//	Delete the entry from Wincache
-		wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache');
-
-		//	Delete the entry from our cell address array
-		parent::deleteCacheData($pCoord);
-	}	//	function deleteCacheData()
-
-
-	/**
-	 * Clone the cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The new worksheet
-	 * @return	void
-	 */
-	public function copyCellCollection(PHPExcel_Worksheet $parent) {
-		parent::copyCellCollection($parent);
-		//	Get a new id for the new file name
-		$baseUnique = $this->_getUniqueID();
-		$newCachePrefix = substr(md5($baseUnique),0,8).'.';
-		$cacheList = $this->getCellList();
-		foreach($cacheList as $cellID) {
-			if ($cellID != $this->_currentObjectID) {
-				$success = false;
-				$obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success);
-				if ($success === false) {
-					//	Entry no longer exists in WinCache, so clear it from the cache array
-					parent::deleteCacheData($cellID);
-					throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in Wincache');
-				}
-				if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
-					$this->__destruct();
-					throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in Wincache');
-				}
-			}
-		}
-		$this->_cachePrefix = $newCachePrefix;
-	}	//	function copyCellCollection()
-
-
-	/**
-	 * Clear the cell collection and disconnect from our parent
-	 *
-	 * @return	void
-	 */
-	public function unsetWorksheetCells() {
-		if(!is_null($this->_currentObject)) {
-			$this->_currentObject->detach();
-			$this->_currentObject = $this->_currentObjectID = null;
-		}
-
-		//	Flush the WinCache cache
-		$this->__destruct();
-
-		$this->_cellCache = array();
-
-		//	detach ourself from the worksheet, so that it can then delete this object successfully
-		$this->_parent = null;
-	}	//	function unsetWorksheetCells()
-
-
-	/**
-	 * Initialise this new cell collection
-	 *
-	 * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
-	 * @param	array of mixed		$arguments	Additional initialisation arguments
-	 */
-	public function __construct(PHPExcel_Worksheet $parent, $arguments) {
-		$cacheTime	= (isset($arguments['cacheTime']))	? $arguments['cacheTime']	: 600;
-
-		if (is_null($this->_cachePrefix)) {
-			$baseUnique = $this->_getUniqueID();
-			$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
-			$this->_cacheTime = $cacheTime;
-
-			parent::__construct($parent);
-		}
-	}	//	function __construct()
-
-
-	/**
-	 * Destroy this cell collection
-	 */
-	public function __destruct() {
-		$cacheList = $this->getCellList();
-		foreach($cacheList as $cellID) {
-			wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
-		}
-	}	//	function __destruct()
-
-
-	/**
-	 * Identify whether the caching method is currently available
-	 * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
-	 *
-	 * @return	boolean
-	 */
-	public static function cacheMethodIsAvailable() {
-		if (!function_exists('wincache_ucache_add')) {
-			return false;
-		}
-
-		return true;
-	}
-
-}

+ 0 - 251
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorageFactory.php

@@ -1,251 +0,0 @@
-<?php
-
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_CachedObjectStorage
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CachedObjectStorageFactory
- *
- * @category    PHPExcel
- * @package        PHPExcel_CachedObjectStorage
- * @copyright    Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CachedObjectStorageFactory
-{
-    const cache_in_memory               = 'Memory';
-    const cache_in_memory_gzip          = 'MemoryGZip';
-    const cache_in_memory_serialized    = 'MemorySerialized';
-    const cache_igbinary                = 'Igbinary';
-    const cache_to_discISAM             = 'DiscISAM';
-    const cache_to_apc                  = 'APC';
-    const cache_to_memcache             = 'Memcache';
-    const cache_to_phpTemp              = 'PHPTemp';
-    const cache_to_wincache             = 'Wincache';
-    const cache_to_sqlite               = 'SQLite';
-    const cache_to_sqlite3              = 'SQLite3';
-
-
-    /**
-     * Name of the method used for cell cacheing
-     *
-     * @var string
-     */
-    private static $_cacheStorageMethod = NULL;
-
-    /**
-     * Name of the class used for cell cacheing
-     *
-     * @var string
-     */
-    private static $_cacheStorageClass = NULL;
-
-
-    /**
-     * List of all possible cache storage methods
-     *
-     * @var string[]
-     */
-    private static $_storageMethods = array(
-        self::cache_in_memory,
-        self::cache_in_memory_gzip,
-        self::cache_in_memory_serialized,
-        self::cache_igbinary,
-        self::cache_to_phpTemp,
-        self::cache_to_discISAM,
-        self::cache_to_apc,
-        self::cache_to_memcache,
-        self::cache_to_wincache,
-        self::cache_to_sqlite,
-        self::cache_to_sqlite3,
-    );
-
-
-    /**
-     * Default arguments for each cache storage method
-     *
-     * @var array of mixed array
-     */
-    private static $_storageMethodDefaultParameters = array(
-        self::cache_in_memory               => array(
-                                                    ),
-        self::cache_in_memory_gzip          => array(
-                                                    ),
-        self::cache_in_memory_serialized    => array(
-                                                    ),
-        self::cache_igbinary                => array(
-                                                    ),
-        self::cache_to_phpTemp              => array( 'memoryCacheSize' => '1MB'
-                                                    ),
-        self::cache_to_discISAM             => array( 'dir'             => NULL
-                                                    ),
-        self::cache_to_apc                  => array( 'cacheTime'       => 600
-                                                    ),
-        self::cache_to_memcache             => array( 'memcacheServer'  => 'localhost',
-                                                      'memcachePort'    => 11211,
-                                                      'cacheTime'       => 600
-                                                    ),
-        self::cache_to_wincache             => array( 'cacheTime'       => 600
-                                                    ),
-        self::cache_to_sqlite               => array(
-                                                    ),
-        self::cache_to_sqlite3              => array(
-                                                    ),
-    );
-
-
-    /**
-     * Arguments for the active cache storage method
-     *
-     * @var array of mixed array
-     */
-    private static $_storageMethodParameters = array();
-
-
-    /**
-     * Return the current cache storage method
-     *
-     * @return string|NULL
-     **/
-    public static function getCacheStorageMethod()
-    {
-        return self::$_cacheStorageMethod;
-    }   //    function getCacheStorageMethod()
-
-
-    /**
-     * Return the current cache storage class
-     *
-     * @return PHPExcel_CachedObjectStorage_ICache|NULL
-     **/
-    public static function getCacheStorageClass()
-    {
-        return self::$_cacheStorageClass;
-    }   //    function getCacheStorageClass()
-
-
-    /**
-     * Return the list of all possible cache storage methods
-     *
-     * @return string[]
-     **/
-    public static function getAllCacheStorageMethods()
-    {
-        return self::$_storageMethods;
-    }   //    function getCacheStorageMethods()
-
-
-    /**
-     * Return the list of all available cache storage methods
-     *
-     * @return string[]
-     **/
-    public static function getCacheStorageMethods()
-    {
-        $activeMethods = array();
-        foreach(self::$_storageMethods as $storageMethod) {
-            $cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod;
-            if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
-                $activeMethods[] = $storageMethod;
-            }
-        }
-        return $activeMethods;
-    }   //    function getCacheStorageMethods()
-
-
-    /**
-     * Identify the cache storage method to use
-     *
-     * @param    string            $method        Name of the method to use for cell cacheing
-     * @param    array of mixed    $arguments    Additional arguments to pass to the cell caching class
-     *                                        when instantiating
-     * @return boolean
-     **/
-    public static function initialize($method = self::cache_in_memory, $arguments = array())
-    {
-        if (!in_array($method,self::$_storageMethods)) {
-            return FALSE;
-        }
-
-        $cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
-        if (!call_user_func(array( $cacheStorageClass,
-                                   'cacheMethodIsAvailable'))) {
-            return FALSE;
-        }
-
-        self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
-        foreach($arguments as $k => $v) {
-            if (array_key_exists($k, self::$_storageMethodParameters[$method])) {
-                self::$_storageMethodParameters[$method][$k] = $v;
-            }
-        }
-
-        if (self::$_cacheStorageMethod === NULL) {
-            self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method;
-            self::$_cacheStorageMethod = $method;
-        }
-        return TRUE;
-    }   //    function initialize()
-
-
-    /**
-     * Initialise the cache storage
-     *
-     * @param    PHPExcel_Worksheet     $parent        Enable cell caching for this worksheet
-     * @return    PHPExcel_CachedObjectStorage_ICache
-     **/
-    public static function getInstance(PHPExcel_Worksheet $parent)
-    {
-        $cacheMethodIsAvailable = TRUE;
-        if (self::$_cacheStorageMethod === NULL) {
-            $cacheMethodIsAvailable = self::initialize();
-        }
-
-        if ($cacheMethodIsAvailable) {
-            $instance = new self::$_cacheStorageClass( $parent,
-                                                       self::$_storageMethodParameters[self::$_cacheStorageMethod]
-                                                     );
-            if ($instance !== NULL) {
-                return $instance;
-            }
-        }
-
-        return FALSE;
-    }   //    function getInstance()
-
-
-    /**
-     * Clear the cache storage
-     *
-     **/
-	public static function finalize()
-	{
-		self::$_cacheStorageMethod = NULL;
-		self::$_cacheStorageClass = NULL;
-		self::$_storageMethodParameters = array();
-	}
-
-}

+ 0 - 98
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php

@@ -1,98 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_CalcEngine_CyclicReferenceStack
- *
- * @category	PHPExcel_CalcEngine_CyclicReferenceStack
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CalcEngine_CyclicReferenceStack {
-
-	/**
-	 *  The call stack for calculated cells
-	 *
-	 *  @var mixed[]
-	 */
-	private $_stack = array();
-
-
-	/**
-	 * Return the number of entries on the stack
-	 *
-	 * @return  integer
-	 */
-	public function count() {
-		return count($this->_stack);
-	}
-
-	/**
-	 * Push a new entry onto the stack
-	 *
-	 * @param  mixed  $value
-	 */
-	public function push($value) {
-		$this->_stack[$value] = $value;
-	}
-
-	/**
-	 * Pop the last entry from the stack
-	 *
-	 * @return  mixed
-	 */
-	public function pop() {
-		return array_pop($this->_stack);
-	}
-
-	/**
-	 * Test to see if a specified entry exists on the stack
-	 *
-	 * @param  mixed  $value  The value to test
-	 */
-	public function onStack($value) {
-		return isset($this->_stack[$value]);
-	}
-
-	/**
-	 * Clear the stack
-	 */
-	public function clear() {
-		$this->_stack = array();
-	}
-
-	/**
-	 * Return an array of all entries on the stack
-	 *
-	 * @return  mixed[]
-	 */
-	public function showStack() {
-		return $this->_stack;
-	}
-
-}

+ 0 - 153
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/CalcEngine/Logger.php

@@ -1,153 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-/**
- * PHPExcel_CalcEngine_Logger
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_CalcEngine_Logger {
-
-	/**
-	 * Flag to determine whether a debug log should be generated by the calculation engine
-	 *		If true, then a debug log will be generated
-	 *		If false, then a debug log will not be generated
-	 *
-	 * @var boolean
-	 */
-	private $_writeDebugLog = FALSE;
-
-	/**
-	 * Flag to determine whether a debug log should be echoed by the calculation engine
-	 *		If true, then a debug log will be echoed
-	 *		If false, then a debug log will not be echoed
-	 * A debug log can only be echoed if it is generated
-	 *
-	 * @var boolean
-	 */
-	private $_echoDebugLog = FALSE;
-
-	/**
-	 * The debug log generated by the calculation engine
-	 *
-	 * @var string[]
-	 */
-	private $_debugLog = array();
-
-	/**
-	 * The calculation engine cell reference stack
-	 *
-	 * @var PHPExcel_CalcEngine_CyclicReferenceStack
-	 */
-	private $_cellStack;
-
-	
-	/**
-	 * Instantiate a Calculation engine logger
-	 *
-	 * @param  PHPExcel_CalcEngine_CyclicReferenceStack $stack
-	 */
-	public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack) {
-		$this->_cellStack = $stack;
-	}
-
-	/**
-	 * Enable/Disable Calculation engine logging
-	 *
-	 * @param  boolean $pValue
-	 */
-	public function setWriteDebugLog($pValue = FALSE) {
-		$this->_writeDebugLog = $pValue;
-	}
-
-	/**
-	 * Return whether calculation engine logging is enabled or disabled
-	 *
-	 * @return  boolean
-	 */
-	public function getWriteDebugLog() {
-		return $this->_writeDebugLog;
-	}
-
-	/**
-	 * Enable/Disable echoing of debug log information
-	 *
-	 * @param  boolean $pValue
-	 */
-	public function setEchoDebugLog($pValue = FALSE) {
-		$this->_echoDebugLog = $pValue;
-	}
-
-	/**
-	 * Return whether echoing of debug log information is enabled or disabled
-	 *
-	 * @return  boolean
-	 */
-	public function getEchoDebugLog() {
-		return $this->_echoDebugLog;
-	}
-
-	/**
-	 * Write an entry to the calculation engine debug log
-	 */
-	public function writeDebugLog() {
-		//	Only write the debug log if logging is enabled
-		if ($this->_writeDebugLog) {
-			$message = implode(func_get_args());
-			$cellReference = implode(' -> ', $this->_cellStack->showStack());
-			if ($this->_echoDebugLog) {
-				echo $cellReference, 
-					($this->_cellStack->count() > 0 ? ' => ' : ''), 
-					$message, 
-					PHP_EOL;
-			}
-			$this->_debugLog[] = $cellReference . 
-				($this->_cellStack->count() > 0 ? ' => ' : '') . 
-				$message;
-		}
-	}	//	function _writeDebug()
-
-	/**
-	 * Clear the calculation engine debug log
-	 */
-	public function clearLog() {
-		$this->_debugLog = array();
-	}	//	function flushLogger()
-
-	/**
-	 * Return the calculation engine debug log
-	 *
-	 * @return  string[]
-	 */
-	public function getLog() {
-		return $this->_debugLog;
-	}	//	function flushLogger()
-
-}	//	class PHPExcel_CalcEngine_Logger
-

+ 0 - 3952
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php

@@ -1,3952 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-if (!defined('CALCULATION_REGEXP_CELLREF')) {
-	//	Test for support of \P (multibyte options) in PCRE
-	if(defined('PREG_BAD_UTF8_ERROR')) {
-		//	Cell reference (cell or range of cells, with or without a sheet reference)
-		define('CALCULATION_REGEXP_CELLREF','((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})');
-		//	Named Range of cells
-		define('CALCULATION_REGEXP_NAMEDRANGE','((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)');
-	} else {
-		//	Cell reference (cell or range of cells, with or without a sheet reference)
-		define('CALCULATION_REGEXP_CELLREF','(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)');
-		//	Named Range of cells
-		define('CALCULATION_REGEXP_NAMEDRANGE','(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9\.]*)');
-	}
-}
-
-
-/**
- * PHPExcel_Calculation (Multiton)
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation {
-
-	/** Constants				*/
-	/** Regular Expressions		*/
-	//	Numeric operand
-	const CALCULATION_REGEXP_NUMBER		= '[-+]?\d*\.?\d+(e[-+]?\d+)?';
-	//	String operand
-	const CALCULATION_REGEXP_STRING		= '"(?:[^"]|"")*"';
-	//	Opening bracket
-	const CALCULATION_REGEXP_OPENBRACE	= '\(';
-	//	Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it)
-	const CALCULATION_REGEXP_FUNCTION	= '@?([A-Z][A-Z0-9\.]*)[\s]*\(';
-	//	Cell reference (cell or range of cells, with or without a sheet reference)
-	const CALCULATION_REGEXP_CELLREF	= CALCULATION_REGEXP_CELLREF;
-	//	Named Range of cells
-	const CALCULATION_REGEXP_NAMEDRANGE	= CALCULATION_REGEXP_NAMEDRANGE;
-	//	Error
-	const CALCULATION_REGEXP_ERROR		= '\#[A-Z][A-Z0_\/]*[!\?]?';
-
-
-	/** constants */
-	const RETURN_ARRAY_AS_ERROR = 'error';
-	const RETURN_ARRAY_AS_VALUE = 'value';
-	const RETURN_ARRAY_AS_ARRAY = 'array';
-
-	private static $returnArrayAsType	= self::RETURN_ARRAY_AS_VALUE;
-
-
-	/**
-	 * Instance of this class
-	 *
-	 * @access	private
-	 * @var PHPExcel_Calculation
-	 */
-	private static $_instance;
-
-
-	/**
-	 * Instance of the workbook this Calculation Engine is using
-	 *
-	 * @access	private
-	 * @var PHPExcel
-	 */
-    private $_workbook;
-
-	/**
-	 * List of instances of the calculation engine that we've instantiated for individual workbooks
-	 *
-	 * @access	private
-	 * @var PHPExcel_Calculation[]
-	 */
-    private static $_workbookSets;
-
-	/**
-	 * Calculation cache
-	 *
-	 * @access	private
-	 * @var array
-	 */
-	private $_calculationCache = array ();
-
-
-	/**
-	 * Calculation cache enabled
-	 *
-	 * @access	private
-	 * @var boolean
-	 */
-	private $_calculationCacheEnabled = TRUE;
-
-
-	/**
-	 * List of operators that can be used within formulae
-	 * The true/false value indicates whether it is a binary operator or a unary operator
-	 *
-	 * @access	private
-	 * @var array
-	 */
-	private static $_operators			= array('+' => TRUE,	'-' => TRUE,	'*' => TRUE,	'/' => TRUE,
-												'^' => TRUE,	'&' => TRUE,	'%' => FALSE,	'~' => FALSE,
-												'>' => TRUE,	'<' => TRUE,	'=' => TRUE,	'>=' => TRUE,
-												'<=' => TRUE,	'<>' => TRUE,	'|' => TRUE,	':' => TRUE
-											   );
-
-
-	/**
-	 * List of binary operators (those that expect two operands)
-	 *
-	 * @access	private
-	 * @var array
-	 */
-	private static $_binaryOperators	= array('+' => TRUE,	'-' => TRUE,	'*' => TRUE,	'/' => TRUE,
-												'^' => TRUE,	'&' => TRUE,	'>' => TRUE,	'<' => TRUE,
-												'=' => TRUE,	'>=' => TRUE,	'<=' => TRUE,	'<>' => TRUE,
-												'|' => TRUE,	':' => TRUE
-											   );
-
-	/**
-	 * The debug log generated by the calculation engine
-	 *
-	 * @access	private
-	 * @var PHPExcel_CalcEngine_Logger
-	 *
-	 */
-	private $debugLog;
-
-	/**
-	 * Flag to determine how formula errors should be handled
-	 *		If true, then a user error will be triggered
-	 *		If false, then an exception will be thrown
-	 *
-	 * @access	public
-	 * @var boolean
-	 *
-	 */
-	public $suppressFormulaErrors = FALSE;
-
-	/**
-	 * Error message for any error that was raised/thrown by the calculation engine
-	 *
-	 * @access	public
-	 * @var string
-	 *
-	 */
-	public $formulaError = NULL;
-
-	/**
-	 * An array of the nested cell references accessed by the calculation engine, used for the debug log
-	 *
-	 * @access	private
-	 * @var array of string
-	 *
-	 */
-	private $_cyclicReferenceStack;
-
-	private $_cellStack = array();
-
-	/**
-	 * Current iteration counter for cyclic formulae
-	 * If the value is 0 (or less) then cyclic formulae will throw an exception,
-	 *    otherwise they will iterate to the limit defined here before returning a result
-	 *
-	 * @var integer
-	 *
-	 */
-	private $_cyclicFormulaCount = 1;
-
-	private $_cyclicFormulaCell = '';
-
-	/**
-	 * Number of iterations for cyclic formulae
-	 *
-	 * @var integer
-	 *
-	 */
-	public $cyclicFormulaCount = 1;
-
-	/**
-	 * Precision used for calculations
-	 *
-	 * @var integer
-	 *
-	 */
-	private $_savedPrecision	= 14;
-
-
-	/**
-	 * The current locale setting
-	 *
-	 * @var string
-	 *
-	 */
-	private static $_localeLanguage = 'en_us';					//	US English	(default locale)
-
-	/**
-	 * List of available locale settings
-	 * Note that this is read for the locale subdirectory only when requested
-	 *
-	 * @var string[]
-	 *
-	 */
-	private static $_validLocaleLanguages = array(	'en'		//	English		(default language)
-												 );
-	/**
-	 * Locale-specific argument separator for function arguments
-	 *
-	 * @var string
-	 *
-	 */
-	private static $_localeArgumentSeparator = ',';
-	private static $_localeFunctions = array();
-
-	/**
-	 * Locale-specific translations for Excel constants (True, False and Null)
-	 *
-	 * @var string[]
-	 *
-	 */
-	public static $_localeBoolean = array(	'TRUE'	=> 'TRUE',
-											'FALSE'	=> 'FALSE',
-											'NULL'	=> 'NULL'
-										  );
-
-
-	/**
-	 * Excel constant string translations to their PHP equivalents
-	 * Constant conversion from text name/value to actual (datatyped) value
-	 *
-	 * @var string[]
-	 *
-	 */
-	private static $_ExcelConstants = array('TRUE'	=> TRUE,
-											'FALSE'	=> FALSE,
-											'NULL'	=> NULL
-										   );
-
-	//	PHPExcel functions
-	private static $_PHPExcelFunctions = array(	// PHPExcel functions
-				'ABS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'abs',
-												 'argumentCount'	=>	'1'
-												),
-				'ACCRINT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::ACCRINT',
-												 'argumentCount'	=>	'4-7'
-												),
-				'ACCRINTM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::ACCRINTM',
-												 'argumentCount'	=>	'3-5'
-												),
-				'ACOS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'acos',
-												 'argumentCount'	=>	'1'
-												),
-				'ACOSH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'acosh',
-												 'argumentCount'	=>	'1'
-												),
-				'ADDRESS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::CELL_ADDRESS',
-												 'argumentCount'	=>	'2-5'
-												),
-				'AMORDEGRC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::AMORDEGRC',
-												 'argumentCount'	=>	'6,7'
-												),
-				'AMORLINC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::AMORLINC',
-												 'argumentCount'	=>	'6,7'
-												),
-				'AND'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::LOGICAL_AND',
-												 'argumentCount'	=>	'1+'
-												),
-				'AREAS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'ASC'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'ASIN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'asin',
-												 'argumentCount'	=>	'1'
-												),
-				'ASINH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'asinh',
-												 'argumentCount'	=>	'1'
-												),
-				'ATAN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'atan',
-												 'argumentCount'	=>	'1'
-												),
-				'ATAN2'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::ATAN2',
-												 'argumentCount'	=>	'2'
-												),
-				'ATANH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'atanh',
-												 'argumentCount'	=>	'1'
-												),
-				'AVEDEV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::AVEDEV',
-												 'argumentCount'	=>	'1+'
-												),
-				'AVERAGE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::AVERAGE',
-												 'argumentCount'	=>	'1+'
-												),
-				'AVERAGEA'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::AVERAGEA',
-												 'argumentCount'	=>	'1+'
-												),
-				'AVERAGEIF'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::AVERAGEIF',
-												 'argumentCount'	=>	'2,3'
-												),
-				'AVERAGEIFS'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'3+'
-												),
-				'BAHTTEXT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'BESSELI'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BESSELI',
-												 'argumentCount'	=>	'2'
-												),
-				'BESSELJ'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BESSELJ',
-												 'argumentCount'	=>	'2'
-												),
-				'BESSELK'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BESSELK',
-												 'argumentCount'	=>	'2'
-												),
-				'BESSELY'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BESSELY',
-												 'argumentCount'	=>	'2'
-												),
-				'BETADIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::BETADIST',
-												 'argumentCount'	=>	'3-5'
-												),
-				'BETAINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::BETAINV',
-												 'argumentCount'	=>	'3-5'
-												),
-				'BIN2DEC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BINTODEC',
-												 'argumentCount'	=>	'1'
-												),
-				'BIN2HEX'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BINTOHEX',
-												 'argumentCount'	=>	'1,2'
-												),
-				'BIN2OCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::BINTOOCT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'BINOMDIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::BINOMDIST',
-												 'argumentCount'	=>	'4'
-												),
-				'CEILING'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::CEILING',
-												 'argumentCount'	=>	'2'
-												),
-				'CELL'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1,2'
-												),
-				'CHAR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::CHARACTER',
-												 'argumentCount'	=>	'1'
-												),
-				'CHIDIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CHIDIST',
-												 'argumentCount'	=>	'2'
-												),
-				'CHIINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CHIINV',
-												 'argumentCount'	=>	'2'
-												),
-				'CHITEST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'CHOOSE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::CHOOSE',
-												 'argumentCount'	=>	'2+'
-												),
-				'CLEAN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::TRIMNONPRINTABLE',
-												 'argumentCount'	=>	'1'
-												),
-				'CODE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::ASCIICODE',
-												 'argumentCount'	=>	'1'
-												),
-				'COLUMN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::COLUMN',
-												 'argumentCount'	=>	'-1',
-												 'passByReference'	=>	array(TRUE)
-												),
-				'COLUMNS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::COLUMNS',
-												 'argumentCount'	=>	'1'
-												),
-				'COMBIN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::COMBIN',
-												 'argumentCount'	=>	'2'
-												),
-				'COMPLEX'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::COMPLEX',
-												 'argumentCount'	=>	'2,3'
-												),
-				'CONCATENATE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::CONCATENATE',
-												 'argumentCount'	=>	'1+'
-												),
-				'CONFIDENCE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CONFIDENCE',
-												 'argumentCount'	=>	'3'
-												),
-				'CONVERT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::CONVERTUOM',
-												 'argumentCount'	=>	'3'
-												),
-				'CORREL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CORREL',
-												 'argumentCount'	=>	'2'
-												),
-				'COS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'cos',
-												 'argumentCount'	=>	'1'
-												),
-				'COSH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'cosh',
-												 'argumentCount'	=>	'1'
-												),
-				'COUNT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::COUNT',
-												 'argumentCount'	=>	'1+'
-												),
-				'COUNTA'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::COUNTA',
-												 'argumentCount'	=>	'1+'
-												),
-				'COUNTBLANK'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::COUNTBLANK',
-												 'argumentCount'	=>	'1'
-												),
-				'COUNTIF'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::COUNTIF',
-												 'argumentCount'	=>	'2'
-												),
-				'COUNTIFS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'COUPDAYBS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPDAYBS',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COUPDAYS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPDAYS',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COUPDAYSNC'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPDAYSNC',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COUPNCD'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPNCD',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COUPNUM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPNUM',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COUPPCD'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::COUPPCD',
-												 'argumentCount'	=>	'3,4'
-												),
-				'COVAR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::COVAR',
-												 'argumentCount'	=>	'2'
-												),
-				'CRITBINOM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CRITBINOM',
-												 'argumentCount'	=>	'3'
-												),
-				'CUBEKPIMEMBER'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBEMEMBER'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBEMEMBERPROPERTY'	=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBERANKEDMEMBER'		=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBESET'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBESETCOUNT'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUBEVALUE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_CUBE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'CUMIPMT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::CUMIPMT',
-												 'argumentCount'	=>	'6'
-												),
-				'CUMPRINC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::CUMPRINC',
-												 'argumentCount'	=>	'6'
-												),
-				'DATE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DATE',
-												 'argumentCount'	=>	'3'
-												),
-				'DATEDIF'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DATEDIF',
-												 'argumentCount'	=>	'2,3'
-												),
-				'DATEVALUE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DATEVALUE',
-												 'argumentCount'	=>	'1'
-												),
-				'DAVERAGE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DAVERAGE',
-												 'argumentCount'	=>	'3'
-												),
-				'DAY'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DAYOFMONTH',
-												 'argumentCount'	=>	'1'
-												),
-				'DAYS360'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DAYS360',
-												 'argumentCount'	=>	'2,3'
-												),
-				'DB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::DB',
-												 'argumentCount'	=>	'4,5'
-												),
-				'DCOUNT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DCOUNT',
-												 'argumentCount'	=>	'3'
-												),
-				'DCOUNTA'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DCOUNTA',
-												 'argumentCount'	=>	'3'
-												),
-				'DDB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::DDB',
-												 'argumentCount'	=>	'4,5'
-												),
-				'DEC2BIN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::DECTOBIN',
-												 'argumentCount'	=>	'1,2'
-												),
-				'DEC2HEX'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::DECTOHEX',
-												 'argumentCount'	=>	'1,2'
-												),
-				'DEC2OCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::DECTOOCT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'DEGREES'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'rad2deg',
-												 'argumentCount'	=>	'1'
-												),
-				'DELTA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::DELTA',
-												 'argumentCount'	=>	'1,2'
-												),
-				'DEVSQ'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::DEVSQ',
-												 'argumentCount'	=>	'1+'
-												),
-				'DGET'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DGET',
-												 'argumentCount'	=>	'3'
-												),
-				'DISC'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::DISC',
-												 'argumentCount'	=>	'4,5'
-												),
-				'DMAX'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DMAX',
-												 'argumentCount'	=>	'3'
-												),
-				'DMIN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DMIN',
-												 'argumentCount'	=>	'3'
-												),
-				'DOLLAR'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::DOLLAR',
-												 'argumentCount'	=>	'1,2'
-												),
-				'DOLLARDE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::DOLLARDE',
-												 'argumentCount'	=>	'2'
-												),
-				'DOLLARFR'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::DOLLARFR',
-												 'argumentCount'	=>	'2'
-												),
-				'DPRODUCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DPRODUCT',
-												 'argumentCount'	=>	'3'
-												),
-				'DSTDEV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DSTDEV',
-												 'argumentCount'	=>	'3'
-												),
-				'DSTDEVP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DSTDEVP',
-												 'argumentCount'	=>	'3'
-												),
-				'DSUM'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DSUM',
-												 'argumentCount'	=>	'3'
-												),
-				'DURATION'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'5,6'
-												),
-				'DVAR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DVAR',
-												 'argumentCount'	=>	'3'
-												),
-				'DVARP'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATABASE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Database::DVARP',
-												 'argumentCount'	=>	'3'
-												),
-				'EDATE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::EDATE',
-												 'argumentCount'	=>	'2'
-												),
-				'EFFECT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::EFFECT',
-												 'argumentCount'	=>	'2'
-												),
-				'EOMONTH'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::EOMONTH',
-												 'argumentCount'	=>	'2'
-												),
-				'ERF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::ERF',
-												 'argumentCount'	=>	'1,2'
-												),
-				'ERFC'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::ERFC',
-												 'argumentCount'	=>	'1'
-												),
-				'ERROR.TYPE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::ERROR_TYPE',
-												 'argumentCount'	=>	'1'
-												),
-				'EVEN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::EVEN',
-												 'argumentCount'	=>	'1'
-												),
-				'EXACT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'EXP'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'exp',
-												 'argumentCount'	=>	'1'
-												),
-				'EXPONDIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::EXPONDIST',
-												 'argumentCount'	=>	'3'
-												),
-				'FACT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::FACT',
-												 'argumentCount'	=>	'1'
-												),
-				'FACTDOUBLE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::FACTDOUBLE',
-												 'argumentCount'	=>	'1'
-												),
-				'FALSE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::FALSE',
-												 'argumentCount'	=>	'0'
-												),
-				'FDIST'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'3'
-												),
-				'FIND'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::SEARCHSENSITIVE',
-												 'argumentCount'	=>	'2,3'
-												),
-				'FINDB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::SEARCHSENSITIVE',
-												 'argumentCount'	=>	'2,3'
-												),
-				'FINV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'3'
-												),
-				'FISHER'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::FISHER',
-												 'argumentCount'	=>	'1'
-												),
-				'FISHERINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::FISHERINV',
-												 'argumentCount'	=>	'1'
-												),
-				'FIXED'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::FIXEDFORMAT',
-												 'argumentCount'	=>	'1-3'
-												),
-				'FLOOR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::FLOOR',
-												 'argumentCount'	=>	'2'
-												),
-				'FORECAST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::FORECAST',
-												 'argumentCount'	=>	'3'
-												),
-				'FREQUENCY'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'FTEST'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'FV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::FV',
-												 'argumentCount'	=>	'3-5'
-												),
-				'FVSCHEDULE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::FVSCHEDULE',
-												 'argumentCount'	=>	'2'
-												),
-				'GAMMADIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::GAMMADIST',
-												 'argumentCount'	=>	'4'
-												),
-				'GAMMAINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::GAMMAINV',
-												 'argumentCount'	=>	'3'
-												),
-				'GAMMALN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::GAMMALN',
-												 'argumentCount'	=>	'1'
-												),
-				'GCD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::GCD',
-												 'argumentCount'	=>	'1+'
-												),
-				'GEOMEAN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::GEOMEAN',
-												 'argumentCount'	=>	'1+'
-												),
-				'GESTEP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::GESTEP',
-												 'argumentCount'	=>	'1,2'
-												),
-				'GETPIVOTDATA'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2+'
-												),
-				'GROWTH'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::GROWTH',
-												 'argumentCount'	=>	'1-4'
-												),
-				'HARMEAN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::HARMEAN',
-												 'argumentCount'	=>	'1+'
-												),
-				'HEX2BIN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::HEXTOBIN',
-												 'argumentCount'	=>	'1,2'
-												),
-				'HEX2DEC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::HEXTODEC',
-												 'argumentCount'	=>	'1'
-												),
-				'HEX2OCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::HEXTOOCT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'HLOOKUP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::HLOOKUP',
-												 'argumentCount'	=>	'3,4'
-												),
-				'HOUR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::HOUROFDAY',
-												 'argumentCount'	=>	'1'
-												),
-				'HYPERLINK'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::HYPERLINK',
-												 'argumentCount'	=>	'1,2',
-												 'passCellReference'=>	TRUE
-												),
-				'HYPGEOMDIST'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::HYPGEOMDIST',
-												 'argumentCount'	=>	'4'
-												),
-				'IF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::STATEMENT_IF',
-												 'argumentCount'	=>	'1-3'
-												),
-				'IFERROR'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::IFERROR',
-												 'argumentCount'	=>	'2'
-												),
-				'IMABS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMABS',
-												 'argumentCount'	=>	'1'
-												),
-				'IMAGINARY'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMAGINARY',
-												 'argumentCount'	=>	'1'
-												),
-				'IMARGUMENT'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMARGUMENT',
-												 'argumentCount'	=>	'1'
-												),
-				'IMCONJUGATE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMCONJUGATE',
-												 'argumentCount'	=>	'1'
-												),
-				'IMCOS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMCOS',
-												 'argumentCount'	=>	'1'
-												),
-				'IMDIV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMDIV',
-												 'argumentCount'	=>	'2'
-												),
-				'IMEXP'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMEXP',
-												 'argumentCount'	=>	'1'
-												),
-				'IMLN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMLN',
-												 'argumentCount'	=>	'1'
-												),
-				'IMLOG10'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMLOG10',
-												 'argumentCount'	=>	'1'
-												),
-				'IMLOG2'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMLOG2',
-												 'argumentCount'	=>	'1'
-												),
-				'IMPOWER'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMPOWER',
-												 'argumentCount'	=>	'2'
-												),
-				'IMPRODUCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMPRODUCT',
-												 'argumentCount'	=>	'1+'
-												),
-				'IMREAL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMREAL',
-												 'argumentCount'	=>	'1'
-												),
-				'IMSIN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMSIN',
-												 'argumentCount'	=>	'1'
-												),
-				'IMSQRT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMSQRT',
-												 'argumentCount'	=>	'1'
-												),
-				'IMSUB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMSUB',
-												 'argumentCount'	=>	'2'
-												),
-				'IMSUM'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::IMSUM',
-												 'argumentCount'	=>	'1+'
-												),
-				'INDEX'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::INDEX',
-												 'argumentCount'	=>	'1-4'
-												),
-				'INDIRECT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::INDIRECT',
-												 'argumentCount'	=>	'1,2',
-												 'passCellReference'=>	TRUE
-												),
-				'INFO'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'INT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::INT',
-												 'argumentCount'	=>	'1'
-												),
-				'INTERCEPT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::INTERCEPT',
-												 'argumentCount'	=>	'2'
-												),
-				'INTRATE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::INTRATE',
-												 'argumentCount'	=>	'4,5'
-												),
-				'IPMT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::IPMT',
-												 'argumentCount'	=>	'4-6'
-												),
-				'IRR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::IRR',
-												 'argumentCount'	=>	'1,2'
-												),
-				'ISBLANK'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_BLANK',
-												 'argumentCount'	=>	'1'
-												),
-				'ISERR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_ERR',
-												 'argumentCount'	=>	'1'
-												),
-				'ISERROR'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_ERROR',
-												 'argumentCount'	=>	'1'
-												),
-				'ISEVEN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_EVEN',
-												 'argumentCount'	=>	'1'
-												),
-				'ISLOGICAL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_LOGICAL',
-												 'argumentCount'	=>	'1'
-												),
-				'ISNA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_NA',
-												 'argumentCount'	=>	'1'
-												),
-				'ISNONTEXT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_NONTEXT',
-												 'argumentCount'	=>	'1'
-												),
-				'ISNUMBER'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_NUMBER',
-												 'argumentCount'	=>	'1'
-												),
-				'ISODD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_ODD',
-												 'argumentCount'	=>	'1'
-												),
-				'ISPMT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::ISPMT',
-												 'argumentCount'	=>	'4'
-												),
-				'ISREF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'ISTEXT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::IS_TEXT',
-												 'argumentCount'	=>	'1'
-												),
-				'JIS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'KURT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::KURT',
-												 'argumentCount'	=>	'1+'
-												),
-				'LARGE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::LARGE',
-												 'argumentCount'	=>	'2'
-												),
-				'LCM'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::LCM',
-												 'argumentCount'	=>	'1+'
-												),
-				'LEFT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::LEFT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'LEFTB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::LEFT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'LEN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::STRINGLENGTH',
-												 'argumentCount'	=>	'1'
-												),
-				'LENB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::STRINGLENGTH',
-												 'argumentCount'	=>	'1'
-												),
-				'LINEST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::LINEST',
-												 'argumentCount'	=>	'1-4'
-												),
-				'LN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'log',
-												 'argumentCount'	=>	'1'
-												),
-				'LOG'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::LOG_BASE',
-												 'argumentCount'	=>	'1,2'
-												),
-				'LOG10'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'log10',
-												 'argumentCount'	=>	'1'
-												),
-				'LOGEST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::LOGEST',
-												 'argumentCount'	=>	'1-4'
-												),
-				'LOGINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::LOGINV',
-												 'argumentCount'	=>	'3'
-												),
-				'LOGNORMDIST'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::LOGNORMDIST',
-												 'argumentCount'	=>	'3'
-												),
-				'LOOKUP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::LOOKUP',
-												 'argumentCount'	=>	'2,3'
-												),
-				'LOWER'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::LOWERCASE',
-												 'argumentCount'	=>	'1'
-												),
-				'MATCH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::MATCH',
-												 'argumentCount'	=>	'2,3'
-												),
-				'MAX'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MAX',
-												 'argumentCount'	=>	'1+'
-												),
-				'MAXA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MAXA',
-												 'argumentCount'	=>	'1+'
-												),
-				'MAXIF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MAXIF',
-												 'argumentCount'	=>	'2+'
-												),
-				'MDETERM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MDETERM',
-												 'argumentCount'	=>	'1'
-												),
-				'MDURATION'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'5,6'
-												),
-				'MEDIAN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MEDIAN',
-												 'argumentCount'	=>	'1+'
-												),
-				'MEDIANIF'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2+'
-												),
-				'MID'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::MID',
-												 'argumentCount'	=>	'3'
-												),
-				'MIDB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::MID',
-												 'argumentCount'	=>	'3'
-												),
-				'MIN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MIN',
-												 'argumentCount'	=>	'1+'
-												),
-				'MINA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MINA',
-												 'argumentCount'	=>	'1+'
-												),
-				'MINIF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MINIF',
-												 'argumentCount'	=>	'2+'
-												),
-				'MINUTE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::MINUTEOFHOUR',
-												 'argumentCount'	=>	'1'
-												),
-				'MINVERSE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MINVERSE',
-												 'argumentCount'	=>	'1'
-												),
-				'MIRR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::MIRR',
-												 'argumentCount'	=>	'3'
-												),
-				'MMULT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MMULT',
-												 'argumentCount'	=>	'2'
-												),
-				'MOD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MOD',
-												 'argumentCount'	=>	'2'
-												),
-				'MODE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::MODE',
-												 'argumentCount'	=>	'1+'
-												),
-				'MONTH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::MONTHOFYEAR',
-												 'argumentCount'	=>	'1'
-												),
-				'MROUND'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MROUND',
-												 'argumentCount'	=>	'2'
-												),
-				'MULTINOMIAL'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::MULTINOMIAL',
-												 'argumentCount'	=>	'1+'
-												),
-				'N'						=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::N',
-												 'argumentCount'	=>	'1'
-												),
-				'NA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::NA',
-												 'argumentCount'	=>	'0'
-												),
-				'NEGBINOMDIST'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::NEGBINOMDIST',
-												 'argumentCount'	=>	'3'
-												),
-				'NETWORKDAYS'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::NETWORKDAYS',
-												 'argumentCount'	=>	'2+'
-												),
-				'NOMINAL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::NOMINAL',
-												 'argumentCount'	=>	'2'
-												),
-				'NORMDIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::NORMDIST',
-												 'argumentCount'	=>	'4'
-												),
-				'NORMINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::NORMINV',
-												 'argumentCount'	=>	'3'
-												),
-				'NORMSDIST'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::NORMSDIST',
-												 'argumentCount'	=>	'1'
-												),
-				'NORMSINV'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::NORMSINV',
-												 'argumentCount'	=>	'1'
-												),
-				'NOT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::NOT',
-												 'argumentCount'	=>	'1'
-												),
-				'NOW'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DATETIMENOW',
-												 'argumentCount'	=>	'0'
-												),
-				'NPER'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::NPER',
-												 'argumentCount'	=>	'3-5'
-												),
-				'NPV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::NPV',
-												 'argumentCount'	=>	'2+'
-												),
-				'OCT2BIN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::OCTTOBIN',
-												 'argumentCount'	=>	'1,2'
-												),
-				'OCT2DEC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::OCTTODEC',
-												 'argumentCount'	=>	'1'
-												),
-				'OCT2HEX'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
-												 'functionCall'		=>	'PHPExcel_Calculation_Engineering::OCTTOHEX',
-												 'argumentCount'	=>	'1,2'
-												),
-				'ODD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::ODD',
-												 'argumentCount'	=>	'1'
-												),
-				'ODDFPRICE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'8,9'
-												),
-				'ODDFYIELD'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'8,9'
-												),
-				'ODDLPRICE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'7,8'
-												),
-				'ODDLYIELD'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'7,8'
-												),
-				'OFFSET'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::OFFSET',
-												 'argumentCount'	=>	'3,5',
-												 'passCellReference'=>	TRUE,
-												 'passByReference'	=>	array(TRUE)
-												),
-				'OR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::LOGICAL_OR',
-												 'argumentCount'	=>	'1+'
-												),
-				'PEARSON'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::CORREL',
-												 'argumentCount'	=>	'2'
-												),
-				'PERCENTILE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::PERCENTILE',
-												 'argumentCount'	=>	'2'
-												),
-				'PERCENTRANK'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::PERCENTRANK',
-												 'argumentCount'	=>	'2,3'
-												),
-				'PERMUT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::PERMUT',
-												 'argumentCount'	=>	'2'
-												),
-				'PHONETIC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1'
-												),
-				'PI'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'pi',
-												 'argumentCount'	=>	'0'
-												),
-				'PMT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PMT',
-												 'argumentCount'	=>	'3-5'
-												),
-				'POISSON'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::POISSON',
-												 'argumentCount'	=>	'3'
-												),
-				'POWER'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::POWER',
-												 'argumentCount'	=>	'2'
-												),
-				'PPMT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PPMT',
-												 'argumentCount'	=>	'4-6'
-												),
-				'PRICE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PRICE',
-												 'argumentCount'	=>	'6,7'
-												),
-				'PRICEDISC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PRICEDISC',
-												 'argumentCount'	=>	'4,5'
-												),
-				'PRICEMAT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PRICEMAT',
-												 'argumentCount'	=>	'5,6'
-												),
-				'PROB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'3,4'
-												),
-				'PRODUCT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::PRODUCT',
-												 'argumentCount'	=>	'1+'
-												),
-				'PROPER'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::PROPERCASE',
-												 'argumentCount'	=>	'1'
-												),
-				'PV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::PV',
-												 'argumentCount'	=>	'3-5'
-												),
-				'QUARTILE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::QUARTILE',
-												 'argumentCount'	=>	'2'
-												),
-				'QUOTIENT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::QUOTIENT',
-												 'argumentCount'	=>	'2'
-												),
-				'RADIANS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'deg2rad',
-												 'argumentCount'	=>	'1'
-												),
-				'RAND'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::RAND',
-												 'argumentCount'	=>	'0'
-												),
-				'RANDBETWEEN'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::RAND',
-												 'argumentCount'	=>	'2'
-												),
-				'RANK'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::RANK',
-												 'argumentCount'	=>	'2,3'
-												),
-				'RATE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::RATE',
-												 'argumentCount'	=>	'3-6'
-												),
-				'RECEIVED'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::RECEIVED',
-												 'argumentCount'	=>	'4-5'
-												),
-				'REPLACE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::REPLACE',
-												 'argumentCount'	=>	'4'
-												),
-				'REPLACEB'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::REPLACE',
-												 'argumentCount'	=>	'4'
-												),
-				'REPT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'str_repeat',
-												 'argumentCount'	=>	'2'
-												),
-				'RIGHT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::RIGHT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'RIGHTB'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::RIGHT',
-												 'argumentCount'	=>	'1,2'
-												),
-				'ROMAN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::ROMAN',
-												 'argumentCount'	=>	'1,2'
-												),
-				'ROUND'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'round',
-												 'argumentCount'	=>	'2'
-												),
-				'ROUNDDOWN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::ROUNDDOWN',
-												 'argumentCount'	=>	'2'
-												),
-				'ROUNDUP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::ROUNDUP',
-												 'argumentCount'	=>	'2'
-												),
-				'ROW'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::ROW',
-												 'argumentCount'	=>	'-1',
-												 'passByReference'	=>	array(TRUE)
-												),
-				'ROWS'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::ROWS',
-												 'argumentCount'	=>	'1'
-												),
-				'RSQ'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::RSQ',
-												 'argumentCount'	=>	'2'
-												),
-				'RTD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'1+'
-												),
-				'SEARCH'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE',
-												 'argumentCount'	=>	'2,3'
-												),
-				'SEARCHB'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE',
-												 'argumentCount'	=>	'2,3'
-												),
-				'SECOND'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::SECONDOFMINUTE',
-												 'argumentCount'	=>	'1'
-												),
-				'SERIESSUM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SERIESSUM',
-												 'argumentCount'	=>	'4'
-												),
-				'SIGN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SIGN',
-												 'argumentCount'	=>	'1'
-												),
-				'SIN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'sin',
-												 'argumentCount'	=>	'1'
-												),
-				'SINH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'sinh',
-												 'argumentCount'	=>	'1'
-												),
-				'SKEW'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::SKEW',
-												 'argumentCount'	=>	'1+'
-												),
-				'SLN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::SLN',
-												 'argumentCount'	=>	'3'
-												),
-				'SLOPE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::SLOPE',
-												 'argumentCount'	=>	'2'
-												),
-				'SMALL'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::SMALL',
-												 'argumentCount'	=>	'2'
-												),
-				'SQRT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'sqrt',
-												 'argumentCount'	=>	'1'
-												),
-				'SQRTPI'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SQRTPI',
-												 'argumentCount'	=>	'1'
-												),
-				'STANDARDIZE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STANDARDIZE',
-												 'argumentCount'	=>	'3'
-												),
-				'STDEV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STDEV',
-												 'argumentCount'	=>	'1+'
-												),
-				'STDEVA'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STDEVA',
-												 'argumentCount'	=>	'1+'
-												),
-				'STDEVP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STDEVP',
-												 'argumentCount'	=>	'1+'
-												),
-				'STDEVPA'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STDEVPA',
-												 'argumentCount'	=>	'1+'
-												),
-				'STEYX'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::STEYX',
-												 'argumentCount'	=>	'2'
-												),
-				'SUBSTITUTE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::SUBSTITUTE',
-												 'argumentCount'	=>	'3,4'
-												),
-				'SUBTOTAL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUBTOTAL',
-												 'argumentCount'	=>	'2+'
-												),
-				'SUM'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUM',
-												 'argumentCount'	=>	'1+'
-												),
-				'SUMIF'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMIF',
-												 'argumentCount'	=>	'2,3'
-												),
-				'SUMIFS'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'?'
-												),
-				'SUMPRODUCT'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMPRODUCT',
-												 'argumentCount'	=>	'1+'
-												),
-				'SUMSQ'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMSQ',
-												 'argumentCount'	=>	'1+'
-												),
-				'SUMX2MY2'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMX2MY2',
-												 'argumentCount'	=>	'2'
-												),
-				'SUMX2PY2'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMX2PY2',
-												 'argumentCount'	=>	'2'
-												),
-				'SUMXMY2'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::SUMXMY2',
-												 'argumentCount'	=>	'2'
-												),
-				'SYD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::SYD',
-												 'argumentCount'	=>	'4'
-												),
-				'T'						=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::RETURNSTRING',
-												 'argumentCount'	=>	'1'
-												),
-				'TAN'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'tan',
-												 'argumentCount'	=>	'1'
-												),
-				'TANH'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'tanh',
-												 'argumentCount'	=>	'1'
-												),
-				'TBILLEQ'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::TBILLEQ',
-												 'argumentCount'	=>	'3'
-												),
-				'TBILLPRICE'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::TBILLPRICE',
-												 'argumentCount'	=>	'3'
-												),
-				'TBILLYIELD'			=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::TBILLYIELD',
-												 'argumentCount'	=>	'3'
-												),
-				'TDIST'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::TDIST',
-												 'argumentCount'	=>	'3'
-												),
-				'TEXT'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::TEXTFORMAT',
-												 'argumentCount'	=>	'2'
-												),
-				'TIME'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::TIME',
-												 'argumentCount'	=>	'3'
-												),
-				'TIMEVALUE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::TIMEVALUE',
-												 'argumentCount'	=>	'1'
-												),
-				'TINV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::TINV',
-												 'argumentCount'	=>	'2'
-												),
-				'TODAY'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DATENOW',
-												 'argumentCount'	=>	'0'
-												),
-				'TRANSPOSE'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::TRANSPOSE',
-												 'argumentCount'	=>	'1'
-												),
-				'TREND'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::TREND',
-												 'argumentCount'	=>	'1-4'
-												),
-				'TRIM'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::TRIMSPACES',
-												 'argumentCount'	=>	'1'
-												),
-				'TRIMMEAN'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::TRIMMEAN',
-												 'argumentCount'	=>	'2'
-												),
-				'TRUE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Logical::TRUE',
-												 'argumentCount'	=>	'0'
-												),
-				'TRUNC'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
-												 'functionCall'		=>	'PHPExcel_Calculation_MathTrig::TRUNC',
-												 'argumentCount'	=>	'1,2'
-												),
-				'TTEST'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'4'
-												),
-				'TYPE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::TYPE',
-												 'argumentCount'	=>	'1'
-												),
-				'UPPER'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::UPPERCASE',
-												 'argumentCount'	=>	'1'
-												),
-				'USDOLLAR'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'2'
-												),
-				'VALUE'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
-												 'functionCall'		=>	'PHPExcel_Calculation_TextData::VALUE',
-												 'argumentCount'	=>	'1'
-												),
-				'VAR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::VARFunc',
-												 'argumentCount'	=>	'1+'
-												),
-				'VARA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::VARA',
-												 'argumentCount'	=>	'1+'
-												),
-				'VARP'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::VARP',
-												 'argumentCount'	=>	'1+'
-												),
-				'VARPA'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::VARPA',
-												 'argumentCount'	=>	'1+'
-												),
-				'VDB'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'5-7'
-												),
-				'VERSION'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::VERSION',
-												 'argumentCount'	=>	'0'
-												),
-				'VLOOKUP'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
-												 'functionCall'		=>	'PHPExcel_Calculation_LookupRef::VLOOKUP',
-												 'argumentCount'	=>	'3,4'
-												),
-				'WEEKDAY'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::DAYOFWEEK',
-												 'argumentCount'	=>	'1,2'
-												),
-				'WEEKNUM'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::WEEKOFYEAR',
-												 'argumentCount'	=>	'1,2'
-												),
-				'WEIBULL'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::WEIBULL',
-												 'argumentCount'	=>	'4'
-												),
-				'WORKDAY'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::WORKDAY',
-												 'argumentCount'	=>	'2+'
-												),
-				'XIRR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::XIRR',
-												 'argumentCount'	=>	'2,3'
-												),
-				'XNPV'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::XNPV',
-												 'argumentCount'	=>	'3'
-												),
-				'YEAR'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::YEAR',
-												 'argumentCount'	=>	'1'
-												),
-				'YEARFRAC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
-												 'functionCall'		=>	'PHPExcel_Calculation_DateTime::YEARFRAC',
-												 'argumentCount'	=>	'2,3'
-												),
-				'YIELD'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Functions::DUMMY',
-												 'argumentCount'	=>	'6,7'
-												),
-				'YIELDDISC'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::YIELDDISC',
-												 'argumentCount'	=>	'4,5'
-												),
-				'YIELDMAT'				=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Financial::YIELDMAT',
-												 'argumentCount'	=>	'5,6'
-												),
-				'ZTEST'					=> array('category'			=>	PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
-												 'functionCall'		=>	'PHPExcel_Calculation_Statistical::ZTEST',
-												 'argumentCount'	=>	'2-3'
-												)
-			);
-
-
-	//	Internal functions used for special control purposes
-	private static $_controlFunctions = array(
-				'MKMATRIX'	=> array('argumentCount'	=>	'*',
-									 'functionCall'		=>	'self::_mkMatrix'
-									)
-			);
-
-
-
-
-	private function __construct(PHPExcel $workbook = NULL) {
-		$setPrecision = (PHP_INT_SIZE == 4) ? 14 : 16;
-		$this->_savedPrecision = ini_get('precision');
-		if ($this->_savedPrecision < $setPrecision) {
-			ini_set('precision',$setPrecision);
-		}
-		$this->delta = 1 * pow(10, -$setPrecision);
-
-		if ($workbook !== NULL) {
-			self::$_workbookSets[$workbook->getID()] = $this;
-		}
-
-		$this->_workbook = $workbook;
-		$this->_cyclicReferenceStack = new PHPExcel_CalcEngine_CyclicReferenceStack();
-	    $this->_debugLog = new PHPExcel_CalcEngine_Logger($this->_cyclicReferenceStack);
-	}	//	function __construct()
-
-
-	public function __destruct() {
-		if ($this->_savedPrecision != ini_get('precision')) {
-			ini_set('precision',$this->_savedPrecision);
-		}
-	}
-
-	private static function _loadLocales() {
-		$localeFileDirectory = PHPEXCEL_ROOT.'PHPExcel/locale/';
-		foreach (glob($localeFileDirectory.'/*',GLOB_ONLYDIR) as $filename) {
-			$filename = substr($filename,strlen($localeFileDirectory)+1);
-			if ($filename != 'en') {
-				self::$_validLocaleLanguages[] = $filename;
-			}
-		}
-	}
-
-	/**
-	 * Get an instance of this class
-	 *
-	 * @access	public
-	 * @param   PHPExcel $workbook  Injected workbook for working with a PHPExcel object,
-	 *									or NULL to create a standalone claculation engine
-	 * @return PHPExcel_Calculation
-	 */
-	public static function getInstance(PHPExcel $workbook = NULL) {
-		if ($workbook !== NULL) {
-    		if (isset(self::$_workbookSets[$workbook->getID()])) {
-    			return self::$_workbookSets[$workbook->getID()];
-    		}
-			return new PHPExcel_Calculation($workbook);
-		}
-
-		if (!isset(self::$_instance) || (self::$_instance === NULL)) {
-			self::$_instance = new PHPExcel_Calculation();
-		}
-
-		return self::$_instance;
-	}	//	function getInstance()
-
-	/**
-	 * Unset an instance of this class
-	 *
-	 * @access	public
-	 * @param   PHPExcel $workbook  Injected workbook identifying the instance to unset
-	 */
-	public static function unsetInstance(PHPExcel $workbook = NULL) {
-		if ($workbook !== NULL) {
-    		if (isset(self::$_workbookSets[$workbook->getID()])) {
-    			unset(self::$_workbookSets[$workbook->getID()]);
-    		}
-		}
-    }
-
-	/**
-	 * Flush the calculation cache for any existing instance of this class
-	 *		but only if a PHPExcel_Calculation instance exists
-	 *
-	 * @access	public
-	 * @return null
-	 */
-	public function flushInstance() {
-		$this->clearCalculationCache();
-	}	//	function flushInstance()
-
-
-	/**
-	 * Get the debuglog for this claculation engine instance
-	 *
-	 * @access	public
-	 * @return PHPExcel_CalcEngine_Logger
-	 */
-	public function getDebugLog() {
-		return $this->_debugLog;
-	}
-
-	/**
-	 * __clone implementation. Cloning should not be allowed in a Singleton!
-	 *
-	 * @access	public
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public final function __clone() {
-		throw new PHPExcel_Calculation_Exception ('Cloning the calculation engine is not allowed!');
-	}	//	function __clone()
-
-
-	/**
-	 * Return the locale-specific translation of TRUE
-	 *
-	 * @access	public
-	 * @return	 string		locale-specific translation of TRUE
-	 */
-	public static function getTRUE() {
-		return self::$_localeBoolean['TRUE'];
-	}
-
-	/**
-	 * Return the locale-specific translation of FALSE
-	 *
-	 * @access	public
-	 * @return	 string		locale-specific translation of FALSE
-	 */
-	public static function getFALSE() {
-		return self::$_localeBoolean['FALSE'];
-	}
-
-	/**
-	 * Set the Array Return Type (Array or Value of first element in the array)
-	 *
-	 * @access	public
-	 * @param	 string	$returnType			Array return type
-	 * @return	 boolean					Success or failure
-	 */
-	public static function setArrayReturnType($returnType) {
-		if (($returnType == self::RETURN_ARRAY_AS_VALUE) ||
-			($returnType == self::RETURN_ARRAY_AS_ERROR) ||
-			($returnType == self::RETURN_ARRAY_AS_ARRAY)) {
-			self::$returnArrayAsType = $returnType;
-			return TRUE;
-		}
-		return FALSE;
-	}	//	function setArrayReturnType()
-
-
-	/**
-	 * Return the Array Return Type (Array or Value of first element in the array)
-	 *
-	 * @access	public
-	 * @return	 string		$returnType			Array return type
-	 */
-	public static function getArrayReturnType() {
-		return self::$returnArrayAsType;
-	}	//	function getArrayReturnType()
-
-
-	/**
-	 * Is calculation caching enabled?
-	 *
-	 * @access	public
-	 * @return boolean
-	 */
-	public function getCalculationCacheEnabled() {
-		return $this->_calculationCacheEnabled;
-	}	//	function getCalculationCacheEnabled()
-
-	/**
-	 * Enable/disable calculation cache
-	 *
-	 * @access	public
-	 * @param boolean $pValue
-	 */
-	public function setCalculationCacheEnabled($pValue = TRUE) {
-		$this->_calculationCacheEnabled = $pValue;
-		$this->clearCalculationCache();
-	}	//	function setCalculationCacheEnabled()
-
-
-	/**
-	 * Enable calculation cache
-	 */
-	public function enableCalculationCache() {
-		$this->setCalculationCacheEnabled(TRUE);
-	}	//	function enableCalculationCache()
-
-
-	/**
-	 * Disable calculation cache
-	 */
-	public function disableCalculationCache() {
-		$this->setCalculationCacheEnabled(FALSE);
-	}	//	function disableCalculationCache()
-
-
-	/**
-	 * Clear calculation cache
-	 */
-	public function clearCalculationCache() {
-		$this->_calculationCache = array();
-	}	//	function clearCalculationCache()
-
-	/**
-	 * Clear calculation cache for a specified worksheet
-	 *
-	 * @param string $worksheetName
-	 */
-	public function clearCalculationCacheForWorksheet($worksheetName) {
-		if (isset($this->_calculationCache[$worksheetName])) {
-			unset($this->_calculationCache[$worksheetName]);
-		}
-	}	//	function clearCalculationCacheForWorksheet()
-
-	/**
-	 * Rename calculation cache for a specified worksheet
-	 *
-	 * @param string $fromWorksheetName
-	 * @param string $toWorksheetName
-	 */
-	public function renameCalculationCacheForWorksheet($fromWorksheetName, $toWorksheetName) {
-		if (isset($this->_calculationCache[$fromWorksheetName])) {
-			$this->_calculationCache[$toWorksheetName] = &$this->_calculationCache[$fromWorksheetName];
-			unset($this->_calculationCache[$fromWorksheetName]);
-		}
-	}	//	function renameCalculationCacheForWorksheet()
-
-
-	/**
-	 * Get the currently defined locale code
-	 *
-	 * @return string
-	 */
-	public function getLocale() {
-		return self::$_localeLanguage;
-	}	//	function getLocale()
-
-
-	/**
-	 * Set the locale code
-	 *
-	 * @param string $locale  The locale to use for formula translation
-	 * @return boolean
-	 */
-	public function setLocale($locale = 'en_us') {
-		//	Identify our locale and language
-		$language = $locale = strtolower($locale);
-		if (strpos($locale,'_') !== FALSE) {
-			list($language) = explode('_',$locale);
-		}
-
-		if (count(self::$_validLocaleLanguages) == 1)
-			self::_loadLocales();
-
-		//	Test whether we have any language data for this language (any locale)
-		if (in_array($language,self::$_validLocaleLanguages)) {
-			//	initialise language/locale settings
-			self::$_localeFunctions = array();
-			self::$_localeArgumentSeparator = ',';
-			self::$_localeBoolean = array('TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL');
-			//	Default is English, if user isn't requesting english, then read the necessary data from the locale files
-			if ($locale != 'en_us') {
-				//	Search for a file with a list of function names for locale
-				$functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_',DIRECTORY_SEPARATOR,$locale).DIRECTORY_SEPARATOR.'functions';
-				if (!file_exists($functionNamesFile)) {
-					//	If there isn't a locale specific function file, look for a language specific function file
-					$functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions';
-					if (!file_exists($functionNamesFile)) {
-						return FALSE;
-					}
-				}
-				//	Retrieve the list of locale or language specific function names
-				$localeFunctions = file($functionNamesFile,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
-				foreach ($localeFunctions as $localeFunction) {
-					list($localeFunction) = explode('##',$localeFunction);	//	Strip out comments
-					if (strpos($localeFunction,'=') !== FALSE) {
-						list($fName,$lfName) = explode('=',$localeFunction);
-						$fName = trim($fName);
-						$lfName = trim($lfName);
-						if ((isset(self::$_PHPExcelFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
-							self::$_localeFunctions[$fName] = $lfName;
-						}
-					}
-				}
-				//	Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions
-				if (isset(self::$_localeFunctions['TRUE'])) { self::$_localeBoolean['TRUE'] = self::$_localeFunctions['TRUE']; }
-				if (isset(self::$_localeFunctions['FALSE'])) { self::$_localeBoolean['FALSE'] = self::$_localeFunctions['FALSE']; }
-
-				$configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_',DIRECTORY_SEPARATOR,$locale).DIRECTORY_SEPARATOR.'config';
-				if (!file_exists($configFile)) {
-					$configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config';
-				}
-				if (file_exists($configFile)) {
-					$localeSettings = file($configFile,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
-					foreach ($localeSettings as $localeSetting) {
-						list($localeSetting) = explode('##',$localeSetting);	//	Strip out comments
-						if (strpos($localeSetting,'=') !== FALSE) {
-							list($settingName,$settingValue) = explode('=',$localeSetting);
-							$settingName = strtoupper(trim($settingName));
-							switch ($settingName) {
-								case 'ARGUMENTSEPARATOR' :
-									self::$_localeArgumentSeparator = trim($settingValue);
-									break;
-							}
-						}
-					}
-				}
-			}
-
-			self::$functionReplaceFromExcel = self::$functionReplaceToExcel =
-			self::$functionReplaceFromLocale = self::$functionReplaceToLocale = NULL;
-			self::$_localeLanguage = $locale;
-			return TRUE;
-		}
-		return FALSE;
-	}	//	function setLocale()
-
-
-
-	public static function _translateSeparator($fromSeparator,$toSeparator,$formula,&$inBraces) {
-		$strlen = mb_strlen($formula);
-		for ($i = 0; $i < $strlen; ++$i) {
-			$chr = mb_substr($formula,$i,1);
-			switch ($chr) {
-				case '{' :	$inBraces = TRUE;
-							break;
-				case '}' :	$inBraces = FALSE;
-							break;
-				case $fromSeparator :
-							if (!$inBraces) {
-								$formula = mb_substr($formula,0,$i).$toSeparator.mb_substr($formula,$i+1);
-							}
-			}
-		}
-		return $formula;
-	}
-
-	private static function _translateFormula($from,$to,$formula,$fromSeparator,$toSeparator) {
-		//	Convert any Excel function names to the required language
-		if (self::$_localeLanguage !== 'en_us') {
-			$inBraces = FALSE;
-			//	If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
-			if (strpos($formula,'"') !== FALSE) {
-				//	So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
-				//		the formula
-				$temp = explode('"',$formula);
-				$i = FALSE;
-				foreach($temp as &$value) {
-					//	Only count/replace in alternating array entries
-					if ($i = !$i) {
-						$value = preg_replace($from,$to,$value);
-						$value = self::_translateSeparator($fromSeparator,$toSeparator,$value,$inBraces);
-					}
-				}
-				unset($value);
-				//	Then rebuild the formula string
-				$formula = implode('"',$temp);
-			} else {
-				//	If there's no quoted strings, then we do a simple count/replace
-				$formula = preg_replace($from,$to,$formula);
-				$formula = self::_translateSeparator($fromSeparator,$toSeparator,$formula,$inBraces);
-			}
-		}
-
-		return $formula;
-	}
-
-	private static $functionReplaceFromExcel	= NULL;
-	private static $functionReplaceToLocale		= NULL;
-
-	public function _translateFormulaToLocale($formula) {
-		if (self::$functionReplaceFromExcel === NULL) {
-			self::$functionReplaceFromExcel = array();
-			foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) {
-				self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui';
-			}
-			foreach(array_keys(self::$_localeBoolean) as $excelBoolean) {
-				self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
-			}
-
-		}
-
-		if (self::$functionReplaceToLocale === NULL) {
-			self::$functionReplaceToLocale = array();
-			foreach(array_values(self::$_localeFunctions) as $localeFunctionName) {
-				self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2';
-			}
-			foreach(array_values(self::$_localeBoolean) as $localeBoolean) {
-				self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2';
-			}
-		}
-
-		return self::_translateFormula(self::$functionReplaceFromExcel,self::$functionReplaceToLocale,$formula,',',self::$_localeArgumentSeparator);
-	}	//	function _translateFormulaToLocale()
-
-
-	private static $functionReplaceFromLocale	= NULL;
-	private static $functionReplaceToExcel		= NULL;
-
-	public function _translateFormulaToEnglish($formula) {
-		if (self::$functionReplaceFromLocale === NULL) {
-			self::$functionReplaceFromLocale = array();
-			foreach(array_values(self::$_localeFunctions) as $localeFunctionName) {
-				self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui';
-			}
-			foreach(array_values(self::$_localeBoolean) as $excelBoolean) {
-				self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
-			}
-		}
-
-		if (self::$functionReplaceToExcel === NULL) {
-			self::$functionReplaceToExcel = array();
-			foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) {
-				self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2';
-			}
-			foreach(array_keys(self::$_localeBoolean) as $excelBoolean) {
-				self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2';
-			}
-		}
-
-		return self::_translateFormula(self::$functionReplaceFromLocale,self::$functionReplaceToExcel,$formula,self::$_localeArgumentSeparator,',');
-	}	//	function _translateFormulaToEnglish()
-
-
-	public static function _localeFunc($function) {
-		if (self::$_localeLanguage !== 'en_us') {
-			$functionName = trim($function,'(');
-			if (isset(self::$_localeFunctions[$functionName])) {
-				$brace = ($functionName != $function);
-				$function = self::$_localeFunctions[$functionName];
-				if ($brace) { $function .= '('; }
-			}
-		}
-		return $function;
-	}
-
-
-
-
-	/**
-	 * Wrap string values in quotes
-	 *
-	 * @param mixed $value
-	 * @return mixed
-	 */
-	public static function _wrapResult($value) {
-		if (is_string($value)) {
-			//	Error values cannot be "wrapped"
-			if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) {
-				//	Return Excel errors "as is"
-				return $value;
-			}
-			//	Return strings wrapped in quotes
-			return '"'.$value.'"';
-		//	Convert numeric errors to NaN error
-		} else if((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return $value;
-	}	//	function _wrapResult()
-
-
-	/**
-	 * Remove quotes used as a wrapper to identify string values
-	 *
-	 * @param mixed $value
-	 * @return mixed
-	 */
-	public static function _unwrapResult($value) {
-		if (is_string($value)) {
-			if ((isset($value{0})) && ($value{0} == '"') && (substr($value,-1) == '"')) {
-				return substr($value,1,-1);
-			}
-		//	Convert numeric errors to NaN error
-		} else if((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		return $value;
-	}	//	function _unwrapResult()
-
-
-
-
-	/**
-	 * Calculate cell value (using formula from a cell ID)
-	 * Retained for backward compatibility
-	 *
-	 * @access	public
-	 * @param	PHPExcel_Cell	$pCell	Cell to calculate
-	 * @return	mixed
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function calculate(PHPExcel_Cell $pCell = NULL) {
-		try {
-			return $this->calculateCellValue($pCell);
-		} catch (PHPExcel_Exception $e) {
-			throw new PHPExcel_Calculation_Exception($e->getMessage());
-		}
-	}	//	function calculate()
-
-
-	/**
-	 * Calculate the value of a cell formula
-	 *
-	 * @access	public
-	 * @param	PHPExcel_Cell	$pCell		Cell to calculate
-	 * @param	Boolean			$resetLog	Flag indicating whether the debug log should be reset or not
-	 * @return	mixed
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function calculateCellValue(PHPExcel_Cell $pCell = NULL, $resetLog = TRUE) {
-		if ($pCell === NULL) {
-			return NULL;
-		}
-
-		$returnArrayAsType = self::$returnArrayAsType;
-		if ($resetLog) {
-			//	Initialise the logging settings if requested
-			$this->formulaError = null;
-			$this->_debugLog->clearLog();
-			$this->_cyclicReferenceStack->clear();
-			$this->_cyclicFormulaCount = 1;
-
-			self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY;
-		}
-
-		//	Execute the calculation for the cell formula
-        $this->_cellStack[] = array(
-            'sheet' => $pCell->getWorksheet()->getTitle(),
-            'cell' => $pCell->getCoordinate(),
-        );
-		try {
-			$result = self::_unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell));
-            $cellAddress = array_pop($this->_cellStack);
-            $this->_workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
-		} catch (PHPExcel_Exception $e) {
-            $cellAddress = array_pop($this->_cellStack);
-            $this->_workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
-			throw new PHPExcel_Calculation_Exception($e->getMessage());
-		}
-
-		if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
-			self::$returnArrayAsType = $returnArrayAsType;
-			$testResult = PHPExcel_Calculation_Functions::flattenArray($result);
-			if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-			//	If there's only a single cell in the array, then we allow it
-			if (count($testResult) != 1) {
-				//	If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it
-				$r = array_keys($result);
-				$r = array_shift($r);
-				if (!is_numeric($r)) { return PHPExcel_Calculation_Functions::VALUE(); }
-				if (is_array($result[$r])) {
-					$c = array_keys($result[$r]);
-					$c = array_shift($c);
-					if (!is_numeric($c)) {
-						return PHPExcel_Calculation_Functions::VALUE();
-					}
-				}
-			}
-			$result = array_shift($testResult);
-		}
-		self::$returnArrayAsType = $returnArrayAsType;
-
-
-		if ($result === NULL) {
-			return 0;
-		} elseif((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		return $result;
-	}	//	function calculateCellValue(
-
-
-	/**
-	 * Validate and parse a formula string
-	 *
-	 * @param	string		$formula		Formula to parse
-	 * @return	array
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function parseFormula($formula) {
-		//	Basic validation that this is indeed a formula
-		//	We return an empty array if not
-		$formula = trim($formula);
-		if ((!isset($formula{0})) || ($formula{0} != '=')) return array();
-		$formula = ltrim(substr($formula,1));
-		if (!isset($formula{0})) return array();
-
-		//	Parse the formula and return the token stack
-		return $this->_parseFormula($formula);
-	}	//	function parseFormula()
-
-
-	/**
-	 * Calculate the value of a formula
-	 *
-	 * @param	string			$formula	Formula to parse
-	 * @param	string			$cellID		Address of the cell to calculate
-	 * @param	PHPExcel_Cell	$pCell		Cell to calculate
-	 * @return	mixed
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function calculateFormula($formula, $cellID=NULL, PHPExcel_Cell $pCell = NULL) {
-		//	Initialise the logging settings
-		$this->formulaError = null;
-		$this->_debugLog->clearLog();
-		$this->_cyclicReferenceStack->clear();
-
-		//	Disable calculation cacheing because it only applies to cell calculations, not straight formulae
-		//	But don't actually flush any cache
-		$resetCache = $this->getCalculationCacheEnabled();
-		$this->_calculationCacheEnabled = FALSE;
-		//	Execute the calculation
-		try {
-			$result = self::_unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell));
-		} catch (PHPExcel_Exception $e) {
-			throw new PHPExcel_Calculation_Exception($e->getMessage());
-		}
-
-		//	Reset calculation cacheing to its previous state
-		$this->_calculationCacheEnabled = $resetCache;
-
-		return $result;
-	}	//	function calculateFormula()
-
-
-    public function getValueFromCache($cellReference, &$cellValue) {
-		// Is calculation cacheing enabled?
-		// Is the value present in calculation cache?
-		$this->_debugLog->writeDebugLog('Testing cache value for cell ', $cellReference);
-		if (($this->_calculationCacheEnabled) && (isset($this->_calculationCache[$cellReference]))) {
-			$this->_debugLog->writeDebugLog('Retrieving value for cell ', $cellReference, ' from cache');
-			// Return the cached result
-			$cellValue = $this->_calculationCache[$cellReference];
-			return TRUE;
-		}
-		return FALSE;
-    }
-
-    public function saveValueToCache($cellReference, $cellValue) {
-		if ($this->_calculationCacheEnabled) {
-			$this->_calculationCache[$cellReference] = $cellValue;
-		}
-	}
-
-	/**
-	 * Parse a cell formula and calculate its value
-	 *
-	 * @param	string			$formula	The formula to parse and calculate
-	 * @param	string			$cellID		The ID (e.g. A3) of the cell that we are calculating
-	 * @param	PHPExcel_Cell	$pCell		Cell to calculate
-	 * @return	mixed
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function _calculateFormulaValue($formula, $cellID=null, PHPExcel_Cell $pCell = null) {
-		$cellValue = null;
-
-		//	Basic validation that this is indeed a formula
-		//	We simply return the cell value if not
-		$formula = trim($formula);
-		if ($formula{0} != '=') return self::_wrapResult($formula);
-		$formula = ltrim(substr($formula, 1));
-		if (!isset($formula{0})) return self::_wrapResult($formula);
-
-		$pCellParent = ($pCell !== NULL) ? $pCell->getWorksheet() : NULL;
-		$wsTitle = ($pCellParent !== NULL) ? $pCellParent->getTitle() : "\x00Wrk";
-        $wsCellReference = $wsTitle . '!' . $cellID;
-
-		if (($cellID !== NULL) && ($this->getValueFromCache($wsCellReference, $cellValue))) {
-			return $cellValue;
-		}
-
-		if (($wsTitle{0} !== "\x00") && ($this->_cyclicReferenceStack->onStack($wsCellReference))) {
-            if ($this->cyclicFormulaCount <= 0) {
-                $this->_cyclicFormulaCell = '';
-				return $this->_raiseFormulaError('Cyclic Reference in Formula');
-			} elseif ($this->_cyclicFormulaCell === $wsCellReference) {
-				++$this->_cyclicFormulaCount;
-				if ($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) {
-                    $this->_cyclicFormulaCell = '';
-					return $cellValue;
-				}
-			} elseif ($this->_cyclicFormulaCell == '') {
-				if ($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) {
-					return $cellValue;
-				}
-				$this->_cyclicFormulaCell = $wsCellReference;
-			}
-		}
-
-		//	Parse the formula onto the token stack and calculate the value
-		$this->_cyclicReferenceStack->push($wsCellReference);
-		$cellValue = $this->_processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell);
-		$this->_cyclicReferenceStack->pop();
-
-		// Save to calculation cache
-		if ($cellID !== NULL) {
-			$this->saveValueToCache($wsCellReference, $cellValue);
-		}
-
-		//	Return the calculated value
-		return $cellValue;
-	}	//	function _calculateFormulaValue()
-
-
-	/**
-	 * Ensure that paired matrix operands are both matrices and of the same size
-	 *
-	 * @param	mixed		&$operand1	First matrix operand
-	 * @param	mixed		&$operand2	Second matrix operand
-	 * @param	integer		$resize		Flag indicating whether the matrices should be resized to match
-	 *										and (if so), whether the smaller dimension should grow or the
-	 *										larger should shrink.
-	 *											0 = no resize
-	 *											1 = shrink to fit
-	 *											2 = extend to fit
-	 */
-	private static function _checkMatrixOperands(&$operand1,&$operand2,$resize = 1) {
-		//	Examine each of the two operands, and turn them into an array if they aren't one already
-		//	Note that this function should only be called if one or both of the operand is already an array
-		if (!is_array($operand1)) {
-			list($matrixRows,$matrixColumns) = self::_getMatrixDimensions($operand2);
-			$operand1 = array_fill(0,$matrixRows,array_fill(0,$matrixColumns,$operand1));
-			$resize = 0;
-		} elseif (!is_array($operand2)) {
-			list($matrixRows,$matrixColumns) = self::_getMatrixDimensions($operand1);
-			$operand2 = array_fill(0,$matrixRows,array_fill(0,$matrixColumns,$operand2));
-			$resize = 0;
-		}
-
-		list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($operand1);
-		list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($operand2);
-		if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
-			$resize = 1;
-		}
-
-		if ($resize == 2) {
-			//	Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger
-			self::_resizeMatricesExtend($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns);
-		} elseif ($resize == 1) {
-			//	Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
-			self::_resizeMatricesShrink($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns);
-		}
-		return array( $matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns);
-	}	//	function _checkMatrixOperands()
-
-
-	/**
-	 * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0
-	 *
-	 * @param	mixed		&$matrix		matrix operand
-	 * @return	array		An array comprising the number of rows, and number of columns
-	 */
-	public static function _getMatrixDimensions(&$matrix) {
-		$matrixRows = count($matrix);
-		$matrixColumns = 0;
-		foreach($matrix as $rowKey => $rowValue) {
-			$matrixColumns = max(count($rowValue),$matrixColumns);
-			if (!is_array($rowValue)) {
-				$matrix[$rowKey] = array($rowValue);
-			} else {
-				$matrix[$rowKey] = array_values($rowValue);
-			}
-		}
-		$matrix = array_values($matrix);
-		return array($matrixRows,$matrixColumns);
-	}	//	function _getMatrixDimensions()
-
-
-	/**
-	 * Ensure that paired matrix operands are both matrices of the same size
-	 *
-	 * @param	mixed		&$matrix1		First matrix operand
-	 * @param	mixed		&$matrix2		Second matrix operand
-	 * @param	integer		$matrix1Rows	Row size of first matrix operand
-	 * @param	integer		$matrix1Columns	Column size of first matrix operand
-	 * @param	integer		$matrix2Rows	Row size of second matrix operand
-	 * @param	integer		$matrix2Columns	Column size of second matrix operand
-	 */
-	private static function _resizeMatricesShrink(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) {
-		if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
-			if ($matrix2Rows < $matrix1Rows) {
-				for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
-					unset($matrix1[$i]);
-				}
-			}
-			if ($matrix2Columns < $matrix1Columns) {
-				for ($i = 0; $i < $matrix1Rows; ++$i) {
-					for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
-						unset($matrix1[$i][$j]);
-					}
-				}
-			}
-		}
-
-		if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
-			if ($matrix1Rows < $matrix2Rows) {
-				for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
-					unset($matrix2[$i]);
-				}
-			}
-			if ($matrix1Columns < $matrix2Columns) {
-				for ($i = 0; $i < $matrix2Rows; ++$i) {
-					for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
-						unset($matrix2[$i][$j]);
-					}
-				}
-			}
-		}
-	}	//	function _resizeMatricesShrink()
-
-
-	/**
-	 * Ensure that paired matrix operands are both matrices of the same size
-	 *
-	 * @param	mixed		&$matrix1	First matrix operand
-	 * @param	mixed		&$matrix2	Second matrix operand
-	 * @param	integer		$matrix1Rows	Row size of first matrix operand
-	 * @param	integer		$matrix1Columns	Column size of first matrix operand
-	 * @param	integer		$matrix2Rows	Row size of second matrix operand
-	 * @param	integer		$matrix2Columns	Column size of second matrix operand
-	 */
-	private static function _resizeMatricesExtend(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) {
-		if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
-			if ($matrix2Columns < $matrix1Columns) {
-				for ($i = 0; $i < $matrix2Rows; ++$i) {
-					$x = $matrix2[$i][$matrix2Columns-1];
-					for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
-						$matrix2[$i][$j] = $x;
-					}
-				}
-			}
-			if ($matrix2Rows < $matrix1Rows) {
-				$x = $matrix2[$matrix2Rows-1];
-				for ($i = 0; $i < $matrix1Rows; ++$i) {
-					$matrix2[$i] = $x;
-				}
-			}
-		}
-
-		if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
-			if ($matrix1Columns < $matrix2Columns) {
-				for ($i = 0; $i < $matrix1Rows; ++$i) {
-					$x = $matrix1[$i][$matrix1Columns-1];
-					for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
-						$matrix1[$i][$j] = $x;
-					}
-				}
-			}
-			if ($matrix1Rows < $matrix2Rows) {
-				$x = $matrix1[$matrix1Rows-1];
-				for ($i = 0; $i < $matrix2Rows; ++$i) {
-					$matrix1[$i] = $x;
-				}
-			}
-		}
-	}	//	function _resizeMatricesExtend()
-
-
-	/**
-	 * Format details of an operand for display in the log (based on operand type)
-	 *
-	 * @param	mixed		$value	First matrix operand
-	 * @return	mixed
-	 */
-	private function _showValue($value) {
-		if ($this->_debugLog->getWriteDebugLog()) {
-			$testArray = PHPExcel_Calculation_Functions::flattenArray($value);
-			if (count($testArray) == 1) {
-				$value = array_pop($testArray);
-			}
-
-			if (is_array($value)) {
-				$returnMatrix = array();
-				$pad = $rpad = ', ';
-				foreach($value as $row) {
-					if (is_array($row)) {
-						$returnMatrix[] = implode($pad,array_map(array($this,'_showValue'),$row));
-						$rpad = '; ';
-					} else {
-						$returnMatrix[] = $this->_showValue($row);
-					}
-				}
-				return '{ '.implode($rpad,$returnMatrix).' }';
-			} elseif(is_string($value) && (trim($value,'"') == $value)) {
-				return '"'.$value.'"';
-			} elseif(is_bool($value)) {
-				return ($value) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE'];
-			}
-		}
-		return PHPExcel_Calculation_Functions::flattenSingleValue($value);
-	}	//	function _showValue()
-
-
-	/**
-	 * Format type and details of an operand for display in the log (based on operand type)
-	 *
-	 * @param	mixed		$value	First matrix operand
-	 * @return	mixed
-	 */
-	private function _showTypeDetails($value) {
-		if ($this->_debugLog->getWriteDebugLog()) {
-			$testArray = PHPExcel_Calculation_Functions::flattenArray($value);
-			if (count($testArray) == 1) {
-				$value = array_pop($testArray);
-			}
-
-			if ($value === NULL) {
-				return 'a NULL value';
-			} elseif (is_float($value)) {
-				$typeString = 'a floating point number';
-			} elseif(is_int($value)) {
-				$typeString = 'an integer number';
-			} elseif(is_bool($value)) {
-				$typeString = 'a boolean';
-			} elseif(is_array($value)) {
-				$typeString = 'a matrix';
-			} else {
-				if ($value == '') {
-					return 'an empty string';
-				} elseif ($value{0} == '#') {
-					return 'a '.$value.' error';
-				} else {
-					$typeString = 'a string';
-				}
-			}
-			return $typeString.' with a value of '.$this->_showValue($value);
-		}
-	}	//	function _showTypeDetails()
-
-
-	private function _convertMatrixReferences($formula) {
-		static $matrixReplaceFrom = array('{',';','}');
-		static $matrixReplaceTo = array('MKMATRIX(MKMATRIX(','),MKMATRIX(','))');
-
-		//	Convert any Excel matrix references to the MKMATRIX() function
-		if (strpos($formula,'{') !== FALSE) {
-			//	If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
-			if (strpos($formula,'"') !== FALSE) {
-				//	So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
-				//		the formula
-				$temp = explode('"',$formula);
-				//	Open and Closed counts used for trapping mismatched braces in the formula
-				$openCount = $closeCount = 0;
-				$i = FALSE;
-				foreach($temp as &$value) {
-					//	Only count/replace in alternating array entries
-					if ($i = !$i) {
-						$openCount += substr_count($value,'{');
-						$closeCount += substr_count($value,'}');
-						$value = str_replace($matrixReplaceFrom,$matrixReplaceTo,$value);
-					}
-				}
-				unset($value);
-				//	Then rebuild the formula string
-				$formula = implode('"',$temp);
-			} else {
-				//	If there's no quoted strings, then we do a simple count/replace
-				$openCount = substr_count($formula,'{');
-				$closeCount = substr_count($formula,'}');
-				$formula = str_replace($matrixReplaceFrom,$matrixReplaceTo,$formula);
-			}
-			//	Trap for mismatched braces and trigger an appropriate error
-			if ($openCount < $closeCount) {
-				if ($openCount > 0) {
-					return $this->_raiseFormulaError("Formula Error: Mismatched matrix braces '}'");
-				} else {
-					return $this->_raiseFormulaError("Formula Error: Unexpected '}' encountered");
-				}
-			} elseif ($openCount > $closeCount) {
-				if ($closeCount > 0) {
-					return $this->_raiseFormulaError("Formula Error: Mismatched matrix braces '{'");
-				} else {
-					return $this->_raiseFormulaError("Formula Error: Unexpected '{' encountered");
-				}
-			}
-		}
-
-		return $formula;
-	}	//	function _convertMatrixReferences()
-
-
-	private static function _mkMatrix() {
-		return func_get_args();
-	}	//	function _mkMatrix()
-
-
-	//	Binary Operators
-	//	These operators always work on two values
-	//	Array key is the operator, the value indicates whether this is a left or right associative operator
-	private static $_operatorAssociativity	= array(
-		'^' => 0,															//	Exponentiation
-		'*' => 0, '/' => 0, 												//	Multiplication and Division
-		'+' => 0, '-' => 0,													//	Addition and Subtraction
-		'&' => 0,															//	Concatenation
-		'|' => 0, ':' => 0,													//	Intersect and Range
-		'>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0		//	Comparison
-	);
-
-	//	Comparison (Boolean) Operators
-	//	These operators work on two values, but always return a boolean result
-	private static $_comparisonOperators	= array('>' => TRUE, '<' => TRUE, '=' => TRUE, '>=' => TRUE, '<=' => TRUE, '<>' => TRUE);
-
-	//	Operator Precedence
-	//	This list includes all valid operators, whether binary (including boolean) or unary (such as %)
-	//	Array key is the operator, the value is its precedence
-	private static $_operatorPrecedence	= array(
-		':' => 8,																//	Range
-		'|' => 7,																//	Intersect
-		'~' => 6,																//	Negation
-		'%' => 5,																//	Percentage
-		'^' => 4,																//	Exponentiation
-		'*' => 3, '/' => 3, 													//	Multiplication and Division
-		'+' => 2, '-' => 2,														//	Addition and Subtraction
-		'&' => 1,																//	Concatenation
-		'>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0			//	Comparison
-	);
-
-	// Convert infix to postfix notation
-	private function _parseFormula($formula, PHPExcel_Cell $pCell = NULL) {
-		if (($formula = $this->_convertMatrixReferences(trim($formula))) === FALSE) {
-			return FALSE;
-		}
-
-		//	If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet),
-		//		so we store the parent worksheet so that we can re-attach it when necessary
-		$pCellParent = ($pCell !== NULL) ? $pCell->getWorksheet() : NULL;
-
-		$regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION.
-							   '|'.self::CALCULATION_REGEXP_CELLREF.
-							   '|'.self::CALCULATION_REGEXP_NUMBER.
-							   '|'.self::CALCULATION_REGEXP_STRING.
-							   '|'.self::CALCULATION_REGEXP_OPENBRACE.
-							   '|'.self::CALCULATION_REGEXP_NAMEDRANGE.
-							   '|'.self::CALCULATION_REGEXP_ERROR.
-							 ')/si';
-
-		//	Start with initialisation
-		$index = 0;
-		$stack = new PHPExcel_Calculation_Token_Stack;
-		$output = array();
-		$expectingOperator = FALSE;					//	We use this test in syntax-checking the expression to determine when a
-													//		- is a negation or + is a positive operator rather than an operation
-		$expectingOperand = FALSE;					//	We use this test in syntax-checking the expression to determine whether an operand
-													//		should be null in a function call
-		//	The guts of the lexical parser
-		//	Loop through the formula extracting each operator and operand in turn
-		while(TRUE) {
-//echo 'Assessing Expression '.substr($formula, $index),PHP_EOL;
-			$opCharacter = $formula{$index};	//	Get the first character of the value at the current index position
-//echo 'Initial character of expression block is '.$opCharacter,PHP_EOL;
-			if ((isset(self::$_comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$_comparisonOperators[$formula{$index+1}]))) {
-				$opCharacter .= $formula{++$index};
-//echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL;
-			}
-
-			//	Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
-			$isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match);
-//echo '$isOperandOrFunction is '.(($isOperandOrFunction) ? 'True' : 'False').PHP_EOL;
-//var_dump($match);
-
-			if ($opCharacter == '-' && !$expectingOperator) {				//	Is it a negation instead of a minus?
-//echo 'Element is a Negation operator',PHP_EOL;
-				$stack->push('Unary Operator','~');							//	Put a negation on the stack
-				++$index;													//		and drop the negation symbol
-			} elseif ($opCharacter == '%' && $expectingOperator) {
-//echo 'Element is a Percentage operator',PHP_EOL;
-				$stack->push('Unary Operator','%');							//	Put a percentage on the stack
-				++$index;
-			} elseif ($opCharacter == '+' && !$expectingOperator) {			//	Positive (unary plus rather than binary operator plus) can be discarded?
-//echo 'Element is a Positive number, not Plus operator',PHP_EOL;
-				++$index;													//	Drop the redundant plus symbol
-			} elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) {	//	We have to explicitly deny a tilde or pipe, because they are legal
-				return $this->_raiseFormulaError("Formula Error: Illegal character '~'");				//		on the stack but not in the input expression
-
-			} elseif ((isset(self::$_operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {	//	Are we putting an operator on the stack?
-//echo 'Element with value '.$opCharacter.' is an Operator',PHP_EOL;
-				while($stack->count() > 0 &&
-					($o2 = $stack->last()) &&
-					isset(self::$_operators[$o2['value']]) &&
-					@(self::$_operatorAssociativity[$opCharacter] ? self::$_operatorPrecedence[$opCharacter] < self::$_operatorPrecedence[$o2['value']] : self::$_operatorPrecedence[$opCharacter] <= self::$_operatorPrecedence[$o2['value']])) {
-					$output[] = $stack->pop();								//	Swap operands and higher precedence operators from the stack to the output
-				}
-				$stack->push('Binary Operator',$opCharacter);	//	Finally put our current operator onto the stack
-				++$index;
-				$expectingOperator = FALSE;
-
-			} elseif ($opCharacter == ')' && $expectingOperator) {			//	Are we expecting to close a parenthesis?
-//echo 'Element is a Closing bracket',PHP_EOL;
-				$expectingOperand = FALSE;
-				while (($o2 = $stack->pop()) && $o2['value'] != '(') {		//	Pop off the stack back to the last (
-					if ($o2 === NULL) return $this->_raiseFormulaError('Formula Error: Unexpected closing brace ")"');
-					else $output[] = $o2;
-				}
-				$d = $stack->last(2);
-				if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) {	//	Did this parenthesis just close a function?
-					$functionName = $matches[1];										//	Get the function name
-//echo 'Closed Function is '.$functionName,PHP_EOL;
-					$d = $stack->pop();
-					$argumentCount = $d['value'];		//	See how many arguments there were (argument count is the next value stored on the stack)
-//if ($argumentCount == 0) {
-//	echo 'With no arguments',PHP_EOL;
-//} elseif ($argumentCount == 1) {
-//	echo 'With 1 argument',PHP_EOL;
-//} else {
-//	echo 'With '.$argumentCount.' arguments',PHP_EOL;
-//}
-					$output[] = $d;						//	Dump the argument count on the output
-					$output[] = $stack->pop();			//	Pop the function and push onto the output
-					if (isset(self::$_controlFunctions[$functionName])) {
-//echo 'Built-in function '.$functionName,PHP_EOL;
-						$expectedArgumentCount = self::$_controlFunctions[$functionName]['argumentCount'];
-						$functionCall = self::$_controlFunctions[$functionName]['functionCall'];
-					} elseif (isset(self::$_PHPExcelFunctions[$functionName])) {
-//echo 'PHPExcel function '.$functionName,PHP_EOL;
-						$expectedArgumentCount = self::$_PHPExcelFunctions[$functionName]['argumentCount'];
-						$functionCall = self::$_PHPExcelFunctions[$functionName]['functionCall'];
-					} else {	// did we somehow push a non-function on the stack? this should never happen
-						return $this->_raiseFormulaError("Formula Error: Internal error, non-function on stack");
-					}
-					//	Check the argument count
-					$argumentCountError = FALSE;
-					if (is_numeric($expectedArgumentCount)) {
-						if ($expectedArgumentCount < 0) {
-//echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount),PHP_EOL;
-							if ($argumentCount > abs($expectedArgumentCount)) {
-								$argumentCountError = TRUE;
-								$expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount);
-							}
-						} else {
-//echo '$expectedArgumentCount is numeric '.$expectedArgumentCount,PHP_EOL;
-							if ($argumentCount != $expectedArgumentCount) {
-								$argumentCountError = TRUE;
-								$expectedArgumentCountString = $expectedArgumentCount;
-							}
-						}
-					} elseif ($expectedArgumentCount != '*') {
-						$isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/',$expectedArgumentCount,$argMatch);
-//print_r($argMatch);
-//echo PHP_EOL;
-						switch ($argMatch[2]) {
-							case '+' :
-								if ($argumentCount < $argMatch[1]) {
-									$argumentCountError = TRUE;
-									$expectedArgumentCountString = $argMatch[1].' or more ';
-								}
-								break;
-							case '-' :
-								if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) {
-									$argumentCountError = TRUE;
-									$expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3];
-								}
-								break;
-							case ',' :
-								if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) {
-									$argumentCountError = TRUE;
-									$expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3];
-								}
-								break;
-						}
-					}
-					if ($argumentCountError) {
-						return $this->_raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString." expected");
-					}
-				}
-				++$index;
-
-			} elseif ($opCharacter == ',') {			//	Is this the separator for function arguments?
-//echo 'Element is a Function argument separator',PHP_EOL;
-				while (($o2 = $stack->pop()) && $o2['value'] != '(') {		//	Pop off the stack back to the last (
-					if ($o2 === NULL) return $this->_raiseFormulaError("Formula Error: Unexpected ,");
-					else $output[] = $o2;	// pop the argument expression stuff and push onto the output
-				}
-				//	If we've a comma when we're expecting an operand, then what we actually have is a null operand;
-				//		so push a null onto the stack
-				if (($expectingOperand) || (!$expectingOperator)) {
-					$output[] = array('type' => 'NULL Value', 'value' => self::$_ExcelConstants['NULL'], 'reference' => NULL);
-				}
-				// make sure there was a function
-				$d = $stack->last(2);
-				if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches))
-					return $this->_raiseFormulaError("Formula Error: Unexpected ,");
-				$d = $stack->pop();
-				$stack->push($d['type'],++$d['value'],$d['reference']);	// increment the argument count
-				$stack->push('Brace', '(');	// put the ( back on, we'll need to pop back to it again
-				$expectingOperator = FALSE;
-				$expectingOperand = TRUE;
-				++$index;
-
-			} elseif ($opCharacter == '(' && !$expectingOperator) {
-//				echo 'Element is an Opening Bracket<br />';
-				$stack->push('Brace', '(');
-				++$index;
-
-			} elseif ($isOperandOrFunction && !$expectingOperator) {	// do we now have a function/variable/number?
-				$expectingOperator = TRUE;
-				$expectingOperand = FALSE;
-				$val = $match[1];
-				$length = strlen($val);
-//				echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function<br />';
-
-				if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) {
-					$val = preg_replace('/\s/u','',$val);
-//					echo 'Element '.$val.' is a Function<br />';
-					if (isset(self::$_PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$_controlFunctions[strtoupper($matches[1])])) {	// it's a function
-						$stack->push('Function', strtoupper($val));
-						$ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch);
-						if ($ax) {
-							$stack->push('Operand Count for Function '.strtoupper($val).')', 0);
-							$expectingOperator = TRUE;
-						} else {
-							$stack->push('Operand Count for Function '.strtoupper($val).')', 1);
-							$expectingOperator = FALSE;
-						}
-						$stack->push('Brace', '(');
-					} else {	// it's a var w/ implicit multiplication
-						$output[] = array('type' => 'Value', 'value' => $matches[1], 'reference' => NULL);
-					}
-				} elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) {
-//					echo 'Element '.$val.' is a Cell reference<br />';
-					//	Watch for this case-change when modifying to allow cell references in different worksheets...
-					//	Should only be applied to the actual cell column, not the worksheet name
-
-					//	If the last entry on the stack was a : operator, then we have a cell range reference
-					$testPrevOp = $stack->last(1);
-					if ($testPrevOp['value'] == ':') {
-						//	If we have a worksheet reference, then we're playing with a 3D reference
-						if ($matches[2] == '') {
-							//	Otherwise, we 'inherit' the worksheet reference from the start cell reference
-							//	The start of the cell range reference should be the last entry in $output
-							$startCellRef = $output[count($output)-1]['value'];
-							preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches);
-							if ($startMatches[2] > '') {
-								$val = $startMatches[2].'!'.$val;
-							}
-						} else {
-							return $this->_raiseFormulaError("3D Range references are not yet supported");
-						}
-					}
-
-					$output[] = array('type' => 'Cell Reference', 'value' => $val, 'reference' => $val);
-//					$expectingOperator = FALSE;
-				} else {	// it's a variable, constant, string, number or boolean
-//					echo 'Element is a Variable, Constant, String, Number or Boolean<br />';
-					//	If the last entry on the stack was a : operator, then we may have a row or column range reference
-					$testPrevOp = $stack->last(1);
-					if ($testPrevOp['value'] == ':') {
-						$startRowColRef = $output[count($output)-1]['value'];
-						$rangeWS1 = '';
-						if (strpos('!',$startRowColRef) !== FALSE) {
-							list($rangeWS1,$startRowColRef) = explode('!',$startRowColRef);
-						}
-						if ($rangeWS1 != '') $rangeWS1 .= '!';
-						$rangeWS2 = $rangeWS1;
-						if (strpos('!',$val) !== FALSE) {
-							list($rangeWS2,$val) = explode('!',$val);
-						}
-						if ($rangeWS2 != '') $rangeWS2 .= '!';
-						if ((is_integer($startRowColRef)) && (ctype_digit($val)) &&
-							($startRowColRef <= 1048576) && ($val <= 1048576)) {
-							//	Row range
-							$endRowColRef = ($pCellParent !== NULL) ? $pCellParent->getHighestColumn() : 'XFD';	//	Max 16,384 columns for Excel2007
-							$output[count($output)-1]['value'] = $rangeWS1.'A'.$startRowColRef;
-							$val = $rangeWS2.$endRowColRef.$val;
-						} elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) &&
-							(strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) {
-							//	Column range
-							$endRowColRef = ($pCellParent !== NULL) ? $pCellParent->getHighestRow() : 1048576;		//	Max 1,048,576 rows for Excel2007
-							$output[count($output)-1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1';
-							$val = $rangeWS2.$val.$endRowColRef;
-						}
-					}
-
-					$localeConstant = FALSE;
-					if ($opCharacter == '"') {
-//						echo 'Element is a String<br />';
-						//	UnEscape any quotes within the string
-						$val = self::_wrapResult(str_replace('""','"',self::_unwrapResult($val)));
-					} elseif (is_numeric($val)) {
-//						echo 'Element is a Number<br />';
-						if ((strpos($val,'.') !== FALSE) || (stripos($val,'e') !== FALSE) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
-//							echo 'Casting '.$val.' to float<br />';
-							$val = (float) $val;
-						} else {
-//							echo 'Casting '.$val.' to integer<br />';
-							$val = (integer) $val;
-						}
-					} elseif (isset(self::$_ExcelConstants[trim(strtoupper($val))])) {
-						$excelConstant = trim(strtoupper($val));
-//						echo 'Element '.$excelConstant.' is an Excel Constant<br />';
-						$val = self::$_ExcelConstants[$excelConstant];
-					} elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$_localeBoolean)) !== FALSE) {
-//						echo 'Element '.$localeConstant.' is an Excel Constant<br />';
-						$val = self::$_ExcelConstants[$localeConstant];
-					}
-					$details = array('type' => 'Value', 'value' => $val, 'reference' => NULL);
-					if ($localeConstant) { $details['localeValue'] = $localeConstant; }
-					$output[] = $details;
-				}
-				$index += $length;
-
-			} elseif ($opCharacter == '$') {	// absolute row or column range
-				++$index;
-			} elseif ($opCharacter == ')') {	// miscellaneous error checking
-				if ($expectingOperand) {
-					$output[] = array('type' => 'NULL Value', 'value' => self::$_ExcelConstants['NULL'], 'reference' => NULL);
-					$expectingOperand = FALSE;
-					$expectingOperator = TRUE;
-				} else {
-					return $this->_raiseFormulaError("Formula Error: Unexpected ')'");
-				}
-			} elseif (isset(self::$_operators[$opCharacter]) && !$expectingOperator) {
-				return $this->_raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'");
-			} else {	// I don't even want to know what you did to get here
-				return $this->_raiseFormulaError("Formula Error: An unexpected error occured");
-			}
-			//	Test for end of formula string
-			if ($index == strlen($formula)) {
-				//	Did we end with an operator?.
-				//	Only valid for the % unary operator
-				if ((isset(self::$_operators[$opCharacter])) && ($opCharacter != '%')) {
-					return $this->_raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands");
-				} else {
-					break;
-				}
-			}
-			//	Ignore white space
-			while (($formula{$index} == "\n") || ($formula{$index} == "\r")) {
-				++$index;
-			}
-			if ($formula{$index} == ' ') {
-				while ($formula{$index} == ' ') {
-					++$index;
-				}
-				//	If we're expecting an operator, but only have a space between the previous and next operands (and both are
-				//		Cell References) then we have an INTERSECTION operator
-//				echo 'Possible Intersect Operator<br />';
-				if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) &&
-					($output[count($output)-1]['type'] == 'Cell Reference')) {
-//					echo 'Element is an Intersect Operator<br />';
-					while($stack->count() > 0 &&
-						($o2 = $stack->last()) &&
-						isset(self::$_operators[$o2['value']]) &&
-						@(self::$_operatorAssociativity[$opCharacter] ? self::$_operatorPrecedence[$opCharacter] < self::$_operatorPrecedence[$o2['value']] : self::$_operatorPrecedence[$opCharacter] <= self::$_operatorPrecedence[$o2['value']])) {
-						$output[] = $stack->pop();								//	Swap operands and higher precedence operators from the stack to the output
-					}
-					$stack->push('Binary Operator','|');	//	Put an Intersect Operator on the stack
-					$expectingOperator = FALSE;
-				}
-			}
-		}
-
-		while (($op = $stack->pop()) !== NULL) {	// pop everything off the stack and push onto output
-			if ((is_array($op) && $op['value'] == '(') || ($op === '('))
-				return $this->_raiseFormulaError("Formula Error: Expecting ')'");	// if there are any opening braces on the stack, then braces were unbalanced
-			$output[] = $op;
-		}
-		return $output;
-	}	//	function _parseFormula()
-
-
-	private static function _dataTestReference(&$operandData)
-	{
-		$operand = $operandData['value'];
-		if (($operandData['reference'] === NULL) && (is_array($operand))) {
-			$rKeys = array_keys($operand);
-			$rowKey = array_shift($rKeys);
-			$cKeys = array_keys(array_keys($operand[$rowKey]));
-			$colKey = array_shift($cKeys);
-			if (ctype_upper($colKey)) {
-				$operandData['reference'] = $colKey.$rowKey;
-			}
-		}
-		return $operand;
-	}
-
-	// evaluate postfix notation
-	private function _processTokenStack($tokens, $cellID = NULL, PHPExcel_Cell $pCell = NULL) {
-		if ($tokens == FALSE) return FALSE;
-
-		//	If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection),
-		//		so we store the parent cell collection so that we can re-attach it when necessary
-		$pCellWorksheet = ($pCell !== NULL) ? $pCell->getWorksheet() : NULL;
-		$pCellParent = ($pCell !== NULL) ? $pCell->getParent() : null;
-		$stack = new PHPExcel_Calculation_Token_Stack;
-
-		//	Loop through each token in turn
-		foreach ($tokens as $tokenData) {
-//			print_r($tokenData);
-//			echo '<br />';
-			$token = $tokenData['value'];
-//			echo '<b>Token is '.$token.'</b><br />';
-			// if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
-			if (isset(self::$_binaryOperators[$token])) {
-//				echo 'Token is a binary operator<br />';
-				//	We must have two operands, error if we don't
-				if (($operand2Data = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack');
-				if (($operand1Data = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack');
-
-				$operand1 = self::_dataTestReference($operand1Data);
-				$operand2 = self::_dataTestReference($operand2Data);
-
-				//	Log what we're doing
-				if ($token == ':') {
-					$this->_debugLog->writeDebugLog('Evaluating Range ', $this->_showValue($operand1Data['reference']), ' ', $token, ' ', $this->_showValue($operand2Data['reference']));
-				} else {
-					$this->_debugLog->writeDebugLog('Evaluating ', $this->_showValue($operand1), ' ', $token, ' ', $this->_showValue($operand2));
-				}
-
-				//	Process the operation in the appropriate manner
-				switch ($token) {
-					//	Comparison (Boolean) Operators
-					case '>'	:			//	Greater than
-					case '<'	:			//	Less than
-					case '>='	:			//	Greater than or Equal to
-					case '<='	:			//	Less than or Equal to
-					case '='	:			//	Equality
-					case '<>'	:			//	Inequality
-						$this->_executeBinaryComparisonOperation($cellID,$operand1,$operand2,$token,$stack);
-						break;
-					//	Binary Operators
-					case ':'	:			//	Range
-						$sheet1 = $sheet2 = '';
-						if (strpos($operand1Data['reference'],'!') !== FALSE) {
-							list($sheet1,$operand1Data['reference']) = explode('!',$operand1Data['reference']);
-						} else {
-							$sheet1 = ($pCellParent !== NULL) ? $pCellWorksheet->getTitle() : '';
-						}
-						if (strpos($operand2Data['reference'],'!') !== FALSE) {
-							list($sheet2,$operand2Data['reference']) = explode('!',$operand2Data['reference']);
-						} else {
-							$sheet2 = $sheet1;
-						}
-						if ($sheet1 == $sheet2) {
-							if ($operand1Data['reference'] === NULL) {
-								if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) {
-									$operand1Data['reference'] = $pCell->getColumn().$operand1Data['value'];
-								} elseif (trim($operand1Data['reference']) == '') {
-									$operand1Data['reference'] = $pCell->getCoordinate();
-								} else {
-									$operand1Data['reference'] = $operand1Data['value'].$pCell->getRow();
-								}
-							}
-							if ($operand2Data['reference'] === NULL) {
-								if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) {
-									$operand2Data['reference'] = $pCell->getColumn().$operand2Data['value'];
-								} elseif (trim($operand2Data['reference']) == '') {
-									$operand2Data['reference'] = $pCell->getCoordinate();
-								} else {
-									$operand2Data['reference'] = $operand2Data['value'].$pCell->getRow();
-								}
-							}
-
-							$oData = array_merge(explode(':',$operand1Data['reference']),explode(':',$operand2Data['reference']));
-							$oCol = $oRow = array();
-							foreach($oData as $oDatum) {
-								$oCR = PHPExcel_Cell::coordinateFromString($oDatum);
-								$oCol[] = PHPExcel_Cell::columnIndexFromString($oCR[0]) - 1;
-								$oRow[] = $oCR[1];
-							}
-							$cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow);
-							if ($pCellParent !== NULL) {
-								$cellValue = $this->extractCellRange($cellRef, $this->_workbook->getSheetByName($sheet1), FALSE);
-							} else {
-								return $this->_raiseFormulaError('Unable to access Cell Reference');
-							}
-							$stack->push('Cell Reference',$cellValue,$cellRef);
-						} else {
-							$stack->push('Error',PHPExcel_Calculation_Functions::REF(),NULL);
-						}
-
-						break;
-					case '+'	:			//	Addition
-						$this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'plusEquals',$stack);
-						break;
-					case '-'	:			//	Subtraction
-						$this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'minusEquals',$stack);
-						break;
-					case '*'	:			//	Multiplication
-						$this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'arrayTimesEquals',$stack);
-						break;
-					case '/'	:			//	Division
-						$this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'arrayRightDivide',$stack);
-						break;
-					case '^'	:			//	Exponential
-						$this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'power',$stack);
-						break;
-					case '&'	:			//	Concatenation
-						//	If either of the operands is a matrix, we need to treat them both as matrices
-						//		(converting the other operand to a matrix if need be); then perform the required
-						//		matrix operation
-						if (is_bool($operand1)) {
-							$operand1 = ($operand1) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE'];
-						}
-						if (is_bool($operand2)) {
-							$operand2 = ($operand2) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE'];
-						}
-						if ((is_array($operand1)) || (is_array($operand2))) {
-							//	Ensure that both operands are arrays/matrices
-							self::_checkMatrixOperands($operand1,$operand2,2);
-							try {
-								//	Convert operand 1 from a PHP array to a matrix
-								$matrix = new PHPExcel_Shared_JAMA_Matrix($operand1);
-								//	Perform the required operation against the operand 1 matrix, passing in operand 2
-								$matrixResult = $matrix->concat($operand2);
-								$result = $matrixResult->getArray();
-							} catch (PHPExcel_Exception $ex) {
-								$this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
-								$result = '#VALUE!';
-							}
-						} else {
-							$result = '"'.str_replace('""','"',self::_unwrapResult($operand1,'"').self::_unwrapResult($operand2,'"')).'"';
-						}
-						$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($result));
-						$stack->push('Value',$result);
-						break;
-					case '|'	:			//	Intersect
-						$rowIntersect = array_intersect_key($operand1,$operand2);
-						$cellIntersect = $oCol = $oRow = array();
-						foreach(array_keys($rowIntersect) as $row) {
-							$oRow[] = $row;
-							foreach($rowIntersect[$row] as $col => $data) {
-								$oCol[] = PHPExcel_Cell::columnIndexFromString($col) - 1;
-								$cellIntersect[$row] = array_intersect_key($operand1[$row],$operand2[$row]);
-							}
-						}
-						$cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow);
-						$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($cellIntersect));
-						$stack->push('Value',$cellIntersect,$cellRef);
-						break;
-				}
-
-			// if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
-			} elseif (($token === '~') || ($token === '%')) {
-//				echo 'Token is a unary operator<br />';
-				if (($arg = $stack->pop()) === NULL) return $this->_raiseFormulaError('Internal error - Operand value missing from stack');
-				$arg = $arg['value'];
-				if ($token === '~') {
-//					echo 'Token is a negation operator<br />';
-					$this->_debugLog->writeDebugLog('Evaluating Negation of ', $this->_showValue($arg));
-					$multiplier = -1;
-				} else {
-//					echo 'Token is a percentile operator<br />';
-					$this->_debugLog->writeDebugLog('Evaluating Percentile of ', $this->_showValue($arg));
-					$multiplier = 0.01;
-				}
-				if (is_array($arg)) {
-					self::_checkMatrixOperands($arg,$multiplier,2);
-					try {
-						$matrix1 = new PHPExcel_Shared_JAMA_Matrix($arg);
-						$matrixResult = $matrix1->arrayTimesEquals($multiplier);
-						$result = $matrixResult->getArray();
-					} catch (PHPExcel_Exception $ex) {
-						$this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
-						$result = '#VALUE!';
-					}
-					$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($result));
-					$stack->push('Value',$result);
-				} else {
-					$this->_executeNumericBinaryOperation($cellID,$multiplier,$arg,'*','arrayTimesEquals',$stack);
-				}
-
-			} elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) {
-				$cellRef = NULL;
-//				echo 'Element '.$token.' is a Cell reference<br />';
-				if (isset($matches[8])) {
-//					echo 'Reference is a Range of cells<br />';
-					if ($pCell === NULL) {
-//						We can't access the range, so return a REF error
-						$cellValue = PHPExcel_Calculation_Functions::REF();
-					} else {
-						$cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10];
-						if ($matches[2] > '') {
-							$matches[2] = trim($matches[2],"\"'");
-							if ((strpos($matches[2],'[') !== FALSE) || (strpos($matches[2],']') !== FALSE)) {
-								//	It's a Reference to an external workbook (not currently supported)
-								return $this->_raiseFormulaError('Unable to access External Workbook');
-							}
-							$matches[2] = trim($matches[2],"\"'");
-//							echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'<br />';
-							$this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]);
-							if ($pCellParent !== NULL) {
-								$cellValue = $this->extractCellRange($cellRef, $this->_workbook->getSheetByName($matches[2]), FALSE);
-							} else {
-								return $this->_raiseFormulaError('Unable to access Cell Reference');
-							}
-							$this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->_showTypeDetails($cellValue));
-//							$cellRef = $matches[2].'!'.$cellRef;
-						} else {
-//							echo '$cellRef='.$cellRef.' in current worksheet<br />';
-							$this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet');
-							if ($pCellParent !== NULL) {
-								$cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, FALSE);
-							} else {
-								return $this->_raiseFormulaError('Unable to access Cell Reference');
-							}
-							$this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' is ', $this->_showTypeDetails($cellValue));
-						}
-					}
-				} else {
-//					echo 'Reference is a single Cell<br />';
-					if ($pCell === NULL) {
-//						We can't access the cell, so return a REF error
-						$cellValue = PHPExcel_Calculation_Functions::REF();
-					} else {
-						$cellRef = $matches[6].$matches[7];
-						if ($matches[2] > '') {
-							$matches[2] = trim($matches[2],"\"'");
-							if ((strpos($matches[2],'[') !== FALSE) || (strpos($matches[2],']') !== FALSE)) {
-								//	It's a Reference to an external workbook (not currently supported)
-								return $this->_raiseFormulaError('Unable to access External Workbook');
-							}
-//							echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'<br />';
-							$this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]);
-							if ($pCellParent !== NULL) {
-								$cellSheet = $this->_workbook->getSheetByName($matches[2]);
-								if ($cellSheet && $cellSheet->cellExists($cellRef)) {
-									$cellValue = $this->extractCellRange($cellRef, $this->_workbook->getSheetByName($matches[2]), FALSE);
-									$pCell->attach($pCellParent);
-								} else {
-									$cellValue = NULL;
-								}
-							} else {
-								return $this->_raiseFormulaError('Unable to access Cell Reference');
-							}
-							$this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->_showTypeDetails($cellValue));
-//							$cellRef = $matches[2].'!'.$cellRef;
-						} else {
-//							echo '$cellRef='.$cellRef.' in current worksheet<br />';
-							$this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet');
-							if ($pCellParent->isDataSet($cellRef)) {
-								$cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, FALSE);
-								$pCell->attach($pCellParent);
-							} else {
-								$cellValue = NULL;
-							}
-							$this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' is ', $this->_showTypeDetails($cellValue));
-						}
-					}
-				}
-				$stack->push('Value',$cellValue,$cellRef);
-
-			// if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
-			} elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) {
-//				echo 'Token is a function<br />';
-				$functionName = $matches[1];
-				$argCount = $stack->pop();
-				$argCount = $argCount['value'];
-				if ($functionName != 'MKMATRIX') {
-					$this->_debugLog->writeDebugLog('Evaluating Function ', self::_localeFunc($functionName), '() with ', (($argCount == 0) ? 'no' : $argCount), ' argument', (($argCount == 1) ? '' : 's'));
-				}
-				if ((isset(self::$_PHPExcelFunctions[$functionName])) || (isset(self::$_controlFunctions[$functionName]))) {	// function
-					if (isset(self::$_PHPExcelFunctions[$functionName])) {
-						$functionCall = self::$_PHPExcelFunctions[$functionName]['functionCall'];
-						$passByReference = isset(self::$_PHPExcelFunctions[$functionName]['passByReference']);
-						$passCellReference = isset(self::$_PHPExcelFunctions[$functionName]['passCellReference']);
-					} elseif (isset(self::$_controlFunctions[$functionName])) {
-						$functionCall = self::$_controlFunctions[$functionName]['functionCall'];
-						$passByReference = isset(self::$_controlFunctions[$functionName]['passByReference']);
-						$passCellReference = isset(self::$_controlFunctions[$functionName]['passCellReference']);
-					}
-					// get the arguments for this function
-//					echo 'Function '.$functionName.' expects '.$argCount.' arguments<br />';
-					$args = $argArrayVals = array();
-					for ($i = 0; $i < $argCount; ++$i) {
-						$arg = $stack->pop();
-						$a = $argCount - $i - 1;
-						if (($passByReference) &&
-							(isset(self::$_PHPExcelFunctions[$functionName]['passByReference'][$a])) &&
-							(self::$_PHPExcelFunctions[$functionName]['passByReference'][$a])) {
-							if ($arg['reference'] === NULL) {
-								$args[] = $cellID;
-								if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($cellID); }
-							} else {
-								$args[] = $arg['reference'];
-								if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($arg['reference']); }
-							}
-						} else {
-							$args[] = self::_unwrapResult($arg['value']);
-							if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($arg['value']); }
-						}
-					}
-					//	Reverse the order of the arguments
-					krsort($args);
-					if (($passByReference) && ($argCount == 0)) {
-						$args[] = $cellID;
-						$argArrayVals[] = $this->_showValue($cellID);
-					}
-//					echo 'Arguments are: ';
-//					print_r($args);
-//					echo '<br />';
-					if ($functionName != 'MKMATRIX') {
-						if ($this->_debugLog->getWriteDebugLog()) {
-							krsort($argArrayVals);
-							$this->_debugLog->writeDebugLog('Evaluating ', self::_localeFunc($functionName), '( ', implode(self::$_localeArgumentSeparator.' ',PHPExcel_Calculation_Functions::flattenArray($argArrayVals)), ' )');
-						}
-					}
-					//	Process each argument in turn, building the return value as an array
-//					if (($argCount == 1) && (is_array($args[1])) && ($functionName != 'MKMATRIX')) {
-//						$operand1 = $args[1];
-//						$this->_debugLog->writeDebugLog('Argument is a matrix: ', $this->_showValue($operand1));
-//						$result = array();
-//						$row = 0;
-//						foreach($operand1 as $args) {
-//							if (is_array($args)) {
-//								foreach($args as $arg) {
-//									$this->_debugLog->writeDebugLog('Evaluating ', self::_localeFunc($functionName), '( ', $this->_showValue($arg), ' )');
-//									$r = call_user_func_array($functionCall,$arg);
-//									$this->_debugLog->writeDebugLog('Evaluation Result for ', self::_localeFunc($functionName), '() function call is ', $this->_showTypeDetails($r));
-//									$result[$row][] = $r;
-//								}
-//								++$row;
-//							} else {
-//								$this->_debugLog->writeDebugLog('Evaluating ', self::_localeFunc($functionName), '( ', $this->_showValue($args), ' )');
-//								$r = call_user_func_array($functionCall,$args);
-//								$this->_debugLog->writeDebugLog('Evaluation Result for ', self::_localeFunc($functionName), '() function call is ', $this->_showTypeDetails($r));
-//								$result[] = $r;
-//							}
-//						}
-//					} else {
-					//	Process the argument with the appropriate function call
-						if ($passCellReference) {
-							$args[] = $pCell;
-						}
-						if (strpos($functionCall,'::') !== FALSE) {
-							$result = call_user_func_array(explode('::',$functionCall),$args);
-						} else {
-							foreach($args as &$arg) {
-								$arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg);
-							}
-							unset($arg);
-							$result = call_user_func_array($functionCall,$args);
-						}
-//					}
-					if ($functionName != 'MKMATRIX') {
-						$this->_debugLog->writeDebugLog('Evaluation Result for ', self::_localeFunc($functionName), '() function call is ', $this->_showTypeDetails($result));
-					}
-					$stack->push('Value',self::_wrapResult($result));
-				}
-
-			} else {
-				// if the token is a number, boolean, string or an Excel error, push it onto the stack
-				if (isset(self::$_ExcelConstants[strtoupper($token)])) {
-					$excelConstant = strtoupper($token);
-//					echo 'Token is a PHPExcel constant: '.$excelConstant.'<br />';
-					$stack->push('Constant Value',self::$_ExcelConstants[$excelConstant]);
-					$this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->_showTypeDetails(self::$_ExcelConstants[$excelConstant]));
-				} elseif ((is_numeric($token)) || ($token === NULL) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) {
-//					echo 'Token is a number, boolean, string, null or an Excel error<br />';
-					$stack->push('Value',$token);
-				// if the token is a named range, push the named range name onto the stack
-				} elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) {
-//					echo 'Token is a named range<br />';
-					$namedRange = $matches[6];
-//					echo 'Named Range is '.$namedRange.'<br />';
-					$this->_debugLog->writeDebugLog('Evaluating Named Range ', $namedRange);
-					$cellValue = $this->extractNamedRange($namedRange, ((NULL !== $pCell) ? $pCellWorksheet : NULL), FALSE);
-					$pCell->attach($pCellParent);
-					$this->_debugLog->writeDebugLog('Evaluation Result for named range ', $namedRange, ' is ', $this->_showTypeDetails($cellValue));
-					$stack->push('Named Range',$cellValue,$namedRange);
-				} else {
-					return $this->_raiseFormulaError("undefined variable '$token'");
-				}
-			}
-		}
-		// when we're out of tokens, the stack should have a single element, the final result
-		if ($stack->count() != 1) return $this->_raiseFormulaError("internal error");
-		$output = $stack->pop();
-		$output = $output['value'];
-
-//		if ((is_array($output)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
-//			return array_shift(PHPExcel_Calculation_Functions::flattenArray($output));
-//		}
-		return $output;
-	}	//	function _processTokenStack()
-
-
-	private function _validateBinaryOperand($cellID, &$operand, &$stack) {
-		if (is_array($operand)) {
-			if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
-				do {
-					$operand = array_pop($operand);
-				} while (is_array($operand));
-			}
-		}
-		//	Numbers, matrices and booleans can pass straight through, as they're already valid
-		if (is_string($operand)) {
-			//	We only need special validations for the operand if it is a string
-			//	Start by stripping off the quotation marks we use to identify true excel string values internally
-			if ($operand > '' && $operand{0} == '"') { $operand = self::_unwrapResult($operand); }
-			//	If the string is a numeric value, we treat it as a numeric, so no further testing
-			if (!is_numeric($operand)) {
-				//	If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
-				if ($operand > '' && $operand{0} == '#') {
-					$stack->push('Value', $operand);
-					$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($operand));
-					return FALSE;
-				} elseif (!PHPExcel_Shared_String::convertToNumberIfFraction($operand)) {
-					//	If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations
-					$stack->push('Value', '#VALUE!');
-					$this->_debugLog->writeDebugLog('Evaluation Result is a ', $this->_showTypeDetails('#VALUE!'));
-					return FALSE;
-				}
-			}
-		}
-
-		//	return a true if the value of the operand is one that we can use in normal binary operations
-		return TRUE;
-	}	//	function _validateBinaryOperand()
-
-
-	private function _executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, &$stack, $recursingArrays=FALSE) {
-		//	If we're dealing with matrix operations, we want a matrix result
-		if ((is_array($operand1)) || (is_array($operand2))) {
-			$result = array();
-			if ((is_array($operand1)) && (!is_array($operand2))) {
-				foreach($operand1 as $x => $operandData) {
-					$this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->_showValue($operandData), ' ', $operation, ' ', $this->_showValue($operand2));
-					$this->_executeBinaryComparisonOperation($cellID,$operandData,$operand2,$operation,$stack);
-					$r = $stack->pop();
-					$result[$x] = $r['value'];
-				}
-			} elseif ((!is_array($operand1)) && (is_array($operand2))) {
-				foreach($operand2 as $x => $operandData) {
-					$this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->_showValue($operand1), ' ', $operation, ' ', $this->_showValue($operandData));
-					$this->_executeBinaryComparisonOperation($cellID,$operand1,$operandData,$operation,$stack);
-					$r = $stack->pop();
-					$result[$x] = $r['value'];
-				}
-			} else {
-				if (!$recursingArrays) { self::_checkMatrixOperands($operand1,$operand2,2); }
-				foreach($operand1 as $x => $operandData) {
-					$this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->_showValue($operandData), ' ', $operation, ' ', $this->_showValue($operand2[$x]));
-					$this->_executeBinaryComparisonOperation($cellID,$operandData,$operand2[$x],$operation,$stack,TRUE);
-					$r = $stack->pop();
-					$result[$x] = $r['value'];
-				}
-			}
-			//	Log the result details
-			$this->_debugLog->writeDebugLog('Comparison Evaluation Result is ', $this->_showTypeDetails($result));
-			//	And push the result onto the stack
-			$stack->push('Array',$result);
-			return TRUE;
-		}
-
-		//	Simple validate the two operands if they are string values
-		if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { $operand1 = self::_unwrapResult($operand1); }
-		if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { $operand2 = self::_unwrapResult($operand2); }
-
-		// Use case insensitive comparaison if not OpenOffice mode
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE)
-		{
-			if (is_string($operand1)) {
-				$operand1 = strtoupper($operand1);
-			}
-
-			if (is_string($operand2)) {
-				$operand2 = strtoupper($operand2);
-			}
-		}
-
-		$useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE;
-
-		//	execute the necessary operation
-		switch ($operation) {
-			//	Greater than
-			case '>':
-				if ($useLowercaseFirstComparison) {
-					$result = $this->strcmpLowercaseFirst($operand1, $operand2) > 0;
-				} else {
-					$result = ($operand1 > $operand2);
-				}
-				break;
-			//	Less than
-			case '<':
-				if ($useLowercaseFirstComparison) {
-					$result = $this->strcmpLowercaseFirst($operand1, $operand2) < 0;
-				} else {
-					$result = ($operand1 < $operand2);
-				}
-				break;
-			//	Equality
-			case '=':
-                if (is_numeric($operand1) && is_numeric($operand2)) {
-                    $result = (abs($operand1 - $operand2) < $this->delta);
-                } else {
-                    $result = strcmp($operand1, $operand2) == 0;
-                }
-				break;
-			//	Greater than or equal
-			case '>=':
-                if (is_numeric($operand1) && is_numeric($operand2)) {
-                    $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 > $operand2));
-				} elseif ($useLowercaseFirstComparison) {
-					$result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0;
-				} else {
-					$result = strcmp($operand1, $operand2) >= 0;
-				}
-				break;
-			//	Less than or equal
-			case '<=':
-                if (is_numeric($operand1) && is_numeric($operand2)) {
-                    $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 < $operand2));
-                } elseif ($useLowercaseFirstComparison) {
-					$result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0;
-				} else {
-					$result = strcmp($operand1, $operand2) <= 0;
-				}
-				break;
-			//	Inequality
-			case '<>':
-                if (is_numeric($operand1) && is_numeric($operand2)) {
-                    $result = (abs($operand1 - $operand2) > 1E-14);
-                } else {
-                    $result = strcmp($operand1, $operand2) != 0;
-                }
-				break;
-		}
-
-		//	Log the result details
-		$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($result));
-		//	And push the result onto the stack
-		$stack->push('Value',$result);
-		return true;
-	}
-
-	/**
-	 * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters
-	 * @param    string    $str1    First string value for the comparison
-	 * @param    string    $str2    Second string value for the comparison
-	 * @return   integer
-	 */
-	private function strcmpLowercaseFirst($str1, $str2)
-	{
-        $inversedStr1 = PHPExcel_Shared_String::StrCaseReverse($str1);
-        $inversedStr2 = PHPExcel_Shared_String::StrCaseReverse($str2);
-
-		return strcmp($inversedStr1, $inversedStr2);
-	}
-
-	private function _executeNumericBinaryOperation($cellID,$operand1,$operand2,$operation,$matrixFunction,&$stack) {
-		//	Validate the two operands
-		if (!$this->_validateBinaryOperand($cellID,$operand1,$stack)) return FALSE;
-		if (!$this->_validateBinaryOperand($cellID,$operand2,$stack)) return FALSE;
-
-		//	If either of the operands is a matrix, we need to treat them both as matrices
-		//		(converting the other operand to a matrix if need be); then perform the required
-		//		matrix operation
-		if ((is_array($operand1)) || (is_array($operand2))) {
-			//	Ensure that both operands are arrays/matrices of the same size
-			self::_checkMatrixOperands($operand1, $operand2, 2);
-
-			try {
-				//	Convert operand 1 from a PHP array to a matrix
-				$matrix = new PHPExcel_Shared_JAMA_Matrix($operand1);
-				//	Perform the required operation against the operand 1 matrix, passing in operand 2
-				$matrixResult = $matrix->$matrixFunction($operand2);
-				$result = $matrixResult->getArray();
-			} catch (PHPExcel_Exception $ex) {
-				$this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
-				$result = '#VALUE!';
-			}
-		} else {
-			if ((PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) &&
-				((is_string($operand1) && !is_numeric($operand1) && strlen($operand1)>0) || 
-                 (is_string($operand2) && !is_numeric($operand2) && strlen($operand2)>0))) {
-				$result = PHPExcel_Calculation_Functions::VALUE();
-			} else {
-				//	If we're dealing with non-matrix operations, execute the necessary operation
-				switch ($operation) {
-					//	Addition
-					case '+':
-						$result = $operand1 + $operand2;
-						break;
-					//	Subtraction
-					case '-':
-						$result = $operand1 - $operand2;
-						break;
-					//	Multiplication
-					case '*':
-						$result = $operand1 * $operand2;
-						break;
-					//	Division
-					case '/':
-						if ($operand2 == 0) {
-							//	Trap for Divide by Zero error
-							$stack->push('Value','#DIV/0!');
-							$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails('#DIV/0!'));
-							return FALSE;
-						} else {
-							$result = $operand1 / $operand2;
-						}
-						break;
-					//	Power
-					case '^':
-						$result = pow($operand1, $operand2);
-						break;
-				}
-			}
-		}
-
-		//	Log the result details
-		$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($result));
-		//	And push the result onto the stack
-		$stack->push('Value',$result);
-		return TRUE;
-	}	//	function _executeNumericBinaryOperation()
-
-
-	// trigger an error, but nicely, if need be
-	protected function _raiseFormulaError($errorMessage) {
-		$this->formulaError = $errorMessage;
-		$this->_cyclicReferenceStack->clear();
-		if (!$this->suppressFormulaErrors) throw new PHPExcel_Calculation_Exception($errorMessage);
-		trigger_error($errorMessage, E_USER_ERROR);
-	}	//	function _raiseFormulaError()
-
-
-	/**
-	 * Extract range values
-	 *
-	 * @param	string				&$pRange	String based range representation
-	 * @param	PHPExcel_Worksheet	$pSheet		Worksheet
-	 * @param	boolean				$resetLog	Flag indicating whether calculation log should be reset or not
-	 * @return  mixed				Array of values in range if range contains more than one element. Otherwise, a single value is returned.
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function extractCellRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = NULL, $resetLog = TRUE) {
-		// Return value
-		$returnValue = array ();
-
-//		echo 'extractCellRange('.$pRange.')',PHP_EOL;
-		if ($pSheet !== NULL) {
-			$pSheetName = $pSheet->getTitle();
-//			echo 'Passed sheet name is '.$pSheetName.PHP_EOL;
-//			echo 'Range reference is '.$pRange.PHP_EOL;
-			if (strpos ($pRange, '!') !== false) {
-//				echo '$pRange reference includes sheet reference',PHP_EOL;
-				list($pSheetName,$pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true);
-//				echo 'New sheet name is '.$pSheetName,PHP_EOL;
-//				echo 'Adjusted Range reference is '.$pRange,PHP_EOL;
-				$pSheet = $this->_workbook->getSheetByName($pSheetName);
-			}
-
-			// Extract range
-			$aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
-			$pRange = $pSheetName.'!'.$pRange;
-			if (!isset($aReferences[1])) {
-				//	Single cell in range
-				sscanf($aReferences[0],'%[A-Z]%d', $currentCol, $currentRow);
-				$cellValue = NULL;
-				if ($pSheet->cellExists($aReferences[0])) {
-					$returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
-				} else {
-					$returnValue[$currentRow][$currentCol] = NULL;
-				}
-			} else {
-				// Extract cell data for all cells in the range
-				foreach ($aReferences as $reference) {
-					// Extract range
-					sscanf($reference,'%[A-Z]%d', $currentCol, $currentRow);
-					$cellValue = NULL;
-					if ($pSheet->cellExists($reference)) {
-						$returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
-					} else {
-						$returnValue[$currentRow][$currentCol] = NULL;
-					}
-				}
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function extractCellRange()
-
-
-	/**
-	 * Extract range values
-	 *
-	 * @param	string				&$pRange	String based range representation
-	 * @param	PHPExcel_Worksheet	$pSheet		Worksheet
-	 * @return  mixed				Array of values in range if range contains more than one element. Otherwise, a single value is returned.
-	 * @param	boolean				$resetLog	Flag indicating whether calculation log should be reset or not
-	 * @throws	PHPExcel_Calculation_Exception
-	 */
-	public function extractNamedRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = NULL, $resetLog = TRUE) {
-		// Return value
-		$returnValue = array ();
-
-//		echo 'extractNamedRange('.$pRange.')<br />';
-		if ($pSheet !== NULL) {
-			$pSheetName = $pSheet->getTitle();
-//			echo 'Current sheet name is '.$pSheetName.'<br />';
-//			echo 'Range reference is '.$pRange.'<br />';
-			if (strpos ($pRange, '!') !== false) {
-//				echo '$pRange reference includes sheet reference',PHP_EOL;
-				list($pSheetName,$pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true);
-//				echo 'New sheet name is '.$pSheetName,PHP_EOL;
-//				echo 'Adjusted Range reference is '.$pRange,PHP_EOL;
-				$pSheet = $this->_workbook->getSheetByName($pSheetName);
-			}
-
-			// Named range?
-			$namedRange = PHPExcel_NamedRange::resolveRange($pRange, $pSheet);
-			if ($namedRange !== NULL) {
-				$pSheet = $namedRange->getWorksheet();
-//				echo 'Named Range '.$pRange.' (';
-				$pRange = $namedRange->getRange();
-				$splitRange = PHPExcel_Cell::splitRange($pRange);
-				//	Convert row and column references
-				if (ctype_alpha($splitRange[0][0])) {
-					$pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow();
-				} elseif(ctype_digit($splitRange[0][0])) {
-					$pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1];
-				}
-//				echo $pRange.') is in sheet '.$namedRange->getWorksheet()->getTitle().'<br />';
-
-//				if ($pSheet->getTitle() != $namedRange->getWorksheet()->getTitle()) {
-//					if (!$namedRange->getLocalOnly()) {
-//						$pSheet = $namedRange->getWorksheet();
-//					} else {
-//						return $returnValue;
-//					}
-//				}
-			} else {
-				return PHPExcel_Calculation_Functions::REF();
-			}
-
-			// Extract range
-			$aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
-//			var_dump($aReferences);
-			if (!isset($aReferences[1])) {
-				//	Single cell (or single column or row) in range
-				list($currentCol,$currentRow) = PHPExcel_Cell::coordinateFromString($aReferences[0]);
-				$cellValue = NULL;
-				if ($pSheet->cellExists($aReferences[0])) {
-					$returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
-				} else {
-					$returnValue[$currentRow][$currentCol] = NULL;
-				}
-			} else {
-				// Extract cell data for all cells in the range
-				foreach ($aReferences as $reference) {
-					// Extract range
-					list($currentCol,$currentRow) = PHPExcel_Cell::coordinateFromString($reference);
-//					echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'<br />';
-					$cellValue = NULL;
-					if ($pSheet->cellExists($reference)) {
-						$returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
-					} else {
-						$returnValue[$currentRow][$currentCol] = NULL;
-					}
-				}
-			}
-//				print_r($returnValue);
-//			echo '<br />';
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function extractNamedRange()
-
-
-	/**
-	 * Is a specific function implemented?
-	 *
-	 * @param	string	$pFunction	Function Name
-	 * @return	boolean
-	 */
-	public function isImplemented($pFunction = '') {
-		$pFunction = strtoupper ($pFunction);
-		if (isset(self::$_PHPExcelFunctions[$pFunction])) {
-			return (self::$_PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY');
-		} else {
-			return FALSE;
-		}
-	}	//	function isImplemented()
-
-
-	/**
-	 * Get a list of all implemented functions as an array of function objects
-	 *
-	 * @return	array of PHPExcel_Calculation_Function
-	 */
-	public function listFunctions() {
-		// Return value
-		$returnValue = array();
-		// Loop functions
-		foreach(self::$_PHPExcelFunctions as $functionName => $function) {
-			if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') {
-				$returnValue[$functionName] = new PHPExcel_Calculation_Function($function['category'],
-																				$functionName,
-																				$function['functionCall']
-																			   );
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function listFunctions()
-
-
-	/**
-	 * Get a list of all Excel function names
-	 *
-	 * @return	array
-	 */
-	public function listAllFunctionNames() {
-		return array_keys(self::$_PHPExcelFunctions);
-	}	//	function listAllFunctionNames()
-
-	/**
-	 * Get a list of implemented Excel function names
-	 *
-	 * @return	array
-	 */
-	public function listFunctionNames() {
-		// Return value
-		$returnValue = array();
-		// Loop functions
-		foreach(self::$_PHPExcelFunctions as $functionName => $function) {
-			if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') {
-				$returnValue[] = $functionName;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function listFunctionNames()
-
-}	//	class PHPExcel_Calculation
-

+ 0 - 725
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php

@@ -1,725 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_Database
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Database {
-
-
-	/**
-	 * __fieldExtract
-	 *
-	 * Extracts the column ID to use for the data field.
-	 *
-	 * @access	private
-	 * @param	mixed[]		$database		The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	mixed		$field			Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @return	string|NULL
-	 *
-	 */
-	private static function __fieldExtract($database,$field) {
-		$field = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($field));
-		$fieldNames = array_map('strtoupper',array_shift($database));
-
-		if (is_numeric($field)) {
-			$keys = array_keys($fieldNames);
-			return $keys[$field-1];
-		}
-		$key = array_search($field,$fieldNames);
-		return ($key) ? $key : NULL;
-	}
-
-	/**
-	 * __filter
-	 *
-	 * Parses the selection criteria, extracts the database rows that match those criteria, and
-	 * returns that subset of rows.
-	 *
-	 * @access	private
-	 * @param	mixed[]		$database		The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	mixed[]		$criteria		The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	array of mixed
-	 *
-	 */
-	private static function __filter($database,$criteria) {
-		$fieldNames = array_shift($database);
-		$criteriaNames = array_shift($criteria);
-
-		//	Convert the criteria into a set of AND/OR conditions with [:placeholders]
-		$testConditions = $testValues = array();
-		$testConditionsCount = 0;
-		foreach($criteriaNames as $key => $criteriaName) {
-			$testCondition = array();
-			$testConditionCount = 0;
-			foreach($criteria as $row => $criterion) {
-				if ($criterion[$key] > '') {
-					$testCondition[] = '[:'.$criteriaName.']'.PHPExcel_Calculation_Functions::_ifCondition($criterion[$key]);
-					$testConditionCount++;
-				}
-			}
-			if ($testConditionCount > 1) {
-				$testConditions[] = 'OR('.implode(',',$testCondition).')';
-				$testConditionsCount++;
-			} elseif($testConditionCount == 1) {
-				$testConditions[] = $testCondition[0];
-				$testConditionsCount++;
-			}
-		}
-
-		if ($testConditionsCount > 1) {
-			$testConditionSet = 'AND('.implode(',',$testConditions).')';
-		} elseif($testConditionsCount == 1) {
-			$testConditionSet = $testConditions[0];
-		}
-
-		//	Loop through each row of the database
-		foreach($database as $dataRow => $dataValues) {
-			//	Substitute actual values from the database row for our [:placeholders]
-			$testConditionList = $testConditionSet;
-			foreach($criteriaNames as $key => $criteriaName) {
-				$k = array_search($criteriaName,$fieldNames);
-				if (isset($dataValues[$k])) {
-					$dataValue = $dataValues[$k];
-					$dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::_wrapResult(strtoupper($dataValue)) : $dataValue;
-					$testConditionList = str_replace('[:'.$criteriaName.']',$dataValue,$testConditionList);
-				}
-			}
-			//	evaluate the criteria against the row data
-			$result = PHPExcel_Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList);
-			//	If the row failed to meet the criteria, remove it from the database
-			if (!$result) {
-				unset($database[$dataRow]);
-			}
-		}
-
-		return $database;
-	}
-
-
-	/**
-	 * DAVERAGE
-	 *
-	 * Averages the values in a column of a list or database that match conditions you specify.
-	 *
-	 * Excel Function:
-	 *		DAVERAGE(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DAVERAGE($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::AVERAGE($colData);
-	}	//	function DAVERAGE()
-
-
-	/**
-	 * DCOUNT
-	 *
-	 * Counts the cells that contain numbers in a column of a list or database that match conditions
-	 * that you specify.
-	 *
-	 * Excel Function:
-	 *		DCOUNT(database,[field],criteria)
-	 *
-	 * Excel Function:
-	 *		DAVERAGE(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	integer
-	 *
-	 * @TODO	The field argument is optional. If field is omitted, DCOUNT counts all records in the
-	 *			database that match the criteria.
-	 *
-	 */
-	public static function DCOUNT($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::COUNT($colData);
-	}	//	function DCOUNT()
-
-
-	/**
-	 * DCOUNTA
-	 *
-	 * Counts the nonblank cells in a column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DCOUNTA(database,[field],criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	integer
-	 *
-	 * @TODO	The field argument is optional. If field is omitted, DCOUNTA counts all records in the
-	 *			database that match the criteria.
-	 *
-	 */
-	public static function DCOUNTA($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::COUNTA($colData);
-	}	//	function DCOUNTA()
-
-
-	/**
-	 * DGET
-	 *
-	 * Extracts a single value from a column of a list or database that matches conditions that you
-	 * specify.
-	 *
-	 * Excel Function:
-	 *		DGET(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	mixed
-	 *
-	 */
-	public static function DGET($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		if (count($colData) > 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return $colData[0];
-	}	//	function DGET()
-
-
-	/**
-	 * DMAX
-	 *
-	 * Returns the largest number in a column of a list or database that matches conditions you that
-	 * specify.
-	 *
-	 * Excel Function:
-	 *		DMAX(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DMAX($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::MAX($colData);
-	}	//	function DMAX()
-
-
-	/**
-	 * DMIN
-	 *
-	 * Returns the smallest number in a column of a list or database that matches conditions you that
-	 * specify.
-	 *
-	 * Excel Function:
-	 *		DMIN(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DMIN($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::MIN($colData);
-	}	//	function DMIN()
-
-
-	/**
-	 * DPRODUCT
-	 *
-	 * Multiplies the values in a column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DPRODUCT(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DPRODUCT($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_MathTrig::PRODUCT($colData);
-	}	//	function DPRODUCT()
-
-
-	/**
-	 * DSTDEV
-	 *
-	 * Estimates the standard deviation of a population based on a sample by using the numbers in a
-	 * column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DSTDEV(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DSTDEV($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::STDEV($colData);
-	}	//	function DSTDEV()
-
-
-	/**
-	 * DSTDEVP
-	 *
-	 * Calculates the standard deviation of a population based on the entire population by using the
-	 * numbers in a column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DSTDEVP(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DSTDEVP($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::STDEVP($colData);
-	}	//	function DSTDEVP()
-
-
-	/**
-	 * DSUM
-	 *
-	 * Adds the numbers in a column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DSUM(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DSUM($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_MathTrig::SUM($colData);
-	}	//	function DSUM()
-
-
-	/**
-	 * DVAR
-	 *
-	 * Estimates the variance of a population based on a sample by using the numbers in a column
-	 * of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DVAR(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DVAR($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::VARFunc($colData);
-	}	//	function DVAR()
-
-
-	/**
-	 * DVARP
-	 *
-	 * Calculates the variance of a population based on the entire population by using the numbers
-	 * in a column of a list or database that match conditions that you specify.
-	 *
-	 * Excel Function:
-	 *		DVARP(database,field,criteria)
-	 *
-	 * @access	public
-	 * @category Database Functions
-	 * @param	mixed[]			$database	The range of cells that makes up the list or database.
-	 *										A database is a list of related data in which rows of related
-	 *										information are records, and columns of data are fields. The
-	 *										first row of the list contains labels for each column.
-	 * @param	string|integer	$field		Indicates which column is used in the function. Enter the
-	 *										column label enclosed between double quotation marks, such as
-	 *										"Age" or "Yield," or a number (without quotation marks) that
-	 *										represents the position of the column within the list: 1 for
-	 *										the first column, 2 for the second column, and so on.
-	 * @param	mixed[]			$criteria	The range of cells that contains the conditions you specify.
-	 *										You can use any range for the criteria argument, as long as it
-	 *										includes at least one column label and at least one cell below
-	 *										the column label in which you specify a condition for the
-	 *										column.
-	 * @return	float
-	 *
-	 */
-	public static function DVARP($database,$field,$criteria) {
-		$field = self::__fieldExtract($database,$field);
-		if (is_null($field)) {
-			return NULL;
-		}
-
-		//	reduce the database to a set of rows that match all the criteria
-		$database = self::__filter($database,$criteria);
-		//	extract an array of values for the requested column
-		$colData = array();
-		foreach($database as $row) {
-			$colData[] = $row[$field];
-		}
-
-		// Return
-		return PHPExcel_Calculation_Statistical::VARP($colData);
-	}	//	function DVARP()
-
-
-}	//	class PHPExcel_Calculation_Database

+ 0 - 1485
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php

@@ -1,1485 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_DateTime
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_DateTime {
-
-	/**
-	 * Identify if a year is a leap year or not
-	 *
-	 * @param	integer	$year	The year to test
-	 * @return	boolean			TRUE if the year is a leap year, otherwise FALSE
-	 */
-	public static function _isLeapYear($year) {
-		return ((($year % 4) == 0) && (($year % 100) != 0) || (($year % 400) == 0));
-	}	//	function _isLeapYear()
-
-
-	/**
-	 * Return the number of days between two dates based on a 360 day calendar
-	 *
-	 * @param	integer	$startDay		Day of month of the start date
-	 * @param	integer	$startMonth		Month of the start date
-	 * @param	integer	$startYear		Year of the start date
-	 * @param	integer	$endDay			Day of month of the start date
-	 * @param	integer	$endMonth		Month of the start date
-	 * @param	integer	$endYear		Year of the start date
-	 * @param	boolean $methodUS		Whether to use the US method or the European method of calculation
-	 * @return	integer	Number of days between the start date and the end date
-	 */
-	private static function _dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, $methodUS) {
-		if ($startDay == 31) {
-			--$startDay;
-		} elseif ($methodUS && ($startMonth == 2 && ($startDay == 29 || ($startDay == 28 && !self::_isLeapYear($startYear))))) {
-			$startDay = 30;
-		}
-		if ($endDay == 31) {
-			if ($methodUS && $startDay != 30) {
-				$endDay = 1;
-				if ($endMonth == 12) {
-					++$endYear;
-					$endMonth = 1;
-				} else {
-					++$endMonth;
-				}
-			} else {
-				$endDay = 30;
-			}
-		}
-
-		return $endDay + $endMonth * 30 + $endYear * 360 - $startDay - $startMonth * 30 - $startYear * 360;
-	}	//	function _dateDiff360()
-
-
-	/**
-	 * _getDateValue
-	 *
-	 * @param	string	$dateValue
-	 * @return	mixed	Excel date/time serial value, or string if error
-	 */
-	public static function _getDateValue($dateValue) {
-		if (!is_numeric($dateValue)) {
-			if ((is_string($dateValue)) &&
-				(PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-			if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) {
-				$dateValue = PHPExcel_Shared_Date::PHPToExcel($dateValue);
-			} else {
-				$saveReturnDateType = PHPExcel_Calculation_Functions::getReturnDateType();
-				PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
-				$dateValue = self::DATEVALUE($dateValue);
-				PHPExcel_Calculation_Functions::setReturnDateType($saveReturnDateType);
-			}
-		}
-		return $dateValue;
-	}	//	function _getDateValue()
-
-
-	/**
-	 * _getTimeValue
-	 *
-	 * @param	string	$timeValue
-	 * @return	mixed	Excel date/time serial value, or string if error
-	 */
-	private static function _getTimeValue($timeValue) {
-		$saveReturnDateType = PHPExcel_Calculation_Functions::getReturnDateType();
-		PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
-		$timeValue = self::TIMEVALUE($timeValue);
-		PHPExcel_Calculation_Functions::setReturnDateType($saveReturnDateType);
-		return $timeValue;
-	}	//	function _getTimeValue()
-
-
-	private static function _adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0) {
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-		$oMonth = (int) $PHPDateObject->format('m');
-		$oYear = (int) $PHPDateObject->format('Y');
-
-		$adjustmentMonthsString = (string) $adjustmentMonths;
-		if ($adjustmentMonths > 0) {
-			$adjustmentMonthsString = '+'.$adjustmentMonths;
-		}
-		if ($adjustmentMonths != 0) {
-			$PHPDateObject->modify($adjustmentMonthsString.' months');
-		}
-		$nMonth = (int) $PHPDateObject->format('m');
-		$nYear = (int) $PHPDateObject->format('Y');
-
-		$monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12);
-		if ($monthDiff != $adjustmentMonths) {
-			$adjustDays = (int) $PHPDateObject->format('d');
-			$adjustDaysString = '-'.$adjustDays.' days';
-			$PHPDateObject->modify($adjustDaysString);
-		}
-		return $PHPDateObject;
-	}	//	function _adjustDateByMonths()
-
-
-	/**
-	 * DATETIMENOW
-	 *
-	 * Returns the current date and time.
-	 * The NOW function is useful when you need to display the current date and time on a worksheet or
-	 * calculate a value based on the current date and time, and have that value updated each time you
-	 * open the worksheet.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
-	 * and time format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		NOW()
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function DATETIMENOW() {
-		$saveTimeZone = date_default_timezone_get();
-		date_default_timezone_set('UTC');
-		$retValue = False;
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					$retValue = (float) PHPExcel_Shared_Date::PHPToExcel(time());
-					break;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					$retValue = (integer) time();
-					break;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					$retValue = new DateTime();
-					break;
-		}
-		date_default_timezone_set($saveTimeZone);
-
-		return $retValue;
-	}	//	function DATETIMENOW()
-
-
-	/**
-	 * DATENOW
-	 *
-	 * Returns the current date.
-	 * The NOW function is useful when you need to display the current date and time on a worksheet or
-	 * calculate a value based on the current date and time, and have that value updated each time you
-	 * open the worksheet.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
-	 * and time format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		TODAY()
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function DATENOW() {
-		$saveTimeZone = date_default_timezone_get();
-		date_default_timezone_set('UTC');
-		$retValue = False;
-		$excelDateTime = floor(PHPExcel_Shared_Date::PHPToExcel(time()));
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					$retValue = (float) $excelDateTime;
-					break;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					$retValue = (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateTime);
-					break;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					$retValue = PHPExcel_Shared_Date::ExcelToPHPObject($excelDateTime);
-					break;
-		}
-		date_default_timezone_set($saveTimeZone);
-
-		return $retValue;
-	}	//	function DATENOW()
-
-
-	/**
-	 * DATE
-	 *
-	 * The DATE function returns a value that represents a particular date.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
-	 * format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		DATE(year,month,day)
-	 *
-	 * PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function.
-	 * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted,
-	 *     as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	integer		$year	The value of the year argument can include one to four digits.
-	 *								Excel interprets the year argument according to the configured
-	 *								date system: 1900 or 1904.
-	 *								If year is between 0 (zero) and 1899 (inclusive), Excel adds that
-	 *								value to 1900 to calculate the year. For example, DATE(108,1,2)
-	 *								returns January 2, 2008 (1900+108).
-	 *								If year is between 1900 and 9999 (inclusive), Excel uses that
-	 *								value as the year. For example, DATE(2008,1,2) returns January 2,
-	 *								2008.
-	 *								If year is less than 0 or is 10000 or greater, Excel returns the
-	 *								#NUM! error value.
-	 * @param	integer		$month	A positive or negative integer representing the month of the year
-	 *								from 1 to 12 (January to December).
-	 *								If month is greater than 12, month adds that number of months to
-	 *								the first month in the year specified. For example, DATE(2008,14,2)
-	 *								returns the serial number representing February 2, 2009.
-	 *								If month is less than 1, month subtracts the magnitude of that
-	 *								number of months, plus 1, from the first month in the year
-	 *								specified. For example, DATE(2008,-3,2) returns the serial number
-	 *								representing September 2, 2007.
-	 * @param	integer		$day	A positive or negative integer representing the day of the month
-	 *								from 1 to 31.
-	 *								If day is greater than the number of days in the month specified,
-	 *								day adds that number of days to the first day in the month. For
-	 *								example, DATE(2008,1,35) returns the serial number representing
-	 *								February 4, 2008.
-	 *								If day is less than 1, day subtracts the magnitude that number of
-	 *								days, plus one, from the first day of the month specified. For
-	 *								example, DATE(2008,1,-15) returns the serial number representing
-	 *								December 16, 2007.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function DATE($year = 0, $month = 1, $day = 1) {
-		$year	= PHPExcel_Calculation_Functions::flattenSingleValue($year);
-		$month	= PHPExcel_Calculation_Functions::flattenSingleValue($month);
-		$day	= PHPExcel_Calculation_Functions::flattenSingleValue($day);
-
-		if (($month !== NULL) && (!is_numeric($month))) {
-            $month = PHPExcel_Shared_Date::monthStringToNumber($month);
-		}
-
-		if (($day !== NULL) && (!is_numeric($day))) {
-            $day = PHPExcel_Shared_Date::dayStringToNumber($day);
-		}
-
-		$year	= ($year !== NULL)	? PHPExcel_Shared_String::testStringAsNumeric($year) : 0;
-		$month	= ($month !== NULL)	? PHPExcel_Shared_String::testStringAsNumeric($month) : 0;
-		$day	= ($day !== NULL)	? PHPExcel_Shared_String::testStringAsNumeric($day) : 0;
-		if ((!is_numeric($year)) ||
-			(!is_numeric($month)) ||
-			(!is_numeric($day))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$year	= (integer) $year;
-		$month	= (integer) $month;
-		$day	= (integer) $day;
-
-		$baseYear = PHPExcel_Shared_Date::getExcelCalendar();
-		// Validate parameters
-		if ($year < ($baseYear-1900)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ((($baseYear-1900) != 0) && ($year < $baseYear) && ($year >= 1900)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		if (($year < $baseYear) && ($year >= ($baseYear-1900))) {
-			$year += 1900;
-		}
-
-		if ($month < 1) {
-			//	Handle year/month adjustment if month < 1
-			--$month;
-			$year += ceil($month / 12) - 1;
-			$month = 13 - abs($month % 12);
-		} elseif ($month > 12) {
-			//	Handle year/month adjustment if month > 12
-			$year += floor($month / 12);
-			$month = ($month % 12);
-		}
-
-		// Re-validate the year parameter after adjustments
-		if (($year < $baseYear) || ($year >= 10000)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day);
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					return (float) $excelDateValue;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue);
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					return PHPExcel_Shared_Date::ExcelToPHPObject($excelDateValue);
-		}
-	}	//	function DATE()
-
-
-	/**
-	 * TIME
-	 *
-	 * The TIME function returns a value that represents a particular time.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
-	 * format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		TIME(hour,minute,second)
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	integer		$hour		A number from 0 (zero) to 32767 representing the hour.
-	 *									Any value greater than 23 will be divided by 24 and the remainder
-	 *									will be treated as the hour value. For example, TIME(27,0,0) =
-	 *									TIME(3,0,0) = .125 or 3:00 AM.
-	 * @param	integer		$minute		A number from 0 to 32767 representing the minute.
-	 *									Any value greater than 59 will be converted to hours and minutes.
-	 *									For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.
-	 * @param	integer		$second		A number from 0 to 32767 representing the second.
-	 *									Any value greater than 59 will be converted to hours, minutes,
-	 *									and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148
-	 *									or 12:33:20 AM
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function TIME($hour = 0, $minute = 0, $second = 0) {
-		$hour	= PHPExcel_Calculation_Functions::flattenSingleValue($hour);
-		$minute	= PHPExcel_Calculation_Functions::flattenSingleValue($minute);
-		$second	= PHPExcel_Calculation_Functions::flattenSingleValue($second);
-
-		if ($hour == '') { $hour = 0; }
-		if ($minute == '') { $minute = 0; }
-		if ($second == '') { $second = 0; }
-
-		if ((!is_numeric($hour)) || (!is_numeric($minute)) || (!is_numeric($second))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$hour	= (integer) $hour;
-		$minute	= (integer) $minute;
-		$second	= (integer) $second;
-
-		if ($second < 0) {
-			$minute += floor($second / 60);
-			$second = 60 - abs($second % 60);
-			if ($second == 60) { $second = 0; }
-		} elseif ($second >= 60) {
-			$minute += floor($second / 60);
-			$second = $second % 60;
-		}
-		if ($minute < 0) {
-			$hour += floor($minute / 60);
-			$minute = 60 - abs($minute % 60);
-			if ($minute == 60) { $minute = 0; }
-		} elseif ($minute >= 60) {
-			$hour += floor($minute / 60);
-			$minute = $minute % 60;
-		}
-
-		if ($hour > 23) {
-			$hour = $hour % 24;
-		} elseif ($hour < 0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					$date = 0;
-					$calendar = PHPExcel_Shared_Date::getExcelCalendar();
-					if ($calendar != PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900) {
-						$date = 1;
-					}
-					return (float) PHPExcel_Shared_Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::FormattedPHPToExcel(1970, 1, 1, $hour, $minute, $second));	// -2147468400; //	-2147472000 + 3600
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					$dayAdjust = 0;
-					if ($hour < 0) {
-						$dayAdjust = floor($hour / 24);
-						$hour = 24 - abs($hour % 24);
-						if ($hour == 24) { $hour = 0; }
-					} elseif ($hour >= 24) {
-						$dayAdjust = floor($hour / 24);
-						$hour = $hour % 24;
-					}
-					$phpDateObject = new DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second);
-					if ($dayAdjust != 0) {
-						$phpDateObject->modify($dayAdjust.' days');
-					}
-					return $phpDateObject;
-		}
-	}	//	function TIME()
-
-
-	/**
-	 * DATEVALUE
-	 *
-	 * Returns a value that represents a particular date.
-	 * Use DATEVALUE to convert a date represented by a text string to an Excel or PHP date/time stamp
-	 * value.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
-	 * format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		DATEVALUE(dateValue)
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	string	$dateValue		Text that represents a date in a Microsoft Excel date format.
-	 *									For example, "1/30/2008" or "30-Jan-2008" are text strings within
-	 *									quotation marks that represent dates. Using the default date
-	 *									system in Excel for Windows, date_text must represent a date from
-	 *									January 1, 1900, to December 31, 9999. Using the default date
-	 *									system in Excel for the Macintosh, date_text must represent a date
-	 *									from January 1, 1904, to December 31, 9999. DATEVALUE returns the
-	 *									#VALUE! error value if date_text is out of this range.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function DATEVALUE($dateValue = 1) {
-		$dateValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($dateValue),'"');
-		//	Strip any ordinals because they're allowed in Excel (English only)
-		$dateValue = preg_replace('/(\d)(st|nd|rd|th)([ -\/])/Ui','$1$3',$dateValue);
-		//	Convert separators (/ . or space) to hyphens (should also handle dot used for ordinals in some countries, e.g. Denmark, Germany)
-		$dateValue	= str_replace(array('/','.','-','  '),array(' ',' ',' ',' '),$dateValue);
-
-		$yearFound = false;
-		$t1 = explode(' ',$dateValue);
-		foreach($t1 as &$t) {
-			if ((is_numeric($t)) && ($t > 31)) {
-				if ($yearFound) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				} else {
-					if ($t < 100) { $t += 1900; }
-					$yearFound = true;
-				}
-			}
-		}
-		if ((count($t1) == 1) && (strpos($t,':') != false)) {
-			//	We've been fed a time value without any date
-			return 0.0;
-		} elseif (count($t1) == 2) {
-			//	We only have two parts of the date: either day/month or month/year
-			if ($yearFound) {
-				array_unshift($t1,1);
-			} else {
-				array_push($t1,date('Y'));
-			}
-		}
-		unset($t);
-		$dateValue = implode(' ',$t1);
-
-		$PHPDateArray = date_parse($dateValue);
-		if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) {
-			$testVal1 = strtok($dateValue,'- ');
-			if ($testVal1 !== False) {
-				$testVal2 = strtok('- ');
-				if ($testVal2 !== False) {
-					$testVal3 = strtok('- ');
-					if ($testVal3 === False) {
-						$testVal3 = strftime('%Y');
-					}
-				} else {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-			$PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3);
-			if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) {
-				$PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3);
-				if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			}
-		}
-
-		if (($PHPDateArray !== False) && ($PHPDateArray['error_count'] == 0)) {
-			// Execute function
-			if ($PHPDateArray['year'] == '')	{ $PHPDateArray['year'] = strftime('%Y'); }
-			if ($PHPDateArray['year'] < 1900)
-				return PHPExcel_Calculation_Functions::VALUE();
-			if ($PHPDateArray['month'] == '')	{ $PHPDateArray['month'] = strftime('%m'); }
-			if ($PHPDateArray['day'] == '')		{ $PHPDateArray['day'] = strftime('%d'); }
-			$excelDateValue = floor(PHPExcel_Shared_Date::FormattedPHPToExcel($PHPDateArray['year'],$PHPDateArray['month'],$PHPDateArray['day'],$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second']));
-
-			switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-				case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-						return (float) $excelDateValue;
-				case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-						return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue);
-				case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-						return new DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function DATEVALUE()
-
-
-	/**
-	 * TIMEVALUE
-	 *
-	 * Returns a value that represents a particular time.
-	 * Use TIMEVALUE to convert a time represented by a text string to an Excel or PHP date/time stamp
-	 * value.
-	 *
-	 * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
-	 * format of your regional settings. PHPExcel does not change cell formatting in this way.
-	 *
-	 * Excel Function:
-	 *		TIMEVALUE(timeValue)
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	string	$timeValue		A text string that represents a time in any one of the Microsoft
-	 *									Excel time formats; for example, "6:45 PM" and "18:45" text strings
-	 *									within quotation marks that represent time.
-	 *									Date information in time_text is ignored.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function TIMEVALUE($timeValue) {
-		$timeValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($timeValue),'"');
-		$timeValue	= str_replace(array('/','.'),array('-','-'),$timeValue);
-
-		$PHPDateArray = date_parse($timeValue);
-		if (($PHPDateArray !== False) && ($PHPDateArray['error_count'] == 0)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($PHPDateArray['year'],$PHPDateArray['month'],$PHPDateArray['day'],$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second']);
-			} else {
-				$excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel(1900,1,1,$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second']) - 1;
-			}
-
-			switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-				case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-						return (float) $excelDateValue;
-				case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-						return (integer) $phpDateValue = PHPExcel_Shared_Date::ExcelToPHP($excelDateValue+25569) - 3600;;
-				case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-						return new DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TIMEVALUE()
-
-
-	/**
-	 * DATEDIF
-	 *
-	 * @param	mixed	$startDate		Excel date serial value, PHP date/time stamp, PHP DateTime object
-	 *									or a standard date string
-	 * @param	mixed	$endDate		Excel date serial value, PHP date/time stamp, PHP DateTime object
-	 *									or a standard date string
-	 * @param	string	$unit
-	 * @return	integer	Interval between the dates
-	 */
-	public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D') {
-		$startDate	= PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
-		$endDate	= PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
-		$unit		= strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($unit));
-
-		if (is_string($startDate = self::_getDateValue($startDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($endDate = self::_getDateValue($endDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Validate parameters
-		if ($startDate >= $endDate) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$difference = $endDate - $startDate;
-
-		$PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate);
-		$startDays = $PHPStartDateObject->format('j');
-		$startMonths = $PHPStartDateObject->format('n');
-		$startYears = $PHPStartDateObject->format('Y');
-
-		$PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
-		$endDays = $PHPEndDateObject->format('j');
-		$endMonths = $PHPEndDateObject->format('n');
-		$endYears = $PHPEndDateObject->format('Y');
-
-		$retVal = PHPExcel_Calculation_Functions::NaN();
-		switch ($unit) {
-			case 'D':
-				$retVal = intval($difference);
-				break;
-			case 'M':
-				$retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12);
-				//	We're only interested in full months
-				if ($endDays < $startDays) {
-					--$retVal;
-				}
-				break;
-			case 'Y':
-				$retVal = intval($endYears - $startYears);
-				//	We're only interested in full months
-				if ($endMonths < $startMonths) {
-					--$retVal;
-				} elseif (($endMonths == $startMonths) && ($endDays < $startDays)) {
-					--$retVal;
-				}
-				break;
-			case 'MD':
-				if ($endDays < $startDays) {
-					$retVal = $endDays;
-					$PHPEndDateObject->modify('-'.$endDays.' days');
-					$adjustDays = $PHPEndDateObject->format('j');
-					if ($adjustDays > $startDays) {
-						$retVal += ($adjustDays - $startDays);
-					}
-				} else {
-					$retVal = $endDays - $startDays;
-				}
-				break;
-			case 'YM':
-				$retVal = intval($endMonths - $startMonths);
-				if ($retVal < 0) $retVal = 12 + $retVal;
-				//	We're only interested in full months
-				if ($endDays < $startDays) {
-					--$retVal;
-				}
-				break;
-			case 'YD':
-				$retVal = intval($difference);
-				if ($endYears > $startYears) {
-					while ($endYears > $startYears) {
-						$PHPEndDateObject->modify('-1 year');
-						$endYears = $PHPEndDateObject->format('Y');
-					}
-					$retVal = $PHPEndDateObject->format('z') - $PHPStartDateObject->format('z');
-					if ($retVal < 0) { $retVal += 365; }
-				}
-				break;
-			default:
-				$retVal = PHPExcel_Calculation_Functions::NaN();
-		}
-		return $retVal;
-	}	//	function DATEDIF()
-
-
-	/**
-	 * DAYS360
-	 *
-	 * Returns the number of days between two dates based on a 360-day year (twelve 30-day months),
-	 * which is used in some accounting calculations. Use this function to help compute payments if
-	 * your accounting system is based on twelve 30-day months.
-	 *
-	 * Excel Function:
-	 *		DAYS360(startDate,endDate[,method])
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	mixed		$startDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *										PHP DateTime object, or a standard date string
-	 * @param	mixed		$endDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *										PHP DateTime object, or a standard date string
-	 * @param	boolean		$method			US or European Method
-	 *										FALSE or omitted: U.S. (NASD) method. If the starting date is
-	 *										the last day of a month, it becomes equal to the 30th of the
-	 *										same month. If the ending date is the last day of a month and
-	 *										the starting date is earlier than the 30th of a month, the
-	 *										ending date becomes equal to the 1st of the next month;
-	 *										otherwise the ending date becomes equal to the 30th of the
-	 *										same month.
-	 *										TRUE: European method. Starting dates and ending dates that
-	 *										occur on the 31st of a month become equal to the 30th of the
-	 *										same month.
-	 * @return	integer		Number of days between start date and end date
-	 */
-	public static function DAYS360($startDate = 0, $endDate = 0, $method = false) {
-		$startDate	= PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
-		$endDate	= PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
-
-		if (is_string($startDate = self::_getDateValue($startDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($endDate = self::_getDateValue($endDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (!is_bool($method)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Execute function
-		$PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate);
-		$startDay = $PHPStartDateObject->format('j');
-		$startMonth = $PHPStartDateObject->format('n');
-		$startYear = $PHPStartDateObject->format('Y');
-
-		$PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
-		$endDay = $PHPEndDateObject->format('j');
-		$endMonth = $PHPEndDateObject->format('n');
-		$endYear = $PHPEndDateObject->format('Y');
-
-		return self::_dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, !$method);
-	}	//	function DAYS360()
-
-
-	/**
-	 * YEARFRAC
-	 *
-	 * Calculates the fraction of the year represented by the number of whole days between two dates
-	 * (the start_date and the end_date).
-	 * Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or
-	 * obligations to assign to a specific term.
-	 *
-	 * Excel Function:
-	 *		YEARFRAC(startDate,endDate[,method])
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	mixed	$startDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @param	mixed	$endDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @param	integer	$method			Method used for the calculation
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float	fraction of the year
-	 */
-	public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) {
-		$startDate	= PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
-		$endDate	= PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
-		$method		= PHPExcel_Calculation_Functions::flattenSingleValue($method);
-
-		if (is_string($startDate = self::_getDateValue($startDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($endDate = self::_getDateValue($endDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) {
-			switch($method) {
-				case 0	:
-					return self::DAYS360($startDate,$endDate) / 360;
-				case 1	:
-					$days = self::DATEDIF($startDate,$endDate);
-					$startYear = self::YEAR($startDate);
-					$endYear = self::YEAR($endDate);
-					$years = $endYear - $startYear + 1;
-					$leapDays = 0;
-					if ($years == 1) {
-						if (self::_isLeapYear($endYear)) {
-							$startMonth = self::MONTHOFYEAR($startDate);
-							$endMonth = self::MONTHOFYEAR($endDate);
-							$endDay = self::DAYOFMONTH($endDate);
-							if (($startMonth < 3) ||
-								(($endMonth * 100 + $endDay) >= (2 * 100 + 29))) {
-				     			$leapDays += 1;
-							}
-						}
-					} else {
-						for($year = $startYear; $year <= $endYear; ++$year) {
-							if ($year == $startYear) {
-								$startMonth = self::MONTHOFYEAR($startDate);
-								$startDay = self::DAYOFMONTH($startDate);
-								if ($startMonth < 3) {
-									$leapDays += (self::_isLeapYear($year)) ? 1 : 0;
-								}
-							} elseif($year == $endYear) {
-								$endMonth = self::MONTHOFYEAR($endDate);
-								$endDay = self::DAYOFMONTH($endDate);
-								if (($endMonth * 100 + $endDay) >= (2 * 100 + 29)) {
-									$leapDays += (self::_isLeapYear($year)) ? 1 : 0;
-								}
-							} else {
-								$leapDays += (self::_isLeapYear($year)) ? 1 : 0;
-							}
-						}
-						if ($years == 2) {
-							if (($leapDays == 0) && (self::_isLeapYear($startYear)) && ($days > 365)) {
-								$leapDays = 1;
-							} elseif ($days < 366) {
-								$years = 1;
-							}
-						}
-						$leapDays /= $years;
-					}
-					return $days / (365 + $leapDays);
-				case 2	:
-					return self::DATEDIF($startDate,$endDate) / 360;
-				case 3	:
-					return self::DATEDIF($startDate,$endDate) / 365;
-				case 4	:
-					return self::DAYS360($startDate,$endDate,True) / 360;
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function YEARFRAC()
-
-
-	/**
-	 * NETWORKDAYS
-	 *
-	 * Returns the number of whole working days between start_date and end_date. Working days
-	 * exclude weekends and any dates identified in holidays.
-	 * Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days
-	 * worked during a specific term.
-	 *
-	 * Excel Function:
-	 *		NETWORKDAYS(startDate,endDate[,holidays[,holiday[,...]]])
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	mixed			$startDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *											PHP DateTime object, or a standard date string
-	 * @param	mixed			$endDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *											PHP DateTime object, or a standard date string
-	 * @param	mixed			$holidays,...	Optional series of Excel date serial value (float), PHP date
-	 *											timestamp (integer), PHP DateTime object, or a standard date
-	 *											strings that will be excluded from the working calendar, such
-	 *											as state and federal holidays and floating holidays.
-	 * @return	integer			Interval between the dates
-	 */
-	public static function NETWORKDAYS($startDate,$endDate) {
-		//	Retrieve the mandatory start and end date that are referenced in the function definition
-		$startDate	= PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
-		$endDate	= PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
-		//	Flush the mandatory start and end date that are referenced in the function definition, and get the optional days
-		$dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		array_shift($dateArgs);
-		array_shift($dateArgs);
-
-		//	Validate the start and end dates
-		if (is_string($startDate = $sDate = self::_getDateValue($startDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$startDate = (float) floor($startDate);
-		if (is_string($endDate = $eDate = self::_getDateValue($endDate))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$endDate = (float) floor($endDate);
-
-		if ($sDate > $eDate) {
-			$startDate = $eDate;
-			$endDate = $sDate;
-		}
-
-		// Execute function
-		$startDoW = 6 - self::DAYOFWEEK($startDate,2);
-		if ($startDoW < 0) { $startDoW = 0; }
-		$endDoW = self::DAYOFWEEK($endDate,2);
-		if ($endDoW >= 6) { $endDoW = 0; }
-
-		$wholeWeekDays = floor(($endDate - $startDate) / 7) * 5;
-		$partWeekDays = $endDoW + $startDoW;
-		if ($partWeekDays > 5) {
-			$partWeekDays -= 5;
-		}
-
-		//	Test any extra holiday parameters
-		$holidayCountedArray = array();
-		foreach ($dateArgs as $holidayDate) {
-			if (is_string($holidayDate = self::_getDateValue($holidayDate))) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-			if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
-				if ((self::DAYOFWEEK($holidayDate,2) < 6) && (!in_array($holidayDate,$holidayCountedArray))) {
-					--$partWeekDays;
-					$holidayCountedArray[] = $holidayDate;
-				}
-			}
-		}
-
-		if ($sDate > $eDate) {
-			return 0 - ($wholeWeekDays + $partWeekDays);
-		}
-		return $wholeWeekDays + $partWeekDays;
-	}	//	function NETWORKDAYS()
-
-
-	/**
-	 * WORKDAY
-	 *
-	 * Returns the date that is the indicated number of working days before or after a date (the
-	 * starting date). Working days exclude weekends and any dates identified as holidays.
-	 * Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected
-	 * delivery times, or the number of days of work performed.
-	 *
-	 * Excel Function:
-	 *		WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])
-	 *
-	 * @access	public
-	 * @category Date/Time Functions
-	 * @param	mixed		$startDate		Excel date serial value (float), PHP date timestamp (integer),
-	 *										PHP DateTime object, or a standard date string
-	 * @param	integer		$endDays		The number of nonweekend and nonholiday days before or after
-	 *										startDate. A positive value for days yields a future date; a
-	 *										negative value yields a past date.
-	 * @param	mixed		$holidays,...	Optional series of Excel date serial value (float), PHP date
-	 *										timestamp (integer), PHP DateTime object, or a standard date
-	 *										strings that will be excluded from the working calendar, such
-	 *										as state and federal holidays and floating holidays.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function WORKDAY($startDate,$endDays) {
-		//	Retrieve the mandatory start date and days that are referenced in the function definition
-		$startDate	= PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
-		$endDays	= PHPExcel_Calculation_Functions::flattenSingleValue($endDays);
-		//	Flush the mandatory start date and days that are referenced in the function definition, and get the optional days
-		$dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		array_shift($dateArgs);
-		array_shift($dateArgs);
-
-		if ((is_string($startDate = self::_getDateValue($startDate))) || (!is_numeric($endDays))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$startDate = (float) floor($startDate);
-		$endDays = (int) floor($endDays);
-		//	If endDays is 0, we always return startDate
-		if ($endDays == 0) { return $startDate; }
-
-		$decrementing = ($endDays < 0) ? True : False;
-
-		//	Adjust the start date if it falls over a weekend
-
-		$startDoW = self::DAYOFWEEK($startDate,3);
-		if (self::DAYOFWEEK($startDate,3) >= 5) {
-			$startDate += ($decrementing) ? -$startDoW + 4: 7 - $startDoW;
-			($decrementing) ? $endDays++ : $endDays--;
-		}
-
-		//	Add endDays
-		$endDate = (float) $startDate + (intval($endDays / 5) * 7) + ($endDays % 5);
-
-		//	Adjust the calculated end date if it falls over a weekend
-		$endDoW = self::DAYOFWEEK($endDate,3);
-		if ($endDoW >= 5) {
-			$endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW;
-		}
-
-		//	Test any extra holiday parameters
-		if (!empty($dateArgs)) {
-			$holidayCountedArray = $holidayDates = array();
-			foreach ($dateArgs as $holidayDate) {
-				if (($holidayDate !== NULL) && (trim($holidayDate) > '')) {
-					if (is_string($holidayDate = self::_getDateValue($holidayDate))) {
-						return PHPExcel_Calculation_Functions::VALUE();
-					}
-					if (self::DAYOFWEEK($holidayDate,3) < 5) {
-						$holidayDates[] = $holidayDate;
-					}
-				}
-			}
-			if ($decrementing) {
-				rsort($holidayDates, SORT_NUMERIC);
-			} else {
-				sort($holidayDates, SORT_NUMERIC);
-			}
-			foreach ($holidayDates as $holidayDate) {
-				if ($decrementing) {
-					if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) {
-						if (!in_array($holidayDate,$holidayCountedArray)) {
-							--$endDate;
-							$holidayCountedArray[] = $holidayDate;
-						}
-					}
-				} else {
-					if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
-						if (!in_array($holidayDate,$holidayCountedArray)) {
-							++$endDate;
-							$holidayCountedArray[] = $holidayDate;
-						}
-					}
-				}
-				//	Adjust the calculated end date if it falls over a weekend
-				$endDoW = self::DAYOFWEEK($endDate,3);
-				if ($endDoW >= 5) {
-					$endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW;
-				}
-
-			}
-		}
-
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					return (float) $endDate;
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					return (integer) PHPExcel_Shared_Date::ExcelToPHP($endDate);
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					return PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
-		}
-	}	//	function WORKDAY()
-
-
-	/**
-	 * DAYOFMONTH
-	 *
-	 * Returns the day of the month, for a specified date. The day is given as an integer
-	 * ranging from 1 to 31.
-	 *
-	 * Excel Function:
-	 *		DAY(dateValue)
-	 *
-	 * @param	mixed	$dateValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @return	int		Day of the month
-	 */
-	public static function DAYOFMONTH($dateValue = 1) {
-		$dateValue	= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-
-		if ($dateValue === null) {
-            $dateValue = 1;
-		} elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($dateValue == 0.0) {
-			return 0;
-		} elseif ($dateValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-
-		return (int) $PHPDateObject->format('j');
-	}	//	function DAYOFMONTH()
-
-
-	/**
-	 * DAYOFWEEK
-	 *
-	 * Returns the day of the week for a specified date. The day is given as an integer
-	 * ranging from 0 to 7 (dependent on the requested style).
-	 *
-	 * Excel Function:
-	 *		WEEKDAY(dateValue[,style])
-	 *
-	 * @param	mixed	$dateValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @param	int		$style			A number that determines the type of return value
-	 *										1 or omitted	Numbers 1 (Sunday) through 7 (Saturday).
-	 *										2				Numbers 1 (Monday) through 7 (Sunday).
-	 *										3				Numbers 0 (Monday) through 6 (Sunday).
-	 * @return	int		Day of the week value
-	 */
-	public static function DAYOFWEEK($dateValue = 1, $style = 1) {
-		$dateValue	= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-		$style		= PHPExcel_Calculation_Functions::flattenSingleValue($style);
-
-		if (!is_numeric($style)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif (($style < 1) || ($style > 3)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$style = floor($style);
-
-		if ($dateValue === null) {
-            $dateValue = 1;
-		} elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($dateValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-		$DoW = $PHPDateObject->format('w');
-
-		$firstDay = 1;
-		switch ($style) {
-			case 1: ++$DoW;
-					break;
-			case 2: if ($DoW == 0) { $DoW = 7; }
-					break;
-			case 3: if ($DoW == 0) { $DoW = 7; }
-					$firstDay = 0;
-					--$DoW;
-					break;
-		}
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL) {
-			//	Test for Excel's 1900 leap year, and introduce the error as required
-			if (($PHPDateObject->format('Y') == 1900) && ($PHPDateObject->format('n') <= 2)) {
-				--$DoW;
-				if ($DoW < $firstDay) {
-					$DoW += 7;
-				}
-			}
-		}
-
-		return (int) $DoW;
-	}	//	function DAYOFWEEK()
-
-
-	/**
-	 * WEEKOFYEAR
-	 *
-	 * Returns the week of the year for a specified date.
-	 * The WEEKNUM function considers the week containing January 1 to be the first week of the year.
-	 * However, there is a European standard that defines the first week as the one with the majority
-	 * of days (four or more) falling in the new year. This means that for years in which there are
-	 * three days or less in the first week of January, the WEEKNUM function returns week numbers
-	 * that are incorrect according to the European standard.
-	 *
-	 * Excel Function:
-	 *		WEEKNUM(dateValue[,style])
-	 *
-	 * @param	mixed	$dateValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @param	boolean	$method			Week begins on Sunday or Monday
-	 *										1 or omitted	Week begins on Sunday.
-	 *										2				Week begins on Monday.
-	 * @return	int		Week Number
-	 */
-	public static function WEEKOFYEAR($dateValue = 1, $method = 1) {
-		$dateValue	= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-		$method		= PHPExcel_Calculation_Functions::flattenSingleValue($method);
-
-		if (!is_numeric($method)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif (($method < 1) || ($method > 2)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$method = floor($method);
-
-		if ($dateValue === null) {
-            $dateValue = 1;
-		} elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($dateValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-		$dayOfYear = $PHPDateObject->format('z');
-		$dow = $PHPDateObject->format('w');
-		$PHPDateObject->modify('-'.$dayOfYear.' days');
-		$dow = $PHPDateObject->format('w');
-		$daysInFirstWeek = 7 - (($dow + (2 - $method)) % 7);
-		$dayOfYear -= $daysInFirstWeek;
-		$weekOfYear = ceil($dayOfYear / 7) + 1;
-
-		return (int) $weekOfYear;
-	}	//	function WEEKOFYEAR()
-
-
-	/**
-	 * MONTHOFYEAR
-	 *
-	 * Returns the month of a date represented by a serial number.
-	 * The month is given as an integer, ranging from 1 (January) to 12 (December).
-	 *
-	 * Excel Function:
-	 *		MONTH(dateValue)
-	 *
-	 * @param	mixed	$dateValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @return	int		Month of the year
-	 */
-	public static function MONTHOFYEAR($dateValue = 1) {
-		$dateValue	= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-
-		if ($dateValue === null) {
-            $dateValue = 1;
-		} elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($dateValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-
-		return (int) $PHPDateObject->format('n');
-	}	//	function MONTHOFYEAR()
-
-
-	/**
-	 * YEAR
-	 *
-	 * Returns the year corresponding to a date.
-	 * The year is returned as an integer in the range 1900-9999.
-	 *
-	 * Excel Function:
-	 *		YEAR(dateValue)
-	 *
-	 * @param	mixed	$dateValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard date string
-	 * @return	int		Year
-	 */
-	public static function YEAR($dateValue = 1) {
-		$dateValue	= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-
-		if ($dateValue === null) {
-            $dateValue = 1;
-		} elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($dateValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Execute function
-		$PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
-
-		return (int) $PHPDateObject->format('Y');
-	}	//	function YEAR()
-
-
-	/**
-	 * HOUROFDAY
-	 *
-	 * Returns the hour of a time value.
-	 * The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).
-	 *
-	 * Excel Function:
-	 *		HOUR(timeValue)
-	 *
-	 * @param	mixed	$timeValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard time string
-	 * @return	int		Hour
-	 */
-	public static function HOUROFDAY($timeValue = 0) {
-		$timeValue	= PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
-
-		if (!is_numeric($timeValue)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				$testVal = strtok($timeValue,'/-: ');
-				if (strlen($testVal) < strlen($timeValue)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			}
-			$timeValue = self::_getTimeValue($timeValue);
-			if (is_string($timeValue)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		// Execute function
-		if ($timeValue >= 1) {
-			$timeValue = fmod($timeValue,1);
-		} elseif ($timeValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
-
-		return (int) gmdate('G',$timeValue);
-	}	//	function HOUROFDAY()
-
-
-	/**
-	 * MINUTEOFHOUR
-	 *
-	 * Returns the minutes of a time value.
-	 * The minute is given as an integer, ranging from 0 to 59.
-	 *
-	 * Excel Function:
-	 *		MINUTE(timeValue)
-	 *
-	 * @param	mixed	$timeValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard time string
-	 * @return	int		Minute
-	 */
-	public static function MINUTEOFHOUR($timeValue = 0) {
-		$timeValue = $timeTester	= PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
-
-		if (!is_numeric($timeValue)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				$testVal = strtok($timeValue,'/-: ');
-				if (strlen($testVal) < strlen($timeValue)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			}
-			$timeValue = self::_getTimeValue($timeValue);
-			if (is_string($timeValue)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		// Execute function
-		if ($timeValue >= 1) {
-			$timeValue = fmod($timeValue,1);
-		} elseif ($timeValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
-
-		return (int) gmdate('i',$timeValue);
-	}	//	function MINUTEOFHOUR()
-
-
-	/**
-	 * SECONDOFMINUTE
-	 *
-	 * Returns the seconds of a time value.
-	 * The second is given as an integer in the range 0 (zero) to 59.
-	 *
-	 * Excel Function:
-	 *		SECOND(timeValue)
-	 *
-	 * @param	mixed	$timeValue		Excel date serial value (float), PHP date timestamp (integer),
-	 *									PHP DateTime object, or a standard time string
-	 * @return	int		Second
-	 */
-	public static function SECONDOFMINUTE($timeValue = 0) {
-		$timeValue	= PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
-
-		if (!is_numeric($timeValue)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				$testVal = strtok($timeValue,'/-: ');
-				if (strlen($testVal) < strlen($timeValue)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			}
-			$timeValue = self::_getTimeValue($timeValue);
-			if (is_string($timeValue)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		// Execute function
-		if ($timeValue >= 1) {
-			$timeValue = fmod($timeValue,1);
-		} elseif ($timeValue < 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
-
-		return (int) gmdate('s',$timeValue);
-	}	//	function SECONDOFMINUTE()
-
-
-	/**
-	 * EDATE
-	 *
-	 * Returns the serial number that represents the date that is the indicated number of months
-	 * before or after a specified date (the start_date).
-	 * Use EDATE to calculate maturity dates or due dates that fall on the same day of the month
-	 * as the date of issue.
-	 *
-	 * Excel Function:
-	 *		EDATE(dateValue,adjustmentMonths)
-	 *
-	 * @param	mixed	$dateValue			Excel date serial value (float), PHP date timestamp (integer),
-	 *										PHP DateTime object, or a standard date string
-	 * @param	int		$adjustmentMonths	The number of months before or after start_date.
-	 *										A positive value for months yields a future date;
-	 *										a negative value yields a past date.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function EDATE($dateValue = 1, $adjustmentMonths = 0) {
-		$dateValue			= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-		$adjustmentMonths	= PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths);
-
-		if (!is_numeric($adjustmentMonths)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$adjustmentMonths = floor($adjustmentMonths);
-
-		if (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Execute function
-		$PHPDateObject = self::_adjustDateByMonths($dateValue,$adjustmentMonths);
-
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject);
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject));
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					return $PHPDateObject;
-		}
-	}	//	function EDATE()
-
-
-	/**
-	 * EOMONTH
-	 *
-	 * Returns the date value for the last day of the month that is the indicated number of months
-	 * before or after start_date.
-	 * Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.
-	 *
-	 * Excel Function:
-	 *		EOMONTH(dateValue,adjustmentMonths)
-	 *
-	 * @param	mixed	$dateValue			Excel date serial value (float), PHP date timestamp (integer),
-	 *										PHP DateTime object, or a standard date string
-	 * @param	int		$adjustmentMonths	The number of months before or after start_date.
-	 *										A positive value for months yields a future date;
-	 *										a negative value yields a past date.
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function EOMONTH($dateValue = 1, $adjustmentMonths = 0) {
-		$dateValue			= PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
-		$adjustmentMonths	= PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths);
-
-		if (!is_numeric($adjustmentMonths)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$adjustmentMonths = floor($adjustmentMonths);
-
-		if (is_string($dateValue = self::_getDateValue($dateValue))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Execute function
-		$PHPDateObject = self::_adjustDateByMonths($dateValue,$adjustmentMonths+1);
-		$adjustDays = (int) $PHPDateObject->format('d');
-		$adjustDaysString = '-'.$adjustDays.' days';
-		$PHPDateObject->modify($adjustDaysString);
-
-		switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
-			case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL :
-					return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject);
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC :
-					return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject));
-			case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT :
-					return $PHPDateObject;
-		}
-	}	//	function EOMONTH()
-
-}	//	class PHPExcel_Calculation_DateTime
-

+ 0 - 2505
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php

@@ -1,2505 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/** EULER */
-define('EULER', 2.71828182845904523536);
-
-
-/**
- * PHPExcel_Calculation_Engineering
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Engineering {
-
-	/**
-	 * Details of the Units of measure that can be used in CONVERTUOM()
-	 *
-	 * @var mixed[]
-	 */
-	private static $_conversionUnits = array( 'g'		=> array(	'Group'	=> 'Mass',			'Unit Name'	=> 'Gram',						'AllowPrefix'	=> True		),
-											  'sg'		=> array(	'Group'	=> 'Mass',			'Unit Name'	=> 'Slug',						'AllowPrefix'	=> False	),
-											  'lbm'		=> array(	'Group'	=> 'Mass',			'Unit Name'	=> 'Pound mass (avoirdupois)',	'AllowPrefix'	=> False	),
-											  'u'		=> array(	'Group'	=> 'Mass',			'Unit Name'	=> 'U (atomic mass unit)',		'AllowPrefix'	=> True		),
-											  'ozm'		=> array(	'Group'	=> 'Mass',			'Unit Name'	=> 'Ounce mass (avoirdupois)',	'AllowPrefix'	=> False	),
-											  'm'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Meter',						'AllowPrefix'	=> True		),
-											  'mi'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Statute mile',				'AllowPrefix'	=> False	),
-											  'Nmi'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Nautical mile',				'AllowPrefix'	=> False	),
-											  'in'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Inch',						'AllowPrefix'	=> False	),
-											  'ft'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Foot',						'AllowPrefix'	=> False	),
-											  'yd'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Yard',						'AllowPrefix'	=> False	),
-											  'ang'		=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Angstrom',					'AllowPrefix'	=> True		),
-											  'Pica'	=> array(	'Group'	=> 'Distance',		'Unit Name'	=> 'Pica (1/72 in)',			'AllowPrefix'	=> False	),
-											  'yr'		=> array(	'Group'	=> 'Time',			'Unit Name'	=> 'Year',						'AllowPrefix'	=> False	),
-											  'day'		=> array(	'Group'	=> 'Time',			'Unit Name'	=> 'Day',						'AllowPrefix'	=> False	),
-											  'hr'		=> array(	'Group'	=> 'Time',			'Unit Name'	=> 'Hour',						'AllowPrefix'	=> False	),
-											  'mn'		=> array(	'Group'	=> 'Time',			'Unit Name'	=> 'Minute',					'AllowPrefix'	=> False	),
-											  'sec'		=> array(	'Group'	=> 'Time',			'Unit Name'	=> 'Second',					'AllowPrefix'	=> True		),
-											  'Pa'		=> array(	'Group'	=> 'Pressure',		'Unit Name'	=> 'Pascal',					'AllowPrefix'	=> True		),
-											  'p'		=> array(	'Group'	=> 'Pressure',		'Unit Name'	=> 'Pascal',					'AllowPrefix'	=> True		),
-											  'atm'		=> array(	'Group'	=> 'Pressure',		'Unit Name'	=> 'Atmosphere',				'AllowPrefix'	=> True		),
-											  'at'		=> array(	'Group'	=> 'Pressure',		'Unit Name'	=> 'Atmosphere',				'AllowPrefix'	=> True		),
-											  'mmHg'	=> array(	'Group'	=> 'Pressure',		'Unit Name'	=> 'mm of Mercury',				'AllowPrefix'	=> True		),
-											  'N'		=> array(	'Group'	=> 'Force',			'Unit Name'	=> 'Newton',					'AllowPrefix'	=> True		),
-											  'dyn'		=> array(	'Group'	=> 'Force',			'Unit Name'	=> 'Dyne',						'AllowPrefix'	=> True		),
-											  'dy'		=> array(	'Group'	=> 'Force',			'Unit Name'	=> 'Dyne',						'AllowPrefix'	=> True		),
-											  'lbf'		=> array(	'Group'	=> 'Force',			'Unit Name'	=> 'Pound force',				'AllowPrefix'	=> False	),
-											  'J'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Joule',						'AllowPrefix'	=> True		),
-											  'e'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Erg',						'AllowPrefix'	=> True		),
-											  'c'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Thermodynamic calorie',		'AllowPrefix'	=> True		),
-											  'cal'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'IT calorie',				'AllowPrefix'	=> True		),
-											  'eV'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Electron volt',				'AllowPrefix'	=> True		),
-											  'ev'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Electron volt',				'AllowPrefix'	=> True		),
-											  'HPh'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Horsepower-hour',			'AllowPrefix'	=> False	),
-											  'hh'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Horsepower-hour',			'AllowPrefix'	=> False	),
-											  'Wh'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Watt-hour',					'AllowPrefix'	=> True		),
-											  'wh'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Watt-hour',					'AllowPrefix'	=> True		),
-											  'flb'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'Foot-pound',				'AllowPrefix'	=> False	),
-											  'BTU'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'BTU',						'AllowPrefix'	=> False	),
-											  'btu'		=> array(	'Group'	=> 'Energy',		'Unit Name'	=> 'BTU',						'AllowPrefix'	=> False	),
-											  'HP'		=> array(	'Group'	=> 'Power',			'Unit Name'	=> 'Horsepower',				'AllowPrefix'	=> False	),
-											  'h'		=> array(	'Group'	=> 'Power',			'Unit Name'	=> 'Horsepower',				'AllowPrefix'	=> False	),
-											  'W'		=> array(	'Group'	=> 'Power',			'Unit Name'	=> 'Watt',						'AllowPrefix'	=> True		),
-											  'w'		=> array(	'Group'	=> 'Power',			'Unit Name'	=> 'Watt',						'AllowPrefix'	=> True		),
-											  'T'		=> array(	'Group'	=> 'Magnetism',		'Unit Name'	=> 'Tesla',						'AllowPrefix'	=> True		),
-											  'ga'		=> array(	'Group'	=> 'Magnetism',		'Unit Name'	=> 'Gauss',						'AllowPrefix'	=> True		),
-											  'C'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Celsius',					'AllowPrefix'	=> False	),
-											  'cel'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Celsius',					'AllowPrefix'	=> False	),
-											  'F'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Fahrenheit',				'AllowPrefix'	=> False	),
-											  'fah'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Fahrenheit',				'AllowPrefix'	=> False	),
-											  'K'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Kelvin',					'AllowPrefix'	=> False	),
-											  'kel'		=> array(	'Group'	=> 'Temperature',	'Unit Name'	=> 'Kelvin',					'AllowPrefix'	=> False	),
-											  'tsp'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Teaspoon',					'AllowPrefix'	=> False	),
-											  'tbs'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Tablespoon',				'AllowPrefix'	=> False	),
-											  'oz'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Fluid Ounce',				'AllowPrefix'	=> False	),
-											  'cup'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Cup',						'AllowPrefix'	=> False	),
-											  'pt'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'U.S. Pint',					'AllowPrefix'	=> False	),
-											  'us_pt'	=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'U.S. Pint',					'AllowPrefix'	=> False	),
-											  'uk_pt'	=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'U.K. Pint',					'AllowPrefix'	=> False	),
-											  'qt'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Quart',						'AllowPrefix'	=> False	),
-											  'gal'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Gallon',					'AllowPrefix'	=> False	),
-											  'l'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Litre',						'AllowPrefix'	=> True		),
-											  'lt'		=> array(	'Group'	=> 'Liquid',		'Unit Name'	=> 'Litre',						'AllowPrefix'	=> True		)
-											);
-
-	/**
-	 * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
-	 *
-	 * @var mixed[]
-	 */
-	private static $_conversionMultipliers = array(	'Y'	=> array(	'multiplier'	=> 1E24,	'name'	=> 'yotta'	),
-													'Z'	=> array(	'multiplier'	=> 1E21,	'name'	=> 'zetta'	),
-													'E'	=> array(	'multiplier'	=> 1E18,	'name'	=> 'exa'	),
-													'P'	=> array(	'multiplier'	=> 1E15,	'name'	=> 'peta'	),
-													'T'	=> array(	'multiplier'	=> 1E12,	'name'	=> 'tera'	),
-													'G'	=> array(	'multiplier'	=> 1E9,		'name'	=> 'giga'	),
-													'M'	=> array(	'multiplier'	=> 1E6,		'name'	=> 'mega'	),
-													'k'	=> array(	'multiplier'	=> 1E3,		'name'	=> 'kilo'	),
-													'h'	=> array(	'multiplier'	=> 1E2,		'name'	=> 'hecto'	),
-													'e'	=> array(	'multiplier'	=> 1E1,		'name'	=> 'deka'	),
-													'd'	=> array(	'multiplier'	=> 1E-1,	'name'	=> 'deci'	),
-													'c'	=> array(	'multiplier'	=> 1E-2,	'name'	=> 'centi'	),
-													'm'	=> array(	'multiplier'	=> 1E-3,	'name'	=> 'milli'	),
-													'u'	=> array(	'multiplier'	=> 1E-6,	'name'	=> 'micro'	),
-													'n'	=> array(	'multiplier'	=> 1E-9,	'name'	=> 'nano'	),
-													'p'	=> array(	'multiplier'	=> 1E-12,	'name'	=> 'pico'	),
-													'f'	=> array(	'multiplier'	=> 1E-15,	'name'	=> 'femto'	),
-													'a'	=> array(	'multiplier'	=> 1E-18,	'name'	=> 'atto'	),
-													'z'	=> array(	'multiplier'	=> 1E-21,	'name'	=> 'zepto'	),
-													'y'	=> array(	'multiplier'	=> 1E-24,	'name'	=> 'yocto'	)
-												 );
-
-	/**
-	 * Details of the Units of measure conversion factors, organised by group
-	 *
-	 * @var mixed[]
-	 */
-	private static $_unitConversions = array(	'Mass'		=> array(	'g'		=> array(	'g'		=> 1.0,
-																							'sg'	=> 6.85220500053478E-05,
-																							'lbm'	=> 2.20462291469134E-03,
-																							'u'		=> 6.02217000000000E+23,
-																							'ozm'	=> 3.52739718003627E-02
-																						),
-																		'sg'	=> array(	'g'		=> 1.45938424189287E+04,
-																							'sg'	=> 1.0,
-																							'lbm'	=> 3.21739194101647E+01,
-																							'u'		=> 8.78866000000000E+27,
-																							'ozm'	=> 5.14782785944229E+02
-																						),
-																		'lbm'	=> array(	'g'		=> 4.5359230974881148E+02,
-																							'sg'	=> 3.10810749306493E-02,
-																							'lbm'	=> 1.0,
-																							'u'		=> 2.73161000000000E+26,
-																							'ozm'	=> 1.60000023429410E+01
-																						),
-																		'u'		=> array(	'g'		=> 1.66053100460465E-24,
-																							'sg'	=> 1.13782988532950E-28,
-																							'lbm'	=> 3.66084470330684E-27,
-																							'u'		=> 1.0,
-																							'ozm'	=> 5.85735238300524E-26
-																						),
-																		'ozm'	=> array(	'g'		=> 2.83495152079732E+01,
-																							'sg'	=> 1.94256689870811E-03,
-																							'lbm'	=> 6.24999908478882E-02,
-																							'u'		=> 1.70725600000000E+25,
-																							'ozm'	=> 1.0
-																						)
-																	),
-												'Distance'	=> array(	'm'		=> array(	'm'		=> 1.0,
-																							'mi'	=> 6.21371192237334E-04,
-																							'Nmi'	=> 5.39956803455724E-04,
-																							'in'	=> 3.93700787401575E+01,
-																							'ft'	=> 3.28083989501312E+00,
-																							'yd'	=> 1.09361329797891E+00,
-																							'ang'	=> 1.00000000000000E+10,
-																							'Pica'	=> 2.83464566929116E+03
-																						),
-																		'mi'	=> array(	'm'		=> 1.60934400000000E+03,
-																							'mi'	=> 1.0,
-																							'Nmi'	=> 8.68976241900648E-01,
-																							'in'	=> 6.33600000000000E+04,
-																							'ft'	=> 5.28000000000000E+03,
-																							'yd'	=> 1.76000000000000E+03,
-																							'ang'	=> 1.60934400000000E+13,
-																							'Pica'	=> 4.56191999999971E+06
-																						),
-																		'Nmi'	=> array(	'm'		=> 1.85200000000000E+03,
-																							'mi'	=> 1.15077944802354E+00,
-																							'Nmi'	=> 1.0,
-																							'in'	=> 7.29133858267717E+04,
-																							'ft'	=> 6.07611548556430E+03,
-																							'yd'	=> 2.02537182785694E+03,
-																							'ang'	=> 1.85200000000000E+13,
-																							'Pica'	=> 5.24976377952723E+06
-																						),
-																		'in'	=> array(	'm'		=> 2.54000000000000E-02,
-																							'mi'	=> 1.57828282828283E-05,
-																							'Nmi'	=> 1.37149028077754E-05,
-																							'in'	=> 1.0,
-																							'ft'	=> 8.33333333333333E-02,
-																							'yd'	=> 2.77777777686643E-02,
-																							'ang'	=> 2.54000000000000E+08,
-																							'Pica'	=> 7.19999999999955E+01
-																						),
-																		'ft'	=> array(	'm'		=> 3.04800000000000E-01,
-																							'mi'	=> 1.89393939393939E-04,
-																							'Nmi'	=> 1.64578833693305E-04,
-																							'in'	=> 1.20000000000000E+01,
-																							'ft'	=> 1.0,
-																							'yd'	=> 3.33333333223972E-01,
-																							'ang'	=> 3.04800000000000E+09,
-																							'Pica'	=> 8.63999999999946E+02
-																						),
-																		'yd'	=> array(	'm'		=> 9.14400000300000E-01,
-																							'mi'	=> 5.68181818368230E-04,
-																							'Nmi'	=> 4.93736501241901E-04,
-																							'in'	=> 3.60000000118110E+01,
-																							'ft'	=> 3.00000000000000E+00,
-																							'yd'	=> 1.0,
-																							'ang'	=> 9.14400000300000E+09,
-																							'Pica'	=> 2.59200000085023E+03
-																						),
-																		'ang'	=> array(	'm'		=> 1.00000000000000E-10,
-																							'mi'	=> 6.21371192237334E-14,
-																							'Nmi'	=> 5.39956803455724E-14,
-																							'in'	=> 3.93700787401575E-09,
-																							'ft'	=> 3.28083989501312E-10,
-																							'yd'	=> 1.09361329797891E-10,
-																							'ang'	=> 1.0,
-																							'Pica'	=> 2.83464566929116E-07
-																						),
-																		'Pica'	=> array(	'm'		=> 3.52777777777800E-04,
-																							'mi'	=> 2.19205948372629E-07,
-																							'Nmi'	=> 1.90484761219114E-07,
-																							'in'	=> 1.38888888888898E-02,
-																							'ft'	=> 1.15740740740748E-03,
-																							'yd'	=> 3.85802469009251E-04,
-																							'ang'	=> 3.52777777777800E+06,
-																							'Pica'	=> 1.0
-																						)
-																	),
-												'Time'		=> array(	'yr'	=> array(	'yr'		=> 1.0,
-																							'day'		=> 365.25,
-																							'hr'		=> 8766.0,
-																							'mn'		=> 525960.0,
-																							'sec'		=> 31557600.0
-																						),
-																		'day'	=> array(	'yr'		=> 2.73785078713210E-03,
-																							'day'		=> 1.0,
-																							'hr'		=> 24.0,
-																							'mn'		=> 1440.0,
-																							'sec'		=> 86400.0
-																						),
-																		'hr'	=> array(	'yr'		=> 1.14077116130504E-04,
-																							'day'		=> 4.16666666666667E-02,
-																							'hr'		=> 1.0,
-																							'mn'		=> 60.0,
-																							'sec'		=> 3600.0
-																						),
-																		'mn'	=> array(	'yr'		=> 1.90128526884174E-06,
-																							'day'		=> 6.94444444444444E-04,
-																							'hr'		=> 1.66666666666667E-02,
-																							'mn'		=> 1.0,
-																							'sec'		=> 60.0
-																						),
-																		'sec'	=> array(	'yr'		=> 3.16880878140289E-08,
-																							'day'		=> 1.15740740740741E-05,
-																							'hr'		=> 2.77777777777778E-04,
-																							'mn'		=> 1.66666666666667E-02,
-																							'sec'		=> 1.0
-																						)
-																	),
-												'Pressure'	=> array(	'Pa'	=> array(	'Pa'		=> 1.0,
-																							'p'			=> 1.0,
-																							'atm'		=> 9.86923299998193E-06,
-																							'at'		=> 9.86923299998193E-06,
-																							'mmHg'		=> 7.50061707998627E-03
-																						),
-																		'p'		=> array(	'Pa'		=> 1.0,
-																							'p'			=> 1.0,
-																							'atm'		=> 9.86923299998193E-06,
-																							'at'		=> 9.86923299998193E-06,
-																							'mmHg'		=> 7.50061707998627E-03
-																						),
-																		'atm'	=> array(	'Pa'		=> 1.01324996583000E+05,
-																							'p'			=> 1.01324996583000E+05,
-																							'atm'		=> 1.0,
-																							'at'		=> 1.0,
-																							'mmHg'		=> 760.0
-																						),
-																		'at'	=> array(	'Pa'		=> 1.01324996583000E+05,
-																							'p'			=> 1.01324996583000E+05,
-																							'atm'		=> 1.0,
-																							'at'		=> 1.0,
-																							'mmHg'		=> 760.0
-																						),
-																		'mmHg'	=> array(	'Pa'		=> 1.33322363925000E+02,
-																							'p'			=> 1.33322363925000E+02,
-																							'atm'		=> 1.31578947368421E-03,
-																							'at'		=> 1.31578947368421E-03,
-																							'mmHg'		=> 1.0
-																						)
-																	),
-												'Force'		=> array(	'N'		=> array(	'N'			=> 1.0,
-																							'dyn'		=> 1.0E+5,
-																							'dy'		=> 1.0E+5,
-																							'lbf'		=> 2.24808923655339E-01
-																						),
-																		'dyn'	=> array(	'N'			=> 1.0E-5,
-																							'dyn'		=> 1.0,
-																							'dy'		=> 1.0,
-																							'lbf'		=> 2.24808923655339E-06
-																						),
-																		'dy'	=> array(	'N'			=> 1.0E-5,
-																							'dyn'		=> 1.0,
-																							'dy'		=> 1.0,
-																							'lbf'		=> 2.24808923655339E-06
-																						),
-																		'lbf'	=> array(	'N'			=> 4.448222,
-																							'dyn'		=> 4.448222E+5,
-																							'dy'		=> 4.448222E+5,
-																							'lbf'		=> 1.0
-																						)
-																	),
-												'Energy'	=> array(	'J'		=> array(	'J'			=> 1.0,
-																							'e'			=> 9.99999519343231E+06,
-																							'c'			=> 2.39006249473467E-01,
-																							'cal'		=> 2.38846190642017E-01,
-																							'eV'		=> 6.24145700000000E+18,
-																							'ev'		=> 6.24145700000000E+18,
-																							'HPh'		=> 3.72506430801000E-07,
-																							'hh'		=> 3.72506430801000E-07,
-																							'Wh'		=> 2.77777916238711E-04,
-																							'wh'		=> 2.77777916238711E-04,
-																							'flb'		=> 2.37304222192651E+01,
-																							'BTU'		=> 9.47815067349015E-04,
-																							'btu'		=> 9.47815067349015E-04
-																						),
-																		'e'		=> array(	'J'			=> 1.00000048065700E-07,
-																							'e'			=> 1.0,
-																							'c'			=> 2.39006364353494E-08,
-																							'cal'		=> 2.38846305445111E-08,
-																							'eV'		=> 6.24146000000000E+11,
-																							'ev'		=> 6.24146000000000E+11,
-																							'HPh'		=> 3.72506609848824E-14,
-																							'hh'		=> 3.72506609848824E-14,
-																							'Wh'		=> 2.77778049754611E-11,
-																							'wh'		=> 2.77778049754611E-11,
-																							'flb'		=> 2.37304336254586E-06,
-																							'BTU'		=> 9.47815522922962E-11,
-																							'btu'		=> 9.47815522922962E-11
-																						),
-																		'c'		=> array(	'J'			=> 4.18399101363672E+00,
-																							'e'			=> 4.18398900257312E+07,
-																							'c'			=> 1.0,
-																							'cal'		=> 9.99330315287563E-01,
-																							'eV'		=> 2.61142000000000E+19,
-																							'ev'		=> 2.61142000000000E+19,
-																							'HPh'		=> 1.55856355899327E-06,
-																							'hh'		=> 1.55856355899327E-06,
-																							'Wh'		=> 1.16222030532950E-03,
-																							'wh'		=> 1.16222030532950E-03,
-																							'flb'		=> 9.92878733152102E+01,
-																							'BTU'		=> 3.96564972437776E-03,
-																							'btu'		=> 3.96564972437776E-03
-																						),
-																		'cal'	=> array(	'J'			=> 4.18679484613929E+00,
-																							'e'			=> 4.18679283372801E+07,
-																							'c'			=> 1.00067013349059E+00,
-																							'cal'		=> 1.0,
-																							'eV'		=> 2.61317000000000E+19,
-																							'ev'		=> 2.61317000000000E+19,
-																							'HPh'		=> 1.55960800463137E-06,
-																							'hh'		=> 1.55960800463137E-06,
-																							'Wh'		=> 1.16299914807955E-03,
-																							'wh'		=> 1.16299914807955E-03,
-																							'flb'		=> 9.93544094443283E+01,
-																							'BTU'		=> 3.96830723907002E-03,
-																							'btu'		=> 3.96830723907002E-03
-																						),
-																		'eV'	=> array(	'J'			=> 1.60219000146921E-19,
-																							'e'			=> 1.60218923136574E-12,
-																							'c'			=> 3.82933423195043E-20,
-																							'cal'		=> 3.82676978535648E-20,
-																							'eV'		=> 1.0,
-																							'ev'		=> 1.0,
-																							'HPh'		=> 5.96826078912344E-26,
-																							'hh'		=> 5.96826078912344E-26,
-																							'Wh'		=> 4.45053000026614E-23,
-																							'wh'		=> 4.45053000026614E-23,
-																							'flb'		=> 3.80206452103492E-18,
-																							'BTU'		=> 1.51857982414846E-22,
-																							'btu'		=> 1.51857982414846E-22
-																						),
-																		'ev'	=> array(	'J'			=> 1.60219000146921E-19,
-																							'e'			=> 1.60218923136574E-12,
-																							'c'			=> 3.82933423195043E-20,
-																							'cal'		=> 3.82676978535648E-20,
-																							'eV'		=> 1.0,
-																							'ev'		=> 1.0,
-																							'HPh'		=> 5.96826078912344E-26,
-																							'hh'		=> 5.96826078912344E-26,
-																							'Wh'		=> 4.45053000026614E-23,
-																							'wh'		=> 4.45053000026614E-23,
-																							'flb'		=> 3.80206452103492E-18,
-																							'BTU'		=> 1.51857982414846E-22,
-																							'btu'		=> 1.51857982414846E-22
-																						),
-																		'HPh'	=> array(	'J'			=> 2.68451741316170E+06,
-																							'e'			=> 2.68451612283024E+13,
-																							'c'			=> 6.41616438565991E+05,
-																							'cal'		=> 6.41186757845835E+05,
-																							'eV'		=> 1.67553000000000E+25,
-																							'ev'		=> 1.67553000000000E+25,
-																							'HPh'		=> 1.0,
-																							'hh'		=> 1.0,
-																							'Wh'		=> 7.45699653134593E+02,
-																							'wh'		=> 7.45699653134593E+02,
-																							'flb'		=> 6.37047316692964E+07,
-																							'BTU'		=> 2.54442605275546E+03,
-																							'btu'		=> 2.54442605275546E+03
-																						),
-																		'hh'	=> array(	'J'			=> 2.68451741316170E+06,
-																							'e'			=> 2.68451612283024E+13,
-																							'c'			=> 6.41616438565991E+05,
-																							'cal'		=> 6.41186757845835E+05,
-																							'eV'		=> 1.67553000000000E+25,
-																							'ev'		=> 1.67553000000000E+25,
-																							'HPh'		=> 1.0,
-																							'hh'		=> 1.0,
-																							'Wh'		=> 7.45699653134593E+02,
-																							'wh'		=> 7.45699653134593E+02,
-																							'flb'		=> 6.37047316692964E+07,
-																							'BTU'		=> 2.54442605275546E+03,
-																							'btu'		=> 2.54442605275546E+03
-																						),
-																		'Wh'	=> array(	'J'			=> 3.59999820554720E+03,
-																							'e'			=> 3.59999647518369E+10,
-																							'c'			=> 8.60422069219046E+02,
-																							'cal'		=> 8.59845857713046E+02,
-																							'eV'		=> 2.24692340000000E+22,
-																							'ev'		=> 2.24692340000000E+22,
-																							'HPh'		=> 1.34102248243839E-03,
-																							'hh'		=> 1.34102248243839E-03,
-																							'Wh'		=> 1.0,
-																							'wh'		=> 1.0,
-																							'flb'		=> 8.54294774062316E+04,
-																							'BTU'		=> 3.41213254164705E+00,
-																							'btu'		=> 3.41213254164705E+00
-																						),
-																		'wh'	=> array(	'J'			=> 3.59999820554720E+03,
-																							'e'			=> 3.59999647518369E+10,
-																							'c'			=> 8.60422069219046E+02,
-																							'cal'		=> 8.59845857713046E+02,
-																							'eV'		=> 2.24692340000000E+22,
-																							'ev'		=> 2.24692340000000E+22,
-																							'HPh'		=> 1.34102248243839E-03,
-																							'hh'		=> 1.34102248243839E-03,
-																							'Wh'		=> 1.0,
-																							'wh'		=> 1.0,
-																							'flb'		=> 8.54294774062316E+04,
-																							'BTU'		=> 3.41213254164705E+00,
-																							'btu'		=> 3.41213254164705E+00
-																						),
-																		'flb'	=> array(	'J'			=> 4.21400003236424E-02,
-																							'e'			=> 4.21399800687660E+05,
-																							'c'			=> 1.00717234301644E-02,
-																							'cal'		=> 1.00649785509554E-02,
-																							'eV'		=> 2.63015000000000E+17,
-																							'ev'		=> 2.63015000000000E+17,
-																							'HPh'		=> 1.56974211145130E-08,
-																							'hh'		=> 1.56974211145130E-08,
-																							'Wh'		=> 1.17055614802000E-05,
-																							'wh'		=> 1.17055614802000E-05,
-																							'flb'		=> 1.0,
-																							'BTU'		=> 3.99409272448406E-05,
-																							'btu'		=> 3.99409272448406E-05
-																						),
-																		'BTU'	=> array(	'J'			=> 1.05505813786749E+03,
-																							'e'			=> 1.05505763074665E+10,
-																							'c'			=> 2.52165488508168E+02,
-																							'cal'		=> 2.51996617135510E+02,
-																							'eV'		=> 6.58510000000000E+21,
-																							'ev'		=> 6.58510000000000E+21,
-																							'HPh'		=> 3.93015941224568E-04,
-																							'hh'		=> 3.93015941224568E-04,
-																							'Wh'		=> 2.93071851047526E-01,
-																							'wh'		=> 2.93071851047526E-01,
-																							'flb'		=> 2.50369750774671E+04,
-																							'BTU'		=> 1.0,
-																							'btu'		=> 1.0,
-																						),
-																		'btu'	=> array(	'J'			=> 1.05505813786749E+03,
-																							'e'			=> 1.05505763074665E+10,
-																							'c'			=> 2.52165488508168E+02,
-																							'cal'		=> 2.51996617135510E+02,
-																							'eV'		=> 6.58510000000000E+21,
-																							'ev'		=> 6.58510000000000E+21,
-																							'HPh'		=> 3.93015941224568E-04,
-																							'hh'		=> 3.93015941224568E-04,
-																							'Wh'		=> 2.93071851047526E-01,
-																							'wh'		=> 2.93071851047526E-01,
-																							'flb'		=> 2.50369750774671E+04,
-																							'BTU'		=> 1.0,
-																							'btu'		=> 1.0,
-																						)
-																	),
-												'Power'		=> array(	'HP'	=> array(	'HP'		=> 1.0,
-																							'h'			=> 1.0,
-																							'W'			=> 7.45701000000000E+02,
-																							'w'			=> 7.45701000000000E+02
-																						),
-																		'h'		=> array(	'HP'		=> 1.0,
-																							'h'			=> 1.0,
-																							'W'			=> 7.45701000000000E+02,
-																							'w'			=> 7.45701000000000E+02
-																						),
-																		'W'		=> array(	'HP'		=> 1.34102006031908E-03,
-																							'h'			=> 1.34102006031908E-03,
-																							'W'			=> 1.0,
-																							'w'			=> 1.0
-																						),
-																		'w'		=> array(	'HP'		=> 1.34102006031908E-03,
-																							'h'			=> 1.34102006031908E-03,
-																							'W'			=> 1.0,
-																							'w'			=> 1.0
-																						)
-																	),
-												'Magnetism'	=> array(	'T'		=> array(	'T'			=> 1.0,
-																							'ga'		=> 10000.0
-																						),
-																		'ga'	=> array(	'T'			=> 0.0001,
-																							'ga'		=> 1.0
-																						)
-																	),
-												'Liquid'	=> array(	'tsp'	=> array(	'tsp'		=> 1.0,
-																							'tbs'		=> 3.33333333333333E-01,
-																							'oz'		=> 1.66666666666667E-01,
-																							'cup'		=> 2.08333333333333E-02,
-																							'pt'		=> 1.04166666666667E-02,
-																							'us_pt'		=> 1.04166666666667E-02,
-																							'uk_pt'		=> 8.67558516821960E-03,
-																							'qt'		=> 5.20833333333333E-03,
-																							'gal'		=> 1.30208333333333E-03,
-																							'l'			=> 4.92999408400710E-03,
-																							'lt'		=> 4.92999408400710E-03
-																						),
-																		'tbs'	=> array(	'tsp'		=> 3.00000000000000E+00,
-																							'tbs'		=> 1.0,
-																							'oz'		=> 5.00000000000000E-01,
-																							'cup'		=> 6.25000000000000E-02,
-																							'pt'		=> 3.12500000000000E-02,
-																							'us_pt'		=> 3.12500000000000E-02,
-																							'uk_pt'		=> 2.60267555046588E-02,
-																							'qt'		=> 1.56250000000000E-02,
-																							'gal'		=> 3.90625000000000E-03,
-																							'l'			=> 1.47899822520213E-02,
-																							'lt'		=> 1.47899822520213E-02
-																						),
-																		'oz'	=> array(	'tsp'		=> 6.00000000000000E+00,
-																							'tbs'		=> 2.00000000000000E+00,
-																							'oz'		=> 1.0,
-																							'cup'		=> 1.25000000000000E-01,
-																							'pt'		=> 6.25000000000000E-02,
-																							'us_pt'		=> 6.25000000000000E-02,
-																							'uk_pt'		=> 5.20535110093176E-02,
-																							'qt'		=> 3.12500000000000E-02,
-																							'gal'		=> 7.81250000000000E-03,
-																							'l'			=> 2.95799645040426E-02,
-																							'lt'		=> 2.95799645040426E-02
-																						),
-																		'cup'	=> array(	'tsp'		=> 4.80000000000000E+01,
-																							'tbs'		=> 1.60000000000000E+01,
-																							'oz'		=> 8.00000000000000E+00,
-																							'cup'		=> 1.0,
-																							'pt'		=> 5.00000000000000E-01,
-																							'us_pt'		=> 5.00000000000000E-01,
-																							'uk_pt'		=> 4.16428088074541E-01,
-																							'qt'		=> 2.50000000000000E-01,
-																							'gal'		=> 6.25000000000000E-02,
-																							'l'			=> 2.36639716032341E-01,
-																							'lt'		=> 2.36639716032341E-01
-																						),
-																		'pt'	=> array(	'tsp'		=> 9.60000000000000E+01,
-																							'tbs'		=> 3.20000000000000E+01,
-																							'oz'		=> 1.60000000000000E+01,
-																							'cup'		=> 2.00000000000000E+00,
-																							'pt'		=> 1.0,
-																							'us_pt'		=> 1.0,
-																							'uk_pt'		=> 8.32856176149081E-01,
-																							'qt'		=> 5.00000000000000E-01,
-																							'gal'		=> 1.25000000000000E-01,
-																							'l'			=> 4.73279432064682E-01,
-																							'lt'		=> 4.73279432064682E-01
-																						),
-																		'us_pt'	=> array(	'tsp'		=> 9.60000000000000E+01,
-																							'tbs'		=> 3.20000000000000E+01,
-																							'oz'		=> 1.60000000000000E+01,
-																							'cup'		=> 2.00000000000000E+00,
-																							'pt'		=> 1.0,
-																							'us_pt'		=> 1.0,
-																							'uk_pt'		=> 8.32856176149081E-01,
-																							'qt'		=> 5.00000000000000E-01,
-																							'gal'		=> 1.25000000000000E-01,
-																							'l'			=> 4.73279432064682E-01,
-																							'lt'		=> 4.73279432064682E-01
-																						),
-																		'uk_pt'	=> array(	'tsp'		=> 1.15266000000000E+02,
-																							'tbs'		=> 3.84220000000000E+01,
-																							'oz'		=> 1.92110000000000E+01,
-																							'cup'		=> 2.40137500000000E+00,
-																							'pt'		=> 1.20068750000000E+00,
-																							'us_pt'		=> 1.20068750000000E+00,
-																							'uk_pt'		=> 1.0,
-																							'qt'		=> 6.00343750000000E-01,
-																							'gal'		=> 1.50085937500000E-01,
-																							'l'			=> 5.68260698087162E-01,
-																							'lt'		=> 5.68260698087162E-01
-																						),
-																		'qt'	=> array(	'tsp'		=> 1.92000000000000E+02,
-																							'tbs'		=> 6.40000000000000E+01,
-																							'oz'		=> 3.20000000000000E+01,
-																							'cup'		=> 4.00000000000000E+00,
-																							'pt'		=> 2.00000000000000E+00,
-																							'us_pt'		=> 2.00000000000000E+00,
-																							'uk_pt'		=> 1.66571235229816E+00,
-																							'qt'		=> 1.0,
-																							'gal'		=> 2.50000000000000E-01,
-																							'l'			=> 9.46558864129363E-01,
-																							'lt'		=> 9.46558864129363E-01
-																						),
-																		'gal'	=> array(	'tsp'		=> 7.68000000000000E+02,
-																							'tbs'		=> 2.56000000000000E+02,
-																							'oz'		=> 1.28000000000000E+02,
-																							'cup'		=> 1.60000000000000E+01,
-																							'pt'		=> 8.00000000000000E+00,
-																							'us_pt'		=> 8.00000000000000E+00,
-																							'uk_pt'		=> 6.66284940919265E+00,
-																							'qt'		=> 4.00000000000000E+00,
-																							'gal'		=> 1.0,
-																							'l'			=> 3.78623545651745E+00,
-																							'lt'		=> 3.78623545651745E+00
-																						),
-																		'l'		=> array(	'tsp'		=> 2.02840000000000E+02,
-																							'tbs'		=> 6.76133333333333E+01,
-																							'oz'		=> 3.38066666666667E+01,
-																							'cup'		=> 4.22583333333333E+00,
-																							'pt'		=> 2.11291666666667E+00,
-																							'us_pt'		=> 2.11291666666667E+00,
-																							'uk_pt'		=> 1.75975569552166E+00,
-																							'qt'		=> 1.05645833333333E+00,
-																							'gal'		=> 2.64114583333333E-01,
-																							'l'			=> 1.0,
-																							'lt'		=> 1.0
-																						),
-																		'lt'	=> array(	'tsp'		=> 2.02840000000000E+02,
-																							'tbs'		=> 6.76133333333333E+01,
-																							'oz'		=> 3.38066666666667E+01,
-																							'cup'		=> 4.22583333333333E+00,
-																							'pt'		=> 2.11291666666667E+00,
-																							'us_pt'		=> 2.11291666666667E+00,
-																							'uk_pt'		=> 1.75975569552166E+00,
-																							'qt'		=> 1.05645833333333E+00,
-																							'gal'		=> 2.64114583333333E-01,
-																							'l'			=> 1.0,
-																							'lt'		=> 1.0
-																						)
-																	)
-											);
-
-
-	/**
-	 * _parseComplex
-	 *
-	 * Parses a complex number into its real and imaginary parts, and an I or J suffix
-	 *
-	 * @param	string		$complexNumber	The complex number
-	 * @return	string[]	Indexed on "real", "imaginary" and "suffix"
-	 */
-	public static function _parseComplex($complexNumber) {
-		$workString = (string) $complexNumber;
-
-		$realNumber = $imaginary = 0;
-		//	Extract the suffix, if there is one
-		$suffix = substr($workString,-1);
-		if (!is_numeric($suffix)) {
-			$workString = substr($workString,0,-1);
-		} else {
-			$suffix = '';
-		}
-
-		//	Split the input into its Real and Imaginary components
-		$leadingSign = 0;
-		if (strlen($workString) > 0) {
-			$leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
-		}
-		$power = '';
-		$realNumber = strtok($workString, '+-');
-		if (strtoupper(substr($realNumber,-1)) == 'E') {
-			$power = strtok('+-');
-			++$leadingSign;
-		}
-
-		$realNumber = substr($workString,0,strlen($realNumber)+strlen($power)+$leadingSign);
-
-		if ($suffix != '') {
-			$imaginary = substr($workString,strlen($realNumber));
-
-			if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) {
-				$imaginary = $realNumber.'1';
-				$realNumber = '0';
-			} else if ($imaginary == '') {
-				$imaginary = $realNumber;
-				$realNumber = '0';
-			} elseif (($imaginary == '+') || ($imaginary == '-')) {
-				$imaginary .= '1';
-			}
-		}
-
-		return array( 'real'		=> $realNumber,
-					  'imaginary'	=> $imaginary,
-					  'suffix'		=> $suffix
-					);
-	}	//	function _parseComplex()
-
-
-	/**
-	 * Cleans the leading characters in a complex number string
-	 *
-	 * @param	string		$complexNumber	The complex number to clean
-	 * @return	string		The "cleaned" complex number
-	 */
-	private static function _cleanComplex($complexNumber) {
-		if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
-		if ($complexNumber{0} == '0') $complexNumber = substr($complexNumber,1);
-		if ($complexNumber{0} == '.') $complexNumber = '0'.$complexNumber;
-		if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
-		return $complexNumber;
-	}
-
-	/**
-	 * Formats a number base string value with leading zeroes
-	 *
-	 * @param	string		$xVal		The "number" to pad
-	 * @param	integer		$places		The length that we want to pad this value
-	 * @return	string		The padded "number"
-	 */
-	private static function _nbrConversionFormat($xVal, $places) {
-		if (!is_null($places)) {
-			if (strlen($xVal) <= $places) {
-				return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
-			} else {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-		}
-
-		return substr($xVal, -10);
-	}	//	function _nbrConversionFormat()
-
-	/**
-	 *	BESSELI
-	 *
-	 *	Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated
-	 *		for purely imaginary arguments
-	 *
-	 *	Excel Function:
-	 *		BESSELI(x,ord)
-	 *
-	 *	@access	public
-	 *	@category Engineering Functions
-	 *	@param	float		$x		The value at which to evaluate the function.
-	 *								If x is nonnumeric, BESSELI returns the #VALUE! error value.
-	 *	@param	integer		$ord	The order of the Bessel function.
-	 *								If ord is not an integer, it is truncated.
-	 *								If $ord is nonnumeric, BESSELI returns the #VALUE! error value.
-	 *								If $ord < 0, BESSELI returns the #NUM! error value.
-	 *	@return	float
-	 *
-	 */
-	public static function BESSELI($x, $ord) {
-		$x	= (is_null($x))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$ord	= (is_null($ord))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
-		if ((is_numeric($x)) && (is_numeric($ord))) {
-			$ord	= floor($ord);
-			if ($ord < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			if (abs($x) <= 30) {
-				$fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord);
-				$ordK = 1;
-				$fSqrX = ($x * $x) / 4;
-				do {
-					$fTerm *= $fSqrX;
-					$fTerm /= ($ordK * ($ordK + $ord));
-					$fResult += $fTerm;
-				} while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
-			} else {
-				$f_2_PI = 2 * M_PI;
-
-				$fXAbs = abs($x);
-				$fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs);
-				if (($ord & 1) && ($x < 0)) {
-					$fResult = -$fResult;
-				}
-			}
-			return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BESSELI()
-
-
-	/**
-	 *	BESSELJ
-	 *
-	 *	Returns the Bessel function
-	 *
-	 *	Excel Function:
-	 *		BESSELJ(x,ord)
-	 *
-	 *	@access	public
-	 *	@category Engineering Functions
-	 *	@param	float		$x		The value at which to evaluate the function.
-	 *								If x is nonnumeric, BESSELJ returns the #VALUE! error value.
-	 *	@param	integer		$ord	The order of the Bessel function. If n is not an integer, it is truncated.
-	 *								If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
-	 *								If $ord < 0, BESSELJ returns the #NUM! error value.
-	 *	@return	float
-	 *
-	 */
-	public static function BESSELJ($x, $ord) {
-		$x	= (is_null($x))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$ord	= (is_null($ord))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
-		if ((is_numeric($x)) && (is_numeric($ord))) {
-			$ord	= floor($ord);
-			if ($ord < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			$fResult = 0;
-			if (abs($x) <= 30) {
-				$fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord);
-				$ordK = 1;
-				$fSqrX = ($x * $x) / -4;
-				do {
-					$fTerm *= $fSqrX;
-					$fTerm /= ($ordK * ($ordK + $ord));
-					$fResult += $fTerm;
-				} while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
-			} else {
-				$f_PI_DIV_2 = M_PI / 2;
-				$f_PI_DIV_4 = M_PI / 4;
-
-				$fXAbs = abs($x);
-				$fResult = sqrt(M_2DIVPI / $fXAbs) * cos($fXAbs - $ord * $f_PI_DIV_2 - $f_PI_DIV_4);
-				if (($ord & 1) && ($x < 0)) {
-					$fResult = -$fResult;
-				}
-			}
-			return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BESSELJ()
-
-
-	private static function _Besselk0($fNum) {
-		if ($fNum <= 2) {
-			$fNum2 = $fNum * 0.5;
-			$y = ($fNum2 * $fNum2);
-			$fRet = -log($fNum2) * self::BESSELI($fNum, 0) +
-					(-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y *
-					(0.10750e-3 + $y * 0.74e-5))))));
-		} else {
-			$y = 2 / $fNum;
-			$fRet = exp(-$fNum) / sqrt($fNum) *
-					(1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y *
-					(0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3))))));
-		}
-		return $fRet;
-	}	//	function _Besselk0()
-
-
-	private static function _Besselk1($fNum) {
-		if ($fNum <= 2) {
-			$fNum2 = $fNum * 0.5;
-			$y = ($fNum2 * $fNum2);
-			$fRet = log($fNum2) * self::BESSELI($fNum, 1) +
-					(1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y *
-					(-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum;
-		} else {
-			$y = 2 / $fNum;
-			$fRet = exp(-$fNum) / sqrt($fNum) *
-					(1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y *
-					(0.325614e-2 + $y * (-0.68245e-3)))))));
-		}
-		return $fRet;
-	}	//	function _Besselk1()
-
-
-	/**
-	 *	BESSELK
-	 *
-	 *	Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated
-	 *		for purely imaginary arguments.
-	 *
-	 *	Excel Function:
-	 *		BESSELK(x,ord)
-	 *
-	 *	@access	public
-	 *	@category Engineering Functions
-	 *	@param	float		$x		The value at which to evaluate the function.
-	 *								If x is nonnumeric, BESSELK returns the #VALUE! error value.
-	 *	@param	integer		$ord	The order of the Bessel function. If n is not an integer, it is truncated.
-	 *								If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
-	 *								If $ord < 0, BESSELK returns the #NUM! error value.
-	 *	@return	float
-	 *
-	 */
-	public static function BESSELK($x, $ord) {
-		$x		= (is_null($x))		? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$ord	= (is_null($ord))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
-		if ((is_numeric($x)) && (is_numeric($ord))) {
-			if (($ord < 0) || ($x == 0.0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			switch(floor($ord)) {
-				case 0 :	return self::_Besselk0($x);
-							break;
-				case 1 :	return self::_Besselk1($x);
-							break;
-				default :	$fTox	= 2 / $x;
-							$fBkm	= self::_Besselk0($x);
-							$fBk	= self::_Besselk1($x);
-							for ($n = 1; $n < $ord; ++$n) {
-								$fBkp	= $fBkm + $n * $fTox * $fBk;
-								$fBkm	= $fBk;
-								$fBk	= $fBkp;
-							}
-			}
-			return (is_nan($fBk)) ? PHPExcel_Calculation_Functions::NaN() : $fBk;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BESSELK()
-
-
-	private static function _Bessely0($fNum) {
-		if ($fNum < 8.0) {
-			$y = ($fNum * $fNum);
-			$f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733))));
-			$f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y))));
-			$fRet = $f1 / $f2 + 0.636619772 * self::BESSELJ($fNum, 0) * log($fNum);
-		} else {
-			$z = 8.0 / $fNum;
-			$y = ($z * $z);
-			$xx = $fNum - 0.785398164;
-			$f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
-			$f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7))));
-			$fRet = sqrt(0.636619772 / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2);
-		}
-		return $fRet;
-	}	//	function _Bessely0()
-
-
-	private static function _Bessely1($fNum) {
-		if ($fNum < 8.0) {
-			$y = ($fNum * $fNum);
-			$f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y *
-				(-0.4237922726e7 + $y * 0.8511937935e4)))));
-			$f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y *
-				(0.1020426050e6 + $y * (0.3549632885e3 + $y)))));
-			$fRet = $f1 / $f2 + 0.636619772 * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum);
-		} else {
-			$fRet = sqrt(0.636619772 / $fNum) * sin($fNum - 2.356194491);
-		}
-		return $fRet;
-	}	//	function _Bessely1()
-
-
-	/**
-	 *	BESSELY
-	 *
-	 *	Returns the Bessel function, which is also called the Weber function or the Neumann function.
-	 *
-	 *	Excel Function:
-	 *		BESSELY(x,ord)
-	 *
-	 *	@access	public
-	 *	@category Engineering Functions
-	 *	@param	float		$x		The value at which to evaluate the function.
-	 *								If x is nonnumeric, BESSELK returns the #VALUE! error value.
-	 *	@param	integer		$ord	The order of the Bessel function. If n is not an integer, it is truncated.
-	 *								If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
-	 *								If $ord < 0, BESSELK returns the #NUM! error value.
-	 *
-	 *	@return	float
-	 */
-	public static function BESSELY($x, $ord) {
-		$x		= (is_null($x))		? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$ord	= (is_null($ord))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
-		if ((is_numeric($x)) && (is_numeric($ord))) {
-			if (($ord < 0) || ($x == 0.0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			switch(floor($ord)) {
-				case 0 :	return self::_Bessely0($x);
-							break;
-				case 1 :	return self::_Bessely1($x);
-							break;
-				default:	$fTox	= 2 / $x;
-							$fBym	= self::_Bessely0($x);
-							$fBy	= self::_Bessely1($x);
-							for ($n = 1; $n < $ord; ++$n) {
-								$fByp	= $n * $fTox * $fBy - $fBym;
-								$fBym	= $fBy;
-								$fBy	= $fByp;
-							}
-			}
-			return (is_nan($fBy)) ? PHPExcel_Calculation_Functions::NaN() : $fBy;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BESSELY()
-
-
-	/**
-	 * BINTODEC
-	 *
-	 * Return a binary value as decimal.
-	 *
-	 * Excel Function:
-	 *		BIN2DEC(x)
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The binary number (as a string) that you want to convert. The number
-	 *								cannot contain more than 10 characters (10 bits). The most significant
-	 *								bit of number is the sign bit. The remaining 9 bits are magnitude bits.
-	 *								Negative numbers are represented using two's-complement notation.
-	 *								If number is not a valid binary number, or if number contains more than
-	 *								10 characters (10 bits), BIN2DEC returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function BINTODEC($x) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-			$x = floor($x);
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if (strlen($x) > 10) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (strlen($x) == 10) {
-			//	Two's Complement
-			$x = substr($x,-9);
-			return '-'.(512-bindec($x));
-		}
-		return bindec($x);
-	}	//	function BINTODEC()
-
-
-	/**
-	 * BINTOHEX
-	 *
-	 * Return a binary value as hex.
-	 *
-	 * Excel Function:
-	 *		BIN2HEX(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The binary number (as a string) that you want to convert. The number
-	 *								cannot contain more than 10 characters (10 bits). The most significant
-	 *								bit of number is the sign bit. The remaining 9 bits are magnitude bits.
-	 *								Negative numbers are represented using two's-complement notation.
-	 *								If number is not a valid binary number, or if number contains more than
-	 *								10 characters (10 bits), BIN2HEX returns the #NUM! error value.
-	 * @param	integer		$places	The number of characters to use. If places is omitted, BIN2HEX uses the
-	 *								minimum number of characters necessary. Places is useful for padding the
-	 *								return value with leading 0s (zeros).
-	 *								If places is not an integer, it is truncated.
-	 *								If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
-	 *								If places is negative, BIN2HEX returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function BINTOHEX($x, $places=NULL) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-			$x = floor($x);
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if (strlen($x) > 10) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (strlen($x) == 10) {
-			//	Two's Complement
-			return str_repeat('F',8).substr(strtoupper(dechex(bindec(substr($x,-9)))),-2);
-		}
-		$hexVal = (string) strtoupper(dechex(bindec($x)));
-
-		return self::_nbrConversionFormat($hexVal,$places);
-	}	//	function BINTOHEX()
-
-
-	/**
-	 * BINTOOCT
-	 *
-	 * Return a binary value as octal.
-	 *
-	 * Excel Function:
-	 *		BIN2OCT(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The binary number (as a string) that you want to convert. The number
-	 *								cannot contain more than 10 characters (10 bits). The most significant
-	 *								bit of number is the sign bit. The remaining 9 bits are magnitude bits.
-	 *								Negative numbers are represented using two's-complement notation.
-	 *								If number is not a valid binary number, or if number contains more than
-	 *								10 characters (10 bits), BIN2OCT returns the #NUM! error value.
-	 * @param	integer		$places	The number of characters to use. If places is omitted, BIN2OCT uses the
-	 *								minimum number of characters necessary. Places is useful for padding the
-	 *								return value with leading 0s (zeros).
-	 *								If places is not an integer, it is truncated.
-	 *								If places is nonnumeric, BIN2OCT returns the #VALUE! error value.
-	 *								If places is negative, BIN2OCT returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function BINTOOCT($x, $places=NULL) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-			$x = floor($x);
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if (strlen($x) > 10) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (strlen($x) == 10) {
-			//	Two's Complement
-			return str_repeat('7',7).substr(strtoupper(decoct(bindec(substr($x,-9)))),-3);
-		}
-		$octVal = (string) decoct(bindec($x));
-
-		return self::_nbrConversionFormat($octVal,$places);
-	}	//	function BINTOOCT()
-
-
-	/**
-	 * DECTOBIN
-	 *
-	 * Return a decimal value as binary.
-	 *
-	 * Excel Function:
-	 *		DEC2BIN(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The decimal integer you want to convert. If number is negative,
-	 *								valid place values are ignored and DEC2BIN returns a 10-character
-	 *								(10-bit) binary number in which the most significant bit is the sign
-	 *								bit. The remaining 9 bits are magnitude bits. Negative numbers are
-	 *								represented using two's-complement notation.
-	 *								If number < -512 or if number > 511, DEC2BIN returns the #NUM! error
-	 *								value.
-	 *								If number is nonnumeric, DEC2BIN returns the #VALUE! error value.
-	 *								If DEC2BIN requires more than places characters, it returns the #NUM!
-	 *								error value.
-	 * @param	integer		$places	The number of characters to use. If places is omitted, DEC2BIN uses
-	 *								the minimum number of characters necessary. Places is useful for
-	 *								padding the return value with leading 0s (zeros).
-	 *								If places is not an integer, it is truncated.
-	 *								If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
-	 *								If places is zero or negative, DEC2BIN returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function DECTOBIN($x, $places=NULL) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) floor($x);
-		$r = decbin($x);
-		if (strlen($r) == 32) {
-			//	Two's Complement
-			$r = substr($r,-10);
-		} elseif (strlen($r) > 11) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return self::_nbrConversionFormat($r,$places);
-	}	//	function DECTOBIN()
-
-
-	/**
-	 * DECTOHEX
-	 *
-	 * Return a decimal value as hex.
-	 *
-	 * Excel Function:
-	 *		DEC2HEX(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The decimal integer you want to convert. If number is negative,
-	 *								places is ignored and DEC2HEX returns a 10-character (40-bit)
-	 *								hexadecimal number in which the most significant bit is the sign
-	 *								bit. The remaining 39 bits are magnitude bits. Negative numbers
-	 *								are represented using two's-complement notation.
-	 *								If number < -549,755,813,888 or if number > 549,755,813,887,
-	 *								DEC2HEX returns the #NUM! error value.
-	 *								If number is nonnumeric, DEC2HEX returns the #VALUE! error value.
-	 *								If DEC2HEX requires more than places characters, it returns the
-	 *								#NUM! error value.
-	 * @param	integer		$places	The number of characters to use. If places is omitted, DEC2HEX uses
-	 *								the minimum number of characters necessary. Places is useful for
-	 *								padding the return value with leading 0s (zeros).
-	 *								If places is not an integer, it is truncated.
-	 *								If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
-	 *								If places is zero or negative, DEC2HEX returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function DECTOHEX($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) floor($x);
-		$r = strtoupper(dechex($x));
-		if (strlen($r) == 8) {
-			//	Two's Complement
-			$r = 'FF'.$r;
-		}
-
-		return self::_nbrConversionFormat($r,$places);
-	}	//	function DECTOHEX()
-
-
-	/**
-	 * DECTOOCT
-	 *
-	 * Return an decimal value as octal.
-	 *
-	 * Excel Function:
-	 *		DEC2OCT(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The decimal integer you want to convert. If number is negative,
-	 *								places is ignored and DEC2OCT returns a 10-character (30-bit)
-	 *								octal number in which the most significant bit is the sign bit.
-	 *								The remaining 29 bits are magnitude bits. Negative numbers are
-	 *								represented using two's-complement notation.
-	 *								If number < -536,870,912 or if number > 536,870,911, DEC2OCT
-	 *								returns the #NUM! error value.
-	 *								If number is nonnumeric, DEC2OCT returns the #VALUE! error value.
-	 *								If DEC2OCT requires more than places characters, it returns the
-	 *								#NUM! error value.
-	 * @param	integer		$places	The number of characters to use. If places is omitted, DEC2OCT uses
-	 *								the minimum number of characters necessary. Places is useful for
-	 *								padding the return value with leading 0s (zeros).
-	 *								If places is not an integer, it is truncated.
-	 *								If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
-	 *								If places is zero or negative, DEC2OCT returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function DECTOOCT($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$x = (int) $x;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) floor($x);
-		$r = decoct($x);
-		if (strlen($r) == 11) {
-			//	Two's Complement
-			$r = substr($r,-10);
-		}
-
-		return self::_nbrConversionFormat($r,$places);
-	}	//	function DECTOOCT()
-
-
-	/**
-	 * HEXTOBIN
-	 *
-	 * Return a hex value as binary.
-	 *
-	 * Excel Function:
-	 *		HEX2BIN(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x			the hexadecimal number you want to convert. Number cannot
-	 *									contain more than 10 characters. The most significant bit of
-	 *									number is the sign bit (40th bit from the right). The remaining
-	 *									9 bits are magnitude bits. Negative numbers are represented
-	 *									using two's-complement notation.
-	 *									If number is negative, HEX2BIN ignores places and returns a
-	 *									10-character binary number.
-	 *									If number is negative, it cannot be less than FFFFFFFE00, and
-	 *									if number is positive, it cannot be greater than 1FF.
-	 *									If number is not a valid hexadecimal number, HEX2BIN returns
-	 *									the #NUM! error value.
-	 *									If HEX2BIN requires more than places characters, it returns
-	 *									the #NUM! error value.
-	 * @param	integer		$places		The number of characters to use. If places is omitted,
-	 *									HEX2BIN uses the minimum number of characters necessary. Places
-	 *									is useful for padding the return value with leading 0s (zeros).
-	 *									If places is not an integer, it is truncated.
-	 *									If places is nonnumeric, HEX2BIN returns the #VALUE! error value.
-	 *									If places is negative, HEX2BIN returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function HEXTOBIN($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$binVal = decbin(hexdec($x));
-
-		return substr(self::_nbrConversionFormat($binVal,$places),-10);
-	}	//	function HEXTOBIN()
-
-
-	/**
-	 * HEXTODEC
-	 *
-	 * Return a hex value as decimal.
-	 *
-	 * Excel Function:
-	 *		HEX2DEC(x)
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The hexadecimal number you want to convert. This number cannot
-	 *								contain more than 10 characters (40 bits). The most significant
-	 *								bit of number is the sign bit. The remaining 39 bits are magnitude
-	 *								bits. Negative numbers are represented using two's-complement
-	 *								notation.
-	 *								If number is not a valid hexadecimal number, HEX2DEC returns the
-	 *								#NUM! error value.
-	 * @return	string
-	 */
-	public static function HEXTODEC($x) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		return hexdec($x);
-	}	//	function HEXTODEC()
-
-
-	/**
-	 * HEXTOOCT
-	 *
-	 * Return a hex value as octal.
-	 *
-	 * Excel Function:
-	 *		HEX2OCT(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x			The hexadecimal number you want to convert. Number cannot
-	 *									contain more than 10 characters. The most significant bit of
-	 *									number is the sign bit. The remaining 39 bits are magnitude
-	 *									bits. Negative numbers are represented using two's-complement
-	 *									notation.
-	 *									If number is negative, HEX2OCT ignores places and returns a
-	 *									10-character octal number.
-	 *									If number is negative, it cannot be less than FFE0000000, and
-	 *									if number is positive, it cannot be greater than 1FFFFFFF.
-	 *									If number is not a valid hexadecimal number, HEX2OCT returns
-	 *									the #NUM! error value.
-	 *									If HEX2OCT requires more than places characters, it returns
-	 *									the #NUM! error value.
-	 * @param	integer		$places		The number of characters to use. If places is omitted, HEX2OCT
-	 *									uses the minimum number of characters necessary. Places is
-	 *									useful for padding the return value with leading 0s (zeros).
-	 *									If places is not an integer, it is truncated.
-	 *									If places is nonnumeric, HEX2OCT returns the #VALUE! error
-	 *									value.
-	 *									If places is negative, HEX2OCT returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function HEXTOOCT($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$octVal = decoct(hexdec($x));
-
-		return self::_nbrConversionFormat($octVal,$places);
-	}	//	function HEXTOOCT()
-
-
-	/**
-	 * OCTTOBIN
-	 *
-	 * Return an octal value as binary.
-	 *
-	 * Excel Function:
-	 *		OCT2BIN(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x			The octal number you want to convert. Number may not
-	 *									contain more than 10 characters. The most significant
-	 *									bit of number is the sign bit. The remaining 29 bits
-	 *									are magnitude bits. Negative numbers are represented
-	 *									using two's-complement notation.
-	 *									If number is negative, OCT2BIN ignores places and returns
-	 *									a 10-character binary number.
-	 *									If number is negative, it cannot be less than 7777777000,
-	 *									and if number is positive, it cannot be greater than 777.
-	 *									If number is not a valid octal number, OCT2BIN returns
-	 *									the #NUM! error value.
-	 *									If OCT2BIN requires more than places characters, it
-	 *									returns the #NUM! error value.
-	 * @param	integer		$places		The number of characters to use. If places is omitted,
-	 *									OCT2BIN uses the minimum number of characters necessary.
-	 *									Places is useful for padding the return value with
-	 *									leading 0s (zeros).
-	 *									If places is not an integer, it is truncated.
-	 *									If places is nonnumeric, OCT2BIN returns the #VALUE!
-	 *									error value.
-	 *									If places is negative, OCT2BIN returns the #NUM! error
-	 *									value.
-	 * @return	string
-	 */
-	public static function OCTTOBIN($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$r = decbin(octdec($x));
-
-		return self::_nbrConversionFormat($r,$places);
-	}	//	function OCTTOBIN()
-
-
-	/**
-	 * OCTTODEC
-	 *
-	 * Return an octal value as decimal.
-	 *
-	 * Excel Function:
-	 *		OCT2DEC(x)
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x		The octal number you want to convert. Number may not contain
-	 *								more than 10 octal characters (30 bits). The most significant
-	 *								bit of number is the sign bit. The remaining 29 bits are
-	 *								magnitude bits. Negative numbers are represented using
-	 *								two's-complement notation.
-	 *								If number is not a valid octal number, OCT2DEC returns the
-	 *								#NUM! error value.
-	 * @return	string
-	 */
-	public static function OCTTODEC($x) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		return octdec($x);
-	}	//	function OCTTODEC()
-
-
-	/**
-	 * OCTTOHEX
-	 *
-	 * Return an octal value as hex.
-	 *
-	 * Excel Function:
-	 *		OCT2HEX(x[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$x			The octal number you want to convert. Number may not contain
-	 *									more than 10 octal characters (30 bits). The most significant
-	 *									bit of number is the sign bit. The remaining 29 bits are
-	 *									magnitude bits. Negative numbers are represented using
-	 *									two's-complement notation.
-	 *									If number is negative, OCT2HEX ignores places and returns a
-	 *									10-character hexadecimal number.
-	 *									If number is not a valid octal number, OCT2HEX returns the
-	 *									#NUM! error value.
-	 *									If OCT2HEX requires more than places characters, it returns
-	 *									the #NUM! error value.
-	 * @param	integer		$places		The number of characters to use. If places is omitted, OCT2HEX
-	 *									uses the minimum number of characters necessary. Places is useful
-	 *									for padding the return value with leading 0s (zeros).
-	 *									If places is not an integer, it is truncated.
-	 *									If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
-	 *									If places is negative, OCT2HEX returns the #NUM! error value.
-	 * @return	string
-	 */
-	public static function OCTTOHEX($x, $places=null) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$places	= PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
-		if (is_bool($x)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$x = (string) $x;
-		if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$hexVal = strtoupper(dechex(octdec($x)));
-
-		return self::_nbrConversionFormat($hexVal,$places);
-	}	//	function OCTTOHEX()
-
-
-	/**
-	 * COMPLEX
-	 *
-	 * Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.
-	 *
-	 * Excel Function:
-	 *		COMPLEX(realNumber,imaginary[,places])
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	float		$realNumber		The real coefficient of the complex number.
-	 * @param	float		$imaginary		The imaginary coefficient of the complex number.
-	 * @param	string		$suffix			The suffix for the imaginary component of the complex number.
-	 *										If omitted, the suffix is assumed to be "i".
-	 * @return	string
-	 */
-	public static function COMPLEX($realNumber=0.0, $imaginary=0.0, $suffix='i') {
-		$realNumber	= (is_null($realNumber))	? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($realNumber);
-		$imaginary	= (is_null($imaginary))		? 0.0 :	PHPExcel_Calculation_Functions::flattenSingleValue($imaginary);
-		$suffix		= (is_null($suffix))		? 'i' :	PHPExcel_Calculation_Functions::flattenSingleValue($suffix);
-
-		if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
-			(($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) {
-			$realNumber	= (float) $realNumber;
-			$imaginary	= (float) $imaginary;
-
-			if ($suffix == '') $suffix = 'i';
-			if ($realNumber == 0.0) {
-				if ($imaginary == 0.0) {
-					return (string) '0';
-				} elseif ($imaginary == 1.0) {
-					return (string) $suffix;
-				} elseif ($imaginary == -1.0) {
-					return (string) '-'.$suffix;
-				}
-				return (string) $imaginary.$suffix;
-			} elseif ($imaginary == 0.0) {
-				return (string) $realNumber;
-			} elseif ($imaginary == 1.0) {
-				return (string) $realNumber.'+'.$suffix;
-			} elseif ($imaginary == -1.0) {
-				return (string) $realNumber.'-'.$suffix;
-			}
-			if ($imaginary > 0) { $imaginary = (string) '+'.$imaginary; }
-			return (string) $realNumber.$imaginary.$suffix;
-		}
-
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function COMPLEX()
-
-
-	/**
-	 * IMAGINARY
-	 *
-	 * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMAGINARY(complexNumber)
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$complexNumber	The complex number for which you want the imaginary
-	 * 										coefficient.
-	 * @return	float
-	 */
-	public static function IMAGINARY($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-		return $parsedComplex['imaginary'];
-	}	//	function IMAGINARY()
-
-
-	/**
-	 * IMREAL
-	 *
-	 * Returns the real coefficient of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMREAL(complexNumber)
-	 *
-	 * @access	public
-	 * @category Engineering Functions
-	 * @param	string		$complexNumber	The complex number for which you want the real coefficient.
-	 * @return	float
-	 */
-	public static function IMREAL($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-		return $parsedComplex['real'];
-	}	//	function IMREAL()
-
-
-	/**
-	 * IMABS
-	 *
-	 * Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMABS(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the absolute value.
-	 * @return	float
-	 */
-	public static function IMABS($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		return sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']));
-	}	//	function IMABS()
-
-
-	/**
-	 * IMARGUMENT
-	 *
-	 * Returns the argument theta of a complex number, i.e. the angle in radians from the real
-	 * axis to the representation of the number in polar coordinates.
-	 *
-	 * Excel Function:
-	 *		IMARGUMENT(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the argument theta.
-	 * @return	float
-	 */
-	public static function IMARGUMENT($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if ($parsedComplex['real'] == 0.0) {
-			if ($parsedComplex['imaginary'] == 0.0) {
-				return 0.0;
-			} elseif($parsedComplex['imaginary'] < 0.0) {
-				return M_PI / -2;
-			} else {
-				return M_PI / 2;
-			}
-		} elseif ($parsedComplex['real'] > 0.0) {
-			return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
-		} elseif ($parsedComplex['imaginary'] < 0.0) {
-			return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
-		} else {
-			return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
-		}
-	}	//	function IMARGUMENT()
-
-
-	/**
-	 * IMCONJUGATE
-	 *
-	 * Returns the complex conjugate of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMCONJUGATE(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the conjugate.
-	 * @return	string
-	 */
-	public static function IMCONJUGATE($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if ($parsedComplex['imaginary'] == 0.0) {
-			return $parsedComplex['real'];
-		} else {
-			return self::_cleanComplex( self::COMPLEX( $parsedComplex['real'],
-													   0 - $parsedComplex['imaginary'],
-													   $parsedComplex['suffix']
-													 )
-									  );
-		}
-	}	//	function IMCONJUGATE()
-
-
-	/**
-	 * IMCOS
-	 *
-	 * Returns the cosine of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMCOS(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the cosine.
-	 * @return	string|float
-	 */
-	public static function IMCOS($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if ($parsedComplex['imaginary'] == 0.0) {
-			return cos($parsedComplex['real']);
-		} else {
-			return self::IMCONJUGATE(self::COMPLEX(cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']));
-		}
-	}	//	function IMCOS()
-
-
-	/**
-	 * IMSIN
-	 *
-	 * Returns the sine of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMSIN(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the sine.
-	 * @return	string|float
-	 */
-	public static function IMSIN($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if ($parsedComplex['imaginary'] == 0.0) {
-			return sin($parsedComplex['real']);
-		} else {
-			return self::COMPLEX(sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']);
-		}
-	}	//	function IMSIN()
-
-
-	/**
-	 * IMSQRT
-	 *
-	 * Returns the square root of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMSQRT(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the square root.
-	 * @return	string
-	 */
-	public static function IMSQRT($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		$theta = self::IMARGUMENT($complexNumber);
-		$d1 = cos($theta / 2);
-		$d2 = sin($theta / 2);
-		$r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
-
-		if ($parsedComplex['suffix'] == '') {
-			return self::COMPLEX($d1 * $r,$d2 * $r);
-		} else {
-			return self::COMPLEX($d1 * $r,$d2 * $r,$parsedComplex['suffix']);
-		}
-	}	//	function IMSQRT()
-
-
-	/**
-	 * IMLN
-	 *
-	 * Returns the natural logarithm of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMLN(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the natural logarithm.
-	 * @return	string
-	 */
-	public static function IMLN($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
-		$t = self::IMARGUMENT($complexNumber);
-
-		if ($parsedComplex['suffix'] == '') {
-			return self::COMPLEX($logR,$t);
-		} else {
-			return self::COMPLEX($logR,$t,$parsedComplex['suffix']);
-		}
-	}	//	function IMLN()
-
-
-	/**
-	 * IMLOG10
-	 *
-	 * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMLOG10(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the common logarithm.
-	 * @return	string
-	 */
-	public static function IMLOG10($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return log10($parsedComplex['real']);
-		}
-
-		return self::IMPRODUCT(log10(EULER),self::IMLN($complexNumber));
-	}	//	function IMLOG10()
-
-
-	/**
-	 * IMLOG2
-	 *
-	 * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMLOG2(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the base-2 logarithm.
-	 * @return	string
-	 */
-	public static function IMLOG2($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return log($parsedComplex['real'],2);
-		}
-
-		return self::IMPRODUCT(log(EULER,2),self::IMLN($complexNumber));
-	}	//	function IMLOG2()
-
-
-	/**
-	 * IMEXP
-	 *
-	 * Returns the exponential of a complex number in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMEXP(complexNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number for which you want the exponential.
-	 * @return	string
-	 */
-	public static function IMEXP($complexNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
-			return '1';
-		}
-
-		$e = exp($parsedComplex['real']);
-		$eX = $e * cos($parsedComplex['imaginary']);
-		$eY = $e * sin($parsedComplex['imaginary']);
-
-		if ($parsedComplex['suffix'] == '') {
-			return self::COMPLEX($eX,$eY);
-		} else {
-			return self::COMPLEX($eX,$eY,$parsedComplex['suffix']);
-		}
-	}	//	function IMEXP()
-
-
-	/**
-	 * IMPOWER
-	 *
-	 * Returns a complex number in x + yi or x + yj text format raised to a power.
-	 *
-	 * Excel Function:
-	 *		IMPOWER(complexNumber,realNumber)
-	 *
-	 * @param	string		$complexNumber	The complex number you want to raise to a power.
-	 * @param	float		$realNumber		The power to which you want to raise the complex number.
-	 * @return	string
-	 */
-	public static function IMPOWER($complexNumber,$realNumber) {
-		$complexNumber	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-		$realNumber		= PHPExcel_Calculation_Functions::flattenSingleValue($realNumber);
-
-		if (!is_numeric($realNumber)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		$parsedComplex = self::_parseComplex($complexNumber);
-
-		$r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']));
-		$rPower = pow($r,$realNumber);
-		$theta = self::IMARGUMENT($complexNumber) * $realNumber;
-		if ($theta == 0) {
-			return 1;
-		} elseif ($parsedComplex['imaginary'] == 0.0) {
-			return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']);
-		} else {
-			return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']);
-		}
-	}	//	function IMPOWER()
-
-
-	/**
-	 * IMDIV
-	 *
-	 * Returns the quotient of two complex numbers in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMDIV(complexDividend,complexDivisor)
-	 *
-	 * @param	string		$complexDividend	The complex numerator or dividend.
-	 * @param	string		$complexDivisor		The complex denominator or divisor.
-	 * @return	string
-	 */
-	public static function IMDIV($complexDividend,$complexDivisor) {
-		$complexDividend	= PHPExcel_Calculation_Functions::flattenSingleValue($complexDividend);
-		$complexDivisor	= PHPExcel_Calculation_Functions::flattenSingleValue($complexDivisor);
-
-		$parsedComplexDividend = self::_parseComplex($complexDividend);
-		$parsedComplexDivisor = self::_parseComplex($complexDivisor);
-
-		if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') &&
-			($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) {
-			$parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix'];
-		}
-
-		$d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']);
-		$d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']);
-		$d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']);
-
-		$r = $d1/$d3;
-		$i = $d2/$d3;
-
-		if ($i > 0.0) {
-			return self::_cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']);
-		} elseif ($i < 0.0) {
-			return self::_cleanComplex($r.$i.$parsedComplexDivisor['suffix']);
-		} else {
-			return $r;
-		}
-	}	//	function IMDIV()
-
-
-	/**
-	 * IMSUB
-	 *
-	 * Returns the difference of two complex numbers in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMSUB(complexNumber1,complexNumber2)
-	 *
-	 * @param	string		$complexNumber1		The complex number from which to subtract complexNumber2.
-	 * @param	string		$complexNumber2		The complex number to subtract from complexNumber1.
-	 * @return	string
-	 */
-	public static function IMSUB($complexNumber1,$complexNumber2) {
-		$complexNumber1	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber1);
-		$complexNumber2	= PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber2);
-
-		$parsedComplex1 = self::_parseComplex($complexNumber1);
-		$parsedComplex2 = self::_parseComplex($complexNumber2);
-
-		if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) &&
-			($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) {
-			$parsedComplex1['suffix'] = $parsedComplex2['suffix'];
-		}
-
-		$d1 = $parsedComplex1['real'] - $parsedComplex2['real'];
-		$d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary'];
-
-		return self::COMPLEX($d1,$d2,$parsedComplex1['suffix']);
-	}	//	function IMSUB()
-
-
-	/**
-	 * IMSUM
-	 *
-	 * Returns the sum of two or more complex numbers in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMSUM(complexNumber[,complexNumber[,...]])
-	 *
-	 * @param	string		$complexNumber,...	Series of complex numbers to add
-	 * @return	string
-	 */
-	public static function IMSUM() {
-		// Return value
-		$returnValue = self::_parseComplex('0');
-		$activeSuffix = '';
-
-		// Loop through the arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			$parsedComplex = self::_parseComplex($arg);
-
-			if ($activeSuffix == '') {
-				$activeSuffix = $parsedComplex['suffix'];
-			} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-
-			$returnValue['real'] += $parsedComplex['real'];
-			$returnValue['imaginary'] += $parsedComplex['imaginary'];
-		}
-
-		if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
-		return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
-	}	//	function IMSUM()
-
-
-	/**
-	 * IMPRODUCT
-	 *
-	 * Returns the product of two or more complex numbers in x + yi or x + yj text format.
-	 *
-	 * Excel Function:
-	 *		IMPRODUCT(complexNumber[,complexNumber[,...]])
-	 *
-	 * @param	string		$complexNumber,...	Series of complex numbers to multiply
-	 * @return	string
-	 */
-	public static function IMPRODUCT() {
-		// Return value
-		$returnValue = self::_parseComplex('1');
-		$activeSuffix = '';
-
-		// Loop through the arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			$parsedComplex = self::_parseComplex($arg);
-
-			$workValue = $returnValue;
-			if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) {
-				$activeSuffix = $parsedComplex['suffix'];
-			} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']);
-			$returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']);
-		}
-
-		if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
-		return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
-	}	//	function IMPRODUCT()
-
-
-	/**
-	 *	DELTA
-	 *
-	 *	Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.
-	 *	Use this function to filter a set of values. For example, by summing several DELTA
-	 *	functions you calculate the count of equal pairs. This function is also known as the
-	 *	Kronecker Delta function.
-	 *
-	 *	Excel Function:
-	 *		DELTA(a[,b])
-	 *
-	 *	@param	float		$a	The first number.
-	 *	@param	float		$b	The second number. If omitted, b is assumed to be zero.
-	 *	@return	int
-	 */
-	public static function DELTA($a, $b=0) {
-		$a	= PHPExcel_Calculation_Functions::flattenSingleValue($a);
-		$b	= PHPExcel_Calculation_Functions::flattenSingleValue($b);
-
-		return (int) ($a == $b);
-	}	//	function DELTA()
-
-
-	/**
-	 *	GESTEP
-	 *
-	 *	Excel Function:
-	 *		GESTEP(number[,step])
-	 *
-	 *	Returns 1 if number >= step; returns 0 (zero) otherwise
-	 *	Use this function to filter a set of values. For example, by summing several GESTEP
-	 *	functions you calculate the count of values that exceed a threshold.
-	 *
-	 *	@param	float		$number		The value to test against step.
-	 *	@param	float		$step		The threshold value.
-	 *									If you omit a value for step, GESTEP uses zero.
-	 *	@return	int
-	 */
-	public static function GESTEP($number, $step=0) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$step	= PHPExcel_Calculation_Functions::flattenSingleValue($step);
-
-		return (int) ($number >= $step);
-	}	//	function GESTEP()
-
-
-	//
-	//	Private method to calculate the erf value
-	//
-	private static $_two_sqrtpi = 1.128379167095512574;
-
-	public static function _erfVal($x) {
-		if (abs($x) > 2.2) {
-			return 1 - self::_erfcVal($x);
-		}
-		$sum = $term = $x;
-		$xsqr = ($x * $x);
-		$j = 1;
-		do {
-			$term *= $xsqr / $j;
-			$sum -= $term / (2 * $j + 1);
-			++$j;
-			$term *= $xsqr / $j;
-			$sum += $term / (2 * $j + 1);
-			++$j;
-			if ($sum == 0.0) {
-				break;
-			}
-		} while (abs($term / $sum) > PRECISION);
-		return self::$_two_sqrtpi * $sum;
-	}	//	function _erfVal()
-
-
-	/**
-	 *	ERF
-	 *
-	 *	Returns the error function integrated between the lower and upper bound arguments.
-	 *
-	 *	Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments,
-	 *			the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
-	 *			improved, so that it can now calculate the function for both positive and negative ranges.
-	 *			PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
-	 *
-	 *	Excel Function:
-	 *		ERF(lower[,upper])
-	 *
-	 *	@param	float		$lower	lower bound for integrating ERF
-	 *	@param	float		$upper	upper bound for integrating ERF.
-	 *								If omitted, ERF integrates between zero and lower_limit
-	 *	@return	float
-	 */
-	public static function ERF($lower, $upper = NULL) {
-		$lower	= PHPExcel_Calculation_Functions::flattenSingleValue($lower);
-		$upper	= PHPExcel_Calculation_Functions::flattenSingleValue($upper);
-
-		if (is_numeric($lower)) {
-			if (is_null($upper)) {
-				return self::_erfVal($lower);
-			}
-			if (is_numeric($upper)) {
-				return self::_erfVal($upper) - self::_erfVal($lower);
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ERF()
-
-
-	//
-	//	Private method to calculate the erfc value
-	//
-	private static $_one_sqrtpi = 0.564189583547756287;
-
-	private static function _erfcVal($x) {
-		if (abs($x) < 2.2) {
-			return 1 - self::_erfVal($x);
-		}
-		if ($x < 0) {
-			return 2 - self::ERFC(-$x);
-		}
-		$a = $n = 1;
-		$b = $c = $x;
-		$d = ($x * $x) + 0.5;
-		$q1 = $q2 = $b / $d;
-		$t = 0;
-		do {
-			$t = $a * $n + $b * $x;
-			$a = $b;
-			$b = $t;
-			$t = $c * $n + $d * $x;
-			$c = $d;
-			$d = $t;
-			$n += 0.5;
-			$q1 = $q2;
-			$q2 = $b / $d;
-		} while ((abs($q1 - $q2) / $q2) > PRECISION);
-		return self::$_one_sqrtpi * exp(-$x * $x) * $q2;
-	}	//	function _erfcVal()
-
-
-	/**
-	 *	ERFC
-	 *
-	 *	Returns the complementary ERF function integrated between x and infinity
-	 *
-	 *	Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument,
-	 *		the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
-	 *		improved, so that it can now calculate the function for both positive and negative x values.
-	 *			PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
-	 *
-	 *	Excel Function:
-	 *		ERFC(x)
-	 *
-	 *	@param	float	$x	The lower bound for integrating ERFC
-	 *	@return	float
-	 */
-	public static function ERFC($x) {
-		$x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
-		if (is_numeric($x)) {
-			return self::_erfcVal($x);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ERFC()
-
-
-	/**
-	 *	getConversionGroups
-	 *	Returns a list of the different conversion groups for UOM conversions
-	 *
-	 *	@return	array
-	 */
-	public static function getConversionGroups() {
-		$conversionGroups = array();
-		foreach(self::$_conversionUnits as $conversionUnit) {
-			$conversionGroups[] = $conversionUnit['Group'];
-		}
-		return array_merge(array_unique($conversionGroups));
-	}	//	function getConversionGroups()
-
-
-	/**
-	 *	getConversionGroupUnits
-	 *	Returns an array of units of measure, for a specified conversion group, or for all groups
-	 *
-	 *	@param	string	$group	The group whose units of measure you want to retrieve
-	 *	@return	array
-	 */
-	public static function getConversionGroupUnits($group = NULL) {
-		$conversionGroups = array();
-		foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) {
-			if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
-				$conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
-			}
-		}
-		return $conversionGroups;
-	}	//	function getConversionGroupUnits()
-
-
-	/**
-	 *	getConversionGroupUnitDetails
-	 *
-	 *	@param	string	$group	The group whose units of measure you want to retrieve
-	 *	@return	array
-	 */
-	public static function getConversionGroupUnitDetails($group = NULL) {
-		$conversionGroups = array();
-		foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) {
-			if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
-				$conversionGroups[$conversionGroup['Group']][] = array(	'unit'			=> $conversionUnit,
-																		'description'	=> $conversionGroup['Unit Name']
-																	  );
-			}
-		}
-		return $conversionGroups;
-	}	//	function getConversionGroupUnitDetails()
-
-
-	/**
-	 *	getConversionMultipliers
-	 *	Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
-	 *
-	 *	@return	array of mixed
-	 */
-	public static function getConversionMultipliers() {
-		return self::$_conversionMultipliers;
-	}	//	function getConversionGroups()
-
-
-	/**
-	 *	CONVERTUOM
-	 *
-	 *	Converts a number from one measurement system to another.
-	 *	For example, CONVERT can translate a table of distances in miles to a table of distances
-	 *	in kilometers.
-	 *
-	 *	Excel Function:
-	 *		CONVERT(value,fromUOM,toUOM)
-	 *
-	 *	@param	float		$value		The value in fromUOM to convert.
-	 *	@param	string		$fromUOM	The units for value.
-	 *	@param	string		$toUOM		The units for the result.
-	 *
-	 *	@return	float
-	 */
-	public static function CONVERTUOM($value, $fromUOM, $toUOM) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$fromUOM	= PHPExcel_Calculation_Functions::flattenSingleValue($fromUOM);
-		$toUOM		= PHPExcel_Calculation_Functions::flattenSingleValue($toUOM);
-
-		if (!is_numeric($value)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$fromMultiplier = 1.0;
-		if (isset(self::$_conversionUnits[$fromUOM])) {
-			$unitGroup1 = self::$_conversionUnits[$fromUOM]['Group'];
-		} else {
-			$fromMultiplier = substr($fromUOM,0,1);
-			$fromUOM = substr($fromUOM,1);
-			if (isset(self::$_conversionMultipliers[$fromMultiplier])) {
-				$fromMultiplier = self::$_conversionMultipliers[$fromMultiplier]['multiplier'];
-			} else {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			if ((isset(self::$_conversionUnits[$fromUOM])) && (self::$_conversionUnits[$fromUOM]['AllowPrefix'])) {
-				$unitGroup1 = self::$_conversionUnits[$fromUOM]['Group'];
-			} else {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-		}
-		$value *= $fromMultiplier;
-
-		$toMultiplier = 1.0;
-		if (isset(self::$_conversionUnits[$toUOM])) {
-			$unitGroup2 = self::$_conversionUnits[$toUOM]['Group'];
-		} else {
-			$toMultiplier = substr($toUOM,0,1);
-			$toUOM = substr($toUOM,1);
-			if (isset(self::$_conversionMultipliers[$toMultiplier])) {
-				$toMultiplier = self::$_conversionMultipliers[$toMultiplier]['multiplier'];
-			} else {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			if ((isset(self::$_conversionUnits[$toUOM])) && (self::$_conversionUnits[$toUOM]['AllowPrefix'])) {
-				$unitGroup2 = self::$_conversionUnits[$toUOM]['Group'];
-			} else {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-		}
-		if ($unitGroup1 != $unitGroup2) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		if (($fromUOM == $toUOM) && ($fromMultiplier == $toMultiplier)) {
-			//	We've already factored $fromMultiplier into the value, so we need
-			//		to reverse it again
-			return $value / $fromMultiplier;
-		} elseif ($unitGroup1 == 'Temperature') {
-			if (($fromUOM == 'F') || ($fromUOM == 'fah')) {
-				if (($toUOM == 'F') || ($toUOM == 'fah')) {
-					return $value;
-				} else {
-					$value = (($value - 32) / 1.8);
-					if (($toUOM == 'K') || ($toUOM == 'kel')) {
-						$value += 273.15;
-					}
-					return $value;
-				}
-			} elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) &&
-					  (($toUOM == 'K') || ($toUOM == 'kel'))) {
-						return $value;
-			} elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) &&
-					  (($toUOM == 'C') || ($toUOM == 'cel'))) {
-					return $value;
-			}
-			if (($toUOM == 'F') || ($toUOM == 'fah')) {
-				if (($fromUOM == 'K') || ($fromUOM == 'kel')) {
-					$value -= 273.15;
-				}
-				return ($value * 1.8) + 32;
-			}
-			if (($toUOM == 'C') || ($toUOM == 'cel')) {
-				return $value - 273.15;
-			}
-			return $value + 273.15;
-		}
-		return ($value * self::$_unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier;
-	}	//	function CONVERTUOM()
-
-}	//	class PHPExcel_Calculation_Engineering

+ 0 - 52
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Exception.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Calculation_Exception
- *
- * @category   PHPExcel
- * @package    PHPExcel_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Exception extends PHPExcel_Exception {
-	/**
-	 * Error handler callback
-	 *
-	 * @param mixed $code
-	 * @param mixed $string
-	 * @param mixed $file
-	 * @param mixed $line
-	 * @param mixed $context
-	 */
-	public static function errorHandlerCallback($code, $string, $file, $line, $context) {
-		$e = new self($string, $code);
-		$e->line = $line;
-		$e->file = $file;
-		throw $e;
-	}
-}

+ 0 - 49
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/ExceptionHandler.php

@@ -1,49 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-/**
- * PHPExcel_Calculation_ExceptionHandler
- *
- * @category   PHPExcel
- * @package    PHPExcel_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_ExceptionHandler {
-	/**
-	 * Register errorhandler
-	 */
-	public function __construct() {
-		set_error_handler(array('PHPExcel_Calculation_Exception', 'errorHandlerCallback'), E_ALL);
-	}
-
-	/**
-	 * Unregister errorhandler
-	 */
-	public function __destruct() {
-		restore_error_handler();
-	}
-}

+ 0 - 2292
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php

@@ -1,2292 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/** FINANCIAL_MAX_ITERATIONS */
-define('FINANCIAL_MAX_ITERATIONS', 128);
-
-/** FINANCIAL_PRECISION */
-define('FINANCIAL_PRECISION', 1.0e-08);
-
-
-/**
- * PHPExcel_Calculation_Financial
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Financial {
-
-	/**
-	 * _lastDayOfMonth
-	 *
-	 * Returns a boolean TRUE/FALSE indicating if this date is the last date of the month
-	 *
-	 * @param	DateTime	$testDate	The date for testing
-	 * @return	boolean
-	 */
-	private static function _lastDayOfMonth($testDate)
-	{
-		return ($testDate->format('d') == $testDate->format('t'));
-	}	//	function _lastDayOfMonth()
-
-
-	/**
-	 * _firstDayOfMonth
-	 *
-	 * Returns a boolean TRUE/FALSE indicating if this date is the first date of the month
-	 *
-	 * @param	DateTime	$testDate	The date for testing
-	 * @return	boolean
-	 */
-	private static function _firstDayOfMonth($testDate)
-	{
-		return ($testDate->format('d') == 1);
-	}	//	function _firstDayOfMonth()
-
-
-	private static function _coupFirstPeriodDate($settlement, $maturity, $frequency, $next)
-	{
-		$months = 12 / $frequency;
-
-		$result = PHPExcel_Shared_Date::ExcelToPHPObject($maturity);
-		$eom = self::_lastDayOfMonth($result);
-
-		while ($settlement < PHPExcel_Shared_Date::PHPToExcel($result)) {
-			$result->modify('-'.$months.' months');
-		}
-		if ($next) {
-			$result->modify('+'.$months.' months');
-		}
-
-		if ($eom) {
-			$result->modify('-1 day');
-		}
-
-		return PHPExcel_Shared_Date::PHPToExcel($result);
-	}	//	function _coupFirstPeriodDate()
-
-
-	private static function _validFrequency($frequency)
-	{
-		if (($frequency == 1) || ($frequency == 2) || ($frequency == 4)) {
-			return true;
-		}
-		if ((PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) &&
-			(($frequency == 6) || ($frequency == 12))) {
-			return true;
-		}
-		return false;
-	}	//	function _validFrequency()
-
-
-	/**
-	 * _daysPerYear
-	 *
-	 * Returns the number of days in a specified year, as defined by the "basis" value
-	 *
-	 * @param	integer		$year	The year against which we're testing
-	 * @param   integer		$basis	The type of day count:
-	 *									0 or omitted US (NASD)	360
-	 *									1						Actual (365 or 366 in a leap year)
-	 *									2						360
-	 *									3						365
-	 *									4						European 360
-	 * @return	integer
-	 */
-	private static function _daysPerYear($year, $basis=0)
-	{
-		switch ($basis) {
-			case 0 :
-			case 2 :
-			case 4 :
-				$daysPerYear = 360;
-				break;
-			case 3 :
-				$daysPerYear = 365;
-				break;
-			case 1 :
-				$daysPerYear = (PHPExcel_Calculation_DateTime::_isLeapYear($year)) ? 366 : 365;
-				break;
-			default	:
-				return PHPExcel_Calculation_Functions::NaN();
-		}
-		return $daysPerYear;
-	}	//	function _daysPerYear()
-
-
-	private static function _interestAndPrincipal($rate=0, $per=0, $nper=0, $pv=0, $fv=0, $type=0)
-	{
-		$pmt = self::PMT($rate, $nper, $pv, $fv, $type);
-		$capital = $pv;
-		for ($i = 1; $i<= $per; ++$i) {
-			$interest = ($type && $i == 1) ? 0 : -$capital * $rate;
-			$principal = $pmt - $interest;
-			$capital += $principal;
-		}
-		return array($interest, $principal);
-	}	//	function _interestAndPrincipal()
-
-
-	/**
-	 * ACCRINT
-	 *
-	 * Returns the accrued interest for a security that pays periodic interest.
-	 *
-	 * Excel Function:
-	 *		ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	$issue			The security's issue date.
-	 * @param	mixed	$firstinterest	The security's first interest date.
-	 * @param	mixed	$settlement		The security's settlement date.
-	 *									The security settlement date is the date after the issue date
-	 *									when the security is traded to the buyer.
-	 * @param	float	$rate			The security's annual coupon rate.
-	 * @param	float	$par			The security's par value.
-	 *									If you omit par, ACCRINT uses $1,000.
-	 * @param	integer	$frequency		the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer	$basis			The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function ACCRINT($issue, $firstinterest, $settlement, $rate, $par=1000, $frequency=1, $basis=0)
-	{
-		$issue		= PHPExcel_Calculation_Functions::flattenSingleValue($issue);
-		$firstinterest	= PHPExcel_Calculation_Functions::flattenSingleValue($firstinterest);
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$rate		= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$par		= (is_null($par))		? 1000 :	PHPExcel_Calculation_Functions::flattenSingleValue($par);
-		$frequency	= (is_null($frequency))	? 1	: 		PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))		? 0	:		PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($rate)) && (is_numeric($par))) {
-			$rate	= (float) $rate;
-			$par	= (float) $par;
-			if (($rate <= 0) || ($par <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
-			if (!is_numeric($daysBetweenIssueAndSettlement)) {
-				//	return date error
-				return $daysBetweenIssueAndSettlement;
-			}
-
-			return $par * $rate * $daysBetweenIssueAndSettlement;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ACCRINT()
-
-
-	/**
-	 * ACCRINTM
-	 *
-	 * Returns the accrued interest for a security that pays interest at maturity.
-	 *
-	 * Excel Function:
-	 *		ACCRINTM(issue,settlement,rate[,par[,basis]])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	issue		The security's issue date.
-	 * @param	mixed	settlement	The security's settlement (or maturity) date.
-	 * @param	float	rate		The security's annual coupon rate.
-	 * @param	float	par			The security's par value.
-	 *									If you omit par, ACCRINT uses $1,000.
-	 * @param	integer	basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function ACCRINTM($issue, $settlement, $rate, $par=1000, $basis=0) {
-		$issue		= PHPExcel_Calculation_Functions::flattenSingleValue($issue);
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$rate		= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$par		= (is_null($par))	? 1000 :	PHPExcel_Calculation_Functions::flattenSingleValue($par);
-		$basis		= (is_null($basis))	? 0 :		PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($rate)) && (is_numeric($par))) {
-			$rate	= (float) $rate;
-			$par	= (float) $par;
-			if (($rate <= 0) || ($par <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
-			if (!is_numeric($daysBetweenIssueAndSettlement)) {
-				//	return date error
-				return $daysBetweenIssueAndSettlement;
-			}
-			return $par * $rate * $daysBetweenIssueAndSettlement;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ACCRINTM()
-
-
-	/**
-	 * AMORDEGRC
-	 *
-	 * Returns the depreciation for each accounting period.
-	 * This function is provided for the French accounting system. If an asset is purchased in
-	 * the middle of the accounting period, the prorated depreciation is taken into account.
-	 * The function is similar to AMORLINC, except that a depreciation coefficient is applied in
-	 * the calculation depending on the life of the assets.
-	 * This function will return the depreciation until the last period of the life of the assets
-	 * or until the cumulated value of depreciation is greater than the cost of the assets minus
-	 * the salvage value.
-	 *
-	 * Excel Function:
-	 *		AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	cost		The cost of the asset.
-	 * @param	mixed	purchased	Date of the purchase of the asset.
-	 * @param	mixed	firstPeriod	Date of the end of the first period.
-	 * @param	mixed	salvage		The salvage value at the end of the life of the asset.
-	 * @param	float	period		The period.
-	 * @param	float	rate		Rate of depreciation.
-	 * @param	integer	basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis=0) {
-		$cost			= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$purchased		= PHPExcel_Calculation_Functions::flattenSingleValue($purchased);
-		$firstPeriod	= PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod);
-		$salvage		= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$period			= floor(PHPExcel_Calculation_Functions::flattenSingleValue($period));
-		$rate			= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$basis			= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	The depreciation coefficients are:
-		//	Life of assets (1/rate)		Depreciation coefficient
-		//	Less than 3 years			1
-		//	Between 3 and 4 years		1.5
-		//	Between 5 and 6 years		2
-		//	More than 6 years			2.5
-		$fUsePer = 1.0 / $rate;
-		if ($fUsePer < 3.0) {
-			$amortiseCoeff = 1.0;
-		} elseif ($fUsePer < 5.0) {
-			$amortiseCoeff = 1.5;
-		} elseif ($fUsePer <= 6.0) {
-			$amortiseCoeff = 2.0;
-		} else {
-			$amortiseCoeff = 2.5;
-		}
-
-		$rate *= $amortiseCoeff;
-		$fNRate = round(PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis) * $rate * $cost,0);
-		$cost -= $fNRate;
-		$fRest = $cost - $salvage;
-
-		for ($n = 0; $n < $period; ++$n) {
-			$fNRate = round($rate * $cost,0);
-			$fRest -= $fNRate;
-
-			if ($fRest < 0.0) {
-				switch ($period - $n) {
-					case 0	:
-					case 1	: return round($cost * 0.5, 0);
-							  break;
-					default	: return 0.0;
-							  break;
-				}
-			}
-			$cost -= $fNRate;
-		}
-		return $fNRate;
-	}	//	function AMORDEGRC()
-
-
-	/**
-	 * AMORLINC
-	 *
-	 * Returns the depreciation for each accounting period.
-	 * This function is provided for the French accounting system. If an asset is purchased in
-	 * the middle of the accounting period, the prorated depreciation is taken into account.
-	 *
-	 * Excel Function:
-	 *		AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	cost		The cost of the asset.
-	 * @param	mixed	purchased	Date of the purchase of the asset.
-	 * @param	mixed	firstPeriod	Date of the end of the first period.
-	 * @param	mixed	salvage		The salvage value at the end of the life of the asset.
-	 * @param	float	period		The period.
-	 * @param	float	rate		Rate of depreciation.
-	 * @param	integer	basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis=0) {
-		$cost			= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$purchased		= PHPExcel_Calculation_Functions::flattenSingleValue($purchased);
-		$firstPeriod	= PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod);
-		$salvage		= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$period			= PHPExcel_Calculation_Functions::flattenSingleValue($period);
-		$rate			= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$basis			= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		$fOneRate = $cost * $rate;
-		$fCostDelta = $cost - $salvage;
-		//	Note, quirky variation for leap years on the YEARFRAC for this function
-		$purchasedYear = PHPExcel_Calculation_DateTime::YEAR($purchased);
-		$yearFrac = PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis);
-
-		if (($basis == 1) && ($yearFrac < 1) && (PHPExcel_Calculation_DateTime::_isLeapYear($purchasedYear))) {
-			$yearFrac *= 365 / 366;
-		}
-
-		$f0Rate = $yearFrac * $rate * $cost;
-		$nNumOfFullPeriods = intval(($cost - $salvage - $f0Rate) / $fOneRate);
-
-		if ($period == 0) {
-			return $f0Rate;
-		} elseif ($period <= $nNumOfFullPeriods) {
-			return $fOneRate;
-		} elseif ($period == ($nNumOfFullPeriods + 1)) {
-            return ($fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate);
-		} else {
-			return 0.0;
-		}
-	}	//	function AMORLINC()
-
-
-	/**
-	 * COUPDAYBS
-	 *
-	 * Returns the number of days from the beginning of the coupon period to the settlement date.
-	 *
-	 * Excel Function:
-	 *		COUPDAYBS(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function COUPDAYBS($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis);
-		$prev = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False);
-
-		return PHPExcel_Calculation_DateTime::YEARFRAC($prev, $settlement, $basis) * $daysPerYear;
-	}	//	function COUPDAYBS()
-
-
-	/**
-	 * COUPDAYS
-	 *
-	 * Returns the number of days in the coupon period that contains the settlement date.
-	 *
-	 * Excel Function:
-	 *		COUPDAYS(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function COUPDAYS($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		switch ($basis) {
-			case 3: // Actual/365
-					return 365 / $frequency;
-			case 1: // Actual/actual
-					if ($frequency == 1) {
-						$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($maturity),$basis);
-						return ($daysPerYear / $frequency);
-					} else {
-						$prev = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False);
-						$next = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True);
-						return ($next - $prev);
-					}
-			default: // US (NASD) 30/360, Actual/360 or European 30/360
-					return 360 / $frequency;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function COUPDAYS()
-
-
-	/**
-	 * COUPDAYSNC
-	 *
-	 * Returns the number of days from the settlement date to the next coupon date.
-	 *
-	 * Excel Function:
-	 *		COUPDAYSNC(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis);
-		$next = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True);
-
-		return PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $next, $basis) * $daysPerYear;
-	}	//	function COUPDAYSNC()
-
-
-	/**
-	 * COUPNCD
-	 *
-	 * Returns the next coupon date after the settlement date.
-	 *
-	 * Excel Function:
-	 *		COUPNCD(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function COUPNCD($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True);
-	}	//	function COUPNCD()
-
-
-	/**
-	 * COUPNUM
-	 *
-	 * Returns the number of coupons payable between the settlement date and maturity date,
-	 * rounded up to the nearest whole coupon.
-	 *
-	 * Excel Function:
-	 *		COUPNUM(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	integer
-	 */
-	public static function COUPNUM($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$settlement = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True);
-		$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis) * 365;
-
-		switch ($frequency) {
-			case 1: // annual payments
-					return ceil($daysBetweenSettlementAndMaturity / 360);
-			case 2: // half-yearly
-					return ceil($daysBetweenSettlementAndMaturity / 180);
-			case 4: // quarterly
-					return ceil($daysBetweenSettlementAndMaturity / 90);
-			case 6: // bimonthly
-					return ceil($daysBetweenSettlementAndMaturity / 60);
-			case 12: // monthly
-					return ceil($daysBetweenSettlementAndMaturity / 30);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function COUPNUM()
-
-
-	/**
-	 * COUPPCD
-	 *
-	 * Returns the previous coupon date before the settlement date.
-	 *
-	 * Excel Function:
-	 *		COUPPCD(settlement,maturity,frequency[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	frequency	the number of coupon payments per year.
-	 *									Valid frequency values are:
-	 *										1	Annual
-	 *										2	Semi-Annual
-	 *										4	Quarterly
-	 *									If working in Gnumeric Mode, the following frequency options are
-	 *									also available
-	 *										6	Bimonthly
-	 *										12	Monthly
-	 * @param	integer		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	mixed	Excel date/time serial value, PHP date/time serial value or PHP date/time object,
-	 *						depending on the value of the ReturnDateType flag
-	 */
-	public static function COUPPCD($settlement, $maturity, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False);
-	}	//	function COUPPCD()
-
-
-	/**
-	 * CUMIPMT
-	 *
-	 * Returns the cumulative interest paid on a loan between the start and end periods.
-	 *
-	 * Excel Function:
-	 *		CUMIPMT(rate,nper,pv,start,end[,type])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$rate	The Interest rate
-	 * @param	integer	$nper	The total number of payment periods
-	 * @param	float	$pv		Present Value
-	 * @param	integer	$start	The first period in the calculation.
-	 *							Payment periods are numbered beginning with 1.
-	 * @param	integer	$end	The last period in the calculation.
-	 * @param	integer	$type	A number 0 or 1 and indicates when payments are due:
-	 *								0 or omitted	At the end of the period.
-	 *								1				At the beginning of the period.
-	 * @return	float
-	 */
-	public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$nper	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$start	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($start);
-		$end	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($end);
-		$type	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($start < 1 || $start > $end) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Calculate
-		$interest = 0;
-		for ($per = $start; $per <= $end; ++$per) {
-			$interest += self::IPMT($rate, $per, $nper, $pv, 0, $type);
-		}
-
-		return $interest;
-	}	//	function CUMIPMT()
-
-
-	/**
-	 * CUMPRINC
-	 *
-	 * Returns the cumulative principal paid on a loan between the start and end periods.
-	 *
-	 * Excel Function:
-	 *		CUMPRINC(rate,nper,pv,start,end[,type])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$rate	The Interest rate
-	 * @param	integer	$nper	The total number of payment periods
-	 * @param	float	$pv		Present Value
-	 * @param	integer	$start	The first period in the calculation.
-	 *							Payment periods are numbered beginning with 1.
-	 * @param	integer	$end	The last period in the calculation.
-	 * @param	integer	$type	A number 0 or 1 and indicates when payments are due:
-	 *								0 or omitted	At the end of the period.
-	 *								1				At the beginning of the period.
-	 * @return	float
-	 */
-	public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$nper	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$start	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($start);
-		$end	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($end);
-		$type	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($start < 1 || $start > $end) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Calculate
-		$principal = 0;
-		for ($per = $start; $per <= $end; ++$per) {
-			$principal += self::PPMT($rate, $per, $nper, $pv, 0, $type);
-		}
-
-		return $principal;
-	}	//	function CUMPRINC()
-
-
-	/**
-	 * DB
-	 *
-	 * Returns the depreciation of an asset for a specified period using the
-	 * fixed-declining balance method.
-	 * This form of depreciation is used if you want to get a higher depreciation value
-	 * at the beginning of the depreciation (as opposed to linear depreciation). The
-	 * depreciation value is reduced with every depreciation period by the depreciation
-	 * already deducted from the initial cost.
-	 *
-	 * Excel Function:
-	 *		DB(cost,salvage,life,period[,month])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	cost		Initial cost of the asset.
-	 * @param	float	salvage		Value at the end of the depreciation.
-	 *								(Sometimes called the salvage value of the asset)
-	 * @param	integer	life		Number of periods over which the asset is depreciated.
-	 *								(Sometimes called the useful life of the asset)
-	 * @param	integer	period		The period for which you want to calculate the
-	 *								depreciation. Period must use the same units as life.
-	 * @param	integer	month		Number of months in the first year. If month is omitted,
-	 *								it defaults to 12.
-	 * @return	float
-	 */
-	public static function DB($cost, $salvage, $life, $period, $month=12) {
-		$cost		= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$salvage	= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$life		= PHPExcel_Calculation_Functions::flattenSingleValue($life);
-		$period		= PHPExcel_Calculation_Functions::flattenSingleValue($period);
-		$month		= PHPExcel_Calculation_Functions::flattenSingleValue($month);
-
-		//	Validate
-		if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($month))) {
-			$cost		= (float) $cost;
-			$salvage	= (float) $salvage;
-			$life		= (int) $life;
-			$period		= (int) $period;
-			$month		= (int) $month;
-			if ($cost == 0) {
-				return 0.0;
-			} elseif (($cost < 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($month < 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			//	Set Fixed Depreciation Rate
-			$fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life));
-			$fixedDepreciationRate = round($fixedDepreciationRate, 3);
-
-			//	Loop through each period calculating the depreciation
-			$previousDepreciation = 0;
-			for ($per = 1; $per <= $period; ++$per) {
-				if ($per == 1) {
-					$depreciation = $cost * $fixedDepreciationRate * $month / 12;
-				} elseif ($per == ($life + 1)) {
-					$depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate * (12 - $month) / 12;
-				} else {
-					$depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate;
-				}
-				$previousDepreciation += $depreciation;
-			}
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				$depreciation = round($depreciation,2);
-			}
-			return $depreciation;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function DB()
-
-
-	/**
-	 * DDB
-	 *
-	 * Returns the depreciation of an asset for a specified period using the
-	 * double-declining balance method or some other method you specify.
-	 *
-	 * Excel Function:
-	 *		DDB(cost,salvage,life,period[,factor])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	cost		Initial cost of the asset.
-	 * @param	float	salvage		Value at the end of the depreciation.
-	 *								(Sometimes called the salvage value of the asset)
-	 * @param	integer	life		Number of periods over which the asset is depreciated.
-	 *								(Sometimes called the useful life of the asset)
-	 * @param	integer	period		The period for which you want to calculate the
-	 *								depreciation. Period must use the same units as life.
-	 * @param	float	factor		The rate at which the balance declines.
-	 *								If factor is omitted, it is assumed to be 2 (the
-	 *								double-declining balance method).
-	 * @return	float
-	 */
-	public static function DDB($cost, $salvage, $life, $period, $factor=2.0) {
-		$cost		= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$salvage	= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$life		= PHPExcel_Calculation_Functions::flattenSingleValue($life);
-		$period		= PHPExcel_Calculation_Functions::flattenSingleValue($period);
-		$factor		= PHPExcel_Calculation_Functions::flattenSingleValue($factor);
-
-		//	Validate
-		if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($factor))) {
-			$cost		= (float) $cost;
-			$salvage	= (float) $salvage;
-			$life		= (int) $life;
-			$period		= (int) $period;
-			$factor		= (float) $factor;
-			if (($cost <= 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($factor <= 0.0) || ($period > $life)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			//	Set Fixed Depreciation Rate
-			$fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life));
-			$fixedDepreciationRate = round($fixedDepreciationRate, 3);
-
-			//	Loop through each period calculating the depreciation
-			$previousDepreciation = 0;
-			for ($per = 1; $per <= $period; ++$per) {
-				$depreciation = min( ($cost - $previousDepreciation) * ($factor / $life), ($cost - $salvage - $previousDepreciation) );
-				$previousDepreciation += $depreciation;
-			}
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				$depreciation = round($depreciation,2);
-			}
-			return $depreciation;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function DDB()
-
-
-	/**
-	 * DISC
-	 *
-	 * Returns the discount rate for a security.
-	 *
-	 * Excel Function:
-	 *		DISC(settlement,maturity,price,redemption[,basis])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue
-	 *								date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	integer	price		The security's price per $100 face value.
-	 * @param	integer	redemption	The security's redemption value per $100 face value.
-	 * @param	integer	basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function DISC($settlement, $maturity, $price, $redemption, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$price		= PHPExcel_Calculation_Functions::flattenSingleValue($price);
-		$redemption	= PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
-		$basis		= PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) {
-			$price		= (float) $price;
-			$redemption	= (float) $redemption;
-			$basis		= (int) $basis;
-			if (($price <= 0) || ($redemption <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-
-			return ((1 - $price / $redemption) / $daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function DISC()
-
-
-	/**
-	 * DOLLARDE
-	 *
-	 * Converts a dollar price expressed as an integer part and a fraction
-	 *		part into a dollar price expressed as a decimal number.
-	 * Fractional dollar numbers are sometimes used for security prices.
-	 *
-	 * Excel Function:
-	 *		DOLLARDE(fractional_dollar,fraction)
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$fractional_dollar	Fractional Dollar
-	 * @param	integer	$fraction			Fraction
-	 * @return	float
-	 */
-	public static function DOLLARDE($fractional_dollar = Null, $fraction = 0) {
-		$fractional_dollar	= PHPExcel_Calculation_Functions::flattenSingleValue($fractional_dollar);
-		$fraction			= (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction);
-
-		// Validate parameters
-		if (is_null($fractional_dollar) || $fraction < 0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($fraction == 0) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$dollars = floor($fractional_dollar);
-		$cents = fmod($fractional_dollar,1);
-		$cents /= $fraction;
-		$cents *= pow(10,ceil(log10($fraction)));
-		return $dollars + $cents;
-	}	//	function DOLLARDE()
-
-
-	/**
-	 * DOLLARFR
-	 *
-	 * Converts a dollar price expressed as a decimal number into a dollar price
-	 *		expressed as a fraction.
-	 * Fractional dollar numbers are sometimes used for security prices.
-	 *
-	 * Excel Function:
-	 *		DOLLARFR(decimal_dollar,fraction)
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$decimal_dollar		Decimal Dollar
-	 * @param	integer	$fraction			Fraction
-	 * @return	float
-	 */
-	public static function DOLLARFR($decimal_dollar = Null, $fraction = 0) {
-		$decimal_dollar	= PHPExcel_Calculation_Functions::flattenSingleValue($decimal_dollar);
-		$fraction		= (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction);
-
-		// Validate parameters
-		if (is_null($decimal_dollar) || $fraction < 0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($fraction == 0) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$dollars = floor($decimal_dollar);
-		$cents = fmod($decimal_dollar,1);
-		$cents *= $fraction;
-		$cents *= pow(10,-ceil(log10($fraction)));
-		return $dollars + $cents;
-	}	//	function DOLLARFR()
-
-
-	/**
-	 * EFFECT
-	 *
-	 * Returns the effective interest rate given the nominal rate and the number of
-	 *		compounding payments per year.
-	 *
-	 * Excel Function:
-	 *		EFFECT(nominal_rate,npery)
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$nominal_rate		Nominal interest rate
-	 * @param	integer	$npery				Number of compounding payments per year
-	 * @return	float
-	 */
-	public static function EFFECT($nominal_rate = 0, $npery = 0) {
-		$nominal_rate	= PHPExcel_Calculation_Functions::flattenSingleValue($nominal_rate);
-		$npery			= (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery);
-
-		// Validate parameters
-		if ($nominal_rate <= 0 || $npery < 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		return pow((1 + $nominal_rate / $npery), $npery) - 1;
-	}	//	function EFFECT()
-
-
-	/**
-	 * FV
-	 *
-	 * Returns the Future Value of a cash flow with constant payments and interest rate (annuities).
-	 *
-	 * Excel Function:
-	 *		FV(rate,nper,pmt[,pv[,type]])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	$rate	The interest rate per period
-	 * @param	int		$nper	Total number of payment periods in an annuity
-	 * @param	float	$pmt	The payment made each period: it cannot change over the
-	 *							life of the annuity. Typically, pmt contains principal
-	 *							and interest but no other fees or taxes.
-	 * @param	float	$pv		Present Value, or the lump-sum amount that a series of
-	 *							future payments is worth right now.
-	 * @param	integer	$type	A number 0 or 1 and indicates when payments are due:
-	 *								0 or omitted	At the end of the period.
-	 *								1				At the beginning of the period.
-	 * @return	float
-	 */
-	public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$nper	= PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pmt	= PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$type	= PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Calculate
-		if (!is_null($rate) && $rate != 0) {
-			return -$pv * pow(1 + $rate, $nper) - $pmt * (1 + $rate * $type) * (pow(1 + $rate, $nper) - 1) / $rate;
-		} else {
-			return -$pv - $pmt * $nper;
-		}
-	}	//	function FV()
-
-
-	/**
-	 * FVSCHEDULE
-	 *
-	 * Returns the future value of an initial principal after applying a series of compound interest rates.
-	 * Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
-	 *
-	 * Excel Function:
-	 *		FVSCHEDULE(principal,schedule)
-	 *
-	 * @param	float	$principal	The present value.
-	 * @param	float[]	$schedule	An array of interest rates to apply.
-	 * @return	float
-	 */
-	public static function FVSCHEDULE($principal, $schedule) {
-		$principal	= PHPExcel_Calculation_Functions::flattenSingleValue($principal);
-		$schedule	= PHPExcel_Calculation_Functions::flattenArray($schedule);
-
-		foreach($schedule as $rate) {
-			$principal *= 1 + $rate;
-		}
-
-		return $principal;
-	}	//	function FVSCHEDULE()
-
-
-	/**
-	 * INTRATE
-	 *
-	 * Returns the interest rate for a fully invested security.
-	 *
-	 * Excel Function:
-	 *		INTRATE(settlement,maturity,investment,redemption[,basis])
-	 *
-	 * @param	mixed	$settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	$maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	integer	$investment	The amount invested in the security.
-	 * @param	integer	$redemption	The amount to be received at maturity.
-	 * @param	integer	$basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$investment	= PHPExcel_Calculation_Functions::flattenSingleValue($investment);
-		$redemption	= PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
-		$basis		= PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($investment)) && (is_numeric($redemption)) && (is_numeric($basis))) {
-			$investment	= (float) $investment;
-			$redemption	= (float) $redemption;
-			$basis		= (int) $basis;
-			if (($investment <= 0) || ($redemption <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-
-			return (($redemption / $investment) - 1) / ($daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function INTRATE()
-
-
-	/**
-	 * IPMT
-	 *
-	 * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
-	 *
-	 * Excel Function:
-	 *		IPMT(rate,per,nper,pv[,fv][,type])
-	 *
-	 * @param	float	$rate	Interest rate per period
-	 * @param	int		$per	Period for which we want to find the interest
-	 * @param	int		$nper	Number of periods
-	 * @param	float	$pv		Present Value
-	 * @param	float	$fv		Future Value
-	 * @param	int		$type	Payment type: 0 = at the end of each period, 1 = at the beginning of each period
-	 * @return	float
-	 */
-	public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$per	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($per);
-		$nper	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$fv		= PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($per <= 0 || $per > $nper) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Calculate
-		$interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type);
-		return $interestAndPrincipal[0];
-	}	//	function IPMT()
-
-	/**
-	 * IRR
-	 *
-	 * Returns the internal rate of return for a series of cash flows represented by the numbers in values. 
-	 * These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur 
-	 * at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received
-	 * for an investment consisting of payments (negative values) and income (positive values) that occur at regular 
-	 * periods.
-	 *
-	 * Excel Function:
-	 *		IRR(values[,guess])
-	 *
-	 * @param	float[]	$values		An array or a reference to cells that contain numbers for which you want
-	 *									to calculate the internal rate of return.
-	 *								Values must contain at least one positive value and one negative value to 
-	 *									calculate the internal rate of return.
-	 * @param	float	$guess		A number that you guess is close to the result of IRR
-	 * @return	float
-	 */
-	public static function IRR($values, $guess = 0.1) {
-		if (!is_array($values)) return PHPExcel_Calculation_Functions::VALUE();
-		$values = PHPExcel_Calculation_Functions::flattenArray($values);
-		$guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess);
-
-		// create an initial range, with a root somewhere between 0 and guess
-		$x1 = 0.0;
-		$x2 = $guess;
-		$f1 = self::NPV($x1, $values);
-		$f2 = self::NPV($x2, $values);
-		for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
-			if (($f1 * $f2) < 0.0) break;
-			if (abs($f1) < abs($f2)) {
-				$f1 = self::NPV($x1 += 1.6 * ($x1 - $x2), $values);
-			} else {
-				$f2 = self::NPV($x2 += 1.6 * ($x2 - $x1), $values);
-			}
-		}
-		if (($f1 * $f2) > 0.0) return PHPExcel_Calculation_Functions::VALUE();
-
-		$f = self::NPV($x1, $values);
-		if ($f < 0.0) {
-			$rtb = $x1;
-			$dx = $x2 - $x1;
-		} else {
-			$rtb = $x2;
-			$dx = $x1 - $x2;
-		}
-
-		for ($i = 0;  $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
-			$dx *= 0.5;
-			$x_mid = $rtb + $dx;
-			$f_mid = self::NPV($x_mid, $values);
-			if ($f_mid <= 0.0) 
-				$rtb = $x_mid;
-			if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) 
-				return $x_mid;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function IRR()
-
-
-	/**
-	 * ISPMT
-	 *
-	 * Returns the interest payment for an investment based on an interest rate and a constant payment schedule.
-	 *
-	 * Excel Function:
-	 *     =ISPMT(interest_rate, period, number_payments, PV)
-	 *
-	 * interest_rate is the interest rate for the investment
-	 *
-	 * period is the period to calculate the interest rate.  It must be betweeen 1 and number_payments.
-	 *
-	 * number_payments is the number of payments for the annuity
-	 *
-	 * PV is the loan amount or present value of the payments
-	 */
-	public static function ISPMT() {
-		// Return value
-		$returnValue = 0;
-
-		// Get the parameters
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		$interestRate = array_shift($aArgs);
-		$period = array_shift($aArgs);
-		$numberPeriods = array_shift($aArgs);
-		$principleRemaining = array_shift($aArgs);
-
-		// Calculate
-		$principlePayment = ($principleRemaining * 1.0) / ($numberPeriods * 1.0);
-		for($i=0; $i <= $period; ++$i) {
-			$returnValue = $interestRate * $principleRemaining * -1;
-			$principleRemaining -= $principlePayment;
-			// principle needs to be 0 after the last payment, don't let floating point screw it up
-			if($i == $numberPeriods) {
-				$returnValue = 0;
-			}
-		}
-		return($returnValue);
-	}	//	function ISPMT()
-
-
-	/**
-	 * MIRR
-	 *
-	 * Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both 
-	 *		the cost of the investment and the interest received on reinvestment of cash.
-	 *
-	 * Excel Function:
-	 *		MIRR(values,finance_rate, reinvestment_rate)
-	 *
-	 * @param	float[]	$values				An array or a reference to cells that contain a series of payments and
-	 *											income occurring at regular intervals.
-	 *										Payments are negative value, income is positive values.
-	 * @param	float	$finance_rate		The interest rate you pay on the money used in the cash flows
-	 * @param	float	$reinvestment_rate	The interest rate you receive on the cash flows as you reinvest them
-	 * @return	float
-	 */
-	public static function MIRR($values, $finance_rate, $reinvestment_rate) {
-		if (!is_array($values)) return PHPExcel_Calculation_Functions::VALUE();
-		$values				= PHPExcel_Calculation_Functions::flattenArray($values);
-		$finance_rate		= PHPExcel_Calculation_Functions::flattenSingleValue($finance_rate);
-		$reinvestment_rate	= PHPExcel_Calculation_Functions::flattenSingleValue($reinvestment_rate);
-		$n = count($values);
-
-		$rr = 1.0 + $reinvestment_rate;
-		$fr = 1.0 + $finance_rate;
-
-		$npv_pos = $npv_neg = 0.0;
-		foreach($values as $i => $v) {
-			if ($v >= 0) {
-				$npv_pos += $v / pow($rr, $i);
-			} else {
-				$npv_neg += $v / pow($fr, $i);
-			}
-		}
-
-		if (($npv_neg == 0) || ($npv_pos == 0) || ($reinvestment_rate <= -1)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		$mirr = pow((-$npv_pos * pow($rr, $n))
-				/ ($npv_neg * ($rr)), (1.0 / ($n - 1))) - 1.0;
-
-		return (is_finite($mirr) ? $mirr : PHPExcel_Calculation_Functions::VALUE());
-	}	//	function MIRR()
-
-
-	/**
-	 * NOMINAL
-	 *
-	 * Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
-	 *
-	 * @param	float	$effect_rate	Effective interest rate
-	 * @param	int		$npery			Number of compounding payments per year
-	 * @return	float
-	 */
-	public static function NOMINAL($effect_rate = 0, $npery = 0) {
-		$effect_rate	= PHPExcel_Calculation_Functions::flattenSingleValue($effect_rate);
-		$npery			= (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery);
-
-		// Validate parameters
-		if ($effect_rate <= 0 || $npery < 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Calculate
-		return $npery * (pow($effect_rate + 1, 1 / $npery) - 1);
-	}	//	function NOMINAL()
-
-
-	/**
-	 * NPER
-	 *
-	 * Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
-	 *
-	 * @param	float	$rate	Interest rate per period
-	 * @param	int		$pmt	Periodic payment (annuity)
-	 * @param	float	$pv		Present Value
-	 * @param	float	$fv		Future Value
-	 * @param	int		$type	Payment type: 0 = at the end of each period, 1 = at the beginning of each period
-	 * @return	float
-	 */
-	public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$pmt	= PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$fv		= PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Calculate
-		if (!is_null($rate) && $rate != 0) {
-			if ($pmt == 0 && $pv == 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return log(($pmt * (1 + $rate * $type) / $rate - $fv) / ($pv + $pmt * (1 + $rate * $type) / $rate)) / log(1 + $rate);
-		} else {
-			if ($pmt == 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return (-$pv -$fv) / $pmt;
-		}
-	}	//	function NPER()
-
-	/**
-	 * NPV
-	 *
-	 * Returns the Net Present Value of a cash flow series given a discount rate.
-	 *
-	 * @return	float
-	 */
-	public static function NPV() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$rate = array_shift($aArgs);
-		for ($i = 1; $i <= count($aArgs); ++$i) {
-			// Is it a numeric value?
-			if (is_numeric($aArgs[$i - 1])) {
-				$returnValue += $aArgs[$i - 1] / pow(1 + $rate, $i);
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function NPV()
-
-	/**
-	 * PMT
-	 *
-	 * Returns the constant payment (annuity) for a cash flow with a constant interest rate.
-	 *
-	 * @param	float	$rate	Interest rate per period
-	 * @param	int		$nper	Number of periods
-	 * @param	float	$pv		Present Value
-	 * @param	float	$fv		Future Value
-	 * @param	int		$type	Payment type: 0 = at the end of each period, 1 = at the beginning of each period
-	 * @return	float
-	 */
-	public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$nper	= PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$fv		= PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Calculate
-		if (!is_null($rate) && $rate != 0) {
-			return (-$fv - $pv * pow(1 + $rate, $nper)) / (1 + $rate * $type) / ((pow(1 + $rate, $nper) - 1) / $rate);
-		} else {
-			return (-$pv - $fv) / $nper;
-		}
-	}	//	function PMT()
-
-
-	/**
-	 * PPMT
-	 *
-	 * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
-	 *
-	 * @param	float	$rate	Interest rate per period
-	 * @param	int		$per	Period for which we want to find the interest
-	 * @param	int		$nper	Number of periods
-	 * @param	float	$pv		Present Value
-	 * @param	float	$fv		Future Value
-	 * @param	int		$type	Payment type: 0 = at the end of each period, 1 = at the beginning of each period
-	 * @return	float
-	 */
-	public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$per	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($per);
-		$nper	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$fv		= PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		if ($per <= 0 || $per > $nper) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// Calculate
-		$interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type);
-		return $interestAndPrincipal[1];
-	}	//	function PPMT()
-
-
-	public static function PRICE($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$rate		= (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$yield		= (float) PHPExcel_Calculation_Functions::flattenSingleValue($yield);
-		$redemption	= (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
-		$frequency	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
-		$basis		= (is_null($basis))	? 0 :	(int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (($settlement > $maturity) ||
-			(!self::_validFrequency($frequency)) ||
-			(($basis < 0) || ($basis > 4))) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$dsc = self::COUPDAYSNC($settlement, $maturity, $frequency, $basis);
-		$e = self::COUPDAYS($settlement, $maturity, $frequency, $basis);
-		$n = self::COUPNUM($settlement, $maturity, $frequency, $basis);
-		$a = self::COUPDAYBS($settlement, $maturity, $frequency, $basis);
-
-		$baseYF	= 1.0 + ($yield / $frequency);
-		$rfp	= 100 * ($rate / $frequency);
-		$de	= $dsc / $e;
-
-		$result = $redemption / pow($baseYF, (--$n + $de));
-		for($k = 0; $k <= $n; ++$k) {
-			$result += $rfp / (pow($baseYF, ($k + $de)));
-		}
-		$result -= $rfp * ($a / $e);
-
-		return $result;
-	}	//	function PRICE()
-
-
-	/**
-	 * PRICEDISC
-	 *
-	 * Returns the price per $100 face value of a discounted security.
-	 *
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	int		discount	The security's discount rate.
-	 * @param	int		redemption	The security's redemption value per $100 face value.
-	 * @param	int		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$discount	= (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount);
-		$redemption	= (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
-		$basis		= (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($discount)) && (is_numeric($redemption)) && (is_numeric($basis))) {
-			if (($discount <= 0) || ($redemption <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-
-			return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function PRICEDISC()
-
-
-	/**
-	 * PRICEMAT
-	 *
-	 * Returns the price per $100 face value of a security that pays interest at maturity.
-	 *
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security's settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	issue		The security's issue date.
-	 * @param	int		rate		The security's interest rate at date of issue.
-	 * @param	int		yield		The security's annual yield.
-	 * @param	int		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$issue		= PHPExcel_Calculation_Functions::flattenSingleValue($issue);
-		$rate		= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$yield		= PHPExcel_Calculation_Functions::flattenSingleValue($yield);
-		$basis		= (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if (is_numeric($rate) && is_numeric($yield)) {
-			if (($rate <= 0) || ($yield <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis);
-			if (!is_numeric($daysPerYear)) {
-				return $daysPerYear;
-			}
-			$daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
-			if (!is_numeric($daysBetweenIssueAndSettlement)) {
-				//	return date error
-				return $daysBetweenIssueAndSettlement;
-			}
-			$daysBetweenIssueAndSettlement *= $daysPerYear;
-			$daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis);
-			if (!is_numeric($daysBetweenIssueAndMaturity)) {
-				//	return date error
-				return $daysBetweenIssueAndMaturity;
-			}
-			$daysBetweenIssueAndMaturity *= $daysPerYear;
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-			$daysBetweenSettlementAndMaturity *= $daysPerYear;
-
-			return ((100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) /
-				   (1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield)) -
-				   (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function PRICEMAT()
-
-
-	/**
-	 * PV
-	 *
-	 * Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
-	 *
-	 * @param	float	$rate	Interest rate per period
-	 * @param	int		$nper	Number of periods
-	 * @param	float	$pmt	Periodic payment (annuity)
-	 * @param	float	$fv		Future Value
-	 * @param	int		$type	Payment type: 0 = at the end of each period, 1 = at the beginning of each period
-	 * @return	float
-	 */
-	public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0) {
-		$rate	= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$nper	= PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pmt	= PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
-		$fv		= PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= PHPExcel_Calculation_Functions::flattenSingleValue($type);
-
-		// Validate parameters
-		if ($type != 0 && $type != 1) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		// Calculate
-		if (!is_null($rate) && $rate != 0) {
-			return (-$pmt * (1 + $rate * $type) * ((pow(1 + $rate, $nper) - 1) / $rate) - $fv) / pow(1 + $rate, $nper);
-		} else {
-			return -$fv - $pmt * $nper;
-		}
-	}	//	function PV()
-
-
-	/**
-	 * RATE
-	 *
-	 * Returns the interest rate per period of an annuity.
-	 * RATE is calculated by iteration and can have zero or more solutions.
-	 * If the successive results of RATE do not converge to within 0.0000001 after 20 iterations,
-	 * RATE returns the #NUM! error value.
-	 *
-	 * Excel Function:
-	 *		RATE(nper,pmt,pv[,fv[,type[,guess]]])
-	 *
-	 * @access	public
-	 * @category Financial Functions
-	 * @param	float	nper		The total number of payment periods in an annuity.
-	 * @param	float	pmt			The payment made each period and cannot change over the life
-	 *									of the annuity.
-	 *								Typically, pmt includes principal and interest but no other
-	 *									fees or taxes.
-	 * @param	float	pv			The present value - the total amount that a series of future
-	 *									payments is worth now.
-	 * @param	float	fv			The future value, or a cash balance you want to attain after
-	 *									the last payment is made. If fv is omitted, it is assumed
-	 *									to be 0 (the future value of a loan, for example, is 0).
-	 * @param	integer	type		A number 0 or 1 and indicates when payments are due:
-	 *										0 or omitted	At the end of the period.
-	 *										1				At the beginning of the period.
-	 * @param	float	guess		Your guess for what the rate will be.
-	 *									If you omit guess, it is assumed to be 10 percent.
-	 * @return	float
-	 **/
-	public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1) {
-		$nper	= (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
-		$pmt	= PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
-		$pv		= PHPExcel_Calculation_Functions::flattenSingleValue($pv);
-		$fv		= (is_null($fv))	? 0.0	:	PHPExcel_Calculation_Functions::flattenSingleValue($fv);
-		$type	= (is_null($type))	? 0		:	(int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
-		$guess	= (is_null($guess))	? 0.1	:	PHPExcel_Calculation_Functions::flattenSingleValue($guess);
-
-		$rate = $guess;
-		if (abs($rate) < FINANCIAL_PRECISION) {
-			$y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
-		} else {
-			$f = exp($nper * log(1 + $rate));
-			$y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
-		}
-		$y0 = $pv + $pmt * $nper + $fv;
-		$y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
-
-		// find root by secant method
-		$i  = $x0 = 0.0;
-		$x1 = $rate;
-		while ((abs($y0 - $y1) > FINANCIAL_PRECISION) && ($i < FINANCIAL_MAX_ITERATIONS)) {
-			$rate = ($y1 * $x0 - $y0 * $x1) / ($y1 - $y0);
-			$x0 = $x1;
-			$x1 = $rate;
-			if (($nper * abs($pmt)) > ($pv - $fv))
-				$x1 = abs($x1);
-
-			if (abs($rate) < FINANCIAL_PRECISION) {
-				$y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
-			} else {
-				$f = exp($nper * log(1 + $rate));
-				$y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
-			}
-
-			$y0 = $y1;
-			$y1 = $y;
-			++$i;
-		}
-		return $rate;
-	}	//	function RATE()
-
-
-	/**
-	 * RECEIVED
-	 *
-	 * Returns the price per $100 face value of a discounted security.
-	 *
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	int		investment	The amount invested in the security.
-	 * @param	int		discount	The security's discount rate.
-	 * @param	int		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$investment	= (float) PHPExcel_Calculation_Functions::flattenSingleValue($investment);
-		$discount	= (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount);
-		$basis		= (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if ((is_numeric($investment)) && (is_numeric($discount)) && (is_numeric($basis))) {
-			if (($investment <= 0) || ($discount <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-
-			return $investment / ( 1 - ($discount * $daysBetweenSettlementAndMaturity));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function RECEIVED()
-
-
-	/**
-	 * SLN
-	 *
-	 * Returns the straight-line depreciation of an asset for one period
-	 *
-	 * @param	cost		Initial cost of the asset
-	 * @param	salvage		Value at the end of the depreciation
-	 * @param	life		Number of periods over which the asset is depreciated
-	 * @return	float
-	 */
-	public static function SLN($cost, $salvage, $life) {
-		$cost		= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$salvage	= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$life		= PHPExcel_Calculation_Functions::flattenSingleValue($life);
-
-		// Calculate
-		if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life))) {
-			if ($life < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return ($cost - $salvage) / $life;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SLN()
-
-
-	/**
-	 * SYD
-	 *
-	 * Returns the sum-of-years' digits depreciation of an asset for a specified period.
-	 *
-	 * @param	cost		Initial cost of the asset
-	 * @param	salvage		Value at the end of the depreciation
-	 * @param	life		Number of periods over which the asset is depreciated
-	 * @param	period		Period
-	 * @return	float
-	 */
-	public static function SYD($cost, $salvage, $life, $period) {
-		$cost		= PHPExcel_Calculation_Functions::flattenSingleValue($cost);
-		$salvage	= PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
-		$life		= PHPExcel_Calculation_Functions::flattenSingleValue($life);
-		$period		= PHPExcel_Calculation_Functions::flattenSingleValue($period);
-
-		// Calculate
-		if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period))) {
-			if (($life < 1) || ($period > $life)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SYD()
-
-
-	/**
-	 * TBILLEQ
-	 *
-	 * Returns the bond-equivalent yield for a Treasury bill.
-	 *
-	 * @param	mixed	settlement	The Treasury bill's settlement date.
-	 *								The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
-	 * @param	mixed	maturity	The Treasury bill's maturity date.
-	 *								The maturity date is the date when the Treasury bill expires.
-	 * @param	int		discount	The Treasury bill's discount rate.
-	 * @return	float
-	 */
-	public static function TBILLEQ($settlement, $maturity, $discount) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$discount	= PHPExcel_Calculation_Functions::flattenSingleValue($discount);
-
-		//	Use TBILLPRICE for validation
-		$testValue = self::TBILLPRICE($settlement, $maturity, $discount);
-		if (is_string($testValue)) {
-			return $testValue;
-		}
-
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-			++$maturity;
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
-		} else {
-			$daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement));
-		}
-
-		return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity);
-	}	//	function TBILLEQ()
-
-
-	/**
-	 * TBILLPRICE
-	 *
-	 * Returns the yield for a Treasury bill.
-	 *
-	 * @param	mixed	settlement	The Treasury bill's settlement date.
-	 *								The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
-	 * @param	mixed	maturity	The Treasury bill's maturity date.
-	 *								The maturity date is the date when the Treasury bill expires.
-	 * @param	int		discount	The Treasury bill's discount rate.
-	 * @return	float
-	 */
-	public static function TBILLPRICE($settlement, $maturity, $discount) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$discount	= PHPExcel_Calculation_Functions::flattenSingleValue($discount);
-
-		if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		//	Validate
-		if (is_numeric($discount)) {
-			if ($discount <= 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				++$maturity;
-				$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
-				if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-					//	return date error
-					return $daysBetweenSettlementAndMaturity;
-				}
-			} else {
-				$daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement));
-			}
-
-			if ($daysBetweenSettlementAndMaturity > 360) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			$price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
-			if ($price <= 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return $price;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TBILLPRICE()
-
-
-	/**
-	 * TBILLYIELD
-	 *
-	 * Returns the yield for a Treasury bill.
-	 *
-	 * @param	mixed	settlement	The Treasury bill's settlement date.
-	 *								The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
-	 * @param	mixed	maturity	The Treasury bill's maturity date.
-	 *								The maturity date is the date when the Treasury bill expires.
-	 * @param	int		price		The Treasury bill's price per $100 face value.
-	 * @return	float
-	 */
-	public static function TBILLYIELD($settlement, $maturity, $price) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$price		= PHPExcel_Calculation_Functions::flattenSingleValue($price);
-
-		//	Validate
-		if (is_numeric($price)) {
-			if ($price <= 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				++$maturity;
-				$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
-				if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-					//	return date error
-					return $daysBetweenSettlementAndMaturity;
-				}
-			} else {
-				$daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement));
-			}
-
-			if ($daysBetweenSettlementAndMaturity > 360) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TBILLYIELD()
-
-
-	public static function XIRR($values, $dates, $guess = 0.1) {
-		if ((!is_array($values)) && (!is_array($dates))) return PHPExcel_Calculation_Functions::VALUE();
-		$values	= PHPExcel_Calculation_Functions::flattenArray($values);
-		$dates	= PHPExcel_Calculation_Functions::flattenArray($dates);
-		$guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess);
-		if (count($values) != count($dates)) return PHPExcel_Calculation_Functions::NaN();
-
-		// create an initial range, with a root somewhere between 0 and guess
-		$x1 = 0.0;
-		$x2 = $guess;
-		$f1 = self::XNPV($x1, $values, $dates);
-		$f2 = self::XNPV($x2, $values, $dates);
-		for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
-			if (($f1 * $f2) < 0.0) break;
-			if (abs($f1) < abs($f2)) {
-				$f1 = self::XNPV($x1 += 1.6 * ($x1 - $x2), $values, $dates);
-			} else {
-				$f2 = self::XNPV($x2 += 1.6 * ($x2 - $x1), $values, $dates);
-			}
-		}
-		if (($f1 * $f2) > 0.0) return PHPExcel_Calculation_Functions::VALUE();
-
-		$f = self::XNPV($x1, $values, $dates);
-		if ($f < 0.0) {
-			$rtb = $x1;
-			$dx = $x2 - $x1;
-		} else {
-			$rtb = $x2;
-			$dx = $x1 - $x2;
-		}
-
-		for ($i = 0;  $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
-			$dx *= 0.5;
-			$x_mid = $rtb + $dx;
-			$f_mid = self::XNPV($x_mid, $values, $dates);
-			if ($f_mid <= 0.0) $rtb = $x_mid;
-			if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) return $x_mid;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}
-
-
-	/**
-	 * XNPV
-	 *
-	 * Returns the net present value for a schedule of cash flows that is not necessarily periodic.
-	 * To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
-	 *
-	 * Excel Function:
-	 *		=XNPV(rate,values,dates)
-	 *
-	 * @param	float			$rate		The discount rate to apply to the cash flows.
-	 * @param	array of float	$values		A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.
-	 * @param	array of mixed	$dates		A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.
-	 * @return	float
-	 */
-	public static function XNPV($rate, $values, $dates) {
-		$rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		if (!is_numeric($rate)) return PHPExcel_Calculation_Functions::VALUE();
-		if ((!is_array($values)) || (!is_array($dates))) return PHPExcel_Calculation_Functions::VALUE();
-		$values	= PHPExcel_Calculation_Functions::flattenArray($values);
-		$dates	= PHPExcel_Calculation_Functions::flattenArray($dates);
-		$valCount = count($values);
-		if ($valCount != count($dates)) return PHPExcel_Calculation_Functions::NaN();
-		if ((min($values) > 0) || (max($values) < 0)) return PHPExcel_Calculation_Functions::VALUE();
-
-		$xnpv = 0.0;
-		for ($i = 0; $i < $valCount; ++$i) {
-			if (!is_numeric($values[$i])) return PHPExcel_Calculation_Functions::VALUE();
-			$xnpv += $values[$i] / pow(1 + $rate, PHPExcel_Calculation_DateTime::DATEDIF($dates[0],$dates[$i],'d') / 365);
-		}
-		return (is_finite($xnpv)) ? $xnpv : PHPExcel_Calculation_Functions::VALUE();
-	}	//	function XNPV()
-
-
-	/**
-	 * YIELDDISC
-	 *
-	 * Returns the annual yield of a security that pays interest at maturity.
-	 *
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security's settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	int		price		The security's price per $100 face value.
-	 * @param	int		redemption	The security's redemption value per $100 face value.
-	 * @param	int		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$price		= PHPExcel_Calculation_Functions::flattenSingleValue($price);
-		$redemption	= PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
-		$basis		= (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if (is_numeric($price) && is_numeric($redemption)) {
-			if (($price <= 0) || ($redemption <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis);
-			if (!is_numeric($daysPerYear)) {
-				return $daysPerYear;
-			}
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity,$basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-			$daysBetweenSettlementAndMaturity *= $daysPerYear;
-
-			return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function YIELDDISC()
-
-
-	/**
-	 * YIELDMAT
-	 *
-	 * Returns the annual yield of a security that pays interest at maturity.
-	 *
-	 * @param	mixed	settlement	The security's settlement date.
-	 *								The security's settlement date is the date after the issue date when the security is traded to the buyer.
-	 * @param	mixed	maturity	The security's maturity date.
-	 *								The maturity date is the date when the security expires.
-	 * @param	mixed	issue		The security's issue date.
-	 * @param	int		rate		The security's interest rate at date of issue.
-	 * @param	int		price		The security's price per $100 face value.
-	 * @param	int		basis		The type of day count to use.
-	 *										0 or omitted	US (NASD) 30/360
-	 *										1				Actual/actual
-	 *										2				Actual/360
-	 *										3				Actual/365
-	 *										4				European 30/360
-	 * @return	float
-	 */
-	public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis=0) {
-		$settlement	= PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
-		$maturity	= PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
-		$issue		= PHPExcel_Calculation_Functions::flattenSingleValue($issue);
-		$rate		= PHPExcel_Calculation_Functions::flattenSingleValue($rate);
-		$price		= PHPExcel_Calculation_Functions::flattenSingleValue($price);
-		$basis		= (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
-
-		//	Validate
-		if (is_numeric($rate) && is_numeric($price)) {
-			if (($rate <= 0) || ($price <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis);
-			if (!is_numeric($daysPerYear)) {
-				return $daysPerYear;
-			}
-			$daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
-			if (!is_numeric($daysBetweenIssueAndSettlement)) {
-				//	return date error
-				return $daysBetweenIssueAndSettlement;
-			}
-			$daysBetweenIssueAndSettlement *= $daysPerYear;
-			$daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis);
-			if (!is_numeric($daysBetweenIssueAndMaturity)) {
-				//	return date error
-				return $daysBetweenIssueAndMaturity;
-			}
-			$daysBetweenIssueAndMaturity *= $daysPerYear;
-			$daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
-			if (!is_numeric($daysBetweenSettlementAndMaturity)) {
-				//	return date error
-				return $daysBetweenSettlementAndMaturity;
-			}
-			$daysBetweenSettlementAndMaturity *= $daysPerYear;
-
-			return ((1 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate) - (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) /
-				   (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) *
-				   ($daysPerYear / $daysBetweenSettlementAndMaturity);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function YIELDMAT()
-
-}	//	class PHPExcel_Calculation_Financial

+ 0 - 614
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/FormulaParser.php

@@ -1,614 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/*
-PARTLY BASED ON:
-	Copyright (c) 2007 E. W. Bachtal, Inc.
-
-	Permission is hereby granted, free of charge, to any person obtaining a copy of this software
-	and associated documentation files (the "Software"), to deal in the Software without restriction,
-	including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-	and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-	subject to the following conditions:
-
-	  The above copyright notice and this permission notice shall be included in all copies or substantial
-	  portions of the Software.
-
-	The software is provided "as is", without warranty of any kind, express or implied, including but not
-	limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
-	no event shall the authors or copyright holders be liable for any claim, damages or other liability,
-	whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
-	software or the use or other dealings in the software.
-
-	http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
-	http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
-*/
-
-/**
- * PHPExcel_Calculation_FormulaParser
- *
- * @category   PHPExcel
- * @package    PHPExcel_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_FormulaParser {
-	/* Character constants */
-	const QUOTE_DOUBLE  = '"';
-	const QUOTE_SINGLE  = '\'';
-	const BRACKET_CLOSE = ']';
-	const BRACKET_OPEN  = '[';
-	const BRACE_OPEN    = '{';
-	const BRACE_CLOSE   = '}';
-	const PAREN_OPEN    = '(';
-	const PAREN_CLOSE   = ')';
-	const SEMICOLON     = ';';
-	const WHITESPACE    = ' ';
-	const COMMA         = ',';
-	const ERROR_START   = '#';
-
-	const OPERATORS_SN 			= "+-";
-	const OPERATORS_INFIX 		= "+-*/^&=><";
-	const OPERATORS_POSTFIX 	= "%";
-
-	/**
-	 * Formula
-	 *
-	 * @var string
-	 */
-	private $_formula;
-
-	/**
-	 * Tokens
-	 *
-	 * @var PHPExcel_Calculation_FormulaToken[]
-	 */
-	private $_tokens = array();
-
-    /**
-     * Create a new PHPExcel_Calculation_FormulaParser
-     *
-     * @param 	string		$pFormula	Formula to parse
-     * @throws 	PHPExcel_Calculation_Exception
-     */
-    public function __construct($pFormula = '')
-    {
-    	// Check parameters
-    	if (is_null($pFormula)) {
-    		throw new PHPExcel_Calculation_Exception("Invalid parameter passed: formula");
-    	}
-
-    	// Initialise values
-    	$this->_formula = trim($pFormula);
-    	// Parse!
-    	$this->_parseToTokens();
-    }
-
-    /**
-     * Get Formula
-     *
-     * @return string
-     */
-    public function getFormula() {
-    	return $this->_formula;
-    }
-
-    /**
-     * Get Token
-     *
-     * @param 	int		$pId	Token id
-     * @return	string
-     * @throws  PHPExcel_Calculation_Exception
-     */
-    public function getToken($pId = 0) {
-    	if (isset($this->_tokens[$pId])) {
-    		return $this->_tokens[$pId];
-    	} else {
-    		throw new PHPExcel_Calculation_Exception("Token with id $pId does not exist.");
-    	}
-    }
-
-    /**
-     * Get Token count
-     *
-     * @return string
-     */
-    public function getTokenCount() {
-    	return count($this->_tokens);
-    }
-
-    /**
-     * Get Tokens
-     *
-     * @return PHPExcel_Calculation_FormulaToken[]
-     */
-    public function getTokens() {
-    	return $this->_tokens;
-    }
-
-    /**
-     * Parse to tokens
-     */
-    private function _parseToTokens() {
-		// No attempt is made to verify formulas; assumes formulas are derived from Excel, where
-		// they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions.
-
-		// Check if the formula has a valid starting =
-		$formulaLength = strlen($this->_formula);
-		if ($formulaLength < 2 || $this->_formula{0} != '=') return;
-
-		// Helper variables
-		$tokens1	= $tokens2 	= $stack = array();
-		$inString	= $inPath 	= $inRange 	= $inError = false;
-		$token		= $previousToken	= $nextToken	= null;
-
-		$index	= 1;
-		$value	= '';
-
-		$ERRORS 			= array("#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A");
-		$COMPARATORS_MULTI 	= array(">=", "<=", "<>");
-
-		while ($index < $formulaLength) {
-			// state-dependent character evaluation (order is important)
-
-			// double-quoted strings
-			// embeds are doubled
-			// end marks token
-			if ($inString) {
-				if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
-					if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) {
-						$value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE;
-						++$index;
-					} else {
-						$inString = false;
-						$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_TEXT);
-						$value = "";
-					}
-				} else {
-					$value .= $this->_formula{$index};
-				}
-				++$index;
-				continue;
-			}
-
-			// single-quoted strings (links)
-			// embeds are double
-			// end does not mark a token
-			if ($inPath) {
-				if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
-					if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) {
-						$value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE;
-						++$index;
-					} else {
-						$inPath = false;
-					}
-				} else {
-					$value .= $this->_formula{$index};
-				}
-				++$index;
-				continue;
-			}
-
-			// bracked strings (R1C1 range index or linked workbook name)
-			// no embeds (changed to "()" by Excel)
-			// end does not mark a token
-			if ($inRange) {
-				if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
-					$inRange = false;
-				}
-				$value .= $this->_formula{$index};
-				++$index;
-				continue;
-			}
-
-			// error values
-			// end marks a token, determined from absolute list of values
-			if ($inError) {
-				$value .= $this->_formula{$index};
-				++$index;
-				if (in_array($value, $ERRORS)) {
-					$inError = false;
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_ERROR);
-					$value = "";
-				}
-				continue;
-			}
-
-			// scientific notation check
-			if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula{$index}) !== false) {
-				if (strlen($value) > 1) {
-					if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula{$index}) != 0) {
-						$value .= $this->_formula{$index};
-						++$index;
-						continue;
-					}
-				}
-			}
-
-			// independent character evaluation (order not important)
-
-			// establish state-dependent character evaluations
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
-				if (strlen($value > 0)) {  // unexpected
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
-					$value = "";
-				}
-				$inString = true;
-				++$index;
-				continue;
- 			}
-
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
-				if (strlen($value) > 0) { // unexpected
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
-					$value = "";
-				}
-				$inPath = true;
-				++$index;
-				continue;
-			}
-
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
-				$inRange = true;
-				$value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN;
-				++$index;
-				continue;
-			}
-
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) {
-				if (strlen($value) > 0) { // unexpected
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
-					$value = "";
-				}
-				$inError = true;
-				$value .= PHPExcel_Calculation_FormulaParser::ERROR_START;
-				++$index;
-				continue;
-			}
-
-			// mark start and end of arrays and array rows
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
-				if (strlen($value) > 0) { // unexpected
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
-					$value = "";
-				}
-
-				$tmp = new PHPExcel_Calculation_FormulaToken("ARRAY", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
-				$tokens1[] = $tmp;
-				$stack[] = clone $tmp;
-
-				$tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
-				$tokens1[] = $tmp;
-				$stack[] = clone $tmp;
-
-				++$index;
-				continue;
-			}
-
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-
-				$tmp = array_pop($stack);
-				$tmp->setValue("");
-				$tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
-				$tokens1[] = $tmp;
-
-				$tmp = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT);
-				$tokens1[] = $tmp;
-
-				$tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
-				$tokens1[] = $tmp;
-				$stack[] = clone $tmp;
-
-				++$index;
-				continue;
-			}
-
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-
-				$tmp = array_pop($stack);
-				$tmp->setValue("");
-				$tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
-				$tokens1[] = $tmp;
-
-				$tmp = array_pop($stack);
-				$tmp->setValue("");
-				$tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
-				$tokens1[] = $tmp;
-
-				++$index;
-				continue;
-			}
-
-			// trim white-space
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-				$tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE);
-				++$index;
-				while (($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
-					++$index;
-				}
-				continue;
-			}
-
-			// multi-character comparators
-			if (($index + 2) <= $formulaLength) {
-				if (in_array(substr($this->_formula, $index, 2), $COMPARATORS_MULTI)) {
-					if (strlen($value) > 0) {
-						$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-						$value = "";
-					}
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken(substr($this->_formula, $index, 2), PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
-					$index += 2;
-					continue;
-				}
-			}
-
-			// standard infix operators
-			if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula{$index}) !== false) {
-				if (strlen($value) > 0) {
-					$tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-				$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
-				++$index;
-				continue;
-			}
-
-			// standard postfix operators (only one)
-			if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula{$index}) !== false) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-				$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
-				++$index;
-				continue;
-			}
-
-			// start subexpression or function
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
-				if (strlen($value) > 0) {
-					$tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
-					$tokens1[] = $tmp;
-					$stack[] = clone $tmp;
-					$value = "";
-				} else {
-					$tmp = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
-					$tokens1[] = $tmp;
-					$stack[] = clone $tmp;
-				}
-				++$index;
-				continue;
-			}
-
-			// function, subexpression, or array parameters, or operand unions
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-
-				$tmp = array_pop($stack);
-				$tmp->setValue("");
-				$tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
-				$stack[] = $tmp;
-
-				if ($tmp->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_UNION);
-				} else {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT);
-				}
-				++$index;
-				continue;
-			}
-
-			// stop subexpression
-			if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
-				if (strlen($value) > 0) {
-					$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-					$value = "";
-				}
-
-				$tmp = array_pop($stack);
-				$tmp->setValue("");
-				$tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
-				$tokens1[] = $tmp;
-
-				++$index;
-				continue;
-			}
-
-        	// token accumulation
-			$value .= $this->_formula{$index};
-			++$index;
-		}
-
-		// dump remaining accumulation
-		if (strlen($value) > 0) {
-			$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
-		}
-
-		// move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections
-		$tokenCount = count($tokens1);
-		for ($i = 0; $i < $tokenCount; ++$i) {
-			$token = $tokens1[$i];
-			if (isset($tokens1[$i - 1])) {
-				$previousToken = $tokens1[$i - 1];
-			} else {
-				$previousToken = null;
-			}
-			if (isset($tokens1[$i + 1])) {
-				$nextToken = $tokens1[$i + 1];
-			} else {
-				$nextToken = null;
-			}
-
-			if (is_null($token)) {
-				continue;
-			}
-
-			if ($token->getTokenType() != PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE) {
-				$tokens2[] = $token;
-				continue;
-			}
-
-			if (is_null($previousToken)) {
-				continue;
-			}
-
-			if (! (
-					(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-					(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-					($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
-				  ) ) {
-				continue;
-			}
-
-			if (is_null($nextToken)) {
-				continue;
-			}
-
-			if (! (
-					(($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) ||
-					(($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) ||
-					($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
-				  ) ) {
-				continue;
-			}
-
-			$tokens2[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_INTERSECTION);
-		}
-
-		// move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators
-		// to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names
-		$this->_tokens = array();
-
-		$tokenCount = count($tokens2);
-		for ($i = 0; $i < $tokenCount; ++$i) {
-			$token = $tokens2[$i];
-			if (isset($tokens2[$i - 1])) {
-				$previousToken = $tokens2[$i - 1];
-			} else {
-				$previousToken = null;
-			}
-			if (isset($tokens2[$i + 1])) {
-				$nextToken = $tokens2[$i + 1];
-			} else {
-				$nextToken = null;
-			}
-
-			if (is_null($token)) {
-				continue;
-			}
-
-			if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "-") {
-				if ($i == 0) {
-					$token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
-				} else if (
-							(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-							(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-							($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
-							($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
-						) {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
-				} else {
-					$token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
-				}
-
-				$this->_tokens[] = $token;
-				continue;
-			}
-
-			if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "+") {
-				if ($i == 0) {
-					continue;
-				} else if (
-							(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-							(($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
-							($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
-							($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
-						) {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
-				} else {
-					continue;
-				}
-
-				$this->_tokens[] = $token;
-				continue;
-			}
-
-			if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) {
-				if (strpos("<>=", substr($token->getValue(), 0, 1)) !== false) {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
-				} else if ($token->getValue() == "&") {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_CONCATENATION);
-				} else {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
-				}
-
-				$this->_tokens[] = $token;
-				continue;
-			}
-
-			if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND && $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) {
-				if (!is_numeric($token->getValue())) {
-					if (strtoupper($token->getValue()) == "TRUE" || strtoupper($token->getValue() == "FALSE")) {
-						$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
-					} else {
-						$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_RANGE);
-					}
-				} else {
-					$token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NUMBER);
-				}
-
-				$this->_tokens[] = $token;
-				continue;
-			}
-
-			if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) {
-				if (strlen($token->getValue() > 0)) {
-					if (substr($token->getValue(), 0, 1) == "@") {
-						$token->setValue(substr($token->getValue(), 1));
-					}
-				}
-			}
-
-        	$this->_tokens[] = $token;
-		}
-    }
-}

+ 0 - 176
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/FormulaToken.php

@@ -1,176 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/*
-PARTLY BASED ON:
-	Copyright (c) 2007 E. W. Bachtal, Inc.
-
-	Permission is hereby granted, free of charge, to any person obtaining a copy of this software
-	and associated documentation files (the "Software"), to deal in the Software without restriction,
-	including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-	and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-	subject to the following conditions:
-
-	  The above copyright notice and this permission notice shall be included in all copies or substantial
-	  portions of the Software.
-
-	The software is provided "as is", without warranty of any kind, express or implied, including but not
-	limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
-	no event shall the authors or copyright holders be liable for any claim, damages or other liability,
-	whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
-	software or the use or other dealings in the software.
-
-	http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
-	http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
-*/
-
-
-/**
- * PHPExcel_Calculation_FormulaToken
- *
- * @category   PHPExcel
- * @package    PHPExcel_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_FormulaToken {
-	/* Token types */
-	const TOKEN_TYPE_NOOP					= 'Noop';
-	const TOKEN_TYPE_OPERAND				= 'Operand';
-	const TOKEN_TYPE_FUNCTION				= 'Function';
-	const TOKEN_TYPE_SUBEXPRESSION			= 'Subexpression';
-	const TOKEN_TYPE_ARGUMENT				= 'Argument';
-	const TOKEN_TYPE_OPERATORPREFIX			= 'OperatorPrefix';
-	const TOKEN_TYPE_OPERATORINFIX			= 'OperatorInfix';
-	const TOKEN_TYPE_OPERATORPOSTFIX		= 'OperatorPostfix';
-	const TOKEN_TYPE_WHITESPACE				= 'Whitespace';
-	const TOKEN_TYPE_UNKNOWN				= 'Unknown';
-
-	/* Token subtypes */
-	const TOKEN_SUBTYPE_NOTHING				= 'Nothing';
-	const TOKEN_SUBTYPE_START				= 'Start';
-	const TOKEN_SUBTYPE_STOP				= 'Stop';
-	const TOKEN_SUBTYPE_TEXT				= 'Text';
-	const TOKEN_SUBTYPE_NUMBER				= 'Number';
-	const TOKEN_SUBTYPE_LOGICAL				= 'Logical';
-	const TOKEN_SUBTYPE_ERROR				= 'Error';
-	const TOKEN_SUBTYPE_RANGE				= 'Range';
-	const TOKEN_SUBTYPE_MATH				= 'Math';
-	const TOKEN_SUBTYPE_CONCATENATION		= 'Concatenation';
-	const TOKEN_SUBTYPE_INTERSECTION		= 'Intersection';
-	const TOKEN_SUBTYPE_UNION				= 'Union';
-
-	/**
-	 * Value
-	 *
-	 * @var string
-	 */
-	private $_value;
-
-	/**
-	 * Token Type (represented by TOKEN_TYPE_*)
-	 *
-	 * @var string
-	 */
-	private $_tokenType;
-
-	/**
-	 * Token SubType (represented by TOKEN_SUBTYPE_*)
-	 *
-	 * @var string
-	 */
-	private $_tokenSubType;
-
-    /**
-     * Create a new PHPExcel_Calculation_FormulaToken
-     *
-     * @param string	$pValue
-     * @param string	$pTokenType 	Token type (represented by TOKEN_TYPE_*)
-     * @param string	$pTokenSubType 	Token Subtype (represented by TOKEN_SUBTYPE_*)
-     */
-    public function __construct($pValue, $pTokenType = PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN, $pTokenSubType = PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING)
-    {
-    	// Initialise values
-    	$this->_value				= $pValue;
-    	$this->_tokenType			= $pTokenType;
-    	$this->_tokenSubType 		= $pTokenSubType;
-    }
-
-    /**
-     * Get Value
-     *
-     * @return string
-     */
-    public function getValue() {
-    	return $this->_value;
-    }
-
-    /**
-     * Set Value
-     *
-     * @param string	$value
-     */
-    public function setValue($value) {
-    	$this->_value = $value;
-    }
-
-    /**
-     * Get Token Type (represented by TOKEN_TYPE_*)
-     *
-     * @return string
-     */
-    public function getTokenType() {
-    	return $this->_tokenType;
-    }
-
-    /**
-     * Set Token Type
-     *
-     * @param string	$value
-     */
-    public function setTokenType($value = PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN) {
-    	$this->_tokenType = $value;
-    }
-
-    /**
-     * Get Token SubType (represented by TOKEN_SUBTYPE_*)
-     *
-     * @return string
-     */
-    public function getTokenSubType() {
-    	return $this->_tokenSubType;
-    }
-
-    /**
-     * Set Token SubType
-     *
-     * @param string	$value
-     */
-    public function setTokenSubType($value = PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) {
-    	$this->_tokenSubType = $value;
-    }
-}

+ 0 - 149
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Function.php

@@ -1,149 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Calculation_Function
- *
- * @category   PHPExcel
- * @package    PHPExcel_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Function {
-	/* Function categories */
-	const CATEGORY_CUBE						= 'Cube';
-	const CATEGORY_DATABASE					= 'Database';
-	const CATEGORY_DATE_AND_TIME			= 'Date and Time';
-	const CATEGORY_ENGINEERING				= 'Engineering';
-	const CATEGORY_FINANCIAL				= 'Financial';
-	const CATEGORY_INFORMATION				= 'Information';
-	const CATEGORY_LOGICAL					= 'Logical';
-	const CATEGORY_LOOKUP_AND_REFERENCE		= 'Lookup and Reference';
-	const CATEGORY_MATH_AND_TRIG			= 'Math and Trig';
-	const CATEGORY_STATISTICAL				= 'Statistical';
-	const CATEGORY_TEXT_AND_DATA			= 'Text and Data';
-
-	/**
-	 * Category (represented by CATEGORY_*)
-	 *
-	 * @var string
-	 */
-	private $_category;
-
-	/**
-	 * Excel name
-	 *
-	 * @var string
-	 */
-	private $_excelName;
-
-	/**
-	 * PHPExcel name
-	 *
-	 * @var string
-	 */
-	private $_phpExcelName;
-
-    /**
-     * Create a new PHPExcel_Calculation_Function
-     *
-     * @param 	string		$pCategory 		Category (represented by CATEGORY_*)
-     * @param 	string		$pExcelName		Excel function name
-     * @param 	string		$pPHPExcelName	PHPExcel function mapping
-     * @throws 	PHPExcel_Calculation_Exception
-     */
-    public function __construct($pCategory = NULL, $pExcelName = NULL, $pPHPExcelName = NULL)
-    {
-    	if (($pCategory !== NULL) && ($pExcelName !== NULL) && ($pPHPExcelName !== NULL)) {
-    		// Initialise values
-    		$this->_category 		= $pCategory;
-    		$this->_excelName 		= $pExcelName;
-    		$this->_phpExcelName 	= $pPHPExcelName;
-    	} else {
-    		throw new PHPExcel_Calculation_Exception("Invalid parameters passed.");
-    	}
-    }
-
-    /**
-     * Get Category (represented by CATEGORY_*)
-     *
-     * @return string
-     */
-    public function getCategory() {
-    	return $this->_category;
-    }
-
-    /**
-     * Set Category (represented by CATEGORY_*)
-     *
-     * @param 	string		$value
-     * @throws 	PHPExcel_Calculation_Exception
-     */
-    public function setCategory($value = null) {
-    	if (!is_null($value)) {
-    		$this->_category = $value;
-    	} else {
-    		throw new PHPExcel_Calculation_Exception("Invalid parameter passed.");
-    	}
-    }
-
-    /**
-     * Get Excel name
-     *
-     * @return string
-     */
-    public function getExcelName() {
-    	return $this->_excelName;
-    }
-
-    /**
-     * Set Excel name
-     *
-     * @param string	$value
-     */
-    public function setExcelName($value) {
-    	$this->_excelName = $value;
-    }
-
-    /**
-     * Get PHPExcel name
-     *
-     * @return string
-     */
-    public function getPHPExcelName() {
-    	return $this->_phpExcelName;
-    }
-
-    /**
-     * Set PHPExcel name
-     *
-     * @param string	$value
-     */
-    public function setPHPExcelName($value) {
-    	$this->_phpExcelName = $value;
-    }
-}

+ 0 - 725
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php

@@ -1,725 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/** MAX_VALUE */
-define('MAX_VALUE', 1.2e308);
-
-/** 2 / PI */
-define('M_2DIVPI', 0.63661977236758134307553505349006);
-
-/** MAX_ITERATIONS */
-define('MAX_ITERATIONS', 256);
-
-/** PRECISION */
-define('PRECISION', 8.88E-016);
-
-
-/**
- * PHPExcel_Calculation_Functions
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Functions {
-
-	/** constants */
-	const COMPATIBILITY_EXCEL		= 'Excel';
-	const COMPATIBILITY_GNUMERIC	= 'Gnumeric';
-	const COMPATIBILITY_OPENOFFICE	= 'OpenOfficeCalc';
-
-	const RETURNDATE_PHP_NUMERIC	= 'P';
-	const RETURNDATE_PHP_OBJECT		= 'O';
-	const RETURNDATE_EXCEL			= 'E';
-
-
-	/**
-	 * Compatibility mode to use for error checking and responses
-	 *
-	 * @access	private
-	 * @var string
-	 */
-	protected static $compatibilityMode	= self::COMPATIBILITY_EXCEL;
-
-	/**
-	 * Data Type to use when returning date values
-	 *
-	 * @access	private
-	 * @var string
-	 */
-	protected static $ReturnDateType	= self::RETURNDATE_EXCEL;
-
-	/**
-	 * List of error codes
-	 *
-	 * @access	private
-	 * @var array
-	 */
-	protected static $_errorCodes	= array( 'null'				=> '#NULL!',
-											 'divisionbyzero'	=> '#DIV/0!',
-											 'value'			=> '#VALUE!',
-											 'reference'		=> '#REF!',
-											 'name'				=> '#NAME?',
-											 'num'				=> '#NUM!',
-											 'na'				=> '#N/A',
-											 'gettingdata'		=> '#GETTING_DATA'
-										   );
-
-
-	/**
-	 * Set the Compatibility Mode
-	 *
-	 * @access	public
-	 * @category Function Configuration
-	 * @param	 string		$compatibilityMode		Compatibility Mode
-	 *												Permitted values are:
-	 *													PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL			'Excel'
-	 *													PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC		'Gnumeric'
-	 *													PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE	'OpenOfficeCalc'
-	 * @return	 boolean	(Success or Failure)
-	 */
-	public static function setCompatibilityMode($compatibilityMode) {
-		if (($compatibilityMode == self::COMPATIBILITY_EXCEL) ||
-			($compatibilityMode == self::COMPATIBILITY_GNUMERIC) ||
-			($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)) {
-			self::$compatibilityMode = $compatibilityMode;
-			return True;
-		}
-		return False;
-	}	//	function setCompatibilityMode()
-
-
-	/**
-	 * Return the current Compatibility Mode
-	 *
-	 * @access	public
-	 * @category Function Configuration
-	 * @return	 string		Compatibility Mode
-	 *							Possible Return values are:
-	 *								PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL			'Excel'
-	 *								PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC		'Gnumeric'
-	 *								PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE	'OpenOfficeCalc'
-	 */
-	public static function getCompatibilityMode() {
-		return self::$compatibilityMode;
-	}	//	function getCompatibilityMode()
-
-
-	/**
-	 * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
-	 *
-	 * @access	public
-	 * @category Function Configuration
-	 * @param	 string	$returnDateType			Return Date Format
-	 *												Permitted values are:
-	 *													PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC		'P'
-	 *													PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT		'O'
-	 *													PHPExcel_Calculation_Functions::RETURNDATE_EXCEL			'E'
-	 * @return	 boolean							Success or failure
-	 */
-	public static function setReturnDateType($returnDateType) {
-		if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) ||
-			($returnDateType == self::RETURNDATE_PHP_OBJECT) ||
-			($returnDateType == self::RETURNDATE_EXCEL)) {
-			self::$ReturnDateType = $returnDateType;
-			return True;
-		}
-		return False;
-	}	//	function setReturnDateType()
-
-
-	/**
-	 * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
-	 *
-	 * @access	public
-	 * @category Function Configuration
-	 * @return	 string		Return Date Format
-	 *							Possible Return values are:
-	 *								PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC		'P'
-	 *								PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT		'O'
-	 *								PHPExcel_Calculation_Functions::RETURNDATE_EXCEL			'E'
-	 */
-	public static function getReturnDateType() {
-		return self::$ReturnDateType;
-	}	//	function getReturnDateType()
-
-
-	/**
-	 * DUMMY
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#Not Yet Implemented
-	 */
-	public static function DUMMY() {
-		return '#Not Yet Implemented';
-	}	//	function DUMMY()
-
-
-	/**
-	 * DIV0
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#Not Yet Implemented
-	 */
-	public static function DIV0() {
-		return self::$_errorCodes['divisionbyzero'];
-	}	//	function DIV0()
-
-
-	/**
-	 * NA
-	 *
-	 * Excel Function:
-	 *		=NA()
-	 *
-	 * Returns the error value #N/A
-	 *		#N/A is the error value that means "no value is available."
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @return	string	#N/A!
-	 */
-	public static function NA() {
-		return self::$_errorCodes['na'];
-	}	//	function NA()
-
-
-	/**
-	 * NaN
-	 *
-	 * Returns the error value #NUM!
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#NUM!
-	 */
-	public static function NaN() {
-		return self::$_errorCodes['num'];
-	}	//	function NaN()
-
-
-	/**
-	 * NAME
-	 *
-	 * Returns the error value #NAME?
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#NAME?
-	 */
-	public static function NAME() {
-		return self::$_errorCodes['name'];
-	}	//	function NAME()
-
-
-	/**
-	 * REF
-	 *
-	 * Returns the error value #REF!
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#REF!
-	 */
-	public static function REF() {
-		return self::$_errorCodes['reference'];
-	}	//	function REF()
-
-
-	/**
-	 * NULL
-	 *
-	 * Returns the error value #NULL!
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#NULL!
-	 */
-	public static function NULL() {
-		return self::$_errorCodes['null'];
-	}	//	function NULL()
-
-
-	/**
-	 * VALUE
-	 *
-	 * Returns the error value #VALUE!
-	 *
-	 * @access	public
-	 * @category Error Returns
-	 * @return	string	#VALUE!
-	 */
-	public static function VALUE() {
-		return self::$_errorCodes['value'];
-	}	//	function VALUE()
-
-
-	public static function isMatrixValue($idx) {
-		return ((substr_count($idx,'.') <= 1) || (preg_match('/\.[A-Z]/',$idx) > 0));
-	}
-
-
-	public static function isValue($idx) {
-		return (substr_count($idx,'.') == 0);
-	}
-
-
-	public static function isCellValue($idx) {
-		return (substr_count($idx,'.') > 1);
-	}
-
-
-	public static function _ifCondition($condition) {
-		$condition	= PHPExcel_Calculation_Functions::flattenSingleValue($condition);
-		if (!isset($condition{0}))
-			$condition = '=""';
-		if (!in_array($condition{0},array('>', '<', '='))) {
-			if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); }
-			return '='.$condition;
-		} else {
-			preg_match('/([<>=]+)(.*)/',$condition,$matches);
-			list(,$operator,$operand) = $matches;
-
-			if (!is_numeric($operand)) {
-				$operand = str_replace('"', '""', $operand);
-				$operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand));
-			}
-
-			return $operator.$operand;
-		}
-	}	//	function _ifCondition()
-
-
-	/**
-	 * ERROR_TYPE
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function ERROR_TYPE($value = '') {
-		$value	= self::flattenSingleValue($value);
-
-		$i = 1;
-		foreach(self::$_errorCodes as $errorCode) {
-			if ($value === $errorCode) {
-				return $i;
-			}
-			++$i;
-		}
-		return self::NA();
-	}	//	function ERROR_TYPE()
-
-
-	/**
-	 * IS_BLANK
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_BLANK($value = NULL) {
-		if (!is_null($value)) {
-			$value	= self::flattenSingleValue($value);
-		}
-
-		return is_null($value);
-	}	//	function IS_BLANK()
-
-
-	/**
-	 * IS_ERR
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_ERR($value = '') {
-		$value		= self::flattenSingleValue($value);
-
-		return self::IS_ERROR($value) && (!self::IS_NA($value));
-	}	//	function IS_ERR()
-
-
-	/**
-	 * IS_ERROR
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_ERROR($value = '') {
-		$value		= self::flattenSingleValue($value);
-
-		if (!is_string($value))
-			return false;
-		return in_array($value, array_values(self::$_errorCodes));
-	}	//	function IS_ERROR()
-
-
-	/**
-	 * IS_NA
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_NA($value = '') {
-		$value		= self::flattenSingleValue($value);
-
-		return ($value === self::NA());
-	}	//	function IS_NA()
-
-
-	/**
-	 * IS_EVEN
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_EVEN($value = NULL) {
-		$value = self::flattenSingleValue($value);
-
-		if ($value === NULL)
-			return self::NAME();
-		if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value))))
-			return self::VALUE();
-		return ($value % 2 == 0);
-	}	//	function IS_EVEN()
-
-
-	/**
-	 * IS_ODD
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function IS_ODD($value = NULL) {
-		$value = self::flattenSingleValue($value);
-
-		if ($value === NULL)
-			return self::NAME();
-		if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value))))
-			return self::VALUE();
-		return (abs($value) % 2 == 1);
-	}	//	function IS_ODD()
-
-
-	/**
-	 * IS_NUMBER
-	 *
-	 * @param	mixed	$value		Value to check
-	 * @return	boolean
-	 */
-	public static function IS_NUMBER($value = NULL) {
-		$value		= self::flattenSingleValue($value);
-
-		if (is_string($value)) {
-			return False;
-		}
-		return is_numeric($value);
-	}	//	function IS_NUMBER()
-
-
-	/**
-	 * IS_LOGICAL
-	 *
-	 * @param	mixed	$value		Value to check
-	 * @return	boolean
-	 */
-	public static function IS_LOGICAL($value = NULL) {
-		$value		= self::flattenSingleValue($value);
-
-		return is_bool($value);
-	}	//	function IS_LOGICAL()
-
-
-	/**
-	 * IS_TEXT
-	 *
-	 * @param	mixed	$value		Value to check
-	 * @return	boolean
-	 */
-	public static function IS_TEXT($value = NULL) {
-		$value		= self::flattenSingleValue($value);
-
-		return (is_string($value) && !self::IS_ERROR($value));
-	}	//	function IS_TEXT()
-
-
-	/**
-	 * IS_NONTEXT
-	 *
-	 * @param	mixed	$value		Value to check
-	 * @return	boolean
-	 */
-	public static function IS_NONTEXT($value = NULL) {
-		return !self::IS_TEXT($value);
-	}	//	function IS_NONTEXT()
-
-
-	/**
-	 * VERSION
-	 *
-	 * @return	string	Version information
-	 */
-	public static function VERSION() {
-		return 'PHPExcel 1.8.1, 2015-04-30';
-	}	//	function VERSION()
-
-
-	/**
-	 * N
-	 *
-	 * Returns a value converted to a number
-	 *
-	 * @param	value		The value you want converted
-	 * @return	number		N converts values listed in the following table
-	 *		If value is or refers to N returns
-	 *		A number			That number
-	 *		A date				The serial number of that date
-	 *		TRUE				1
-	 *		FALSE				0
-	 *		An error value		The error value
-	 *		Anything else		0
-	 */
-	public static function N($value = NULL) {
-		while (is_array($value)) {
-			$value = array_shift($value);
-		}
-
-		switch (gettype($value)) {
-			case 'double'	:
-			case 'float'	:
-			case 'integer'	:
-				return $value;
-				break;
-			case 'boolean'	:
-				return (integer) $value;
-				break;
-			case 'string'	:
-				//	Errors
-				if ((strlen($value) > 0) && ($value{0} == '#')) {
-					return $value;
-				}
-				break;
-		}
-		return 0;
-	}	//	function N()
-
-
-	/**
-	 * TYPE
-	 *
-	 * Returns a number that identifies the type of a value
-	 *
-	 * @param	value		The value you want tested
-	 * @return	number		N converts values listed in the following table
-	 *		If value is or refers to N returns
-	 *		A number			1
-	 *		Text				2
-	 *		Logical Value		4
-	 *		An error value		16
-	 *		Array or Matrix		64
-	 */
-	public static function TYPE($value = NULL) {
-		$value	= self::flattenArrayIndexed($value);
-		if (is_array($value) && (count($value) > 1)) {
-			$a = array_keys($value);
-			$a = array_pop($a);
-			//	Range of cells is an error
-			if (self::isCellValue($a)) {
-				return 16;
-			//	Test for Matrix
-			} elseif (self::isMatrixValue($a)) {
-				return 64;
-			}
-		} elseif(empty($value)) {
-			//	Empty Cell
-			return 1;
-		}
-		$value	= self::flattenSingleValue($value);
-
-		if (($value === NULL) || (is_float($value)) || (is_int($value))) {
-				return 1;
-		} elseif(is_bool($value)) {
-				return 4;
-		} elseif(is_array($value)) {
-				return 64;
-		} elseif(is_string($value)) {
-			//	Errors
-			if ((strlen($value) > 0) && ($value{0} == '#')) {
-				return 16;
-			}
-			return 2;
-		}
-		return 0;
-	}	//	function TYPE()
-
-
-	/**
-	 * Convert a multi-dimensional array to a simple 1-dimensional array
-	 *
-	 * @param	array	$array	Array to be flattened
-	 * @return	array	Flattened array
-	 */
-	public static function flattenArray($array) {
-		if (!is_array($array)) {
-			return (array) $array;
-		}
-
-		$arrayValues = array();
-		foreach ($array as $value) {
-			if (is_array($value)) {
-				foreach ($value as $val) {
-					if (is_array($val)) {
-						foreach ($val as $v) {
-							$arrayValues[] = $v;
-						}
-					} else {
-						$arrayValues[] = $val;
-					}
-				}
-			} else {
-				$arrayValues[] = $value;
-			}
-		}
-
-		return $arrayValues;
-	}	//	function flattenArray()
-
-
-	/**
-	 * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing
-	 *
-	 * @param	array	$array	Array to be flattened
-	 * @return	array	Flattened array
-	 */
-	public static function flattenArrayIndexed($array) {
-		if (!is_array($array)) {
-			return (array) $array;
-		}
-
-		$arrayValues = array();
-		foreach ($array as $k1 => $value) {
-			if (is_array($value)) {
-				foreach ($value as $k2 => $val) {
-					if (is_array($val)) {
-						foreach ($val as $k3 => $v) {
-							$arrayValues[$k1.'.'.$k2.'.'.$k3] = $v;
-						}
-					} else {
-						$arrayValues[$k1.'.'.$k2] = $val;
-					}
-				}
-			} else {
-				$arrayValues[$k1] = $value;
-			}
-		}
-
-		return $arrayValues;
-	}	//	function flattenArrayIndexed()
-
-
-	/**
-	 * Convert an array to a single scalar value by extracting the first element
-	 *
-	 * @param	mixed		$value		Array or scalar value
-	 * @return	mixed
-	 */
-	public static function flattenSingleValue($value = '') {
-		while (is_array($value)) {
-			$value = array_pop($value);
-		}
-
-		return $value;
-	}	//	function flattenSingleValue()
-
-}	//	class PHPExcel_Calculation_Functions
-
-
-//
-//	There are a few mathematical functions that aren't available on all versions of PHP for all platforms
-//	These functions aren't available in Windows implementations of PHP prior to version 5.3.0
-//	So we test if they do exist for this version of PHP/operating platform; and if not we create them
-//
-if (!function_exists('acosh')) {
-	function acosh($x) {
-		return 2 * log(sqrt(($x + 1) / 2) + sqrt(($x - 1) / 2));
-	}	//	function acosh()
-}
-
-if (!function_exists('asinh')) {
-	function asinh($x) {
-		return log($x + sqrt(1 + $x * $x));
-	}	//	function asinh()
-}
-
-if (!function_exists('atanh')) {
-	function atanh($x) {
-		return (log(1 + $x) - log(1 - $x)) / 2;
-	}	//	function atanh()
-}
-
-
-//
-//	Strangely, PHP doesn't have a mb_str_replace multibyte function
-//	As we'll only ever use this function with UTF-8 characters, we can simply "hard-code" the character set
-//
-if ((!function_exists('mb_str_replace')) &&
-	(function_exists('mb_substr')) && (function_exists('mb_strlen')) && (function_exists('mb_strpos'))) {
-	function mb_str_replace($search, $replace, $subject) {
-		if(is_array($subject)) {
-			$ret = array();
-			foreach($subject as $key => $val) {
-				$ret[$key] = mb_str_replace($search, $replace, $val);
-			}
-			return $ret;
-		}
-
-		foreach((array) $search as $key => $s) {
-			if($s == '' && $s !== 0) {
-				continue;
-			}
-			$r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : '');
-			$pos = mb_strpos($subject, $s, 0, 'UTF-8');
-			while($pos !== false) {
-				$subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8');
-				$pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8');
-			}
-		}
-		return $subject;
-	}
-}

+ 0 - 288
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Logical.php

@@ -1,288 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_Logical
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Logical {
-
-	/**
-	 * TRUE
-	 *
-	 * Returns the boolean TRUE.
-	 *
-	 * Excel Function:
-	 *		=TRUE()
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @return	boolean		True
-	 */
-	public static function TRUE() {
-		return TRUE;
-	}	//	function TRUE()
-
-
-	/**
-	 * FALSE
-	 *
-	 * Returns the boolean FALSE.
-	 *
-	 * Excel Function:
-	 *		=FALSE()
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @return	boolean		False
-	 */
-	public static function FALSE() {
-		return FALSE;
-	}	//	function FALSE()
-
-
-	/**
-	 * LOGICAL_AND
-	 *
-	 * Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.
-	 *
-	 * Excel Function:
-	 *		=AND(logical1[,logical2[, ...]])
-	 *
-	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
-	 *			or references that contain logical values.
-	 *
-	 *		Boolean arguments are treated as True or False as appropriate
-	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
-	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
-	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	boolean		The logical AND of the arguments.
-	 */
-	public static function LOGICAL_AND() {
-		// Return value
-		$returnValue = TRUE;
-
-		// Loop through the arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		$argCount = -1;
-		foreach ($aArgs as $argCount => $arg) {
-			// Is it a boolean value?
-			if (is_bool($arg)) {
-				$returnValue = $returnValue && $arg;
-			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
-				$returnValue = $returnValue && ($arg != 0);
-			} elseif (is_string($arg)) {
-				$arg = strtoupper($arg);
-				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
-					$arg = TRUE;
-				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
-					$arg = FALSE;
-				} else {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-				$returnValue = $returnValue && ($arg != 0);
-			}
-		}
-
-		// Return
-		if ($argCount < 0) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		return $returnValue;
-	}	//	function LOGICAL_AND()
-
-
-	/**
-	 * LOGICAL_OR
-	 *
-	 * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
-	 *
-	 * Excel Function:
-	 *		=OR(logical1[,logical2[, ...]])
-	 *
-	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
-	 *			or references that contain logical values.
-	 *
-	 *		Boolean arguments are treated as True or False as appropriate
-	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
-	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
-	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	boolean		The logical OR of the arguments.
-	 */
-	public static function LOGICAL_OR() {
-		// Return value
-		$returnValue = FALSE;
-
-		// Loop through the arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		$argCount = -1;
-		foreach ($aArgs as $argCount => $arg) {
-			// Is it a boolean value?
-			if (is_bool($arg)) {
-				$returnValue = $returnValue || $arg;
-			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
-				$returnValue = $returnValue || ($arg != 0);
-			} elseif (is_string($arg)) {
-				$arg = strtoupper($arg);
-				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
-					$arg = TRUE;
-				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
-					$arg = FALSE;
-				} else {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-				$returnValue = $returnValue || ($arg != 0);
-			}
-		}
-
-		// Return
-		if ($argCount < 0) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		return $returnValue;
-	}	//	function LOGICAL_OR()
-
-
-	/**
-	 * NOT
-	 *
-	 * Returns the boolean inverse of the argument.
-	 *
-	 * Excel Function:
-	 *		=NOT(logical)
-	 *
-	 *		The argument must evaluate to a logical value such as TRUE or FALSE
-	 *
-	 *		Boolean arguments are treated as True or False as appropriate
-	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
-	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
-	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	mixed		$logical	A value or expression that can be evaluated to TRUE or FALSE
-	 * @return	boolean		The boolean inverse of the argument.
-	 */
-	public static function NOT($logical=FALSE) {
-		$logical = PHPExcel_Calculation_Functions::flattenSingleValue($logical);
-		if (is_string($logical)) {
-			$logical = strtoupper($logical);
-			if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) {
-				return FALSE;
-			} elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) {
-				return TRUE;
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-
-		return !$logical;
-	}	//	function NOT()
-
-	/**
-	 * STATEMENT_IF
-	 *
-	 * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
-	 *
-	 * Excel Function:
-	 *		=IF(condition[,returnIfTrue[,returnIfFalse]])
-	 *
-	 *		Condition is any value or expression that can be evaluated to TRUE or FALSE.
-	 *			For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
-	 *			the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
-	 *			This argument can use any comparison calculation operator.
-	 *		ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
-	 *			For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
-	 *			then the IF function returns the text "Within budget"
-	 *			If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
-	 *			the logical value TRUE for this argument.
-	 *			ReturnIfTrue can be another formula.
-	 *		ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
-	 *			For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
-	 *			then the IF function returns the text "Over budget".
-	 *			If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
-	 *			If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
-	 *			ReturnIfFalse can be another formula.
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	mixed	$condition		Condition to evaluate
-	 * @param	mixed	$returnIfTrue	Value to return when condition is true
-	 * @param	mixed	$returnIfFalse	Optional value to return when condition is false
-	 * @return	mixed	The value of returnIfTrue or returnIfFalse determined by condition
-	 */
-	public static function STATEMENT_IF($condition = TRUE, $returnIfTrue = 0, $returnIfFalse = FALSE) {
-		$condition		= (is_null($condition))		? TRUE :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition);
-		$returnIfTrue	= (is_null($returnIfTrue))	? 0 :		PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue);
-		$returnIfFalse	= (is_null($returnIfFalse))	? FALSE :	PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse);
-
-		return ($condition) ? $returnIfTrue : $returnIfFalse;
-	}	//	function STATEMENT_IF()
-
-
-	/**
-	 * IFERROR
-	 *
-	 * Excel Function:
-	 *		=IFERROR(testValue,errorpart)
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	mixed	$testValue	Value to check, is also the value returned when no error
-	 * @param	mixed	$errorpart	Value to return when testValue is an error condition
-	 * @return	mixed	The value of errorpart or testValue determined by error condition
-	 */
-	public static function IFERROR($testValue = '', $errorpart = '') {
-		$testValue	= (is_null($testValue))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
-		$errorpart	= (is_null($errorpart))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($errorpart);
-
-		return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue);
-	}	//	function IFERROR()
-
-}	//	class PHPExcel_Calculation_Logical

+ 0 - 876
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php

@@ -1,876 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_LookupRef
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_LookupRef {
-
-
-	/**
-	 * CELL_ADDRESS
-	 *
-	 * Creates a cell address as text, given specified row and column numbers.
-	 *
-	 * Excel Function:
-	 *		=ADDRESS(row, column, [relativity], [referenceStyle], [sheetText])
-	 *
-	 * @param	row				Row number to use in the cell reference
-	 * @param	column			Column number to use in the cell reference
-	 * @param	relativity		Flag indicating the type of reference to return
-	 *								1 or omitted	Absolute
-	 *								2				Absolute row; relative column
-	 *								3				Relative row; absolute column
-	 *								4				Relative
-	 * @param	referenceStyle	A logical value that specifies the A1 or R1C1 reference style.
-	 *								TRUE or omitted		CELL_ADDRESS returns an A1-style reference
-	 *								FALSE				CELL_ADDRESS returns an R1C1-style reference
-	 * @param	sheetText		Optional Name of worksheet to use
-	 * @return	string
-	 */
-	public static function CELL_ADDRESS($row, $column, $relativity=1, $referenceStyle=True, $sheetText='') {
-		$row		= PHPExcel_Calculation_Functions::flattenSingleValue($row);
-		$column		= PHPExcel_Calculation_Functions::flattenSingleValue($column);
-		$relativity	= PHPExcel_Calculation_Functions::flattenSingleValue($relativity);
-		$sheetText	= PHPExcel_Calculation_Functions::flattenSingleValue($sheetText);
-
-		if (($row < 1) || ($column < 1)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if ($sheetText > '') {
-			if (strpos($sheetText,' ') !== False) { $sheetText = "'".$sheetText."'"; }
-			$sheetText .='!';
-		}
-		if ((!is_bool($referenceStyle)) || $referenceStyle) {
-			$rowRelative = $columnRelative = '$';
-			$column = PHPExcel_Cell::stringFromColumnIndex($column-1);
-			if (($relativity == 2) || ($relativity == 4)) { $columnRelative = ''; }
-			if (($relativity == 3) || ($relativity == 4)) { $rowRelative = ''; }
-			return $sheetText.$columnRelative.$column.$rowRelative.$row;
-		} else {
-			if (($relativity == 2) || ($relativity == 4)) { $column = '['.$column.']'; }
-			if (($relativity == 3) || ($relativity == 4)) { $row = '['.$row.']'; }
-			return $sheetText.'R'.$row.'C'.$column;
-		}
-	}	//	function CELL_ADDRESS()
-
-
-	/**
-	 * COLUMN
-	 *
-	 * Returns the column number of the given cell reference
-	 * If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array.
-	 * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
-	 *		reference of the cell in which the COLUMN function appears; otherwise this function returns 0.
-	 *
-	 * Excel Function:
-	 *		=COLUMN([cellAddress])
-	 *
-	 * @param	cellAddress		A reference to a range of cells for which you want the column numbers
-	 * @return	integer or array of integer
-	 */
-	public static function COLUMN($cellAddress=Null) {
-		if (is_null($cellAddress) || trim($cellAddress) === '') { return 0; }
-
-		if (is_array($cellAddress)) {
-			foreach($cellAddress as $columnKey => $value) {
-				$columnKey = preg_replace('/[^a-z]/i','',$columnKey);
-				return (integer) PHPExcel_Cell::columnIndexFromString($columnKey);
-			}
-		} else {
-			if (strpos($cellAddress,'!') !== false) {
-				list($sheet,$cellAddress) = explode('!',$cellAddress);
-			}
-			if (strpos($cellAddress,':') !== false) {
-				list($startAddress,$endAddress) = explode(':',$cellAddress);
-				$startAddress = preg_replace('/[^a-z]/i','',$startAddress);
-				$endAddress = preg_replace('/[^a-z]/i','',$endAddress);
-				$returnValue = array();
-				do {
-					$returnValue[] = (integer) PHPExcel_Cell::columnIndexFromString($startAddress);
-				} while ($startAddress++ != $endAddress);
-				return $returnValue;
-			} else {
-				$cellAddress = preg_replace('/[^a-z]/i','',$cellAddress);
-				return (integer) PHPExcel_Cell::columnIndexFromString($cellAddress);
-			}
-		}
-	}	//	function COLUMN()
-
-
-	/**
-	 * COLUMNS
-	 *
-	 * Returns the number of columns in an array or reference.
-	 *
-	 * Excel Function:
-	 *		=COLUMNS(cellAddress)
-	 *
-	 * @param	cellAddress		An array or array formula, or a reference to a range of cells for which you want the number of columns
-	 * @return	integer			The number of columns in cellAddress
-	 */
-	public static function COLUMNS($cellAddress=Null) {
-		if (is_null($cellAddress) || $cellAddress === '') {
-			return 1;
-		} elseif (!is_array($cellAddress)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		$x = array_keys($cellAddress);
-		$x = array_shift($x);
-		$isMatrix = (is_numeric($x));
-		list($columns,$rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
-
-		if ($isMatrix) {
-			return $rows;
-		} else {
-			return $columns;
-		}
-	}	//	function COLUMNS()
-
-
-	/**
-	 * ROW
-	 *
-	 * Returns the row number of the given cell reference
-	 * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array.
-	 * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
-	 *		reference of the cell in which the ROW function appears; otherwise this function returns 0.
-	 *
-	 * Excel Function:
-	 *		=ROW([cellAddress])
-	 *
-	 * @param	cellAddress		A reference to a range of cells for which you want the row numbers
-	 * @return	integer or array of integer
-	 */
-	public static function ROW($cellAddress=Null) {
-		if (is_null($cellAddress) || trim($cellAddress) === '') { return 0; }
-
-		if (is_array($cellAddress)) {
-			foreach($cellAddress as $columnKey => $rowValue) {
-				foreach($rowValue as $rowKey => $cellValue) {
-					return (integer) preg_replace('/[^0-9]/i','',$rowKey);
-				}
-			}
-		} else {
-			if (strpos($cellAddress,'!') !== false) {
-				list($sheet,$cellAddress) = explode('!',$cellAddress);
-			}
-			if (strpos($cellAddress,':') !== false) {
-				list($startAddress,$endAddress) = explode(':',$cellAddress);
-				$startAddress = preg_replace('/[^0-9]/','',$startAddress);
-				$endAddress = preg_replace('/[^0-9]/','',$endAddress);
-				$returnValue = array();
-				do {
-					$returnValue[][] = (integer) $startAddress;
-				} while ($startAddress++ != $endAddress);
-				return $returnValue;
-			} else {
-				list($cellAddress) = explode(':',$cellAddress);
-				return (integer) preg_replace('/[^0-9]/','',$cellAddress);
-			}
-		}
-	}	//	function ROW()
-
-
-	/**
-	 * ROWS
-	 *
-	 * Returns the number of rows in an array or reference.
-	 *
-	 * Excel Function:
-	 *		=ROWS(cellAddress)
-	 *
-	 * @param	cellAddress		An array or array formula, or a reference to a range of cells for which you want the number of rows
-	 * @return	integer			The number of rows in cellAddress
-	 */
-	public static function ROWS($cellAddress=Null) {
-		if (is_null($cellAddress) || $cellAddress === '') {
-			return 1;
-		} elseif (!is_array($cellAddress)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		$i = array_keys($cellAddress);
-		$isMatrix = (is_numeric(array_shift($i)));
-		list($columns,$rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
-
-		if ($isMatrix) {
-			return $columns;
-		} else {
-			return $rows;
-		}
-	}	//	function ROWS()
-
-
-	/**
-	 * HYPERLINK
-	 *
-	 * Excel Function:
-	 *		=HYPERLINK(linkURL,displayName)
-	 *
-	 * @access	public
-	 * @category Logical Functions
-	 * @param	string			$linkURL		Value to check, is also the value returned when no error
-	 * @param	string			$displayName	Value to return when testValue is an error condition
-	 * @param	PHPExcel_Cell	$pCell			The cell to set the hyperlink in
-	 * @return	mixed	The value of $displayName (or $linkURL if $displayName was blank)
-	 */
-	public static function HYPERLINK($linkURL = '', $displayName = null, PHPExcel_Cell $pCell = null) {
-		$args = func_get_args();
-		$pCell = array_pop($args);
-
-		$linkURL		= (is_null($linkURL))		? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($linkURL);
-		$displayName	= (is_null($displayName))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($displayName);
-
-		if ((!is_object($pCell)) || (trim($linkURL) == '')) {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-
-		if ((is_object($displayName)) || trim($displayName) == '') {
-			$displayName = $linkURL;
-		}
-
-		$pCell->getHyperlink()->setUrl($linkURL);
-
-		return $displayName;
-	}	//	function HYPERLINK()
-
-
-	/**
-	 * INDIRECT
-	 *
-	 * Returns the reference specified by a text string.
-	 * References are immediately evaluated to display their contents.
-	 *
-	 * Excel Function:
-	 *		=INDIRECT(cellAddress)
-	 *
-	 * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
-	 *
-	 * @param	cellAddress		$cellAddress	The cell address of the current cell (containing this formula)
-	 * @param	PHPExcel_Cell	$pCell			The current cell (containing this formula)
-	 * @return	mixed			The cells referenced by cellAddress
-	 *
-	 * @todo	Support for the optional a1 parameter introduced in Excel 2010
-	 *
-	 */
-	public static function INDIRECT($cellAddress = NULL, PHPExcel_Cell $pCell = NULL) {
-		$cellAddress	= PHPExcel_Calculation_Functions::flattenSingleValue($cellAddress);
-		if (is_null($cellAddress) || $cellAddress === '') {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-
-		$cellAddress1 = $cellAddress;
-		$cellAddress2 = NULL;
-		if (strpos($cellAddress,':') !== false) {
-			list($cellAddress1,$cellAddress2) = explode(':',$cellAddress);
-		}
-
-		if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) ||
-			((!is_null($cellAddress2)) && (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) {
-			if (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) {
-				return PHPExcel_Calculation_Functions::REF();
-			}
-
-			if (strpos($cellAddress,'!') !== FALSE) {
-				list($sheetName, $cellAddress) = explode('!',$cellAddress);
-				$sheetName = trim($sheetName, "'");
-				$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
-			} else {
-				$pSheet = $pCell->getWorksheet();
-			}
-
-			return PHPExcel_Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, FALSE);
-		}
-
-		if (strpos($cellAddress,'!') !== FALSE) {
-			list($sheetName,$cellAddress) = explode('!',$cellAddress);
-			$sheetName = trim($sheetName, "'");
-			$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
-		} else {
-			$pSheet = $pCell->getWorksheet();
-		}
-
-		return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, FALSE);
-	}	//	function INDIRECT()
-
-
-	/**
-	 * OFFSET
-	 *
-	 * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
-	 * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and
-	 * the number of columns to be returned.
-	 *
-	 * Excel Function:
-	 *		=OFFSET(cellAddress, rows, cols, [height], [width])
-	 *
-	 * @param	cellAddress		The reference from which you want to base the offset. Reference must refer to a cell or
-	 *								range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
-	 * @param	rows			The number of rows, up or down, that you want the upper-left cell to refer to.
-	 *								Using 5 as the rows argument specifies that the upper-left cell in the reference is
-	 *								five rows below reference. Rows can be positive (which means below the starting reference)
-	 *								or negative (which means above the starting reference).
-	 * @param	cols			The number of columns, to the left or right, that you want the upper-left cell of the result
-	 *								to refer to. Using 5 as the cols argument specifies that the upper-left cell in the
-	 *								reference is five columns to the right of reference. Cols can be positive (which means
-	 *								to the right of the starting reference) or negative (which means to the left of the
-	 *								starting reference).
-	 * @param	height			The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
-	 * @param	width			The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
-	 * @return	string			A reference to a cell or range of cells
-	 */
-	public static function OFFSET($cellAddress=Null,$rows=0,$columns=0,$height=null,$width=null) {
-		$rows		= PHPExcel_Calculation_Functions::flattenSingleValue($rows);
-		$columns	= PHPExcel_Calculation_Functions::flattenSingleValue($columns);
-		$height		= PHPExcel_Calculation_Functions::flattenSingleValue($height);
-		$width		= PHPExcel_Calculation_Functions::flattenSingleValue($width);
-		if ($cellAddress == Null) {
-			return 0;
-		}
-
-		$args = func_get_args();
-		$pCell = array_pop($args);
-		if (!is_object($pCell)) {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-
-		$sheetName = NULL;
-		if (strpos($cellAddress,"!")) {
-			list($sheetName,$cellAddress) = explode("!",$cellAddress);
-			$sheetName = trim($sheetName, "'");
-		}
-		if (strpos($cellAddress,":")) {
-			list($startCell,$endCell) = explode(":",$cellAddress);
-		} else {
-			$startCell = $endCell = $cellAddress;
-		}
-		list($startCellColumn,$startCellRow) = PHPExcel_Cell::coordinateFromString($startCell);
-		list($endCellColumn,$endCellRow) = PHPExcel_Cell::coordinateFromString($endCell);
-
-		$startCellRow += $rows;
-		$startCellColumn = PHPExcel_Cell::columnIndexFromString($startCellColumn) - 1;
-		$startCellColumn += $columns;
-
-		if (($startCellRow <= 0) || ($startCellColumn < 0)) {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-		$endCellColumn = PHPExcel_Cell::columnIndexFromString($endCellColumn) - 1;
-		if (($width != null) && (!is_object($width))) {
-			$endCellColumn = $startCellColumn + $width - 1;
-		} else {
-			$endCellColumn += $columns;
-		}
-		$startCellColumn = PHPExcel_Cell::stringFromColumnIndex($startCellColumn);
-
-		if (($height != null) && (!is_object($height))) {
-			$endCellRow = $startCellRow + $height - 1;
-		} else {
-			$endCellRow += $rows;
-		}
-
-		if (($endCellRow <= 0) || ($endCellColumn < 0)) {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-		$endCellColumn = PHPExcel_Cell::stringFromColumnIndex($endCellColumn);
-
-		$cellAddress = $startCellColumn.$startCellRow;
-		if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
-			$cellAddress .= ':'.$endCellColumn.$endCellRow;
-		}
-
-		if ($sheetName !== NULL) {
-			$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
-		} else {
-			$pSheet = $pCell->getWorksheet();
-		}
-
-		return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False);
-	}	//	function OFFSET()
-
-
-	/**
-	 * CHOOSE
-	 *
-	 * Uses lookup_value to return a value from the list of value arguments.
-	 * Use CHOOSE to select one of up to 254 values based on the lookup_value.
-	 *
-	 * Excel Function:
-	 *		=CHOOSE(index_num, value1, [value2], ...)
-	 *
-	 * @param	index_num		Specifies which value argument is selected.
-	 *							Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number
-	 *								between 1 and 254.
-	 * @param	value1...		Value1 is required, subsequent values are optional.
-	 *							Between 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on
-	 *								index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or
-	 *								text.
-	 * @return	mixed			The selected value
-	 */
-	public static function CHOOSE() {
-		$chooseArgs = func_get_args();
-		$chosenEntry = PHPExcel_Calculation_Functions::flattenArray(array_shift($chooseArgs));
-		$entryCount = count($chooseArgs) - 1;
-
-		if(is_array($chosenEntry)) {
-			$chosenEntry = array_shift($chosenEntry);
-		}
-		if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) {
-			--$chosenEntry;
-		} else {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$chosenEntry = floor($chosenEntry);
-		if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (is_array($chooseArgs[$chosenEntry])) {
-			return PHPExcel_Calculation_Functions::flattenArray($chooseArgs[$chosenEntry]);
-		} else {
-			return $chooseArgs[$chosenEntry];
-		}
-	}	//	function CHOOSE()
-
-
-	/**
-	 * MATCH
-	 *
-	 * The MATCH function searches for a specified item in a range of cells
-	 *
-	 * Excel Function:
-	 *		=MATCH(lookup_value, lookup_array, [match_type])
-	 *
-	 * @param	lookup_value	The value that you want to match in lookup_array
-	 * @param	lookup_array	The range of cells being searched
-	 * @param	match_type		The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.
-	 * @return	integer			The relative position of the found item
-	 */
-	public static function MATCH($lookup_value, $lookup_array, $match_type=1) {
-		$lookup_array = PHPExcel_Calculation_Functions::flattenArray($lookup_array);
-		$lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
-		$match_type	= (is_null($match_type)) ? 1 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($match_type);
-		//	MATCH is not case sensitive
-		$lookup_value = strtolower($lookup_value);
-
-		//	lookup_value type has to be number, text, or logical values
-		if ((!is_numeric($lookup_value)) && (!is_string($lookup_value)) && (!is_bool($lookup_value))) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		//	match_type is 0, 1 or -1
-		if (($match_type !== 0) && ($match_type !== -1) && ($match_type !== 1)) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		//	lookup_array should not be empty
-		$lookupArraySize = count($lookup_array);
-		if ($lookupArraySize <= 0) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		//	lookup_array should contain only number, text, or logical values, or empty (null) cells
-		foreach($lookup_array as $i => $lookupArrayValue) {
-			//	check the type of the value
-			if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) &&
-				(!is_bool($lookupArrayValue)) && (!is_null($lookupArrayValue))) {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			//	convert strings to lowercase for case-insensitive testing
-			if (is_string($lookupArrayValue)) {
-				$lookup_array[$i] = strtolower($lookupArrayValue);
-			}
-			if ((is_null($lookupArrayValue)) && (($match_type == 1) || ($match_type == -1))) {
-				$lookup_array = array_slice($lookup_array,0,$i-1);
-			}
-		}
-
-		// if match_type is 1 or -1, the list has to be ordered
-		if ($match_type == 1) {
-			asort($lookup_array);
-			$keySet = array_keys($lookup_array);
-		} elseif($match_type == -1) {
-			arsort($lookup_array);
-			$keySet = array_keys($lookup_array);
-		}
-
-		// **
-		// find the match
-		// **
-		// loop on the cells
-//		var_dump($lookup_array);
-//		echo '<br />';
-		foreach($lookup_array as $i => $lookupArrayValue) {
-			if (($match_type == 0) && ($lookupArrayValue == $lookup_value)) {
-				//	exact match
-				return ++$i;
-			} elseif (($match_type == -1) && ($lookupArrayValue <= $lookup_value)) {
-//				echo '$i = '.$i.' => ';
-//				var_dump($lookupArrayValue);
-//				echo '<br />';
-//				echo 'Keyset = ';
-//				var_dump($keySet);
-//				echo '<br />';
-				$i = array_search($i,$keySet);
-//				echo '$i='.$i.'<br />';
-				// if match_type is -1 <=> find the smallest value that is greater than or equal to lookup_value
-				if ($i < 1){
-					// 1st cell was allready smaller than the lookup_value
-					break;
-				} else {
-					// the previous cell was the match
-					return $keySet[$i-1]+1;
-				}
-			} elseif (($match_type == 1) && ($lookupArrayValue >= $lookup_value)) {
-//				echo '$i = '.$i.' => ';
-//				var_dump($lookupArrayValue);
-//				echo '<br />';
-//				echo 'Keyset = ';
-//				var_dump($keySet);
-//				echo '<br />';
-				$i = array_search($i,$keySet);
-//				echo '$i='.$i.'<br />';
-				// if match_type is 1 <=> find the largest value that is less than or equal to lookup_value
-				if ($i < 1){
-					// 1st cell was allready bigger than the lookup_value
-					break;
-				} else {
-					// the previous cell was the match
-					return $keySet[$i-1]+1;
-				}
-			}
-		}
-
-		//	unsuccessful in finding a match, return #N/A error value
-		return PHPExcel_Calculation_Functions::NA();
-	}	//	function MATCH()
-
-
-	/**
-	 * INDEX
-	 *
-	 * Uses an index to choose a value from a reference or array
-	 *
-	 * Excel Function:
-	 *		=INDEX(range_array, row_num, [column_num])
-	 *
-	 * @param	range_array		A range of cells or an array constant
-	 * @param	row_num			The row in array from which to return a value. If row_num is omitted, column_num is required.
-	 * @param	column_num		The column in array from which to return a value. If column_num is omitted, row_num is required.
-	 * @return	mixed			the value of a specified cell or array of cells
-	 */
-	public static function INDEX($arrayValues,$rowNum = 0,$columnNum = 0) {
-
-		if (($rowNum < 0) || ($columnNum < 0)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (!is_array($arrayValues)) {
-			return PHPExcel_Calculation_Functions::REF();
-		}
-
-		$rowKeys = array_keys($arrayValues);
-		$columnKeys = @array_keys($arrayValues[$rowKeys[0]]);
-
-		if ($columnNum > count($columnKeys)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($columnNum == 0) {
-			if ($rowNum == 0) {
-				return $arrayValues;
-			}
-			$rowNum = $rowKeys[--$rowNum];
-			$returnArray = array();
-			foreach($arrayValues as $arrayColumn) {
-				if (is_array($arrayColumn)) {
-					if (isset($arrayColumn[$rowNum])) {
-						$returnArray[] = $arrayColumn[$rowNum];
-					} else {
-						return $arrayValues[$rowNum];
-					}
-				} else {
-					return $arrayValues[$rowNum];
-				}
-			}
-			return $returnArray;
-		}
-		$columnNum = $columnKeys[--$columnNum];
-		if ($rowNum > count($rowKeys)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		} elseif ($rowNum == 0) {
-			return $arrayValues[$columnNum];
-		}
-		$rowNum = $rowKeys[--$rowNum];
-
-		return $arrayValues[$rowNum][$columnNum];
-	}	//	function INDEX()
-
-
-	/**
-	 * TRANSPOSE
-	 *
-	 * @param	array	$matrixData	A matrix of values
-	 * @return	array
-	 *
-	 * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix.
-	 */
-	public static function TRANSPOSE($matrixData) {
-		$returnMatrix = array();
-		if (!is_array($matrixData)) { $matrixData = array(array($matrixData)); }
-
-		$column = 0;
-		foreach($matrixData as $matrixRow) {
-			$row = 0;
-			foreach($matrixRow as $matrixCell) {
-				$returnMatrix[$row][$column] = $matrixCell;
-				++$row;
-			}
-			++$column;
-		}
-		return $returnMatrix;
-	}	//	function TRANSPOSE()
-
-
-	private static function _vlookupSort($a,$b) {
-		$f = array_keys($a);
-		$firstColumn = array_shift($f);
-		if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) {
-			return 0;
-		}
-		return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1;
-	}	//	function _vlookupSort()
-
-
-	/**
-	* VLOOKUP
-	* The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.
-	* @param	lookup_value	The value that you want to match in lookup_array
-	* @param	lookup_array	The range of cells being searched
-	* @param	index_number	The column number in table_array from which the matching value must be returned. The first column is 1.
-	* @param	not_exact_match	Determines if you are looking for an exact match based on lookup_value.
-	* @return	mixed			The value of the found cell
-	*/
-	public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match=true) {
-		$lookup_value	= PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
-		$index_number	= PHPExcel_Calculation_Functions::flattenSingleValue($index_number);
-		$not_exact_match	= PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match);
-
-		// index_number must be greater than or equal to 1
-		if ($index_number < 1) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		// index_number must be less than or equal to the number of columns in lookup_array
-		if ((!is_array($lookup_array)) || (empty($lookup_array))) {
-			return PHPExcel_Calculation_Functions::REF();
-		} else {
-			$f = array_keys($lookup_array);
-			$firstRow = array_pop($f);
-			if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
-				return PHPExcel_Calculation_Functions::REF();
-			} else {
-				$columnKeys = array_keys($lookup_array[$firstRow]);
-				$returnColumn = $columnKeys[--$index_number];
-				$firstColumn = array_shift($columnKeys);
-			}
-		}
-
-		if (!$not_exact_match) {
-			uasort($lookup_array,array('self','_vlookupSort'));
-		}
-
-		$rowNumber = $rowValue = False;
-		foreach($lookup_array as $rowKey => $rowData) {
-			if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) ||
-				(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) {
-				break;
-			}
-			$rowNumber = $rowKey;
-			$rowValue = $rowData[$firstColumn];
-		}
-
-		if ($rowNumber !== false) {
-			if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
-				//	if an exact match is required, we have what we need to return an appropriate response
-				return PHPExcel_Calculation_Functions::NA();
-			} else {
-				//	otherwise return the appropriate value
-				return $lookup_array[$rowNumber][$returnColumn];
-			}
-		}
-
-		return PHPExcel_Calculation_Functions::NA();
-	}	//	function VLOOKUP()
-
-
-/**
-    * HLOOKUP
-    * The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
-    * @param    lookup_value    The value that you want to match in lookup_array
-    * @param    lookup_array    The range of cells being searched
-    * @param    index_number    The row number in table_array from which the matching value must be returned. The first row is 1.
-    * @param    not_exact_match Determines if you are looking for an exact match based on lookup_value.
-    * @return   mixed           The value of the found cell
-    */
-    public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match=true) {
-        $lookup_value   = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
-        $index_number   = PHPExcel_Calculation_Functions::flattenSingleValue($index_number);
-        $not_exact_match    = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match);
-
-        // index_number must be greater than or equal to 1
-        if ($index_number < 1) {
-            return PHPExcel_Calculation_Functions::VALUE();
-        }
-
-        // index_number must be less than or equal to the number of columns in lookup_array
-        if ((!is_array($lookup_array)) || (empty($lookup_array))) {
-            return PHPExcel_Calculation_Functions::REF();
-        } else {
-            $f = array_keys($lookup_array);
-            $firstRow = array_pop($f);
-            if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
-                return PHPExcel_Calculation_Functions::REF();
-            } else {
-                $columnKeys = array_keys($lookup_array[$firstRow]);
-                                $firstkey = $f[0] - 1;
-                $returnColumn = $firstkey + $index_number;
-                $firstColumn = array_shift($f);
-            }
-        }
-
-        if (!$not_exact_match) {
-            $firstRowH = asort($lookup_array[$firstColumn]);
-        }
-
-        $rowNumber = $rowValue = False;
-        foreach($lookup_array[$firstColumn] as $rowKey => $rowData) {
-			if ((is_numeric($lookup_value) && is_numeric($rowData) && ($rowData > $lookup_value)) ||
-				(!is_numeric($lookup_value) && !is_numeric($rowData) && (strtolower($rowData) > strtolower($lookup_value)))) {
-                break;
-            }
-            $rowNumber = $rowKey;
-            $rowValue = $rowData;
-        }
-
-        if ($rowNumber !== false) {
-            if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
-                //  if an exact match is required, we have what we need to return an appropriate response
-                return PHPExcel_Calculation_Functions::NA();
-            } else {
-                //  otherwise return the appropriate value
-                return $lookup_array[$returnColumn][$rowNumber];
-            }
-        }
-
-        return PHPExcel_Calculation_Functions::NA();
-    }   //  function HLOOKUP()
-
-
-	/**
-	 * LOOKUP
-	 * The LOOKUP function searches for value either from a one-row or one-column range or from an array.
-	 * @param	lookup_value	The value that you want to match in lookup_array
-	 * @param	lookup_vector	The range of cells being searched
-	 * @param	result_vector	The column from which the matching value must be returned
-	 * @return	mixed			The value of the found cell
-	 */
-	public static function LOOKUP($lookup_value, $lookup_vector, $result_vector=null) {
-		$lookup_value	= PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
-
-		if (!is_array($lookup_vector)) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-		$lookupRows = count($lookup_vector);
-		$l = array_keys($lookup_vector);
-		$l = array_shift($l);
-		$lookupColumns = count($lookup_vector[$l]);
-		if ((($lookupRows == 1) && ($lookupColumns > 1)) || (($lookupRows == 2) && ($lookupColumns != 2))) {
-			$lookup_vector = self::TRANSPOSE($lookup_vector);
-			$lookupRows = count($lookup_vector);
-			$l = array_keys($lookup_vector);
-			$lookupColumns = count($lookup_vector[array_shift($l)]);
-		}
-
-		if (is_null($result_vector)) {
-			$result_vector = $lookup_vector;
-		}
-		$resultRows = count($result_vector);
-		$l = array_keys($result_vector);
-		$l = array_shift($l);
-		$resultColumns = count($result_vector[$l]);
-		if ((($resultRows == 1) && ($resultColumns > 1)) || (($resultRows == 2) && ($resultColumns != 2))) {
-			$result_vector = self::TRANSPOSE($result_vector);
-			$resultRows = count($result_vector);
-			$r = array_keys($result_vector);
-			$resultColumns = count($result_vector[array_shift($r)]);
-		}
-
-		if ($lookupRows == 2) {
-			$result_vector = array_pop($lookup_vector);
-			$lookup_vector = array_shift($lookup_vector);
-		}
-		if ($lookupColumns != 2) {
-			foreach($lookup_vector as &$value) {
-				if (is_array($value)) {
-					$k = array_keys($value);
-					$key1 = $key2 = array_shift($k);
-					$key2++;
-					$dataValue1 = $value[$key1];
-				} else {
-					$key1 = 0;
-					$key2 = 1;
-					$dataValue1 = $value;
-				}
-				$dataValue2 = array_shift($result_vector);
-				if (is_array($dataValue2)) {
-					$dataValue2 = array_shift($dataValue2);
-				}
-				$value = array($key1 => $dataValue1, $key2 => $dataValue2);
-			}
-			unset($value);
-		}
-
-		return self::VLOOKUP($lookup_value,$lookup_vector,2);
- 	}	//	function LOOKUP()
-
-}	//	class PHPExcel_Calculation_LookupRef

+ 0 - 1376
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php

@@ -1,1376 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_MathTrig
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_MathTrig {
-
-	//
-	//	Private method to return an array of the factors of the input value
-	//
-	private static function _factors($value) {
-		$startVal = floor(sqrt($value));
-
-		$factorArray = array();
-		for ($i = $startVal; $i > 1; --$i) {
-			if (($value % $i) == 0) {
-				$factorArray = array_merge($factorArray,self::_factors($value / $i));
-				$factorArray = array_merge($factorArray,self::_factors($i));
-				if ($i <= sqrt($value)) {
-					break;
-				}
-			}
-		}
-		if (!empty($factorArray)) {
-			rsort($factorArray);
-			return $factorArray;
-		} else {
-			return array((integer) $value);
-		}
-	}	//	function _factors()
-
-
-	private static function _romanCut($num, $n) {
-		return ($num - ($num % $n ) ) / $n;
-	}	//	function _romanCut()
-
-
-	/**
-	 * ATAN2
-	 *
-	 * This function calculates the arc tangent of the two variables x and y. It is similar to
-	 *		calculating the arc tangent of y ÷ x, except that the signs of both arguments are used
-	 *		to determine the quadrant of the result.
-	 * The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a
-	 *		point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between
-	 *		-pi and pi, excluding -pi.
-	 *
-	 * Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard
-	 *		PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.
-	 *
-	 * Excel Function:
-	 *		ATAN2(xCoordinate,yCoordinate)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$xCoordinate		The x-coordinate of the point.
-	 * @param	float	$yCoordinate		The y-coordinate of the point.
-	 * @return	float	The inverse tangent of the specified x- and y-coordinates.
-	 */
-	public static function ATAN2($xCoordinate = NULL, $yCoordinate = NULL) {
-		$xCoordinate	= PHPExcel_Calculation_Functions::flattenSingleValue($xCoordinate);
-		$yCoordinate	= PHPExcel_Calculation_Functions::flattenSingleValue($yCoordinate);
-
-		$xCoordinate	= ($xCoordinate !== NULL)	? $xCoordinate : 0.0;
-		$yCoordinate	= ($yCoordinate !== NULL)	? $yCoordinate : 0.0;
-
-		if (((is_numeric($xCoordinate)) || (is_bool($xCoordinate))) &&
-			((is_numeric($yCoordinate)))  || (is_bool($yCoordinate))) {
-			$xCoordinate	= (float) $xCoordinate;
-			$yCoordinate	= (float) $yCoordinate;
-
-			if (($xCoordinate == 0) && ($yCoordinate == 0)) {
-				return PHPExcel_Calculation_Functions::DIV0();
-			}
-
-			return atan2($yCoordinate, $xCoordinate);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ATAN2()
-
-
-	/**
-	 * CEILING
-	 *
-	 * Returns number rounded up, away from zero, to the nearest multiple of significance.
-	 *		For example, if you want to avoid using pennies in your prices and your product is
-	 *		priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the
-	 *		nearest nickel.
-	 *
-	 * Excel Function:
-	 *		CEILING(number[,significance])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$number			The number you want to round.
-	 * @param	float	$significance	The multiple to which you want to round.
-	 * @return	float	Rounded Number
-	 */
-	public static function CEILING($number, $significance = NULL) {
-		$number			= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$significance	= PHPExcel_Calculation_Functions::flattenSingleValue($significance);
-
-		if ((is_null($significance)) &&
-			(PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) {
-			$significance = $number/abs($number);
-		}
-
-        if ((is_numeric($number)) && (is_numeric($significance))) {
-            if (($number == 0.0 ) || ($significance == 0.0)) {
-				return 0.0;
-			} elseif (self::SIGN($number) == self::SIGN($significance)) {
-				return ceil($number / $significance) * $significance;
-			} else {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function CEILING()
-
-
-	/**
-	 * COMBIN
-	 *
-	 * Returns the number of combinations for a given number of items. Use COMBIN to
-	 *		determine the total possible number of groups for a given number of items.
-	 *
-	 * Excel Function:
-	 *		COMBIN(numObjs,numInSet)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	int		$numObjs	Number of different objects
-	 * @param	int		$numInSet	Number of objects in each combination
-	 * @return	int		Number of combinations
-	 */
-	public static function COMBIN($numObjs, $numInSet) {
-		$numObjs	= PHPExcel_Calculation_Functions::flattenSingleValue($numObjs);
-		$numInSet	= PHPExcel_Calculation_Functions::flattenSingleValue($numInSet);
-
-		if ((is_numeric($numObjs)) && (is_numeric($numInSet))) {
-			if ($numObjs < $numInSet) {
-				return PHPExcel_Calculation_Functions::NaN();
-			} elseif ($numInSet < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return round(self::FACT($numObjs) / self::FACT($numObjs - $numInSet)) / self::FACT($numInSet);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function COMBIN()
-
-
-	/**
-	 * EVEN
-	 *
-	 * Returns number rounded up to the nearest even integer.
-	 * You can use this function for processing items that come in twos. For example,
-	 *		a packing crate accepts rows of one or two items. The crate is full when
-	 *		the number of items, rounded up to the nearest two, matches the crate's
-	 *		capacity.
-	 *
-	 * Excel Function:
-	 *		EVEN(number)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$number			Number to round
-	 * @return	int		Rounded Number
-	 */
-	public static function EVEN($number) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-
-		if (is_null($number)) {
-			return 0;
-		} elseif (is_bool($number)) {
-			$number = (int) $number;
-		}
-
-		if (is_numeric($number)) {
-			$significance = 2 * self::SIGN($number);
-			return (int) self::CEILING($number,$significance);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function EVEN()
-
-
-	/**
-	 * FACT
-	 *
-	 * Returns the factorial of a number.
-	 * The factorial of a number is equal to 1*2*3*...* number.
-	 *
-	 * Excel Function:
-	 *		FACT(factVal)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$factVal	Factorial Value
-	 * @return	int		Factorial
-	 */
-	public static function FACT($factVal) {
-		$factVal	= PHPExcel_Calculation_Functions::flattenSingleValue($factVal);
-
-		if (is_numeric($factVal)) {
-			if ($factVal < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$factLoop = floor($factVal);
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				if ($factVal > $factLoop) {
-					return PHPExcel_Calculation_Functions::NaN();
-				}
-			}
-
-			$factorial = 1;
-			while ($factLoop > 1) {
-				$factorial *= $factLoop--;
-			}
-			return $factorial ;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function FACT()
-
-
-	/**
-	 * FACTDOUBLE
-	 *
-	 * Returns the double factorial of a number.
-	 *
-	 * Excel Function:
-	 *		FACTDOUBLE(factVal)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$factVal	Factorial Value
-	 * @return	int		Double Factorial
-	 */
-	public static function FACTDOUBLE($factVal) {
-		$factLoop	= PHPExcel_Calculation_Functions::flattenSingleValue($factVal);
-
-		if (is_numeric($factLoop)) {
-			$factLoop	= floor($factLoop);
-			if ($factVal < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$factorial = 1;
-			while ($factLoop > 1) {
-				$factorial *= $factLoop--;
-				--$factLoop;
-			}
-			return $factorial ;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function FACTDOUBLE()
-
-
-	/**
-	 * FLOOR
-	 *
-	 * Rounds number down, toward zero, to the nearest multiple of significance.
-	 *
-	 * Excel Function:
-	 *		FLOOR(number[,significance])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$number			Number to round
-	 * @param	float	$significance	Significance
-	 * @return	float	Rounded Number
-	 */
-	public static function FLOOR($number, $significance = NULL) {
-		$number			= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$significance	= PHPExcel_Calculation_Functions::flattenSingleValue($significance);
-
-		if ((is_null($significance)) && (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) {
-			$significance = $number/abs($number);
-		}
-
-		if ((is_numeric($number)) && (is_numeric($significance))) {
-            if ($significance == 0.0) {
-                return PHPExcel_Calculation_Functions::DIV0();
-            } elseif ($number == 0.0) {
-				return 0.0;
-			} elseif (self::SIGN($number) == self::SIGN($significance)) {
-				return floor($number / $significance) * $significance;
-			} else {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-		} else
-
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function FLOOR()
-
-
-	/**
-	 * GCD
-	 *
-	 * Returns the greatest common divisor of a series of numbers.
-	 * The greatest common divisor is the largest integer that divides both
-	 *		number1 and number2 without a remainder.
-	 *
-	 * Excel Function:
-	 *		GCD(number1[,number2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed	$arg,...		Data values
-	 * @return	integer					Greatest Common Divisor
-	 */
-	public static function GCD() {
-		$returnValue = 1;
-		$allValuesFactors = array();
-		// Loop through arguments
-		foreach(PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) {
-			if (!is_numeric($value)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			} elseif ($value == 0) {
-				continue;
-			} elseif($value < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$myFactors = self::_factors($value);
-			$myCountedFactors = array_count_values($myFactors);
-			$allValuesFactors[] = $myCountedFactors;
-		}
-		$allValuesCount = count($allValuesFactors);
-		if ($allValuesCount == 0) {
-			return 0;
-		}
-
-		$mergedArray = $allValuesFactors[0];
-		for ($i=1;$i < $allValuesCount; ++$i) {
-			$mergedArray = array_intersect_key($mergedArray,$allValuesFactors[$i]);
-		}
-		$mergedArrayValues = count($mergedArray);
-		if ($mergedArrayValues == 0) {
-			return $returnValue;
-		} elseif ($mergedArrayValues > 1) {
-			foreach($mergedArray as $mergedKey => $mergedValue) {
-				foreach($allValuesFactors as $highestPowerTest) {
-					foreach($highestPowerTest as $testKey => $testValue) {
-						if (($testKey == $mergedKey) && ($testValue < $mergedValue)) {
-							$mergedArray[$mergedKey] = $testValue;
-							$mergedValue = $testValue;
-						}
-					}
-				}
-			}
-
-			$returnValue = 1;
-			foreach($mergedArray as $key => $value) {
-				$returnValue *= pow($key,$value);
-			}
-			return $returnValue;
-		} else {
-			$keys = array_keys($mergedArray);
-			$key = $keys[0];
-			$value = $mergedArray[$key];
-			foreach($allValuesFactors as $testValue) {
-				foreach($testValue as $mergedKey => $mergedValue) {
-					if (($mergedKey == $key) && ($mergedValue < $value)) {
-						$value = $mergedValue;
-					}
-				}
-			}
-			return pow($key,$value);
-		}
-	}	//	function GCD()
-
-
-	/**
-	 * INT
-	 *
-	 * Casts a floating point value to an integer
-	 *
-	 * Excel Function:
-	 *		INT(number)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$number			Number to cast to an integer
-	 * @return	integer	Integer value
-	 */
-	public static function INT($number) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-
-		if (is_null($number)) {
-			return 0;
-		} elseif (is_bool($number)) {
-			return (int) $number;
-		}
-		if (is_numeric($number)) {
-			return (int) floor($number);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function INT()
-
-
-	/**
-	 * LCM
-	 *
-	 * Returns the lowest common multiplier of a series of numbers
-	 * The least common multiple is the smallest positive integer that is a multiple
-	 * of all integer arguments number1, number2, and so on. Use LCM to add fractions
-	 * with different denominators.
-	 *
-	 * Excel Function:
-	 *		LCM(number1[,number2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed	$arg,...		Data values
-	 * @return	int		Lowest Common Multiplier
-	 */
-	public static function LCM() {
-		$returnValue = 1;
-		$allPoweredFactors = array();
-		// Loop through arguments
-		foreach(PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) {
-			if (!is_numeric($value)) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-			if ($value == 0) {
-				return 0;
-			} elseif ($value < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$myFactors = self::_factors(floor($value));
-			$myCountedFactors = array_count_values($myFactors);
-			$myPoweredFactors = array();
-			foreach($myCountedFactors as $myCountedFactor => $myCountedPower) {
-				$myPoweredFactors[$myCountedFactor] = pow($myCountedFactor,$myCountedPower);
-			}
-			foreach($myPoweredFactors as $myPoweredValue => $myPoweredFactor) {
-				if (array_key_exists($myPoweredValue,$allPoweredFactors)) {
-					if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) {
-						$allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
-					}
-				} else {
-					$allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
-				}
-			}
-		}
-		foreach($allPoweredFactors as $allPoweredFactor) {
-			$returnValue *= (integer) $allPoweredFactor;
-		}
-		return $returnValue;
-	}	//	function LCM()
-
-
-	/**
-	 * LOG_BASE
-	 *
-	 * Returns the logarithm of a number to a specified base. The default base is 10.
-	 *
-	 * Excel Function:
-	 *		LOG(number[,base])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	float	$number		The positive real number for which you want the logarithm
-	 * @param	float	$base		The base of the logarithm. If base is omitted, it is assumed to be 10.
-	 * @return	float
-	 */
-	public static function LOG_BASE($number = NULL, $base = 10) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$base	= (is_null($base)) ? 10 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($base);
-
-		if ((!is_numeric($base)) || (!is_numeric($number)))
-			return PHPExcel_Calculation_Functions::VALUE();
-		if (($base <= 0) || ($number <= 0))
-			return PHPExcel_Calculation_Functions::NaN();
-		return log($number, $base);
-	}	//	function LOG_BASE()
-
-
-	/**
-	 * MDETERM
-	 *
-	 * Returns the matrix determinant of an array.
-	 *
-	 * Excel Function:
-	 *		MDETERM(array)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	array	$matrixValues	A matrix of values
-	 * @return	float
-	 */
-	public static function MDETERM($matrixValues) {
-		$matrixData = array();
-		if (!is_array($matrixValues)) { $matrixValues = array(array($matrixValues)); }
-
-		$row = $maxColumn = 0;
-		foreach($matrixValues as $matrixRow) {
-			if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
-			$column = 0;
-			foreach($matrixRow as $matrixCell) {
-				if ((is_string($matrixCell)) || ($matrixCell === null)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-				$matrixData[$column][$row] = $matrixCell;
-				++$column;
-			}
-			if ($column > $maxColumn) { $maxColumn = $column; }
-			++$row;
-		}
-		if ($row != $maxColumn) { return PHPExcel_Calculation_Functions::VALUE(); }
-
-		try {
-			$matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData);
-			return $matrix->det();
-		} catch (PHPExcel_Exception $ex) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-	}	//	function MDETERM()
-
-
-	/**
-	 * MINVERSE
-	 *
-	 * Returns the inverse matrix for the matrix stored in an array.
-	 *
-	 * Excel Function:
-	 *		MINVERSE(array)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	array	$matrixValues	A matrix of values
-	 * @return	array
-	 */
-	public static function MINVERSE($matrixValues) {
-		$matrixData = array();
-		if (!is_array($matrixValues)) { $matrixValues = array(array($matrixValues)); }
-
-		$row = $maxColumn = 0;
-		foreach($matrixValues as $matrixRow) {
-			if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
-			$column = 0;
-			foreach($matrixRow as $matrixCell) {
-				if ((is_string($matrixCell)) || ($matrixCell === null)) {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-				$matrixData[$column][$row] = $matrixCell;
-				++$column;
-			}
-			if ($column > $maxColumn) { $maxColumn = $column; }
-			++$row;
-		}
-		if ($row != $maxColumn) { return PHPExcel_Calculation_Functions::VALUE(); }
-
-		try {
-			$matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData);
-			return $matrix->inverse()->getArray();
-		} catch (PHPExcel_Exception $ex) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-	}	//	function MINVERSE()
-
-
-	/**
-	 * MMULT
-	 *
-	 * @param	array	$matrixData1	A matrix of values
-	 * @param	array	$matrixData2	A matrix of values
-	 * @return	array
-	 */
-	public static function MMULT($matrixData1,$matrixData2) {
-		$matrixAData = $matrixBData = array();
-		if (!is_array($matrixData1)) { $matrixData1 = array(array($matrixData1)); }
-		if (!is_array($matrixData2)) { $matrixData2 = array(array($matrixData2)); }
-
-		try {
-            $rowA = 0;
-            foreach($matrixData1 as $matrixRow) {
-                if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
-                $columnA = 0;
-                foreach($matrixRow as $matrixCell) {
-                    if ((!is_numeric($matrixCell)) || ($matrixCell === null)) {
-                        return PHPExcel_Calculation_Functions::VALUE();
-                    }
-                    $matrixAData[$rowA][$columnA] = $matrixCell;
-                    ++$columnA;
-                }
-                ++$rowA;
-            }
-			$matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData);
-			$rowB = 0;
-			foreach($matrixData2 as $matrixRow) {
-				if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
-				$columnB = 0;
-				foreach($matrixRow as $matrixCell) {
-					if ((!is_numeric($matrixCell)) || ($matrixCell === null)) {
-						return PHPExcel_Calculation_Functions::VALUE();
-					}
-					$matrixBData[$rowB][$columnB] = $matrixCell;
-					++$columnB;
-				}
-				++$rowB;
-			}
-			$matrixB = new PHPExcel_Shared_JAMA_Matrix($matrixBData);
-
-			if ($columnA != $rowB) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-
-			return $matrixA->times($matrixB)->getArray();
-		} catch (PHPExcel_Exception $ex) {
-            var_dump($ex->getMessage());
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-	}	//	function MMULT()
-
-
-	/**
-	 * MOD
-	 *
-	 * @param	int		$a		Dividend
-	 * @param	int		$b		Divisor
-	 * @return	int		Remainder
-	 */
-	public static function MOD($a = 1, $b = 1) {
-		$a		= PHPExcel_Calculation_Functions::flattenSingleValue($a);
-		$b		= PHPExcel_Calculation_Functions::flattenSingleValue($b);
-
-		if ($b == 0.0) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		} elseif (($a < 0.0) && ($b > 0.0)) {
-			return $b - fmod(abs($a),$b);
-		} elseif (($a > 0.0) && ($b < 0.0)) {
-			return $b + fmod($a,abs($b));
-		}
-
-		return fmod($a,$b);
-	}	//	function MOD()
-
-
-	/**
-	 * MROUND
-	 *
-	 * Rounds a number to the nearest multiple of a specified value
-	 *
-	 * @param	float	$number			Number to round
-	 * @param	int		$multiple		Multiple to which you want to round $number
-	 * @return	float	Rounded Number
-	 */
-	public static function MROUND($number,$multiple) {
-		$number		= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$multiple	= PHPExcel_Calculation_Functions::flattenSingleValue($multiple);
-
-		if ((is_numeric($number)) && (is_numeric($multiple))) {
-			if ($multiple == 0) {
-				return 0;
-			}
-			if ((self::SIGN($number)) == (self::SIGN($multiple))) {
-				$multiplier = 1 / $multiple;
-				return round($number * $multiplier) / $multiplier;
-			}
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function MROUND()
-
-
-	/**
-	 * MULTINOMIAL
-	 *
-	 * Returns the ratio of the factorial of a sum of values to the product of factorials.
-	 *
-	 * @param	array of mixed		Data Series
-	 * @return	float
-	 */
-	public static function MULTINOMIAL() {
-		$summer = 0;
-		$divisor = 1;
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
-			// Is it a numeric value?
-			if (is_numeric($arg)) {
-				if ($arg < 1) {
-					return PHPExcel_Calculation_Functions::NaN();
-				}
-				$summer += floor($arg);
-				$divisor *= self::FACT($arg);
-			} else {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-		}
-
-		// Return
-		if ($summer > 0) {
-			$summer = self::FACT($summer);
-			return $summer / $divisor;
-		}
-		return 0;
-	}	//	function MULTINOMIAL()
-
-
-	/**
-	 * ODD
-	 *
-	 * Returns number rounded up to the nearest odd integer.
-	 *
-	 * @param	float	$number			Number to round
-	 * @return	int		Rounded Number
-	 */
-	public static function ODD($number) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-
-		if (is_null($number)) {
-			return 1;
-		} elseif (is_bool($number)) {
-			$number = (int) $number;
-		}
-
-		if (is_numeric($number)) {
-			$significance = self::SIGN($number);
-			if ($significance == 0) {
-				return 1;
-			}
-
-			$result = self::CEILING($number,$significance);
-			if ($result == self::EVEN($result)) {
-				$result += $significance;
-			}
-
-			return (int) $result;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ODD()
-
-
-	/**
-	 * POWER
-	 *
-	 * Computes x raised to the power y.
-	 *
-	 * @param	float		$x
-	 * @param	float		$y
-	 * @return	float
-	 */
-	public static function POWER($x = 0, $y = 2) {
-		$x	= PHPExcel_Calculation_Functions::flattenSingleValue($x);
-		$y	= PHPExcel_Calculation_Functions::flattenSingleValue($y);
-
-		// Validate parameters
-		if ($x == 0.0 && $y == 0.0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		} elseif ($x == 0.0 && $y < 0.0) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		// Return
-		$result = pow($x, $y);
-		return (!is_nan($result) && !is_infinite($result)) ? $result : PHPExcel_Calculation_Functions::NaN();
-	}	//	function POWER()
-
-
-	/**
-	 * PRODUCT
-	 *
-	 * PRODUCT returns the product of all the values and cells referenced in the argument list.
-	 *
-	 * Excel Function:
-	 *		PRODUCT(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function PRODUCT() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if (is_null($returnValue)) {
-					$returnValue = $arg;
-				} else {
-					$returnValue *= $arg;
-				}
-			}
-		}
-
-		// Return
-		if (is_null($returnValue)) {
-			return 0;
-		}
-		return $returnValue;
-	}	//	function PRODUCT()
-
-
-	/**
-	 * QUOTIENT
-	 *
-	 * QUOTIENT function returns the integer portion of a division. Numerator is the divided number
-	 *		and denominator is the divisor.
-	 *
-	 * Excel Function:
-	 *		QUOTIENT(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function QUOTIENT() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if (is_null($returnValue)) {
-					$returnValue = ($arg == 0) ? 0 : $arg;
-				} else {
-					if (($returnValue == 0) || ($arg == 0)) {
-						$returnValue = 0;
-					} else {
-						$returnValue /= $arg;
-					}
-				}
-			}
-		}
-
-		// Return
-		return intval($returnValue);
-	}	//	function QUOTIENT()
-
-
-	/**
-	 * RAND
-	 *
-	 * @param	int		$min	Minimal value
-	 * @param	int		$max	Maximal value
-	 * @return	int		Random number
-	 */
-	public static function RAND($min = 0, $max = 0) {
-		$min		= PHPExcel_Calculation_Functions::flattenSingleValue($min);
-		$max		= PHPExcel_Calculation_Functions::flattenSingleValue($max);
-
-		if ($min == 0 && $max == 0) {
-			return (mt_rand(0,10000000)) / 10000000;
-		} else {
-			return mt_rand($min, $max);
-		}
-	}	//	function RAND()
-
-
-	public static function ROMAN($aValue, $style=0) {
-		$aValue	= PHPExcel_Calculation_Functions::flattenSingleValue($aValue);
-		$style	= (is_null($style))	? 0 :	(integer) PHPExcel_Calculation_Functions::flattenSingleValue($style);
-		if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$aValue = (integer) $aValue;
-		if ($aValue == 0) {
-			return '';
-		}
-
-		$mill = Array('', 'M', 'MM', 'MMM', 'MMMM', 'MMMMM');
-		$cent = Array('', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM');
-		$tens = Array('', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC');
-		$ones = Array('', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX');
-
-		$roman = '';
-		while ($aValue > 5999) {
-			$roman .= 'M';
-			$aValue -= 1000;
-		}
-		$m = self::_romanCut($aValue, 1000);	$aValue %= 1000;
-		$c = self::_romanCut($aValue, 100);		$aValue %= 100;
-		$t = self::_romanCut($aValue, 10);		$aValue %= 10;
-
-		return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue];
-	}	//	function ROMAN()
-
-
-	/**
-	 * ROUNDUP
-	 *
-	 * Rounds a number up to a specified number of decimal places
-	 *
-	 * @param	float	$number			Number to round
-	 * @param	int		$digits			Number of digits to which you want to round $number
-	 * @return	float	Rounded Number
-	 */
-	public static function ROUNDUP($number,$digits) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$digits	= PHPExcel_Calculation_Functions::flattenSingleValue($digits);
-
-		if ((is_numeric($number)) && (is_numeric($digits))) {
-			$significance = pow(10,(int) $digits);
-			if ($number < 0.0) {
-				return floor($number * $significance) / $significance;
-			} else {
-				return ceil($number * $significance) / $significance;
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ROUNDUP()
-
-
-	/**
-	 * ROUNDDOWN
-	 *
-	 * Rounds a number down to a specified number of decimal places
-	 *
-	 * @param	float	$number			Number to round
-	 * @param	int		$digits			Number of digits to which you want to round $number
-	 * @return	float	Rounded Number
-	 */
-	public static function ROUNDDOWN($number,$digits) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-		$digits	= PHPExcel_Calculation_Functions::flattenSingleValue($digits);
-
-		if ((is_numeric($number)) && (is_numeric($digits))) {
-			$significance = pow(10,(int) $digits);
-			if ($number < 0.0) {
-				return ceil($number * $significance) / $significance;
-			} else {
-				return floor($number * $significance) / $significance;
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function ROUNDDOWN()
-
-
-	/**
-	 * SERIESSUM
-	 *
-	 * Returns the sum of a power series
-	 *
-	 * @param	float			$x	Input value to the power series
-	 * @param	float			$n	Initial power to which you want to raise $x
-	 * @param	float			$m	Step by which to increase $n for each term in the series
-	 * @param	array of mixed		Data Series
-	 * @return	float
-	 */
-	public static function SERIESSUM() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		$x = array_shift($aArgs);
-		$n = array_shift($aArgs);
-		$m = array_shift($aArgs);
-
-		if ((is_numeric($x)) && (is_numeric($n)) && (is_numeric($m))) {
-			// Calculate
-			$i = 0;
-			foreach($aArgs as $arg) {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$returnValue += $arg * pow($x,$n + ($m * $i++));
-				} else {
-					return PHPExcel_Calculation_Functions::VALUE();
-				}
-			}
-			// Return
-			return $returnValue;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SERIESSUM()
-
-
-	/**
-	 * SIGN
-	 *
-	 * Determines the sign of a number. Returns 1 if the number is positive, zero (0)
-	 *		if the number is 0, and -1 if the number is negative.
-	 *
-	 * @param	float	$number			Number to round
-	 * @return	int		sign value
-	 */
-	public static function SIGN($number) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-
-		if (is_bool($number))
-			return (int) $number;
-		if (is_numeric($number)) {
-			if ($number == 0.0) {
-				return 0;
-			}
-			return $number / abs($number);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SIGN()
-
-
-	/**
-	 * SQRTPI
-	 *
-	 * Returns the square root of (number * pi).
-	 *
-	 * @param	float	$number		Number
-	 * @return	float	Square Root of Number * Pi
-	 */
-	public static function SQRTPI($number) {
-		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);
-
-		if (is_numeric($number)) {
-			if ($number < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return sqrt($number * M_PI) ;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SQRTPI()
-
-
-	/**
-	 * SUBTOTAL
-	 *
-	 * Returns a subtotal in a list or database.
-	 *
-	 * @param	int		the number 1 to 11 that specifies which function to
-	 *					use in calculating subtotals within a list.
-	 * @param	array of mixed		Data Series
-	 * @return	float
-	 */
-	public static function SUBTOTAL() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$subtotal = array_shift($aArgs);
-
-		if ((is_numeric($subtotal)) && (!is_string($subtotal))) {
-			switch($subtotal) {
-				case 1	:
-					return PHPExcel_Calculation_Statistical::AVERAGE($aArgs);
-					break;
-				case 2	:
-					return PHPExcel_Calculation_Statistical::COUNT($aArgs);
-					break;
-				case 3	:
-					return PHPExcel_Calculation_Statistical::COUNTA($aArgs);
-					break;
-				case 4	:
-					return PHPExcel_Calculation_Statistical::MAX($aArgs);
-					break;
-				case 5	:
-					return PHPExcel_Calculation_Statistical::MIN($aArgs);
-					break;
-				case 6	:
-					return self::PRODUCT($aArgs);
-					break;
-				case 7	:
-					return PHPExcel_Calculation_Statistical::STDEV($aArgs);
-					break;
-				case 8	:
-					return PHPExcel_Calculation_Statistical::STDEVP($aArgs);
-					break;
-				case 9	:
-					return self::SUM($aArgs);
-					break;
-				case 10	:
-					return PHPExcel_Calculation_Statistical::VARFunc($aArgs);
-					break;
-				case 11	:
-					return PHPExcel_Calculation_Statistical::VARP($aArgs);
-					break;
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SUBTOTAL()
-
-
-	/**
-	 * SUM
-	 *
-	 * SUM computes the sum of all the values and cells referenced in the argument list.
-	 *
-	 * Excel Function:
-	 *		SUM(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function SUM() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through the arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$returnValue += $arg;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function SUM()
-
-
-	/**
-	 * SUMIF
-	 *
-	 * Counts the number of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		SUMIF(value1[,value2[, ...]],condition)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	string		$condition		The criteria that defines which cells will be summed.
-	 * @return	float
-	 */
-	public static function SUMIF($aArgs,$condition,$sumArgs = array()) {
-		// Return value
-		$returnValue = 0;
-
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
-		$sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
-		if (empty($sumArgs)) {
-			$sumArgs = $aArgs;
-		}
-		$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
-		// Loop through arguments
-		foreach ($aArgs as $key => $arg) {
-			if (!is_numeric($arg)) {
-				$arg = str_replace('"', '""', $arg);
-				$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
-			}
-
-			$testCondition = '='.$arg.$condition;
-			if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
-				// Is it a value within our criteria
-				$returnValue += $sumArgs[$key];
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function SUMIF()
-
-
-	/**
-	 * SUMPRODUCT
-	 *
-	 * Excel Function:
-	 *		SUMPRODUCT(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function SUMPRODUCT() {
-		$arrayList = func_get_args();
-
-		$wrkArray = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList));
-		$wrkCellCount = count($wrkArray);
-
-		for ($i=0; $i< $wrkCellCount; ++$i) {
-			if ((!is_numeric($wrkArray[$i])) || (is_string($wrkArray[$i]))) {
-				$wrkArray[$i] = 0;
-			}
-		}
-
-		foreach($arrayList as $matrixData) {
-			$array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData);
-			$count = count($array2);
-			if ($wrkCellCount != $count) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			}
-
-			foreach ($array2 as $i => $val) {
-				if ((!is_numeric($val)) || (is_string($val))) {
-					$val = 0;
-				}
-				$wrkArray[$i] *= $val;
-			}
-		}
-
-		return array_sum($wrkArray);
-	}	//	function SUMPRODUCT()
-
-
-	/**
-	 * SUMSQ
-	 *
-	 * SUMSQ returns the sum of the squares of the arguments
-	 *
-	 * Excel Function:
-	 *		SUMSQ(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function SUMSQ() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$returnValue += ($arg * $arg);
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function SUMSQ()
-
-
-	/**
-	 * SUMX2MY2
-	 *
-	 * @param	mixed[]	$matrixData1	Matrix #1
-	 * @param	mixed[]	$matrixData2	Matrix #2
-	 * @return	float
-	 */
-	public static function SUMX2MY2($matrixData1,$matrixData2) {
-		$array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
-		$array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
-		$count1 = count($array1);
-		$count2 = count($array2);
-		if ($count1 < $count2) {
-			$count = $count1;
-		} else {
-			$count = $count2;
-		}
-
-		$result = 0;
-		for ($i = 0; $i < $count; ++$i) {
-			if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) &&
-				((is_numeric($array2[$i])) && (!is_string($array2[$i])))) {
-				$result += ($array1[$i] * $array1[$i]) - ($array2[$i] * $array2[$i]);
-			}
-		}
-
-		return $result;
-	}	//	function SUMX2MY2()
-
-
-	/**
-	 * SUMX2PY2
-	 *
-	 * @param	mixed[]	$matrixData1	Matrix #1
-	 * @param	mixed[]	$matrixData2	Matrix #2
-	 * @return	float
-	 */
-	public static function SUMX2PY2($matrixData1,$matrixData2) {
-		$array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
-		$array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
-		$count1 = count($array1);
-		$count2 = count($array2);
-		if ($count1 < $count2) {
-			$count = $count1;
-		} else {
-			$count = $count2;
-		}
-
-		$result = 0;
-		for ($i = 0; $i < $count; ++$i) {
-			if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) &&
-				((is_numeric($array2[$i])) && (!is_string($array2[$i])))) {
-				$result += ($array1[$i] * $array1[$i]) + ($array2[$i] * $array2[$i]);
-			}
-		}
-
-		return $result;
-	}	//	function SUMX2PY2()
-
-
-	/**
-	 * SUMXMY2
-	 *
-	 * @param	mixed[]	$matrixData1	Matrix #1
-	 * @param	mixed[]	$matrixData2	Matrix #2
-	 * @return	float
-	 */
-	public static function SUMXMY2($matrixData1,$matrixData2) {
-		$array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
-		$array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
-		$count1 = count($array1);
-		$count2 = count($array2);
-		if ($count1 < $count2) {
-			$count = $count1;
-		} else {
-			$count = $count2;
-		}
-
-		$result = 0;
-		for ($i = 0; $i < $count; ++$i) {
-			if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) &&
-				((is_numeric($array2[$i])) && (!is_string($array2[$i])))) {
-				$result += ($array1[$i] - $array2[$i]) * ($array1[$i] - $array2[$i]);
-			}
-		}
-
-		return $result;
-	}	//	function SUMXMY2()
-
-
-	/**
-	 * TRUNC
-	 *
-	 * Truncates value to the number of fractional digits by number_digits.
-	 *
-	 * @param	float		$value
-	 * @param	int			$digits
-	 * @return	float		Truncated value
-	 */
-	public static function TRUNC($value = 0, $digits = 0) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$digits	= PHPExcel_Calculation_Functions::flattenSingleValue($digits);
-
-		// Validate parameters
-		if ((!is_numeric($value)) || (!is_numeric($digits)))
-			return PHPExcel_Calculation_Functions::VALUE();
-		$digits	= floor($digits);
-
-		// Truncate
-		$adjust = pow(10, $digits);
-
-		if (($digits > 0) && (rtrim(intval((abs($value) - abs(intval($value))) * $adjust),'0') < $adjust/10))
-			return $value;
-
-		return (intval($value * $adjust)) / $adjust;
-	}	//	function TRUNC()
-
-}	//	class PHPExcel_Calculation_MathTrig

+ 0 - 3651
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php

@@ -1,3651 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/trendClass.php';
-
-
-/** LOG_GAMMA_X_MAX_VALUE */
-define('LOG_GAMMA_X_MAX_VALUE', 2.55e305);
-
-/** XMININ */
-define('XMININ', 2.23e-308);
-
-/** EPS */
-define('EPS', 2.22e-16);
-
-/** SQRT2PI */
-define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
-
-
-/**
- * PHPExcel_Calculation_Statistical
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Statistical {
-
-
-	private static function _checkTrendArrays(&$array1,&$array2) {
-		if (!is_array($array1)) { $array1 = array($array1); }
-		if (!is_array($array2)) { $array2 = array($array2); }
-
-		$array1 = PHPExcel_Calculation_Functions::flattenArray($array1);
-		$array2 = PHPExcel_Calculation_Functions::flattenArray($array2);
-		foreach($array1 as $key => $value) {
-			if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
-				unset($array1[$key]);
-				unset($array2[$key]);
-			}
-		}
-		foreach($array2 as $key => $value) {
-			if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
-				unset($array1[$key]);
-				unset($array2[$key]);
-			}
-		}
-		$array1 = array_merge($array1);
-		$array2 = array_merge($array2);
-
-		return True;
-	}	//	function _checkTrendArrays()
-
-
-	/**
-	 * Beta function.
-	 *
-	 * @author Jaco van Kooten
-	 *
-	 * @param p require p>0
-	 * @param q require q>0
-	 * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
-	 */
-	private static function _beta($p, $q) {
-		if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) {
-			return 0.0;
-		} else {
-			return exp(self::_logBeta($p, $q));
-		}
-	}	//	function _beta()
-
-
-	/**
-	 * Incomplete beta function
-	 *
-	 * @author Jaco van Kooten
-	 * @author Paul Meagher
-	 *
-	 * The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992).
-	 * @param x require 0<=x<=1
-	 * @param p require p>0
-	 * @param q require q>0
-	 * @return 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
-	 */
-	private static function _incompleteBeta($x, $p, $q) {
-		if ($x <= 0.0) {
-			return 0.0;
-		} elseif ($x >= 1.0) {
-			return 1.0;
-		} elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) {
-			return 0.0;
-		}
-		$beta_gam = exp((0 - self::_logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x));
-		if ($x < ($p + 1.0) / ($p + $q + 2.0)) {
-			return $beta_gam * self::_betaFraction($x, $p, $q) / $p;
-		} else {
-			return 1.0 - ($beta_gam * self::_betaFraction(1 - $x, $q, $p) / $q);
-		}
-	}	//	function _incompleteBeta()
-
-
-	// Function cache for _logBeta function
-	private static $_logBetaCache_p			= 0.0;
-	private static $_logBetaCache_q			= 0.0;
-	private static $_logBetaCache_result	= 0.0;
-
-	/**
-	 * The natural logarithm of the beta function.
-	 *
-	 * @param p require p>0
-	 * @param q require q>0
-	 * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
-	 * @author Jaco van Kooten
-	 */
-	private static function _logBeta($p, $q) {
-		if ($p != self::$_logBetaCache_p || $q != self::$_logBetaCache_q) {
-			self::$_logBetaCache_p = $p;
-			self::$_logBetaCache_q = $q;
-			if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) {
-				self::$_logBetaCache_result = 0.0;
-			} else {
-				self::$_logBetaCache_result = self::_logGamma($p) + self::_logGamma($q) - self::_logGamma($p + $q);
-			}
-		}
-		return self::$_logBetaCache_result;
-	}	//	function _logBeta()
-
-
-	/**
-	 * Evaluates of continued fraction part of incomplete beta function.
-	 * Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
-	 * @author Jaco van Kooten
-	 */
-	private static function _betaFraction($x, $p, $q) {
-		$c = 1.0;
-		$sum_pq = $p + $q;
-		$p_plus = $p + 1.0;
-		$p_minus = $p - 1.0;
-		$h = 1.0 - $sum_pq * $x / $p_plus;
-		if (abs($h) < XMININ) {
-			$h = XMININ;
-		}
-		$h = 1.0 / $h;
-		$frac = $h;
-		$m	 = 1;
-		$delta = 0.0;
-		while ($m <= MAX_ITERATIONS && abs($delta-1.0) > PRECISION ) {
-			$m2 = 2 * $m;
-			// even index for d
-			$d = $m * ($q - $m) * $x / ( ($p_minus + $m2) * ($p + $m2));
-			$h = 1.0 + $d * $h;
-			if (abs($h) < XMININ) {
-				$h = XMININ;
-			}
-			$h = 1.0 / $h;
-			$c = 1.0 + $d / $c;
-			if (abs($c) < XMININ) {
-				$c = XMININ;
-			}
-			$frac *= $h * $c;
-			// odd index for d
-			$d = -($p + $m) * ($sum_pq + $m) * $x / (($p + $m2) * ($p_plus + $m2));
-			$h = 1.0 + $d * $h;
-			if (abs($h) < XMININ) {
-				$h = XMININ;
-			}
-			$h = 1.0 / $h;
-			$c = 1.0 + $d / $c;
-			if (abs($c) < XMININ) {
-				$c = XMININ;
-			}
-			$delta = $h * $c;
-			$frac *= $delta;
-			++$m;
-		}
-		return $frac;
-	}	//	function _betaFraction()
-
-
-	/**
-	 * logGamma function
-	 *
-	 * @version 1.1
-	 * @author Jaco van Kooten
-	 *
-	 * Original author was Jaco van Kooten. Ported to PHP by Paul Meagher.
-	 *
-	 * The natural logarithm of the gamma function. <br />
-	 * Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz <br />
-	 * Applied Mathematics Division <br />
-	 * Argonne National Laboratory <br />
-	 * Argonne, IL 60439 <br />
-	 * <p>
-	 * References:
-	 * <ol>
-	 * <li>W. J. Cody and K. E. Hillstrom, 'Chebyshev Approximations for the Natural
-	 *	 Logarithm of the Gamma Function,' Math. Comp. 21, 1967, pp. 198-203.</li>
-	 * <li>K. E. Hillstrom, ANL/AMD Program ANLC366S, DGAMMA/DLGAMA, May, 1969.</li>
-	 * <li>Hart, Et. Al., Computer Approximations, Wiley and sons, New York, 1968.</li>
-	 * </ol>
-	 * </p>
-	 * <p>
-	 * From the original documentation:
-	 * </p>
-	 * <p>
-	 * This routine calculates the LOG(GAMMA) function for a positive real argument X.
-	 * Computation is based on an algorithm outlined in references 1 and 2.
-	 * The program uses rational functions that theoretically approximate LOG(GAMMA)
-	 * to at least 18 significant decimal digits. The approximation for X > 12 is from
-	 * reference 3, while approximations for X < 12.0 are similar to those in reference
-	 * 1, but are unpublished. The accuracy achieved depends on the arithmetic system,
-	 * the compiler, the intrinsic functions, and proper selection of the
-	 * machine-dependent constants.
-	 * </p>
-	 * <p>
-	 * Error returns: <br />
-	 * The program returns the value XINF for X .LE. 0.0 or when overflow would occur.
-	 * The computation is believed to be free of underflow and overflow.
-	 * </p>
-	 * @return MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
-	 */
-
-	// Function cache for logGamma
-	private static $_logGammaCache_result	= 0.0;
-	private static $_logGammaCache_x		= 0.0;
-
-	private static function _logGamma($x) {
-		// Log Gamma related constants
-		static $lg_d1 = -0.5772156649015328605195174;
-		static $lg_d2 = 0.4227843350984671393993777;
-		static $lg_d4 = 1.791759469228055000094023;
-
-		static $lg_p1 = array(	4.945235359296727046734888,
-								201.8112620856775083915565,
-								2290.838373831346393026739,
-								11319.67205903380828685045,
-								28557.24635671635335736389,
-								38484.96228443793359990269,
-								26377.48787624195437963534,
-								7225.813979700288197698961 );
-		static $lg_p2 = array(	4.974607845568932035012064,
-								542.4138599891070494101986,
-								15506.93864978364947665077,
-								184793.2904445632425417223,
-								1088204.76946882876749847,
-								3338152.967987029735917223,
-								5106661.678927352456275255,
-								3074109.054850539556250927 );
-		static $lg_p4 = array(	14745.02166059939948905062,
-								2426813.369486704502836312,
-								121475557.4045093227939592,
-								2663432449.630976949898078,
-								29403789566.34553899906876,
-								170266573776.5398868392998,
-								492612579337.743088758812,
-								560625185622.3951465078242 );
-
-		static $lg_q1 = array(	67.48212550303777196073036,
-								1113.332393857199323513008,
-								7738.757056935398733233834,
-								27639.87074403340708898585,
-								54993.10206226157329794414,
-								61611.22180066002127833352,
-								36351.27591501940507276287,
-								8785.536302431013170870835 );
-		static $lg_q2 = array(	183.0328399370592604055942,
-								7765.049321445005871323047,
-								133190.3827966074194402448,
-								1136705.821321969608938755,
-								5267964.117437946917577538,
-								13467014.54311101692290052,
-								17827365.30353274213975932,
-								9533095.591844353613395747 );
-		static $lg_q4 = array(	2690.530175870899333379843,
-								639388.5654300092398984238,
-								41355999.30241388052042842,
-								1120872109.61614794137657,
-								14886137286.78813811542398,
-								101680358627.2438228077304,
-								341747634550.7377132798597,
-								446315818741.9713286462081 );
-
-		static $lg_c  = array(	-0.001910444077728,
-								8.4171387781295e-4,
-								-5.952379913043012e-4,
-								7.93650793500350248e-4,
-								-0.002777777777777681622553,
-								0.08333333333333333331554247,
-								0.0057083835261 );
-
-	// Rough estimate of the fourth root of logGamma_xBig
-	static $lg_frtbig = 2.25e76;
-	static $pnt68	 = 0.6796875;
-
-
-	if ($x == self::$_logGammaCache_x) {
-		return self::$_logGammaCache_result;
-	}
-	$y = $x;
-	if ($y > 0.0 && $y <= LOG_GAMMA_X_MAX_VALUE) {
-		if ($y <= EPS) {
-			$res = -log(y);
-		} elseif ($y <= 1.5) {
-			// ---------------------
-			//	EPS .LT. X .LE. 1.5
-			// ---------------------
-			if ($y < $pnt68) {
-				$corr = -log($y);
-				$xm1 = $y;
-			} else {
-				$corr = 0.0;
-				$xm1 = $y - 1.0;
-			}
-			if ($y <= 0.5 || $y >= $pnt68) {
-				$xden = 1.0;
-				$xnum = 0.0;
-				for ($i = 0; $i < 8; ++$i) {
-					$xnum = $xnum * $xm1 + $lg_p1[$i];
-					$xden = $xden * $xm1 + $lg_q1[$i];
-				}
-				$res = $corr + $xm1 * ($lg_d1 + $xm1 * ($xnum / $xden));
-			} else {
-				$xm2 = $y - 1.0;
-				$xden = 1.0;
-				$xnum = 0.0;
-				for ($i = 0; $i < 8; ++$i) {
-					$xnum = $xnum * $xm2 + $lg_p2[$i];
-					$xden = $xden * $xm2 + $lg_q2[$i];
-				}
-				$res = $corr + $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden));
-			}
-		} elseif ($y <= 4.0) {
-			// ---------------------
-			//	1.5 .LT. X .LE. 4.0
-			// ---------------------
-			$xm2 = $y - 2.0;
-			$xden = 1.0;
-			$xnum = 0.0;
-			for ($i = 0; $i < 8; ++$i) {
-				$xnum = $xnum * $xm2 + $lg_p2[$i];
-				$xden = $xden * $xm2 + $lg_q2[$i];
-			}
-			$res = $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden));
-		} elseif ($y <= 12.0) {
-			// ----------------------
-			//	4.0 .LT. X .LE. 12.0
-			// ----------------------
-			$xm4 = $y - 4.0;
-			$xden = -1.0;
-			$xnum = 0.0;
-			for ($i = 0; $i < 8; ++$i) {
-				$xnum = $xnum * $xm4 + $lg_p4[$i];
-				$xden = $xden * $xm4 + $lg_q4[$i];
-			}
-			$res = $lg_d4 + $xm4 * ($xnum / $xden);
-		} else {
-			// ---------------------------------
-			//	Evaluate for argument .GE. 12.0
-			// ---------------------------------
-			$res = 0.0;
-			if ($y <= $lg_frtbig) {
-				$res = $lg_c[6];
-				$ysq = $y * $y;
-				for ($i = 0; $i < 6; ++$i)
-					$res = $res / $ysq + $lg_c[$i];
-				}
-				$res /= $y;
-				$corr = log($y);
-				$res = $res + log(SQRT2PI) - 0.5 * $corr;
-				$res += $y * ($corr - 1.0);
-			}
-		} else {
-			// --------------------------
-			//	Return for bad arguments
-			// --------------------------
-			$res = MAX_VALUE;
-		}
-		// ------------------------------
-		//	Final adjustments and return
-		// ------------------------------
-		self::$_logGammaCache_x = $x;
-		self::$_logGammaCache_result = $res;
-		return $res;
-	}	//	function _logGamma()
-
-
-	//
-	//	Private implementation of the incomplete Gamma function
-	//
-	private static function _incompleteGamma($a,$x) {
-		static $max = 32;
-		$summer = 0;
-		for ($n=0; $n<=$max; ++$n) {
-			$divisor = $a;
-			for ($i=1; $i<=$n; ++$i) {
-				$divisor *= ($a + $i);
-			}
-			$summer += (pow($x,$n) / $divisor);
-		}
-		return pow($x,$a) * exp(0-$x) * $summer;
-	}	//	function _incompleteGamma()
-
-
-	//
-	//	Private implementation of the Gamma function
-	//
-	private static function _gamma($data) {
-		if ($data == 0.0) return 0;
-
-		static $p0 = 1.000000000190015;
-		static $p = array ( 1 => 76.18009172947146,
-							2 => -86.50532032941677,
-							3 => 24.01409824083091,
-							4 => -1.231739572450155,
-							5 => 1.208650973866179e-3,
-							6 => -5.395239384953e-6
-						  );
-
-		$y = $x = $data;
-		$tmp = $x + 5.5;
-		$tmp -= ($x + 0.5) * log($tmp);
-
-		$summer = $p0;
-		for ($j=1;$j<=6;++$j) {
-			$summer += ($p[$j] / ++$y);
-		}
-		return exp(0 - $tmp + log(SQRT2PI * $summer / $x));
-	}	//	function _gamma()
-
-
-	/***************************************************************************
-	 *								inverse_ncdf.php
-	 *							-------------------
-	 *	begin				: Friday, January 16, 2004
-	 *	copyright			: (C) 2004 Michael Nickerson
-	 *	email				: nickersonm@yahoo.com
-	 *
-	 ***************************************************************************/
-	private static function _inverse_ncdf($p) {
-		//	Inverse ncdf approximation by Peter J. Acklam, implementation adapted to
-		//	PHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as
-		//	a guide. http://home.online.no/~pjacklam/notes/invnorm/index.html
-		//	I have not checked the accuracy of this implementation. Be aware that PHP
-		//	will truncate the coeficcients to 14 digits.
-
-		//	You have permission to use and distribute this function freely for
-		//	whatever purpose you want, but please show common courtesy and give credit
-		//	where credit is due.
-
-		//	Input paramater is $p - probability - where 0 < p < 1.
-
-		//	Coefficients in rational approximations
-		static $a = array(	1 => -3.969683028665376e+01,
-							2 => 2.209460984245205e+02,
-							3 => -2.759285104469687e+02,
-							4 => 1.383577518672690e+02,
-							5 => -3.066479806614716e+01,
-							6 => 2.506628277459239e+00
-						 );
-
-		static $b = array(	1 => -5.447609879822406e+01,
-							2 => 1.615858368580409e+02,
-							3 => -1.556989798598866e+02,
-							4 => 6.680131188771972e+01,
-							5 => -1.328068155288572e+01
-						 );
-
-		static $c = array(	1 => -7.784894002430293e-03,
-							2 => -3.223964580411365e-01,
-							3 => -2.400758277161838e+00,
-							4 => -2.549732539343734e+00,
-							5 => 4.374664141464968e+00,
-							6 => 2.938163982698783e+00
-						 );
-
-		static $d = array(	1 => 7.784695709041462e-03,
-							2 => 3.224671290700398e-01,
-							3 => 2.445134137142996e+00,
-							4 => 3.754408661907416e+00
-						 );
-
-		//	Define lower and upper region break-points.
-		$p_low = 0.02425;			//Use lower region approx. below this
-		$p_high = 1 - $p_low;		//Use upper region approx. above this
-
-		if (0 < $p && $p < $p_low) {
-			//	Rational approximation for lower region.
-			$q = sqrt(-2 * log($p));
-			return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /
-					(((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
-		} elseif ($p_low <= $p && $p <= $p_high) {
-			//	Rational approximation for central region.
-			$q = $p - 0.5;
-			$r = $q * $q;
-			return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q /
-				   ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1);
-		} elseif ($p_high < $p && $p < 1) {
-			//	Rational approximation for upper region.
-			$q = sqrt(-2 * log(1 - $p));
-			return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /
-					 (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
-		}
-		//	If 0 < p < 1, return a null value
-		return PHPExcel_Calculation_Functions::NULL();
-	}	//	function _inverse_ncdf()
-
-
-	private static function _inverse_ncdf2($prob) {
-		//	Approximation of inverse standard normal CDF developed by
-		//	B. Moro, "The Full Monte," Risk 8(2), Feb 1995, 57-58.
-
-		$a1 = 2.50662823884;
-		$a2 = -18.61500062529;
-		$a3 = 41.39119773534;
-		$a4 = -25.44106049637;
-
-		$b1 = -8.4735109309;
-		$b2 = 23.08336743743;
-		$b3 = -21.06224101826;
-		$b4 = 3.13082909833;
-
-		$c1 = 0.337475482272615;
-		$c2 = 0.976169019091719;
-		$c3 = 0.160797971491821;
-		$c4 = 2.76438810333863E-02;
-		$c5 = 3.8405729373609E-03;
-		$c6 = 3.951896511919E-04;
-		$c7 = 3.21767881768E-05;
-		$c8 = 2.888167364E-07;
-		$c9 = 3.960315187E-07;
-
-		$y = $prob - 0.5;
-		if (abs($y) < 0.42) {
-			$z = ($y * $y);
-			$z = $y * ((($a4 * $z + $a3) * $z + $a2) * $z + $a1) / (((($b4 * $z + $b3) * $z + $b2) * $z + $b1) * $z + 1);
-		} else {
-			if ($y > 0) {
-				$z = log(-log(1 - $prob));
-			} else {
-				$z = log(-log($prob));
-			}
-			$z = $c1 + $z * ($c2 + $z * ($c3 + $z * ($c4 + $z * ($c5 + $z * ($c6 + $z * ($c7 + $z * ($c8 + $z * $c9)))))));
-			if ($y < 0) {
-				$z = -$z;
-			}
-		}
-		return $z;
-	}	//	function _inverse_ncdf2()
-
-
-	private static function _inverse_ncdf3($p) {
-		//	ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3.
-		//	Produces the normal deviate Z corresponding to a given lower
-		//	tail area of P; Z is accurate to about 1 part in 10**16.
-		//
-		//	This is a PHP version of the original FORTRAN code that can
-		//	be found at http://lib.stat.cmu.edu/apstat/
-		$split1 = 0.425;
-		$split2 = 5;
-		$const1 = 0.180625;
-		$const2 = 1.6;
-
-		//	coefficients for p close to 0.5
-		$a0 = 3.3871328727963666080;
-		$a1 = 1.3314166789178437745E+2;
-		$a2 = 1.9715909503065514427E+3;
-		$a3 = 1.3731693765509461125E+4;
-		$a4 = 4.5921953931549871457E+4;
-		$a5 = 6.7265770927008700853E+4;
-		$a6 = 3.3430575583588128105E+4;
-		$a7 = 2.5090809287301226727E+3;
-
-		$b1 = 4.2313330701600911252E+1;
-		$b2 = 6.8718700749205790830E+2;
-		$b3 = 5.3941960214247511077E+3;
-		$b4 = 2.1213794301586595867E+4;
-		$b5 = 3.9307895800092710610E+4;
-		$b6 = 2.8729085735721942674E+4;
-		$b7 = 5.2264952788528545610E+3;
-
-		//	coefficients for p not close to 0, 0.5 or 1.
-		$c0 = 1.42343711074968357734;
-		$c1 = 4.63033784615654529590;
-		$c2 = 5.76949722146069140550;
-		$c3 = 3.64784832476320460504;
-		$c4 = 1.27045825245236838258;
-		$c5 = 2.41780725177450611770E-1;
-		$c6 = 2.27238449892691845833E-2;
-		$c7 = 7.74545014278341407640E-4;
-
-		$d1 = 2.05319162663775882187;
-		$d2 = 1.67638483018380384940;
-		$d3 = 6.89767334985100004550E-1;
-		$d4 = 1.48103976427480074590E-1;
-		$d5 = 1.51986665636164571966E-2;
-		$d6 = 5.47593808499534494600E-4;
-		$d7 = 1.05075007164441684324E-9;
-
-		//	coefficients for p near 0 or 1.
-		$e0 = 6.65790464350110377720;
-		$e1 = 5.46378491116411436990;
-		$e2 = 1.78482653991729133580;
-		$e3 = 2.96560571828504891230E-1;
-		$e4 = 2.65321895265761230930E-2;
-		$e5 = 1.24266094738807843860E-3;
-		$e6 = 2.71155556874348757815E-5;
-		$e7 = 2.01033439929228813265E-7;
-
-		$f1 = 5.99832206555887937690E-1;
-		$f2 = 1.36929880922735805310E-1;
-		$f3 = 1.48753612908506148525E-2;
-		$f4 = 7.86869131145613259100E-4;
-		$f5 = 1.84631831751005468180E-5;
-		$f6 = 1.42151175831644588870E-7;
-		$f7 = 2.04426310338993978564E-15;
-
-		$q = $p - 0.5;
-
-		//	computation for p close to 0.5
-		if (abs($q) <= split1) {
-			$R = $const1 - $q * $q;
-			$z = $q * ((((((($a7 * $R + $a6) * $R + $a5) * $R + $a4) * $R + $a3) * $R + $a2) * $R + $a1) * $R + $a0) /
-					  ((((((($b7 * $R + $b6) * $R + $b5) * $R + $b4) * $R + $b3) * $R + $b2) * $R + $b1) * $R + 1);
-		} else {
-			if ($q < 0) {
-				$R = $p;
-			} else {
-				$R = 1 - $p;
-			}
-			$R = pow(-log($R),2);
-
-			//	computation for p not close to 0, 0.5 or 1.
-			If ($R <= $split2) {
-				$R = $R - $const2;
-				$z = ((((((($c7 * $R + $c6) * $R + $c5) * $R + $c4) * $R + $c3) * $R + $c2) * $R + $c1) * $R + $c0) /
-					 ((((((($d7 * $R + $d6) * $R + $d5) * $R + $d4) * $R + $d3) * $R + $d2) * $R + $d1) * $R + 1);
-			} else {
-			//	computation for p near 0 or 1.
-				$R = $R - $split2;
-				$z = ((((((($e7 * $R + $e6) * $R + $e5) * $R + $e4) * $R + $e3) * $R + $e2) * $R + $e1) * $R + $e0) /
-					 ((((((($f7 * $R + $f6) * $R + $f5) * $R + $f4) * $R + $f3) * $R + $f2) * $R + $f1) * $R + 1);
-			}
-			if ($q < 0) {
-				$z = -$z;
-			}
-		}
-		return $z;
-	}	//	function _inverse_ncdf3()
-
-
-	/**
-	 * AVEDEV
-	 *
-	 * Returns the average of the absolute deviations of data points from their mean.
-	 * AVEDEV is a measure of the variability in a data set.
-	 *
-	 * Excel Function:
-	 *		AVEDEV(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function AVEDEV() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGE($aArgs);
-		if ($aMean != PHPExcel_Calculation_Functions::DIV0()) {
-			$aCount = 0;
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-					$arg = (integer) $arg;
-				}
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					if (is_null($returnValue)) {
-						$returnValue = abs($arg - $aMean);
-					} else {
-						$returnValue += abs($arg - $aMean);
-					}
-					++$aCount;
-				}
-			}
-
-			// Return
-			if ($aCount == 0) {
-				return PHPExcel_Calculation_Functions::DIV0();
-			}
-			return $returnValue / $aCount;
-		}
-		return PHPExcel_Calculation_Functions::NaN();
-	}	//	function AVEDEV()
-
-
-	/**
-	 * AVERAGE
-	 *
-	 * Returns the average (arithmetic mean) of the arguments
-	 *
-	 * Excel Function:
-	 *		AVERAGE(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function AVERAGE() {
-		$returnValue = $aCount = 0;
-
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) {
-			if ((is_bool($arg)) &&
-				((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-				$arg = (integer) $arg;
-			}
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if (is_null($returnValue)) {
-					$returnValue = $arg;
-				} else {
-					$returnValue += $arg;
-				}
-				++$aCount;
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			return $returnValue / $aCount;
-		} else {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-	}	//	function AVERAGE()
-
-
-	/**
-	 * AVERAGEA
-	 *
-	 * Returns the average of its arguments, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		AVERAGEA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function AVERAGEA() {
-		// Return value
-		$returnValue = null;
-
-		$aCount = 0;
-		// Loop through arguments
-		foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) {
-			if ((is_bool($arg)) &&
-				(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-			} else {
-				if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
-					if (is_bool($arg)) {
-						$arg = (integer) $arg;
-					} elseif (is_string($arg)) {
-						$arg = 0;
-					}
-					if (is_null($returnValue)) {
-						$returnValue = $arg;
-					} else {
-						$returnValue += $arg;
-					}
-					++$aCount;
-				}
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			return $returnValue / $aCount;
-		} else {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-	}	//	function AVERAGEA()
-
-
-	/**
-	 * AVERAGEIF
-	 *
-	 * Returns the average value from a range of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		AVERAGEIF(value1[,value2[, ...]],condition)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	string		$condition		The criteria that defines which cells will be checked.
-	 * @param	mixed[]		$averageArgs	Data values
-	 * @return	float
-	 */
-	public static function AVERAGEIF($aArgs,$condition,$averageArgs = array()) {
-		// Return value
-		$returnValue = 0;
-
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
-		$averageArgs = PHPExcel_Calculation_Functions::flattenArray($averageArgs);
-		if (empty($averageArgs)) {
-			$averageArgs = $aArgs;
-		}
-		$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
-		// Loop through arguments
-		$aCount = 0;
-		foreach ($aArgs as $key => $arg) {
-			if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); }
-			$testCondition = '='.$arg.$condition;
-			if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
-				if ((is_null($returnValue)) || ($arg > $returnValue)) {
-					$returnValue += $arg;
-					++$aCount;
-				}
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			return $returnValue / $aCount;
-		} else {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-	}	//	function AVERAGEIF()
-
-
-	/**
-	 * BETADIST
-	 *
-	 * Returns the beta distribution.
-	 *
-	 * @param	float		$value			Value at which you want to evaluate the distribution
-	 * @param	float		$alpha			Parameter to the distribution
-	 * @param	float		$beta			Parameter to the distribution
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function BETADIST($value,$alpha,$beta,$rMin=0,$rMax=1) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$alpha	= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-		$beta	= PHPExcel_Calculation_Functions::flattenSingleValue($beta);
-		$rMin	= PHPExcel_Calculation_Functions::flattenSingleValue($rMin);
-		$rMax	= PHPExcel_Calculation_Functions::flattenSingleValue($rMax);
-
-		if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) {
-			if (($value < $rMin) || ($value > $rMax) || ($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ($rMin > $rMax) {
-				$tmp = $rMin;
-				$rMin = $rMax;
-				$rMax = $tmp;
-			}
-			$value -= $rMin;
-			$value /= ($rMax - $rMin);
-			return self::_incompleteBeta($value,$alpha,$beta);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BETADIST()
-
-
-	/**
-	 * BETAINV
-	 *
-	 * Returns the inverse of the beta distribution.
-	 *
-	 * @param	float		$probability	Probability at which you want to evaluate the distribution
-	 * @param	float		$alpha			Parameter to the distribution
-	 * @param	float		$beta			Parameter to the distribution
-	 * @param	float		$rMin			Minimum value
-	 * @param	float		$rMax			Maximum value
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function BETAINV($probability,$alpha,$beta,$rMin=0,$rMax=1) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$alpha			= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-		$beta			= PHPExcel_Calculation_Functions::flattenSingleValue($beta);
-		$rMin			= PHPExcel_Calculation_Functions::flattenSingleValue($rMin);
-		$rMax			= PHPExcel_Calculation_Functions::flattenSingleValue($rMax);
-
-		if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) {
-			if (($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax) || ($probability <= 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ($rMin > $rMax) {
-				$tmp = $rMin;
-				$rMin = $rMax;
-				$rMax = $tmp;
-			}
-			$a = 0;
-			$b = 2;
-
-			$i = 0;
-			while ((($b - $a) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
-				$guess = ($a + $b) / 2;
-				$result = self::BETADIST($guess, $alpha, $beta);
-				if (($result == $probability) || ($result == 0)) {
-					$b = $a;
-				} elseif ($result > $probability) {
-					$b = $guess;
-				} else {
-					$a = $guess;
-				}
-			}
-			if ($i == MAX_ITERATIONS) {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			return round($rMin + $guess * ($rMax - $rMin),12);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BETAINV()
-
-
-	/**
-	 * BINOMDIST
-	 *
-	 * Returns the individual term binomial distribution probability. Use BINOMDIST in problems with
-	 *		a fixed number of tests or trials, when the outcomes of any trial are only success or failure,
-	 *		when trials are independent, and when the probability of success is constant throughout the
-	 *		experiment. For example, BINOMDIST can calculate the probability that two of the next three
-	 *		babies born are male.
-	 *
-	 * @param	float		$value			Number of successes in trials
-	 * @param	float		$trials			Number of trials
-	 * @param	float		$probability	Probability of success on each trial
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 * @todo	Cumulative distribution function
-	 *
-	 */
-	public static function BINOMDIST($value, $trials, $probability, $cumulative) {
-		$value			= floor(PHPExcel_Calculation_Functions::flattenSingleValue($value));
-		$trials			= floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials));
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-
-		if ((is_numeric($value)) && (is_numeric($trials)) && (is_numeric($probability))) {
-			if (($value < 0) || ($value > $trials)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($probability < 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					$summer = 0;
-					for ($i = 0; $i <= $value; ++$i) {
-						$summer += PHPExcel_Calculation_MathTrig::COMBIN($trials,$i) * pow($probability,$i) * pow(1 - $probability,$trials - $i);
-					}
-					return $summer;
-				} else {
-					return PHPExcel_Calculation_MathTrig::COMBIN($trials,$value) * pow($probability,$value) * pow(1 - $probability,$trials - $value) ;
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function BINOMDIST()
-
-
-	/**
-	 * CHIDIST
-	 *
-	 * Returns the one-tailed probability of the chi-squared distribution.
-	 *
-	 * @param	float		$value			Value for the function
-	 * @param	float		$degrees		degrees of freedom
-	 * @return	float
-	 */
-	public static function CHIDIST($value, $degrees) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$degrees	= floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
-
-		if ((is_numeric($value)) && (is_numeric($degrees))) {
-			if ($degrees < 1) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ($value < 0) {
-				if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-					return 1;
-				}
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return 1 - (self::_incompleteGamma($degrees/2,$value/2) / self::_gamma($degrees/2));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function CHIDIST()
-
-
-	/**
-	 * CHIINV
-	 *
-	 * Returns the one-tailed probability of the chi-squared distribution.
-	 *
-	 * @param	float		$probability	Probability for the function
-	 * @param	float		$degrees		degrees of freedom
-	 * @return	float
-	 */
-	public static function CHIINV($probability, $degrees) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$degrees		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
-
-		if ((is_numeric($probability)) && (is_numeric($degrees))) {
-
-			$xLo = 100;
-			$xHi = 0;
-
-			$x = $xNew = 1;
-			$dx	= 1;
-			$i = 0;
-
-			while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
-				// Apply Newton-Raphson step
-				$result = self::CHIDIST($x, $degrees);
-				$error = $result - $probability;
-				if ($error == 0.0) {
-					$dx = 0;
-				} elseif ($error < 0.0) {
-					$xLo = $x;
-				} else {
-					$xHi = $x;
-				}
-				// Avoid division by zero
-				if ($result != 0.0) {
-					$dx = $error / $result;
-					$xNew = $x - $dx;
-				}
-				// If the NR fails to converge (which for example may be the
-				// case if the initial guess is too rough) we apply a bisection
-				// step to determine a more narrow interval around the root.
-				if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) {
-					$xNew = ($xLo + $xHi) / 2;
-					$dx = $xNew - $x;
-				}
-				$x = $xNew;
-			}
-			if ($i == MAX_ITERATIONS) {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			return round($x,12);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function CHIINV()
-
-
-	/**
-	 * CONFIDENCE
-	 *
-	 * Returns the confidence interval for a population mean
-	 *
-	 * @param	float		$alpha
-	 * @param	float		$stdDev		Standard Deviation
-	 * @param	float		$size
-	 * @return	float
-	 *
-	 */
-	public static function CONFIDENCE($alpha,$stdDev,$size) {
-		$alpha	= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-		$stdDev	= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-		$size	= floor(PHPExcel_Calculation_Functions::flattenSingleValue($size));
-
-		if ((is_numeric($alpha)) && (is_numeric($stdDev)) && (is_numeric($size))) {
-			if (($alpha <= 0) || ($alpha >= 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($stdDev <= 0) || ($size < 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return self::NORMSINV(1 - $alpha / 2) * $stdDev / sqrt($size);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function CONFIDENCE()
-
-
-	/**
-	 * CORREL
-	 *
-	 * Returns covariance, the average of the products of deviations for each data point pair.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function CORREL($yValues,$xValues=null) {
-		if ((is_null($xValues)) || (!is_array($yValues)) || (!is_array($xValues))) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getCorrelation();
-	}	//	function CORREL()
-
-
-	/**
-	 * COUNT
-	 *
-	 * Counts the number of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		COUNT(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	int
-	 */
-	public static function COUNT() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-		foreach ($aArgs as $k => $arg) {
-			if ((is_bool($arg)) &&
-				((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-				$arg = (integer) $arg;
-			}
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				++$returnValue;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function COUNT()
-
-
-	/**
-	 * COUNTA
-	 *
-	 * Counts the number of cells that are not empty within the list of arguments
-	 *
-	 * Excel Function:
-	 *		COUNTA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	int
-	 */
-	public static function COUNTA() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric, boolean or string value?
-			if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
-				++$returnValue;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function COUNTA()
-
-
-	/**
-	 * COUNTBLANK
-	 *
-	 * Counts the number of empty cells within the list of arguments
-	 *
-	 * Excel Function:
-	 *		COUNTBLANK(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	int
-	 */
-	public static function COUNTBLANK() {
-		// Return value
-		$returnValue = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a blank cell?
-			if ((is_null($arg)) || ((is_string($arg)) && ($arg == ''))) {
-				++$returnValue;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function COUNTBLANK()
-
-
-	/**
-	 * COUNTIF
-	 *
-	 * Counts the number of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		COUNTIF(value1[,value2[, ...]],condition)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	string		$condition		The criteria that defines which cells will be counted.
-	 * @return	int
-	 */
-	public static function COUNTIF($aArgs,$condition) {
-		// Return value
-		$returnValue = 0;
-
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
-		$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
-		// Loop through arguments
-		foreach ($aArgs as $arg) {
-			if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); }
-			$testCondition = '='.$arg.$condition;
-			if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
-				// Is it a value within our criteria
-				++$returnValue;
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function COUNTIF()
-
-
-	/**
-	 * COVAR
-	 *
-	 * Returns covariance, the average of the products of deviations for each data point pair.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function COVAR($yValues,$xValues) {
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getCovariance();
-	}	//	function COVAR()
-
-
-	/**
-	 * CRITBINOM
-	 *
-	 * Returns the smallest value for which the cumulative binomial distribution is greater
-	 *		than or equal to a criterion value
-	 *
-	 * See http://support.microsoft.com/kb/828117/ for details of the algorithm used
-	 *
-	 * @param	float		$trials			number of Bernoulli trials
-	 * @param	float		$probability	probability of a success on each trial
-	 * @param	float		$alpha			criterion value
-	 * @return	int
-	 *
-	 * @todo	Warning. This implementation differs from the algorithm detailed on the MS
-	 *			web site in that $CumPGuessMinus1 = $CumPGuess - 1 rather than $CumPGuess - $PGuess
-	 *			This eliminates a potential endless loop error, but may have an adverse affect on the
-	 *			accuracy of the function (although all my tests have so far returned correct results).
-	 *
-	 */
-	public static function CRITBINOM($trials, $probability, $alpha) {
-		$trials			= floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials));
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$alpha			= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-
-		if ((is_numeric($trials)) && (is_numeric($probability)) && (is_numeric($alpha))) {
-			if ($trials < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($probability < 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($alpha < 0) || ($alpha > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ($alpha <= 0.5) {
-				$t = sqrt(log(1 / ($alpha * $alpha)));
-				$trialsApprox = 0 - ($t + (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t));
-			} else {
-				$t = sqrt(log(1 / pow(1 - $alpha,2)));
-				$trialsApprox = $t - (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t);
-			}
-			$Guess = floor($trials * $probability + $trialsApprox * sqrt($trials * $probability * (1 - $probability)));
-			if ($Guess < 0) {
-				$Guess = 0;
-			} elseif ($Guess > $trials) {
-				$Guess = $trials;
-			}
-
-			$TotalUnscaledProbability = $UnscaledPGuess = $UnscaledCumPGuess = 0.0;
-			$EssentiallyZero = 10e-12;
-
-			$m = floor($trials * $probability);
-			++$TotalUnscaledProbability;
-			if ($m == $Guess) { ++$UnscaledPGuess; }
-			if ($m <= $Guess) { ++$UnscaledCumPGuess; }
-
-			$PreviousValue = 1;
-			$Done = False;
-			$k = $m + 1;
-			while ((!$Done) && ($k <= $trials)) {
-				$CurrentValue = $PreviousValue * ($trials - $k + 1) * $probability / ($k * (1 - $probability));
-				$TotalUnscaledProbability += $CurrentValue;
-				if ($k == $Guess) { $UnscaledPGuess += $CurrentValue; }
-				if ($k <= $Guess) { $UnscaledCumPGuess += $CurrentValue; }
-				if ($CurrentValue <= $EssentiallyZero) { $Done = True; }
-				$PreviousValue = $CurrentValue;
-				++$k;
-			}
-
-			$PreviousValue = 1;
-			$Done = False;
-			$k = $m - 1;
-			while ((!$Done) && ($k >= 0)) {
-				$CurrentValue = $PreviousValue * $k + 1 * (1 - $probability) / (($trials - $k) * $probability);
-				$TotalUnscaledProbability += $CurrentValue;
-				if ($k == $Guess) { $UnscaledPGuess += $CurrentValue; }
-				if ($k <= $Guess) { $UnscaledCumPGuess += $CurrentValue; }
-				if ($CurrentValue <= $EssentiallyZero) { $Done = True; }
-				$PreviousValue = $CurrentValue;
-				--$k;
-			}
-
-			$PGuess = $UnscaledPGuess / $TotalUnscaledProbability;
-			$CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability;
-
-//			$CumPGuessMinus1 = $CumPGuess - $PGuess;
-			$CumPGuessMinus1 = $CumPGuess - 1;
-
-			while (True) {
-				if (($CumPGuessMinus1 < $alpha) && ($CumPGuess >= $alpha)) {
-					return $Guess;
-				} elseif (($CumPGuessMinus1 < $alpha) && ($CumPGuess < $alpha)) {
-					$PGuessPlus1 = $PGuess * ($trials - $Guess) * $probability / $Guess / (1 - $probability);
-					$CumPGuessMinus1 = $CumPGuess;
-					$CumPGuess = $CumPGuess + $PGuessPlus1;
-					$PGuess = $PGuessPlus1;
-					++$Guess;
-				} elseif (($CumPGuessMinus1 >= $alpha) && ($CumPGuess >= $alpha)) {
-					$PGuessMinus1 = $PGuess * $Guess * (1 - $probability) / ($trials - $Guess + 1) / $probability;
-					$CumPGuess = $CumPGuessMinus1;
-					$CumPGuessMinus1 = $CumPGuessMinus1 - $PGuess;
-					$PGuess = $PGuessMinus1;
-					--$Guess;
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function CRITBINOM()
-
-
-	/**
-	 * DEVSQ
-	 *
-	 * Returns the sum of squares of deviations of data points from their sample mean.
-	 *
-	 * Excel Function:
-	 *		DEVSQ(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function DEVSQ() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGE($aArgs);
-		if ($aMean != PHPExcel_Calculation_Functions::DIV0()) {
-			$aCount = -1;
-			foreach ($aArgs as $k => $arg) {
-				// Is it a numeric value?
-				if ((is_bool($arg)) &&
-					((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-					$arg = (integer) $arg;
-				}
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					if (is_null($returnValue)) {
-						$returnValue = pow(($arg - $aMean),2);
-					} else {
-						$returnValue += pow(($arg - $aMean),2);
-					}
-					++$aCount;
-				}
-			}
-
-			// Return
-			if (is_null($returnValue)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			} else {
-				return $returnValue;
-			}
-		}
-		return self::NA();
-	}	//	function DEVSQ()
-
-
-	/**
-	 * EXPONDIST
-	 *
-	 *	Returns the exponential distribution. Use EXPONDIST to model the time between events,
-	 *		such as how long an automated bank teller takes to deliver cash. For example, you can
-	 *		use EXPONDIST to determine the probability that the process takes at most 1 minute.
-	 *
-	 * @param	float		$value			Value of the function
-	 * @param	float		$lambda			The parameter value
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 */
-	public static function EXPONDIST($value, $lambda, $cumulative) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$lambda	= PHPExcel_Calculation_Functions::flattenSingleValue($lambda);
-		$cumulative	= PHPExcel_Calculation_Functions::flattenSingleValue($cumulative);
-
-		if ((is_numeric($value)) && (is_numeric($lambda))) {
-			if (($value < 0) || ($lambda < 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					return 1 - exp(0-$value*$lambda);
-				} else {
-					return $lambda * exp(0-$value*$lambda);
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function EXPONDIST()
-
-
-	/**
-	 * FISHER
-	 *
-	 * Returns the Fisher transformation at x. This transformation produces a function that
-	 *		is normally distributed rather than skewed. Use this function to perform hypothesis
-	 *		testing on the correlation coefficient.
-	 *
-	 * @param	float		$value
-	 * @return	float
-	 */
-	public static function FISHER($value) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		if (is_numeric($value)) {
-			if (($value <= -1) || ($value >= 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return 0.5 * log((1+$value)/(1-$value));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function FISHER()
-
-
-	/**
-	 * FISHERINV
-	 *
-	 * Returns the inverse of the Fisher transformation. Use this transformation when
-	 *		analyzing correlations between ranges or arrays of data. If y = FISHER(x), then
-	 *		FISHERINV(y) = x.
-	 *
-	 * @param	float		$value
-	 * @return	float
-	 */
-	public static function FISHERINV($value) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		if (is_numeric($value)) {
-			return (exp(2 * $value) - 1) / (exp(2 * $value) + 1);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function FISHERINV()
-
-
-	/**
-	 * FORECAST
-	 *
-	 * Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value.
-	 *
-	 * @param	float				Value of X for which we want to find Y
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function FORECAST($xValue,$yValues,$xValues) {
-		$xValue	= PHPExcel_Calculation_Functions::flattenSingleValue($xValue);
-		if (!is_numeric($xValue)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getValueOfYForX($xValue);
-	}	//	function FORECAST()
-
-
-	/**
-	 * GAMMADIST
-	 *
-	 * Returns the gamma distribution.
-	 *
-	 * @param	float		$value			Value at which you want to evaluate the distribution
-	 * @param	float		$a				Parameter to the distribution
-	 * @param	float		$b				Parameter to the distribution
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function GAMMADIST($value,$a,$b,$cumulative) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$a		= PHPExcel_Calculation_Functions::flattenSingleValue($a);
-		$b		= PHPExcel_Calculation_Functions::flattenSingleValue($b);
-
-		if ((is_numeric($value)) && (is_numeric($a)) && (is_numeric($b))) {
-			if (($value < 0) || ($a <= 0) || ($b <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					return self::_incompleteGamma($a,$value / $b) / self::_gamma($a);
-				} else {
-					return (1 / (pow($b,$a) * self::_gamma($a))) * pow($value,$a-1) * exp(0-($value / $b));
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function GAMMADIST()
-
-
-	/**
-	 * GAMMAINV
-	 *
-	 * Returns the inverse of the beta distribution.
-	 *
-	 * @param	float		$probability	Probability at which you want to evaluate the distribution
-	 * @param	float		$alpha			Parameter to the distribution
-	 * @param	float		$beta			Parameter to the distribution
-	 * @return	float
-	 *
-	 */
-	public static function GAMMAINV($probability,$alpha,$beta) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$alpha			= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-		$beta			= PHPExcel_Calculation_Functions::flattenSingleValue($beta);
-
-		if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta))) {
-			if (($alpha <= 0) || ($beta <= 0) || ($probability < 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-
-			$xLo = 0;
-			$xHi = $alpha * $beta * 5;
-
-			$x = $xNew = 1;
-			$error = $pdf = 0;
-			$dx	= 1024;
-			$i = 0;
-
-			while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
-				// Apply Newton-Raphson step
-				$error = self::GAMMADIST($x, $alpha, $beta, True) - $probability;
-				if ($error < 0.0) {
-					$xLo = $x;
-				} else {
-					$xHi = $x;
-				}
-				$pdf = self::GAMMADIST($x, $alpha, $beta, False);
-				// Avoid division by zero
-				if ($pdf != 0.0) {
-					$dx = $error / $pdf;
-					$xNew = $x - $dx;
-				}
-				// If the NR fails to converge (which for example may be the
-				// case if the initial guess is too rough) we apply a bisection
-				// step to determine a more narrow interval around the root.
-				if (($xNew < $xLo) || ($xNew > $xHi) || ($pdf == 0.0)) {
-					$xNew = ($xLo + $xHi) / 2;
-					$dx = $xNew - $x;
-				}
-				$x = $xNew;
-			}
-			if ($i == MAX_ITERATIONS) {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			return $x;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function GAMMAINV()
-
-
-	/**
-	 * GAMMALN
-	 *
-	 * Returns the natural logarithm of the gamma function.
-	 *
-	 * @param	float		$value
-	 * @return	float
-	 */
-	public static function GAMMALN($value) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		if (is_numeric($value)) {
-			if ($value <= 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return log(self::_gamma($value));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function GAMMALN()
-
-
-	/**
-	 * GEOMEAN
-	 *
-	 * Returns the geometric mean of an array or range of positive data. For example, you
-	 *		can use GEOMEAN to calculate average growth rate given compound interest with
-	 *		variable rates.
-	 *
-	 * Excel Function:
-	 *		GEOMEAN(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function GEOMEAN() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		$aMean = PHPExcel_Calculation_MathTrig::PRODUCT($aArgs);
-		if (is_numeric($aMean) && ($aMean > 0)) {
-			$aCount = self::COUNT($aArgs) ;
-			if (self::MIN($aArgs) > 0) {
-				return pow($aMean, (1 / $aCount));
-			}
-		}
-		return PHPExcel_Calculation_Functions::NaN();
-	}	//	GEOMEAN()
-
-
-	/**
-	 * GROWTH
-	 *
-	 * Returns values along a predicted emponential trend
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @param	array of mixed		Values of X for which we want to find Y
-	 * @param	boolean				A logical value specifying whether to force the intersect to equal 0.
-	 * @return	array of float
-	 */
-	public static function GROWTH($yValues,$xValues=array(),$newValues=array(),$const=True) {
-		$yValues = PHPExcel_Calculation_Functions::flattenArray($yValues);
-		$xValues = PHPExcel_Calculation_Functions::flattenArray($xValues);
-		$newValues = PHPExcel_Calculation_Functions::flattenArray($newValues);
-		$const	= (is_null($const))	? True :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
-
-		$bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL,$yValues,$xValues,$const);
-		if (empty($newValues)) {
-			$newValues = $bestFitExponential->getXValues();
-		}
-
-		$returnArray = array();
-		foreach($newValues as $xValue) {
-			$returnArray[0][] = $bestFitExponential->getValueOfYForX($xValue);
-		}
-
-		return $returnArray;
-	}	//	function GROWTH()
-
-
-	/**
-	 * HARMEAN
-	 *
-	 * Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the
-	 *		arithmetic mean of reciprocals.
-	 *
-	 * Excel Function:
-	 *		HARMEAN(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function HARMEAN() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::NA();
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		if (self::MIN($aArgs) < 0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$aCount = 0;
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if ($arg <= 0) {
-					return PHPExcel_Calculation_Functions::NaN();
-				}
-				if (is_null($returnValue)) {
-					$returnValue = (1 / $arg);
-				} else {
-					$returnValue += (1 / $arg);
-				}
-				++$aCount;
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			return 1 / ($returnValue / $aCount);
-		} else {
-			return $returnValue;
-		}
-	}	//	function HARMEAN()
-
-
-	/**
-	 * HYPGEOMDIST
-	 *
-	 * Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of
-	 * sample successes, given the sample size, population successes, and population size.
-	 *
-	 * @param	float		$sampleSuccesses		Number of successes in the sample
-	 * @param	float		$sampleNumber			Size of the sample
-	 * @param	float		$populationSuccesses	Number of successes in the population
-	 * @param	float		$populationNumber		Population size
-	 * @return	float
-	 *
-	 */
-	public static function HYPGEOMDIST($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) {
-		$sampleSuccesses		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleSuccesses));
-		$sampleNumber			= floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleNumber));
-		$populationSuccesses	= floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationSuccesses));
-		$populationNumber		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationNumber));
-
-		if ((is_numeric($sampleSuccesses)) && (is_numeric($sampleNumber)) && (is_numeric($populationSuccesses)) && (is_numeric($populationNumber))) {
-			if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return PHPExcel_Calculation_MathTrig::COMBIN($populationSuccesses,$sampleSuccesses) *
-				   PHPExcel_Calculation_MathTrig::COMBIN($populationNumber - $populationSuccesses,$sampleNumber - $sampleSuccesses) /
-				   PHPExcel_Calculation_MathTrig::COMBIN($populationNumber,$sampleNumber);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function HYPGEOMDIST()
-
-
-	/**
-	 * INTERCEPT
-	 *
-	 * Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function INTERCEPT($yValues,$xValues) {
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getIntersect();
-	}	//	function INTERCEPT()
-
-
-	/**
-	 * KURT
-	 *
-	 * Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness
-	 * or flatness of a distribution compared with the normal distribution. Positive
-	 * kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a
-	 * relatively flat distribution.
-	 *
-	 * @param	array	Data Series
-	 * @return	float
-	 */
-	public static function KURT() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-		$mean = self::AVERAGE($aArgs);
-		$stdDev = self::STDEV($aArgs);
-
-		if ($stdDev > 0) {
-			$count = $summer = 0;
-			// Loop through arguments
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-				} else {
-					// Is it a numeric value?
-					if ((is_numeric($arg)) && (!is_string($arg))) {
-						$summer += pow((($arg - $mean) / $stdDev),4) ;
-						++$count;
-					}
-				}
-			}
-
-			// Return
-			if ($count > 3) {
-				return $summer * ($count * ($count+1) / (($count-1) * ($count-2) * ($count-3))) - (3 * pow($count-1,2) / (($count-2) * ($count-3)));
-			}
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function KURT()
-
-
-	/**
-	 * LARGE
-	 *
-	 * Returns the nth largest value in a data set. You can use this function to
-	 *		select a value based on its relative standing.
-	 *
-	 * Excel Function:
-	 *		LARGE(value1[,value2[, ...]],entry)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	int			$entry			Position (ordered from the largest) in the array or range of data to return
-	 * @return	float
-	 *
-	 */
-	public static function LARGE() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$entry = floor(array_pop($aArgs));
-
-		if ((is_numeric($entry)) && (!is_string($entry))) {
-			$mArgs = array();
-			foreach ($aArgs as $arg) {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$mArgs[] = $arg;
-				}
-			}
-			$count = self::COUNT($mArgs);
-			$entry = floor(--$entry);
-			if (($entry < 0) || ($entry >= $count) || ($count == 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			rsort($mArgs);
-			return $mArgs[$entry];
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function LARGE()
-
-
-	/**
-	 * LINEST
-	 *
-	 * Calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data,
-	 *		and then returns an array that describes the line.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @param	boolean				A logical value specifying whether to force the intersect to equal 0.
-	 * @param	boolean				A logical value specifying whether to return additional regression statistics.
-	 * @return	array
-	 */
-	public static function LINEST($yValues, $xValues = NULL, $const = TRUE, $stats = FALSE) {
-		$const	= (is_null($const))	? TRUE :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
-		$stats	= (is_null($stats))	? FALSE :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats);
-		if (is_null($xValues)) $xValues = range(1,count(PHPExcel_Calculation_Functions::flattenArray($yValues)));
-
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return 0;
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues,$const);
-		if ($stats) {
-			return array( array( $bestFitLinear->getSlope(),
-						 		 $bestFitLinear->getSlopeSE(),
-						 		 $bestFitLinear->getGoodnessOfFit(),
-						 		 $bestFitLinear->getF(),
-						 		 $bestFitLinear->getSSRegression(),
-							   ),
-						  array( $bestFitLinear->getIntersect(),
-								 $bestFitLinear->getIntersectSE(),
-								 $bestFitLinear->getStdevOfResiduals(),
-								 $bestFitLinear->getDFResiduals(),
-								 $bestFitLinear->getSSResiduals()
-							   )
-						);
-		} else {
-			return array( $bestFitLinear->getSlope(),
-						  $bestFitLinear->getIntersect()
-						);
-		}
-	}	//	function LINEST()
-
-
-	/**
-	 * LOGEST
-	 *
-	 * Calculates an exponential curve that best fits the X and Y data series,
-	 *		and then returns an array that describes the line.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @param	boolean				A logical value specifying whether to force the intersect to equal 0.
-	 * @param	boolean				A logical value specifying whether to return additional regression statistics.
-	 * @return	array
-	 */
-	public static function LOGEST($yValues,$xValues=null,$const=True,$stats=False) {
-		$const	= (is_null($const))	? True :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
-		$stats	= (is_null($stats))	? False :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats);
-		if (is_null($xValues)) $xValues = range(1,count(PHPExcel_Calculation_Functions::flattenArray($yValues)));
-
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		foreach($yValues as $value) {
-			if ($value <= 0.0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-		}
-
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return 1;
-		}
-
-		$bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL,$yValues,$xValues,$const);
-		if ($stats) {
-			return array( array( $bestFitExponential->getSlope(),
-						 		 $bestFitExponential->getSlopeSE(),
-						 		 $bestFitExponential->getGoodnessOfFit(),
-						 		 $bestFitExponential->getF(),
-						 		 $bestFitExponential->getSSRegression(),
-							   ),
-						  array( $bestFitExponential->getIntersect(),
-								 $bestFitExponential->getIntersectSE(),
-								 $bestFitExponential->getStdevOfResiduals(),
-								 $bestFitExponential->getDFResiduals(),
-								 $bestFitExponential->getSSResiduals()
-							   )
-						);
-		} else {
-			return array( $bestFitExponential->getSlope(),
-						  $bestFitExponential->getIntersect()
-						);
-		}
-	}	//	function LOGEST()
-
-
-	/**
-	 * LOGINV
-	 *
-	 * Returns the inverse of the normal cumulative distribution
-	 *
-	 * @param	float		$probability
-	 * @param	float		$mean
-	 * @param	float		$stdDev
-	 * @return	float
-	 *
-	 * @todo	Try implementing P J Acklam's refinement algorithm for greater
-	 *			accuracy if I can get my head round the mathematics
-	 *			(as described at) http://home.online.no/~pjacklam/notes/invnorm/
-	 */
-	public static function LOGINV($probability, $mean, $stdDev) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$mean			= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-		$stdDev			= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-
-		if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
-			if (($probability < 0) || ($probability > 1) || ($stdDev <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return exp($mean + $stdDev * self::NORMSINV($probability));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function LOGINV()
-
-
-	/**
-	 * LOGNORMDIST
-	 *
-	 * Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed
-	 * with parameters mean and standard_dev.
-	 *
-	 * @param	float		$value
-	 * @param	float		$mean
-	 * @param	float		$stdDev
-	 * @return	float
-	 */
-	public static function LOGNORMDIST($value, $mean, $stdDev) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$mean	= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-		$stdDev	= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-
-		if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
-			if (($value <= 0) || ($stdDev <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return self::NORMSDIST((log($value) - $mean) / $stdDev);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function LOGNORMDIST()
-
-
-	/**
-	 * MAX
-	 *
-	 * MAX returns the value of the element of the values passed that has the highest value,
-	 *		with negative numbers considered smaller than positive numbers.
-	 *
-	 * Excel Function:
-	 *		MAX(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MAX() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if ((is_null($returnValue)) || ($arg > $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		if(is_null($returnValue)) {
-			return 0;
-		}
-		return $returnValue;
-	}	//	function MAX()
-
-
-	/**
-	 * MAXA
-	 *
-	 * Returns the greatest value in a list of arguments, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		MAXA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MAXA() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
-				if (is_bool($arg)) {
-					$arg = (integer) $arg;
-				} elseif (is_string($arg)) {
-					$arg = 0;
-				}
-				if ((is_null($returnValue)) || ($arg > $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		if(is_null($returnValue)) {
-			return 0;
-		}
-		return $returnValue;
-	}	//	function MAXA()
-
-
-	/**
-	 * MAXIF
-	 *
-	 * Counts the maximum value within a range of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		MAXIF(value1[,value2[, ...]],condition)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	string		$condition		The criteria that defines which cells will be checked.
-	 * @return	float
-	 */
-	public static function MAXIF($aArgs,$condition,$sumArgs = array()) {
-		// Return value
-		$returnValue = null;
-
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
-		$sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
-		if (empty($sumArgs)) {
-			$sumArgs = $aArgs;
-		}
-		$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
-		// Loop through arguments
-		foreach ($aArgs as $key => $arg) {
-			if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); }
-			$testCondition = '='.$arg.$condition;
-			if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
-				if ((is_null($returnValue)) || ($arg > $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function MAXIF()
-
-
-	/**
-	 * MEDIAN
-	 *
-	 * Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
-	 *
-	 * Excel Function:
-	 *		MEDIAN(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MEDIAN() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::NaN();
-
-		$mArgs = array();
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$mArgs[] = $arg;
-			}
-		}
-
-		$mValueCount = count($mArgs);
-		if ($mValueCount > 0) {
-			sort($mArgs,SORT_NUMERIC);
-			$mValueCount = $mValueCount / 2;
-			if ($mValueCount == floor($mValueCount)) {
-				$returnValue = ($mArgs[$mValueCount--] + $mArgs[$mValueCount]) / 2;
-			} else {
-				$mValueCount == floor($mValueCount);
-				$returnValue = $mArgs[$mValueCount];
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function MEDIAN()
-
-
-	/**
-	 * MIN
-	 *
-	 * MIN returns the value of the element of the values passed that has the smallest value,
-	 *		with negative numbers considered smaller than positive numbers.
-	 *
-	 * Excel Function:
-	 *		MIN(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MIN() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				if ((is_null($returnValue)) || ($arg < $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		if(is_null($returnValue)) {
-			return 0;
-		}
-		return $returnValue;
-	}	//	function MIN()
-
-
-	/**
-	 * MINA
-	 *
-	 * Returns the smallest value in a list of arguments, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		MINA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MINA() {
-		// Return value
-		$returnValue = null;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
-				if (is_bool($arg)) {
-					$arg = (integer) $arg;
-				} elseif (is_string($arg)) {
-					$arg = 0;
-				}
-				if ((is_null($returnValue)) || ($arg < $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		if(is_null($returnValue)) {
-			return 0;
-		}
-		return $returnValue;
-	}	//	function MINA()
-
-
-	/**
-	 * MINIF
-	 *
-	 * Returns the minimum value within a range of cells that contain numbers within the list of arguments
-	 *
-	 * Excel Function:
-	 *		MINIF(value1[,value2[, ...]],condition)
-	 *
-	 * @access	public
-	 * @category Mathematical and Trigonometric Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	string		$condition		The criteria that defines which cells will be checked.
-	 * @return	float
-	 */
-	public static function MINIF($aArgs,$condition,$sumArgs = array()) {
-		// Return value
-		$returnValue = null;
-
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
-		$sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
-		if (empty($sumArgs)) {
-			$sumArgs = $aArgs;
-		}
-		$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
-		// Loop through arguments
-		foreach ($aArgs as $key => $arg) {
-			if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); }
-			$testCondition = '='.$arg.$condition;
-			if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
-				if ((is_null($returnValue)) || ($arg < $returnValue)) {
-					$returnValue = $arg;
-				}
-			}
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function MINIF()
-
-
-	//
-	//	Special variant of array_count_values that isn't limited to strings and integers,
-	//		but can work with floating point numbers as values
-	//
-	private static function _modeCalc($data) {
-		$frequencyArray = array();
-		foreach($data as $datum) {
-			$found = False;
-			foreach($frequencyArray as $key => $value) {
-				if ((string) $value['value'] == (string) $datum) {
-					++$frequencyArray[$key]['frequency'];
-					$found = True;
-					break;
-				}
-			}
-			if (!$found) {
-				$frequencyArray[] = array('value'		=> $datum,
-										  'frequency'	=>	1 );
-			}
-		}
-
-		foreach($frequencyArray as $key => $value) {
-			$frequencyList[$key] = $value['frequency'];
-			$valueList[$key] = $value['value'];
-		}
-		array_multisort($frequencyList, SORT_DESC, $valueList, SORT_ASC, SORT_NUMERIC, $frequencyArray);
-
-		if ($frequencyArray[0]['frequency'] == 1) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-		return $frequencyArray[0]['value'];
-	}	//	function _modeCalc()
-
-
-	/**
-	 * MODE
-	 *
-	 * Returns the most frequently occurring, or repetitive, value in an array or range of data
-	 *
-	 * Excel Function:
-	 *		MODE(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function MODE() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::NA();
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		$mArgs = array();
-		foreach ($aArgs as $arg) {
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$mArgs[] = $arg;
-			}
-		}
-
-		if (!empty($mArgs)) {
-			return self::_modeCalc($mArgs);
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function MODE()
-
-
-	/**
-	 * NEGBINOMDIST
-	 *
-	 * Returns the negative binomial distribution. NEGBINOMDIST returns the probability that
-	 *		there will be number_f failures before the number_s-th success, when the constant
-	 *		probability of a success is probability_s. This function is similar to the binomial
-	 *		distribution, except that the number of successes is fixed, and the number of trials is
-	 *		variable. Like the binomial, trials are assumed to be independent.
-	 *
-	 * @param	float		$failures		Number of Failures
-	 * @param	float		$successes		Threshold number of Successes
-	 * @param	float		$probability	Probability of success on each trial
-	 * @return	float
-	 *
-	 */
-	public static function NEGBINOMDIST($failures, $successes, $probability) {
-		$failures		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($failures));
-		$successes		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($successes));
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-
-		if ((is_numeric($failures)) && (is_numeric($successes)) && (is_numeric($probability))) {
-			if (($failures < 0) || ($successes < 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (($probability < 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
-				if (($failures + $successes - 1) <= 0) {
-					return PHPExcel_Calculation_Functions::NaN();
-				}
-			}
-			return (PHPExcel_Calculation_MathTrig::COMBIN($failures + $successes - 1,$successes - 1)) * (pow($probability,$successes)) * (pow(1 - $probability,$failures)) ;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function NEGBINOMDIST()
-
-
-	/**
-	 * NORMDIST
-	 *
-	 * Returns the normal distribution for the specified mean and standard deviation. This
-	 * function has a very wide range of applications in statistics, including hypothesis
-	 * testing.
-	 *
-	 * @param	float		$value
-	 * @param	float		$mean		Mean Value
-	 * @param	float		$stdDev		Standard Deviation
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function NORMDIST($value, $mean, $stdDev, $cumulative) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$mean	= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-		$stdDev	= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-
-		if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
-			if ($stdDev < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					return 0.5 * (1 + PHPExcel_Calculation_Engineering::_erfVal(($value - $mean) / ($stdDev * sqrt(2))));
-				} else {
-					return (1 / (SQRT2PI * $stdDev)) * exp(0 - (pow($value - $mean,2) / (2 * ($stdDev * $stdDev))));
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function NORMDIST()
-
-
-	/**
-	 * NORMINV
-	 *
-	 * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.
-	 *
-	 * @param	float		$value
-	 * @param	float		$mean		Mean Value
-	 * @param	float		$stdDev		Standard Deviation
-	 * @return	float
-	 *
-	 */
-	public static function NORMINV($probability,$mean,$stdDev) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$mean			= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-		$stdDev			= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-
-		if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
-			if (($probability < 0) || ($probability > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ($stdDev < 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return (self::_inverse_ncdf($probability) * $stdDev) + $mean;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function NORMINV()
-
-
-	/**
-	 * NORMSDIST
-	 *
-	 * Returns the standard normal cumulative distribution function. The distribution has
-	 * a mean of 0 (zero) and a standard deviation of one. Use this function in place of a
-	 * table of standard normal curve areas.
-	 *
-	 * @param	float		$value
-	 * @return	float
-	 */
-	public static function NORMSDIST($value) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		return self::NORMDIST($value, 0, 1, True);
-	}	//	function NORMSDIST()
-
-
-	/**
-	 * NORMSINV
-	 *
-	 * Returns the inverse of the standard normal cumulative distribution
-	 *
-	 * @param	float		$value
-	 * @return	float
-	 */
-	public static function NORMSINV($value) {
-		return self::NORMINV($value, 0, 1);
-	}	//	function NORMSINV()
-
-
-	/**
-	 * PERCENTILE
-	 *
-	 * Returns the nth percentile of values in a range..
-	 *
-	 * Excel Function:
-	 *		PERCENTILE(value1[,value2[, ...]],entry)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	float		$entry			Percentile value in the range 0..1, inclusive.
-	 * @return	float
-	 */
-	public static function PERCENTILE() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$entry = array_pop($aArgs);
-
-		if ((is_numeric($entry)) && (!is_string($entry))) {
-			if (($entry < 0) || ($entry > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$mArgs = array();
-			foreach ($aArgs as $arg) {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$mArgs[] = $arg;
-				}
-			}
-			$mValueCount = count($mArgs);
-			if ($mValueCount > 0) {
-				sort($mArgs);
-				$count = self::COUNT($mArgs);
-				$index = $entry * ($count-1);
-				$iBase = floor($index);
-				if ($index == $iBase) {
-					return $mArgs[$index];
-				} else {
-					$iNext = $iBase + 1;
-					$iProportion = $index - $iBase;
-					return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion) ;
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function PERCENTILE()
-
-
-	/**
-	 * PERCENTRANK
-	 *
-	 * Returns the rank of a value in a data set as a percentage of the data set.
-	 *
-	 * @param	array of number		An array of, or a reference to, a list of numbers.
-	 * @param	number				The number whose rank you want to find.
-	 * @param	number				The number of significant digits for the returned percentage value.
-	 * @return	float
-	 */
-	public static function PERCENTRANK($valueSet,$value,$significance=3) {
-		$valueSet	= PHPExcel_Calculation_Functions::flattenArray($valueSet);
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$significance	= (is_null($significance))	? 3 :	(integer) PHPExcel_Calculation_Functions::flattenSingleValue($significance);
-
-		foreach($valueSet as $key => $valueEntry) {
-			if (!is_numeric($valueEntry)) {
-				unset($valueSet[$key]);
-			}
-		}
-		sort($valueSet,SORT_NUMERIC);
-		$valueCount = count($valueSet);
-		if ($valueCount == 0) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-
-		$valueAdjustor = $valueCount - 1;
-		if (($value < $valueSet[0]) || ($value > $valueSet[$valueAdjustor])) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		$pos = array_search($value,$valueSet);
-		if ($pos === False) {
-			$pos = 0;
-			$testValue = $valueSet[0];
-			while ($testValue < $value) {
-				$testValue = $valueSet[++$pos];
-			}
-			--$pos;
-			$pos += (($value - $valueSet[$pos]) / ($testValue - $valueSet[$pos]));
-		}
-
-		return round($pos / $valueAdjustor,$significance);
-	}	//	function PERCENTRANK()
-
-
-	/**
-	 * PERMUT
-	 *
-	 * Returns the number of permutations for a given number of objects that can be
-	 *		selected from number objects. A permutation is any set or subset of objects or
-	 *		events where internal order is significant. Permutations are different from
-	 *		combinations, for which the internal order is not significant. Use this function
-	 *		for lottery-style probability calculations.
-	 *
-	 * @param	int		$numObjs	Number of different objects
-	 * @param	int		$numInSet	Number of objects in each permutation
-	 * @return	int		Number of permutations
-	 */
-	public static function PERMUT($numObjs,$numInSet) {
-		$numObjs	= PHPExcel_Calculation_Functions::flattenSingleValue($numObjs);
-		$numInSet	= PHPExcel_Calculation_Functions::flattenSingleValue($numInSet);
-
-		if ((is_numeric($numObjs)) && (is_numeric($numInSet))) {
-			$numInSet = floor($numInSet);
-			if ($numObjs < $numInSet) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return round(PHPExcel_Calculation_MathTrig::FACT($numObjs) / PHPExcel_Calculation_MathTrig::FACT($numObjs - $numInSet));
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function PERMUT()
-
-
-	/**
-	 * POISSON
-	 *
-	 * Returns the Poisson distribution. A common application of the Poisson distribution
-	 * is predicting the number of events over a specific time, such as the number of
-	 * cars arriving at a toll plaza in 1 minute.
-	 *
-	 * @param	float		$value
-	 * @param	float		$mean		Mean Value
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function POISSON($value, $mean, $cumulative) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$mean	= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-
-		if ((is_numeric($value)) && (is_numeric($mean))) {
-			if (($value < 0) || ($mean <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					$summer = 0;
-					for ($i = 0; $i <= floor($value); ++$i) {
-						$summer += pow($mean,$i) / PHPExcel_Calculation_MathTrig::FACT($i);
-					}
-					return exp(0-$mean) * $summer;
-				} else {
-					return (exp(0-$mean) * pow($mean,$value)) / PHPExcel_Calculation_MathTrig::FACT($value);
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function POISSON()
-
-
-	/**
-	 * QUARTILE
-	 *
-	 * Returns the quartile of a data set.
-	 *
-	 * Excel Function:
-	 *		QUARTILE(value1[,value2[, ...]],entry)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	int			$entry			Quartile value in the range 1..3, inclusive.
-	 * @return	float
-	 */
-	public static function QUARTILE() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$entry = floor(array_pop($aArgs));
-
-		if ((is_numeric($entry)) && (!is_string($entry))) {
-			$entry /= 4;
-			if (($entry < 0) || ($entry > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return self::PERCENTILE($aArgs,$entry);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function QUARTILE()
-
-
-	/**
-	 * RANK
-	 *
-	 * Returns the rank of a number in a list of numbers.
-	 *
-	 * @param	number				The number whose rank you want to find.
-	 * @param	array of number		An array of, or a reference to, a list of numbers.
-	 * @param	mixed				Order to sort the values in the value set
-	 * @return	float
-	 */
-	public static function RANK($value,$valueSet,$order=0) {
-		$value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet);
-		$order	= (is_null($order))	? 0 :	(integer) PHPExcel_Calculation_Functions::flattenSingleValue($order);
-
-		foreach($valueSet as $key => $valueEntry) {
-			if (!is_numeric($valueEntry)) {
-				unset($valueSet[$key]);
-			}
-		}
-
-		if ($order == 0) {
-			rsort($valueSet,SORT_NUMERIC);
-		} else {
-			sort($valueSet,SORT_NUMERIC);
-		}
-		$pos = array_search($value,$valueSet);
-		if ($pos === False) {
-			return PHPExcel_Calculation_Functions::NA();
-		}
-
-		return ++$pos;
-	}	//	function RANK()
-
-
-	/**
-	 * RSQ
-	 *
-	 * Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function RSQ($yValues,$xValues) {
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getGoodnessOfFit();
-	}	//	function RSQ()
-
-
-	/**
-	 * SKEW
-	 *
-	 * Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry
-	 * of a distribution around its mean. Positive skewness indicates a distribution with an
-	 * asymmetric tail extending toward more positive values. Negative skewness indicates a
-	 * distribution with an asymmetric tail extending toward more negative values.
-	 *
-	 * @param	array	Data Series
-	 * @return	float
-	 */
-	public static function SKEW() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-		$mean = self::AVERAGE($aArgs);
-		$stdDev = self::STDEV($aArgs);
-
-		$count = $summer = 0;
-		// Loop through arguments
-		foreach ($aArgs as $k => $arg) {
-			if ((is_bool($arg)) &&
-				(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-			} else {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$summer += pow((($arg - $mean) / $stdDev),3) ;
-					++$count;
-				}
-			}
-		}
-
-		// Return
-		if ($count > 2) {
-			return $summer * ($count / (($count-1) * ($count-2)));
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function SKEW()
-
-
-	/**
-	 * SLOPE
-	 *
-	 * Returns the slope of the linear regression line through data points in known_y's and known_x's.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function SLOPE($yValues,$xValues) {
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getSlope();
-	}	//	function SLOPE()
-
-
-	/**
-	 * SMALL
-	 *
-	 * Returns the nth smallest value in a data set. You can use this function to
-	 *		select a value based on its relative standing.
-	 *
-	 * Excel Function:
-	 *		SMALL(value1[,value2[, ...]],entry)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	int			$entry			Position (ordered from the smallest) in the array or range of data to return
-	 * @return	float
-	 */
-	public static function SMALL() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$entry = array_pop($aArgs);
-
-		if ((is_numeric($entry)) && (!is_string($entry))) {
-			$mArgs = array();
-			foreach ($aArgs as $arg) {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$mArgs[] = $arg;
-				}
-			}
-			$count = self::COUNT($mArgs);
-			$entry = floor(--$entry);
-			if (($entry < 0) || ($entry >= $count) || ($count == 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			sort($mArgs);
-			return $mArgs[$entry];
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SMALL()
-
-
-	/**
-	 * STANDARDIZE
-	 *
-	 * Returns a normalized value from a distribution characterized by mean and standard_dev.
-	 *
-	 * @param	float	$value		Value to normalize
-	 * @param	float	$mean		Mean Value
-	 * @param	float	$stdDev		Standard Deviation
-	 * @return	float	Standardized value
-	 */
-	public static function STANDARDIZE($value,$mean,$stdDev) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$mean	= PHPExcel_Calculation_Functions::flattenSingleValue($mean);
-		$stdDev	= PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
-
-		if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
-			if ($stdDev <= 0) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			return ($value - $mean) / $stdDev ;
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function STANDARDIZE()
-
-
-	/**
-	 * STDEV
-	 *
-	 * Estimates standard deviation based on a sample. The standard deviation is a measure of how
-	 *		widely values are dispersed from the average value (the mean).
-	 *
-	 * Excel Function:
-	 *		STDEV(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function STDEV() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGE($aArgs);
-		if (!is_null($aMean)) {
-			$aCount = -1;
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-					$arg = (integer) $arg;
-				}
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					if (is_null($returnValue)) {
-						$returnValue = pow(($arg - $aMean),2);
-					} else {
-						$returnValue += pow(($arg - $aMean),2);
-					}
-					++$aCount;
-				}
-			}
-
-			// Return
-			if (($aCount > 0) && ($returnValue >= 0)) {
-				return sqrt($returnValue / $aCount);
-			}
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function STDEV()
-
-
-	/**
-	 * STDEVA
-	 *
-	 * Estimates standard deviation based on a sample, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		STDEVA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function STDEVA() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGEA($aArgs);
-		if (!is_null($aMean)) {
-			$aCount = -1;
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-				} else {
-					// Is it a numeric value?
-					if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
-						if (is_bool($arg)) {
-							$arg = (integer) $arg;
-						} elseif (is_string($arg)) {
-							$arg = 0;
-						}
-						if (is_null($returnValue)) {
-							$returnValue = pow(($arg - $aMean),2);
-						} else {
-							$returnValue += pow(($arg - $aMean),2);
-						}
-						++$aCount;
-					}
-				}
-			}
-
-			// Return
-			if (($aCount > 0) && ($returnValue >= 0)) {
-				return sqrt($returnValue / $aCount);
-			}
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function STDEVA()
-
-
-	/**
-	 * STDEVP
-	 *
-	 * Calculates standard deviation based on the entire population
-	 *
-	 * Excel Function:
-	 *		STDEVP(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function STDEVP() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGE($aArgs);
-		if (!is_null($aMean)) {
-			$aCount = 0;
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
-					$arg = (integer) $arg;
-				}
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					if (is_null($returnValue)) {
-						$returnValue = pow(($arg - $aMean),2);
-					} else {
-						$returnValue += pow(($arg - $aMean),2);
-					}
-					++$aCount;
-				}
-			}
-
-			// Return
-			if (($aCount > 0) && ($returnValue >= 0)) {
-				return sqrt($returnValue / $aCount);
-			}
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function STDEVP()
-
-
-	/**
-	 * STDEVPA
-	 *
-	 * Calculates standard deviation based on the entire population, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		STDEVPA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function STDEVPA() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-
-		// Return value
-		$returnValue = null;
-
-		$aMean = self::AVERAGEA($aArgs);
-		if (!is_null($aMean)) {
-			$aCount = 0;
-			foreach ($aArgs as $k => $arg) {
-				if ((is_bool($arg)) &&
-					(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-				} else {
-					// Is it a numeric value?
-					if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
-						if (is_bool($arg)) {
-							$arg = (integer) $arg;
-						} elseif (is_string($arg)) {
-							$arg = 0;
-						}
-						if (is_null($returnValue)) {
-							$returnValue = pow(($arg - $aMean),2);
-						} else {
-							$returnValue += pow(($arg - $aMean),2);
-						}
-						++$aCount;
-					}
-				}
-			}
-
-			// Return
-			if (($aCount > 0) && ($returnValue >= 0)) {
-				return sqrt($returnValue / $aCount);
-			}
-		}
-		return PHPExcel_Calculation_Functions::DIV0();
-	}	//	function STDEVPA()
-
-
-	/**
-	 * STEYX
-	 *
-	 * Returns the standard error of the predicted y-value for each x in the regression.
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @return	float
-	 */
-	public static function STEYX($yValues,$xValues) {
-		if (!self::_checkTrendArrays($yValues,$xValues)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		$yValueCount = count($yValues);
-		$xValueCount = count($xValues);
-
-		if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
-			return PHPExcel_Calculation_Functions::NA();
-		} elseif ($yValueCount == 1) {
-			return PHPExcel_Calculation_Functions::DIV0();
-		}
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues);
-		return $bestFitLinear->getStdevOfResiduals();
-	}	//	function STEYX()
-
-
-	/**
-	 * TDIST
-	 *
-	 * Returns the probability of Student's T distribution.
-	 *
-	 * @param	float		$value			Value for the function
-	 * @param	float		$degrees		degrees of freedom
-	 * @param	float		$tails			number of tails (1 or 2)
-	 * @return	float
-	 */
-	public static function TDIST($value, $degrees, $tails) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$degrees	= floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
-		$tails		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($tails));
-
-		if ((is_numeric($value)) && (is_numeric($degrees)) && (is_numeric($tails))) {
-			if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			//	tdist, which finds the probability that corresponds to a given value
-			//	of t with k degrees of freedom. This algorithm is translated from a
-			//	pascal function on p81 of "Statistical Computing in Pascal" by D
-			//	Cooke, A H Craven & G M Clark (1985: Edward Arnold (Pubs.) Ltd:
-			//	London). The above Pascal algorithm is itself a translation of the
-			//	fortran algoritm "AS 3" by B E Cooper of the Atlas Computer
-			//	Laboratory as reported in (among other places) "Applied Statistics
-			//	Algorithms", editied by P Griffiths and I D Hill (1985; Ellis
-			//	Horwood Ltd.; W. Sussex, England).
-			$tterm = $degrees;
-			$ttheta = atan2($value,sqrt($tterm));
-			$tc = cos($ttheta);
-			$ts = sin($ttheta);
-			$tsum = 0;
-
-			if (($degrees % 2) == 1) {
-				$ti = 3;
-				$tterm = $tc;
-			} else {
-				$ti = 2;
-				$tterm = 1;
-			}
-
-			$tsum = $tterm;
-			while ($ti < $degrees) {
-				$tterm *= $tc * $tc * ($ti - 1) / $ti;
-				$tsum += $tterm;
-				$ti += 2;
-			}
-			$tsum *= $ts;
-			if (($degrees % 2) == 1) { $tsum = M_2DIVPI * ($tsum + $ttheta); }
-			$tValue = 0.5 * (1 + $tsum);
-			if ($tails == 1) {
-				return 1 - abs($tValue);
-			} else {
-				return 1 - abs((1 - $tValue) - $tValue);
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TDIST()
-
-
-	/**
-	 * TINV
-	 *
-	 * Returns the one-tailed probability of the chi-squared distribution.
-	 *
-	 * @param	float		$probability	Probability for the function
-	 * @param	float		$degrees		degrees of freedom
-	 * @return	float
-	 */
-	public static function TINV($probability, $degrees) {
-		$probability	= PHPExcel_Calculation_Functions::flattenSingleValue($probability);
-		$degrees		= floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
-
-		if ((is_numeric($probability)) && (is_numeric($degrees))) {
-			$xLo = 100;
-			$xHi = 0;
-
-			$x = $xNew = 1;
-			$dx	= 1;
-			$i = 0;
-
-			while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
-				// Apply Newton-Raphson step
-				$result = self::TDIST($x, $degrees, 2);
-				$error = $result - $probability;
-				if ($error == 0.0) {
-					$dx = 0;
-				} elseif ($error < 0.0) {
-					$xLo = $x;
-				} else {
-					$xHi = $x;
-				}
-				// Avoid division by zero
-				if ($result != 0.0) {
-					$dx = $error / $result;
-					$xNew = $x - $dx;
-				}
-				// If the NR fails to converge (which for example may be the
-				// case if the initial guess is too rough) we apply a bisection
-				// step to determine a more narrow interval around the root.
-				if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) {
-					$xNew = ($xLo + $xHi) / 2;
-					$dx = $xNew - $x;
-				}
-				$x = $xNew;
-			}
-			if ($i == MAX_ITERATIONS) {
-				return PHPExcel_Calculation_Functions::NA();
-			}
-			return round($x,12);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TINV()
-
-
-	/**
-	 * TREND
-	 *
-	 * Returns values along a linear trend
-	 *
-	 * @param	array of mixed		Data Series Y
-	 * @param	array of mixed		Data Series X
-	 * @param	array of mixed		Values of X for which we want to find Y
-	 * @param	boolean				A logical value specifying whether to force the intersect to equal 0.
-	 * @return	array of float
-	 */
-	public static function TREND($yValues,$xValues=array(),$newValues=array(),$const=True) {
-		$yValues = PHPExcel_Calculation_Functions::flattenArray($yValues);
-		$xValues = PHPExcel_Calculation_Functions::flattenArray($xValues);
-		$newValues = PHPExcel_Calculation_Functions::flattenArray($newValues);
-		$const	= (is_null($const))	? True :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
-
-		$bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues,$const);
-		if (empty($newValues)) {
-			$newValues = $bestFitLinear->getXValues();
-		}
-
-		$returnArray = array();
-		foreach($newValues as $xValue) {
-			$returnArray[0][] = $bestFitLinear->getValueOfYForX($xValue);
-		}
-
-		return $returnArray;
-	}	//	function TREND()
-
-
-	/**
-	 * TRIMMEAN
-	 *
-	 * Returns the mean of the interior of a data set. TRIMMEAN calculates the mean
-	 *		taken by excluding a percentage of data points from the top and bottom tails
-	 *		of a data set.
-	 *
-	 * Excel Function:
-	 *		TRIMEAN(value1[,value2[, ...]],$discard)
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @param	float		$discard		Percentage to discard
-	 * @return	float
-	 */
-	public static function TRIMMEAN() {
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
-		// Calculate
-		$percent = array_pop($aArgs);
-
-		if ((is_numeric($percent)) && (!is_string($percent))) {
-			if (($percent < 0) || ($percent > 1)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			$mArgs = array();
-			foreach ($aArgs as $arg) {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) && (!is_string($arg))) {
-					$mArgs[] = $arg;
-				}
-			}
-			$discard = floor(self::COUNT($mArgs) * $percent / 2);
-			sort($mArgs);
-			for ($i=0; $i < $discard; ++$i) {
-				array_pop($mArgs);
-				array_shift($mArgs);
-			}
-			return self::AVERAGE($mArgs);
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function TRIMMEAN()
-
-
-	/**
-	 * VARFunc
-	 *
-	 * Estimates variance based on a sample.
-	 *
-	 * Excel Function:
-	 *		VAR(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function VARFunc() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::DIV0();
-
-		$summerA = $summerB = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		$aCount = 0;
-		foreach ($aArgs as $arg) {
-			if (is_bool($arg)) { $arg = (integer) $arg; }
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$summerA += ($arg * $arg);
-				$summerB += $arg;
-				++$aCount;
-			}
-		}
-
-		// Return
-		if ($aCount > 1) {
-			$summerA *= $aCount;
-			$summerB *= $summerB;
-			$returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1));
-		}
-		return $returnValue;
-	}	//	function VARFunc()
-
-
-	/**
-	 * VARA
-	 *
-	 * Estimates variance based on a sample, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		VARA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function VARA() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::DIV0();
-
-		$summerA = $summerB = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-		$aCount = 0;
-		foreach ($aArgs as $k => $arg) {
-			if ((is_string($arg)) &&
-				(PHPExcel_Calculation_Functions::isValue($k))) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			} elseif ((is_string($arg)) &&
-				(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-			} else {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
-					if (is_bool($arg)) {
-						$arg = (integer) $arg;
-					} elseif (is_string($arg)) {
-						$arg = 0;
-					}
-					$summerA += ($arg * $arg);
-					$summerB += $arg;
-					++$aCount;
-				}
-			}
-		}
-
-		// Return
-		if ($aCount > 1) {
-			$summerA *= $aCount;
-			$summerB *= $summerB;
-			$returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1));
-		}
-		return $returnValue;
-	}	//	function VARA()
-
-
-	/**
-	 * VARP
-	 *
-	 * Calculates variance based on the entire population
-	 *
-	 * Excel Function:
-	 *		VARP(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function VARP() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::DIV0();
-
-		$summerA = $summerB = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		$aCount = 0;
-		foreach ($aArgs as $arg) {
-			if (is_bool($arg)) { $arg = (integer) $arg; }
-			// Is it a numeric value?
-			if ((is_numeric($arg)) && (!is_string($arg))) {
-				$summerA += ($arg * $arg);
-				$summerB += $arg;
-				++$aCount;
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			$summerA *= $aCount;
-			$summerB *= $summerB;
-			$returnValue = ($summerA - $summerB) / ($aCount * $aCount);
-		}
-		return $returnValue;
-	}	//	function VARP()
-
-
-	/**
-	 * VARPA
-	 *
-	 * Calculates variance based on the entire population, including numbers, text, and logical values
-	 *
-	 * Excel Function:
-	 *		VARPA(value1[,value2[, ...]])
-	 *
-	 * @access	public
-	 * @category Statistical Functions
-	 * @param	mixed		$arg,...		Data values
-	 * @return	float
-	 */
-	public static function VARPA() {
-		// Return value
-		$returnValue = PHPExcel_Calculation_Functions::DIV0();
-
-		$summerA = $summerB = 0;
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
-		$aCount = 0;
-		foreach ($aArgs as $k => $arg) {
-			if ((is_string($arg)) &&
-				(PHPExcel_Calculation_Functions::isValue($k))) {
-				return PHPExcel_Calculation_Functions::VALUE();
-			} elseif ((is_string($arg)) &&
-				(!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
-			} else {
-				// Is it a numeric value?
-				if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
-					if (is_bool($arg)) {
-						$arg = (integer) $arg;
-					} elseif (is_string($arg)) {
-						$arg = 0;
-					}
-					$summerA += ($arg * $arg);
-					$summerB += $arg;
-					++$aCount;
-				}
-			}
-		}
-
-		// Return
-		if ($aCount > 0) {
-			$summerA *= $aCount;
-			$summerB *= $summerB;
-			$returnValue = ($summerA - $summerB) / ($aCount * $aCount);
-		}
-		return $returnValue;
-	}	//	function VARPA()
-
-
-	/**
-	 * WEIBULL
-	 *
-	 * Returns the Weibull distribution. Use this distribution in reliability
-	 * analysis, such as calculating a device's mean time to failure.
-	 *
-	 * @param	float		$value
-	 * @param	float		$alpha		Alpha Parameter
-	 * @param	float		$beta		Beta Parameter
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function WEIBULL($value, $alpha, $beta, $cumulative) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$alpha	= PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
-		$beta	= PHPExcel_Calculation_Functions::flattenSingleValue($beta);
-
-		if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta))) {
-			if (($value < 0) || ($alpha <= 0) || ($beta <= 0)) {
-				return PHPExcel_Calculation_Functions::NaN();
-			}
-			if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
-				if ($cumulative) {
-					return 1 - exp(0 - pow($value / $beta,$alpha));
-				} else {
-					return ($alpha / pow($beta,$alpha)) * pow($value,$alpha - 1) * exp(0 - pow($value / $beta,$alpha));
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function WEIBULL()
-
-
-	/**
-	 * ZTEST
-	 *
-	 * Returns the Weibull distribution. Use this distribution in reliability
-	 * analysis, such as calculating a device's mean time to failure.
-	 *
-	 * @param	float		$dataSet
-	 * @param	float		$m0		Alpha Parameter
-	 * @param	float		$sigma	Beta Parameter
-	 * @param	boolean		$cumulative
-	 * @return	float
-	 *
-	 */
-	public static function ZTEST($dataSet, $m0, $sigma = NULL) {
-		$dataSet	= PHPExcel_Calculation_Functions::flattenArrayIndexed($dataSet);
-		$m0			= PHPExcel_Calculation_Functions::flattenSingleValue($m0);
-		$sigma		= PHPExcel_Calculation_Functions::flattenSingleValue($sigma);
-
-		if (is_null($sigma)) {
-			$sigma = self::STDEV($dataSet);
-		}
-		$n = count($dataSet);
-
-		return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0)/($sigma/SQRT($n)));
-	}	//	function ZTEST()
-
-}	//	class PHPExcel_Calculation_Statistical

+ 0 - 630
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php

@@ -1,630 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Calculation_TextData
- *
- * @category	PHPExcel
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_TextData {
-
-	private static $_invalidChars = Null;
-
-	private static function _uniord($c) {
-		if (ord($c{0}) >=0 && ord($c{0}) <= 127)
-			return ord($c{0});
-		if (ord($c{0}) >= 192 && ord($c{0}) <= 223)
-			return (ord($c{0})-192)*64 + (ord($c{1})-128);
-		if (ord($c{0}) >= 224 && ord($c{0}) <= 239)
-			return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
-		if (ord($c{0}) >= 240 && ord($c{0}) <= 247)
-			return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
-		if (ord($c{0}) >= 248 && ord($c{0}) <= 251)
-			return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
-		if (ord($c{0}) >= 252 && ord($c{0}) <= 253)
-			return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
-		if (ord($c{0}) >= 254 && ord($c{0}) <= 255) //error
-			return PHPExcel_Calculation_Functions::VALUE();
-		return 0;
-	}	//	function _uniord()
-
-	/**
-	 * CHARACTER
-	 *
-	 * @param	string	$character	Value
-	 * @return	int
-	 */
-	public static function CHARACTER($character) {
-		$character	= PHPExcel_Calculation_Functions::flattenSingleValue($character);
-
-		if ((!is_numeric($character)) || ($character < 0)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (function_exists('mb_convert_encoding')) {
-			return mb_convert_encoding('&#'.intval($character).';', 'UTF-8', 'HTML-ENTITIES');
-		} else {
-			return chr(intval($character));
-		}
-	}
-
-
-	/**
-	 * TRIMNONPRINTABLE
-	 *
-	 * @param	mixed	$stringValue	Value to check
-	 * @return	string
-	 */
-	public static function TRIMNONPRINTABLE($stringValue = '') {
-		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
-
-		if (is_bool($stringValue)) {
-			return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if (self::$_invalidChars == Null) {
-			self::$_invalidChars = range(chr(0),chr(31));
-		}
-
-		if (is_string($stringValue) || is_numeric($stringValue)) {
-			return str_replace(self::$_invalidChars, '', trim($stringValue, "\x00..\x1F"));
-		}
-		return NULL;
-	}	//	function TRIMNONPRINTABLE()
-
-
-	/**
-	 * TRIMSPACES
-	 *
-	 * @param	mixed	$stringValue	Value to check
-	 * @return	string
-	 */
-	public static function TRIMSPACES($stringValue = '') {
-		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
-		if (is_bool($stringValue)) {
-			return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if (is_string($stringValue) || is_numeric($stringValue)) {
-			return trim(preg_replace('/ +/',' ',trim($stringValue, ' ')), ' ');
-		}
-		return NULL;
-	}	//	function TRIMSPACES()
-
-
-	/**
-	 * ASCIICODE
-	 *
-	 * @param	string	$characters		Value
-	 * @return	int
-	 */
-	public static function ASCIICODE($characters) {
-		if (($characters === NULL) || ($characters === ''))
-			return PHPExcel_Calculation_Functions::VALUE();
-		$characters	= PHPExcel_Calculation_Functions::flattenSingleValue($characters);
-		if (is_bool($characters)) {
-			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-				$characters = (int) $characters;
-			} else {
-				$characters = ($characters) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-			}
-		}
-
-		$character = $characters;
-		if ((function_exists('mb_strlen')) && (function_exists('mb_substr'))) {
-			if (mb_strlen($characters, 'UTF-8') > 1) { $character = mb_substr($characters, 0, 1, 'UTF-8'); }
-			return self::_uniord($character);
-		} else {
-			if (strlen($characters) > 0) { $character = substr($characters, 0, 1); }
-			return ord($character);
-		}
-	}	//	function ASCIICODE()
-
-
-	/**
-	 * CONCATENATE
-	 *
-	 * @return	string
-	 */
-	public static function CONCATENATE() {
-		// Return value
-		$returnValue = '';
-
-		// Loop through arguments
-		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-		foreach ($aArgs as $arg) {
-			if (is_bool($arg)) {
-				if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
-					$arg = (int) $arg;
-				} else {
-					$arg = ($arg) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-				}
-			}
-			$returnValue .= $arg;
-		}
-
-		// Return
-		return $returnValue;
-	}	//	function CONCATENATE()
-
-
-	/**
-	 * DOLLAR
-	 *
-	 * This function converts a number to text using currency format, with the decimals rounded to the specified place.
-	 * The format used is $#,##0.00_);($#,##0.00)..
-	 *
-	 * @param	float	$value			The value to format
-	 * @param	int		$decimals		The number of digits to display to the right of the decimal point.
-	 *									If decimals is negative, number is rounded to the left of the decimal point.
-	 *									If you omit decimals, it is assumed to be 2
-	 * @return	string
-	 */
-	public static function DOLLAR($value = 0, $decimals = 2) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$decimals	= is_null($decimals) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($decimals);
-
-		// Validate parameters
-		if (!is_numeric($value) || !is_numeric($decimals)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$decimals = floor($decimals);
-
-		$mask = '$#,##0';
-		if ($decimals > 0) {
-			$mask .= '.' . str_repeat('0',$decimals);
-		} else {
-			$round = pow(10,abs($decimals));
-			if ($value < 0) { $round = 0-$round; }
-			$value = PHPExcel_Calculation_MathTrig::MROUND($value, $round);
-		}
-
-		return PHPExcel_Style_NumberFormat::toFormattedString($value, $mask);
-
-	}	//	function DOLLAR()
-
-
-	/**
-	 * SEARCHSENSITIVE
-	 *
-	 * @param	string	$needle		The string to look for
-	 * @param	string	$haystack	The string in which to look
-	 * @param	int		$offset		Offset within $haystack
-	 * @return	string
-	 */
-	public static function SEARCHSENSITIVE($needle,$haystack,$offset=1) {
-		$needle		= PHPExcel_Calculation_Functions::flattenSingleValue($needle);
-		$haystack	= PHPExcel_Calculation_Functions::flattenSingleValue($haystack);
-		$offset		= PHPExcel_Calculation_Functions::flattenSingleValue($offset);
-
-		if (!is_bool($needle)) {
-			if (is_bool($haystack)) {
-				$haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-			}
-
-			if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) {
-				if (PHPExcel_Shared_String::CountCharacters($needle) == 0) {
-					return $offset;
-				}
-				if (function_exists('mb_strpos')) {
-					$pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8');
-				} else {
-					$pos = strpos($haystack, $needle, --$offset);
-				}
-				if ($pos !== false) {
-					return ++$pos;
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SEARCHSENSITIVE()
-
-
-	/**
-	 * SEARCHINSENSITIVE
-	 *
-	 * @param	string	$needle		The string to look for
-	 * @param	string	$haystack	The string in which to look
-	 * @param	int		$offset		Offset within $haystack
-	 * @return	string
-	 */
-	public static function SEARCHINSENSITIVE($needle,$haystack,$offset=1) {
-		$needle		= PHPExcel_Calculation_Functions::flattenSingleValue($needle);
-		$haystack	= PHPExcel_Calculation_Functions::flattenSingleValue($haystack);
-		$offset		= PHPExcel_Calculation_Functions::flattenSingleValue($offset);
-
-		if (!is_bool($needle)) {
-			if (is_bool($haystack)) {
-				$haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-			}
-
-			if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) {
-				if (PHPExcel_Shared_String::CountCharacters($needle) == 0) {
-					return $offset;
-				}
-				if (function_exists('mb_stripos')) {
-					$pos = mb_stripos($haystack, $needle, --$offset,'UTF-8');
-				} else {
-					$pos = stripos($haystack, $needle, --$offset);
-				}
-				if ($pos !== false) {
-					return ++$pos;
-				}
-			}
-		}
-		return PHPExcel_Calculation_Functions::VALUE();
-	}	//	function SEARCHINSENSITIVE()
-
-
-	/**
-	 * FIXEDFORMAT
-	 *
-	 * @param	mixed		$value	Value to check
-	 * @param	integer		$decimals
-	 * @param	boolean		$no_commas
-	 * @return	boolean
-	 */
-	public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = FALSE) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$decimals	= PHPExcel_Calculation_Functions::flattenSingleValue($decimals);
-		$no_commas	= PHPExcel_Calculation_Functions::flattenSingleValue($no_commas);
-
-		// Validate parameters
-		if (!is_numeric($value) || !is_numeric($decimals)) {
-			return PHPExcel_Calculation_Functions::NaN();
-		}
-		$decimals = floor($decimals);
-
-		$valueResult = round($value,$decimals);
-		if ($decimals < 0) { $decimals = 0; }
-		if (!$no_commas) {
-			$valueResult = number_format($valueResult,$decimals);
-		}
-
-		return (string) $valueResult;
-	}	//	function FIXEDFORMAT()
-
-
-	/**
-	 * LEFT
-	 *
-	 * @param	string	$value	Value
-	 * @param	int		$chars	Number of characters
-	 * @return	string
-	 */
-	public static function LEFT($value = '', $chars = 1) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$chars		= PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
-		if ($chars < 0) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (is_bool($value)) {
-			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if (function_exists('mb_substr')) {
-			return mb_substr($value, 0, $chars, 'UTF-8');
-		} else {
-			return substr($value, 0, $chars);
-		}
-	}	//	function LEFT()
-
-
-	/**
-	 * MID
-	 *
-	 * @param	string	$value	Value
-	 * @param	int		$start	Start character
-	 * @param	int		$chars	Number of characters
-	 * @return	string
-	 */
-	public static function MID($value = '', $start = 1, $chars = null) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$start		= PHPExcel_Calculation_Functions::flattenSingleValue($start);
-		$chars		= PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
-		if (($start < 1) || ($chars < 0)) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (is_bool($value)) {
-			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if (function_exists('mb_substr')) {
-			return mb_substr($value, --$start, $chars, 'UTF-8');
-		} else {
-			return substr($value, --$start, $chars);
-		}
-	}	//	function MID()
-
-
-	/**
-	 * RIGHT
-	 *
-	 * @param	string	$value	Value
-	 * @param	int		$chars	Number of characters
-	 * @return	string
-	 */
-	public static function RIGHT($value = '', $chars = 1) {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$chars		= PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
-		if ($chars < 0) {
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-
-		if (is_bool($value)) {
-			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) {
-			return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8');
-		} else {
-			return substr($value, strlen($value) - $chars);
-		}
-	}	//	function RIGHT()
-
-
-	/**
-	 * STRINGLENGTH
-	 *
-	 * @param	string	$value	Value
-	 * @return	string
-	 */
-	public static function STRINGLENGTH($value = '') {
-		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		if (is_bool($value)) {
-			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		if (function_exists('mb_strlen')) {
-			return mb_strlen($value, 'UTF-8');
-		} else {
-			return strlen($value);
-		}
-	}	//	function STRINGLENGTH()
-
-
-	/**
-	 * LOWERCASE
-	 *
-	 * Converts a string value to upper case.
-	 *
-	 * @param	string		$mixedCaseString
-	 * @return	string
-	 */
-	public static function LOWERCASE($mixedCaseString) {
-		$mixedCaseString	= PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
-		if (is_bool($mixedCaseString)) {
-			$mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		return PHPExcel_Shared_String::StrToLower($mixedCaseString);
-	}	//	function LOWERCASE()
-
-
-	/**
-	 * UPPERCASE
-	 *
-	 * Converts a string value to upper case.
-	 *
-	 * @param	string		$mixedCaseString
-	 * @return	string
-	 */
-	public static function UPPERCASE($mixedCaseString) {
-		$mixedCaseString	= PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
-		if (is_bool($mixedCaseString)) {
-			$mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		return PHPExcel_Shared_String::StrToUpper($mixedCaseString);
-	}	//	function UPPERCASE()
-
-
-	/**
-	 * PROPERCASE
-	 *
-	 * Converts a string value to upper case.
-	 *
-	 * @param	string		$mixedCaseString
-	 * @return	string
-	 */
-	public static function PROPERCASE($mixedCaseString) {
-		$mixedCaseString	= PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
-		if (is_bool($mixedCaseString)) {
-			$mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
-		}
-
-		return PHPExcel_Shared_String::StrToTitle($mixedCaseString);
-	}	//	function PROPERCASE()
-
-
-	/**
-	 * REPLACE
-	 *
-	 * @param	string	$oldText	String to modify
-	 * @param	int		$start		Start character
-	 * @param	int		$chars		Number of characters
-	 * @param	string	$newText	String to replace in defined position 
-	 * @return	string
-	 */
-	public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText) {
-		$oldText	= PHPExcel_Calculation_Functions::flattenSingleValue($oldText);
-		$start		= PHPExcel_Calculation_Functions::flattenSingleValue($start);
-		$chars		= PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-		$newText	= PHPExcel_Calculation_Functions::flattenSingleValue($newText);
-
-		$left = self::LEFT($oldText,$start-1);
-		$right = self::RIGHT($oldText,self::STRINGLENGTH($oldText)-($start+$chars)+1);
-
-		return $left.$newText.$right;
-	}	//	function REPLACE()
-
-
-	/**
-	 * SUBSTITUTE
-	 *
-	 * @param	string	$text		Value
-	 * @param	string	$fromText	From Value
-	 * @param	string	$toText		To Value
-	 * @param	integer	$instance	Instance Number
-	 * @return	string
-	 */
-	public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0) {
-		$text		= PHPExcel_Calculation_Functions::flattenSingleValue($text);
-		$fromText	= PHPExcel_Calculation_Functions::flattenSingleValue($fromText);
-		$toText		= PHPExcel_Calculation_Functions::flattenSingleValue($toText);
-		$instance	= floor(PHPExcel_Calculation_Functions::flattenSingleValue($instance));
-
-		if ($instance == 0) {
-			if(function_exists('mb_str_replace')) {
-				return mb_str_replace($fromText,$toText,$text);
-			} else {
-				return str_replace($fromText,$toText,$text);
-			}
-		} else {
-			$pos = -1;
-			while($instance > 0) {
-				if (function_exists('mb_strpos')) {
-					$pos = mb_strpos($text, $fromText, $pos+1, 'UTF-8');
-				} else {
-					$pos = strpos($text, $fromText, $pos+1);
-				}
-				if ($pos === false) {
-					break;
-				}
-				--$instance;
-			}
-			if ($pos !== false) {
-				if (function_exists('mb_strlen')) {
-					return self::REPLACE($text,++$pos,mb_strlen($fromText, 'UTF-8'),$toText);
-				} else {
-					return self::REPLACE($text,++$pos,strlen($fromText),$toText);
-				}
-			}
-		}
-
-		return $text;
-	}	//	function SUBSTITUTE()
-
-
-	/**
-	 * RETURNSTRING
-	 *
-	 * @param	mixed	$testValue	Value to check
-	 * @return	boolean
-	 */
-	public static function RETURNSTRING($testValue = '') {
-		$testValue	= PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
-
-		if (is_string($testValue)) {
-			return $testValue;
-		}
-		return Null;
-	}	//	function RETURNSTRING()
-
-
-	/**
-	 * TEXTFORMAT
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @param	string	$format	Format mask to use
-	 * @return	boolean
-	 */
-	public static function TEXTFORMAT($value,$format) {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-		$format	= PHPExcel_Calculation_Functions::flattenSingleValue($format);
-
-		if ((is_string($value)) && (!is_numeric($value)) && PHPExcel_Shared_Date::isDateTimeFormatCode($format)) {
-			$value = PHPExcel_Calculation_DateTime::DATEVALUE($value);
-		}
-
-		return (string) PHPExcel_Style_NumberFormat::toFormattedString($value,$format);
-	}	//	function TEXTFORMAT()
-
-	/**
-	 * VALUE
-	 *
-	 * @param	mixed	$value	Value to check
-	 * @return	boolean
-	 */
-	public static function VALUE($value = '') {
-		$value	= PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
-		if (!is_numeric($value)) {
-            $numberValue = str_replace(
-                PHPExcel_Shared_String::getThousandsSeparator(), 
-                '', 
-                trim($value, " \t\n\r\0\x0B" . PHPExcel_Shared_String::getCurrencyCode())
-            );
-            if (is_numeric($numberValue)) {
-                return (float) $numberValue;
-            }
-
-            $dateSetting = PHPExcel_Calculation_Functions::getReturnDateType();
-            PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
-
-            if (strpos($value, ':') !== false) {
-                $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($value);
-                if ($timeValue !== PHPExcel_Calculation_Functions::VALUE()) {
-                    PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
-                    return $timeValue;
-                }
-            }
-			$dateValue = PHPExcel_Calculation_DateTime::DATEVALUE($value);
-            if ($dateValue !== PHPExcel_Calculation_Functions::VALUE()) {
-                PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
-                return $dateValue;
-            }
-            PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
-
-			return PHPExcel_Calculation_Functions::VALUE();
-		}
-		return (float) $value;
-	}
-
-}

+ 0 - 115
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Token/Stack.php

@@ -1,115 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Calculation
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Calculation_Token_Stack
- *
- * @category	PHPExcel_Calculation_Token_Stack
- * @package		PHPExcel_Calculation
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Calculation_Token_Stack {
-
-	/**
-	 *  The parser stack for formulae
-	 *
-	 *  @var mixed[]
-	 */
-	private $_stack = array();
-
-	/**
-	 *  Count of entries in the parser stack
-	 *
-	 *  @var integer
-	 */
-	private $_count = 0;
-
-
-	/**
-	 * Return the number of entries on the stack
-	 *
-	 * @return  integer
-	 */
-	public function count() {
-		return $this->_count;
-	}	//	function count()
-
-	/**
-	 * Push a new entry onto the stack
-	 *
-	 * @param  mixed  $type
-	 * @param  mixed  $value
-	 * @param  mixed  $reference
-	 */
-	public function push($type, $value, $reference = NULL) {
-		$this->_stack[$this->_count++] = array('type'		=> $type,
-											   'value'		=> $value,
-											   'reference'	=> $reference
-											  );
-		if ($type == 'Function') {
-			$localeFunction = PHPExcel_Calculation::_localeFunc($value);
-			if ($localeFunction != $value) {
-				$this->_stack[($this->_count - 1)]['localeValue'] = $localeFunction;
-			}
-		}
-	}	//	function push()
-
-	/**
-	 * Pop the last entry from the stack
-	 *
-	 * @return  mixed
-	 */
-	public function pop() {
-		if ($this->_count > 0) {
-			return $this->_stack[--$this->_count];
-		}
-		return NULL;
-	}	//	function pop()
-
-	/**
-	 * Return an entry from the stack without removing it
-	 *
-	 * @param   integer  $n  number indicating how far back in the stack we want to look
-	 * @return  mixed
-	 */
-	public function last($n = 1) {
-		if ($this->_count - $n < 0) {
-			return NULL;
-		}
-		return $this->_stack[$this->_count - $n];
-	}	//	function last()
-
-	/**
-	 * Clear the stack
-	 */
-	function clear() {
-		$this->_stack = array();
-		$this->_count = 0;
-	}
-
-}	//	class PHPExcel_Calculation_Token_Stack

+ 0 - 351
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Calculation/functionlist.txt

@@ -1,351 +0,0 @@
-ABS
-ACCRINT
-ACCRINTM
-ACOS
-ACOSH
-ADDRESS
-AMORDEGRC
-AMORLINC
-AND
-AREAS
-ASC
-ASIN
-ASINH
-ATAN
-ATAN2
-ATANH
-AVEDEV
-AVERAGE
-AVERAGEA
-AVERAGEIF
-AVERAGEIFS
-BAHTTEXT
-BESSELI
-BESSELJ
-BESSELK
-BESSELY
-BETADIST
-BETAINV
-BIN2DEC
-BIN2HEX
-BIN2OCT
-BINOMDIST
-CEILING
-CELL
-CHAR
-CHIDIST
-CHIINV
-CHITEST
-CHOOSE
-CLEAN
-CODE
-COLUMN
-COLUMNS
-COMBIN
-COMPLEX
-CONCATENATE
-CONFIDENCE
-CONVERT
-CORREL
-COS
-COSH
-COUNT
-COUNTA
-COUNTBLANK
-COUNTIF
-COUNTIFS
-COUPDAYBS
-COUPDAYBS
-COUPDAYSNC
-COUPNCD
-COUPNUM
-COUPPCD
-COVAR
-CRITBINOM
-CUBEKPIMEMBER
-CUBEMEMBER
-CUBEMEMBERPROPERTY
-CUBERANKEDMEMBER
-CUBESET
-CUBESETCOUNT
-CUBEVALUE
-CUMIPMT
-CUMPRINC
-DATE
-DATEDIF
-DATEVALUE
-DAVERAGE
-DAY
-DAYS360
-DB
-DCOUNT
-DCOUNTA
-DDB
-DEC2BIN
-DEC2HEX
-DEC2OCT
-DEGREES
-DELTA
-DEVSQ
-DGET
-DISC
-DMAX
-DMIN
-DOLLAR
-DOLLARDE
-DOLLARFR
-DPRODUCT
-DSTDEV
-DSTDEVP
-DSUM
-DURATION
-DVAR
-DVARP
-EDATE
-EFFECT
-EOMONTH
-ERF
-ERFC
-ERROR.TYPE
-EVEN
-EXACT
-EXP
-EXPONDIST
-FACT
-FACTDOUBLE
-FALSE
-FDIST
-FIND
-FINDB
-FINV
-FISHER
-FISHERINV
-FIXED
-FLOOR
-FORECAST
-FREQUENCY
-FTEST
-FV
-FVSCHEDULE
-GAMAMDIST
-GAMMAINV
-GAMMALN
-GCD
-GEOMEAN
-GESTEP
-GETPIVOTDATA
-GROWTH
-HARMEAN
-HEX2BIN
-HEX2OCT
-HLOOKUP
-HOUR
-HYPERLINK
-HYPGEOMDIST
-IF
-IFERROR
-IMABS
-IMAGINARY
-IMARGUMENT
-IMCONJUGATE
-IMCOS
-IMEXP
-IMLN
-IMLOG10
-IMLOG2
-IMPOWER
-IMPRODUCT
-IMREAL
-IMSIN
-IMSQRT
-IMSUB
-IMSUM
-INDEX
-INDIRECT
-INFO
-INT
-INTERCEPT
-INTRATE
-IPMT
-IRR
-ISBLANK
-ISERR
-ISERROR
-ISEVEN
-ISLOGICAL
-ISNA
-ISNONTEXT
-ISNUMBER
-ISODD
-ISPMT
-ISREF
-ISTEXT
-JIS
-KURT
-LARGE
-LCM
-LEFT
-LEFTB
-LEN
-LENB
-LINEST
-LN
-LOG
-LOG10
-LOGEST
-LOGINV
-LOGNORMDIST
-LOOKUP
-LOWER
-MATCH
-MAX
-MAXA
-MDETERM
-MDURATION
-MEDIAN
-MID
-MIDB
-MIN
-MINA
-MINUTE
-MINVERSE
-MIRR
-MMULT
-MOD
-MODE
-MONTH
-MROUND
-MULTINOMIAL
-N
-NA
-NEGBINOMDIST
-NETWORKDAYS
-NOMINAL
-NORMDIST
-NORMINV
-NORMSDIST
-NORMSINV
-NOT
-NOW
-NPER
-NPV
-OCT2BIN
-OCT2DEC
-OCT2HEX
-ODD
-ODDFPRICE
-ODDFYIELD
-ODDLPRICE
-ODDLYIELD
-OFFSET
-OR
-PEARSON
-PERCENTILE
-PERCENTRANK
-PERMUT
-PHONETIC
-PI
-PMT
-POISSON
-POWER
-PPMT
-PRICE
-PRICEDISC
-PRICEMAT
-PROB
-PRODUCT
-PROPER
-PV
-QUARTILE
-QUOTIENT
-RADIANS
-RAND
-RANDBETWEEN
-RANK
-RATE
-RECEIVED
-REPLACE
-REPLACEB
-REPT
-RIGHT
-RIGHTB
-ROMAN
-ROUND
-ROUNDDOWN
-ROUNDUP
-ROW
-ROWS
-RSQ
-RTD
-SEARCH
-SEARCHB
-SECOND
-SERIESSUM
-SIGN
-SIN
-SINH
-SKEW
-SLN
-SLOPE
-SMALL
-SQRT
-SQRTPI
-STANDARDIZE
-STDEV
-STDEVA
-STDEVP
-STDEVPA
-STEYX
-SUBSTITUTE
-SUBTOTAL
-SUM
-SUMIF
-SUMIFS
-SUMPRODUCT
-SUMSQ
-SUMX2MY2
-SUMX2PY2
-SUMXMY2
-SYD
-T
-TAN
-TANH
-TBILLEQ
-TBILLPRICE
-TBILLYIELD
-TDIST
-TEXT
-TIME
-TIMEVALUE
-TINV
-TODAY
-TRANSPOSE
-TREND
-TRIM
-TRIMMEAN
-TRUE
-TRUNC
-TTEST
-TYPE
-UPPER
-USDOLLAR
-VALUE
-VAR
-VARA
-VARP
-VARPA
-VDB
-VERSION
-VLOOKUP
-WEEKDAY
-WEEKNUM
-WEIBULL
-WORKDAY
-XIRR
-XNPV
-YEAR
-YEARFRAC
-YIELD
-YIELDDISC
-YIELDMAT
-ZTEST

+ 0 - 1022
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell.php

@@ -1,1022 +0,0 @@
-<?php
-/**
- *	PHPExcel
- *
- *	Copyright (c) 2006 - 2014 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_Cell
- *	@copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- *	@license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- *	@version	##VERSION##, ##DATE##
- */
-
-
-/**
- *	PHPExcel_Cell
- *
- *	@category   PHPExcel
- *	@package	PHPExcel_Cell
- *	@copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell
-{
-
-	/**
-	 *  Default range variable constant
-	 *
-	 *  @var  string
-	 */
-	const DEFAULT_RANGE = 'A1:A1';
-
-	/**
-	 *	Value binder to use
-	 *
-	 *	@var	PHPExcel_Cell_IValueBinder
-	 */
-	private static $_valueBinder = NULL;
-
-	/**
-	 *	Value of the cell
-	 *
-	 *	@var	mixed
-	 */
-	private $_value;
-
-	/**
-	 *	Calculated value of the cell (used for caching)
-	 *	This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
-	 *		create the original spreadsheet file.
-	 *	Note that this value is not guaranteed to reflect the actual calculated value because it is
-	 *		possible that auto-calculation was disabled in the original spreadsheet, and underlying data
-	 *		values used by the formula have changed since it was last calculated.
-	 *
-	 *	@var mixed
-	 */
-	private $_calculatedValue = NULL;
-
-	/**
-	 *	Type of the cell data
-	 *
-	 *	@var	string
-	 */
-	private $_dataType;
-
-	/**
-	 *	Parent worksheet
-	 *
-	 *	@var	PHPExcel_CachedObjectStorage_CacheBase
-	 */
-	private $_parent;
-
-	/**
-	 *	Index to cellXf
-	 *
-	 *	@var	int
-	 */
-	private $_xfIndex = 0;
-
-	/**
-	 *	Attributes of the formula
-	 *
-	 */
-	private $_formulaAttributes;
-
-
-	/**
-	 *	Send notification to the cache controller
-	 *
-	 *	@return void
-	 **/
-	public function notifyCacheController() {
-		$this->_parent->updateCacheData($this);
-
-		return $this;
-	}
-
-	public function detach() {
-		$this->_parent = NULL;
-	}
-
-	public function attach(PHPExcel_CachedObjectStorage_CacheBase $parent) {
-		$this->_parent = $parent;
-	}
-
-
-	/**
-	 *	Create a new Cell
-	 *
-	 *	@param	mixed				$pValue
-	 *	@param	string				$pDataType
-	 *	@param	PHPExcel_Worksheet	$pSheet
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function __construct($pValue = NULL, $pDataType = NULL, PHPExcel_Worksheet $pSheet = NULL)
-	{
-		// Initialise cell value
-		$this->_value = $pValue;
-
-		// Set worksheet cache
-		$this->_parent = $pSheet->getCellCacheController();
-
-		// Set datatype?
-		if ($pDataType !== NULL) {
-			if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
-				$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
-			$this->_dataType = $pDataType;
-		} elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
-            throw new PHPExcel_Exception("Value could not be bound to cell.");
-		}
-	}
-
-	/**
-	 *	Get cell coordinate column
-	 *
-	 *	@return	string
-	 */
-	public function getColumn()
-	{
-		return $this->_parent->getCurrentColumn();
-	}
-
-	/**
-	 *	Get cell coordinate row
-	 *
-	 *	@return	int
-	 */
-	public function getRow()
-	{
-		return $this->_parent->getCurrentRow();
-	}
-
-	/**
-	 *	Get cell coordinate
-	 *
-	 *	@return	string
-	 */
-	public function getCoordinate()
-	{
-		return $this->_parent->getCurrentAddress();
-	}
-
-	/**
-	 *	Get cell value
-	 *
-	 *	@return	mixed
-	 */
-	public function getValue()
-	{
-		return $this->_value;
-	}
-
-	/**
-	 *	Get cell value with formatting
-	 *
-	 *	@return	string
-	 */
-	public function getFormattedValue()
-	{
-		return (string) PHPExcel_Style_NumberFormat::toFormattedString(
-				$this->getCalculatedValue(),
-				$this->getStyle()
-					->getNumberFormat()->getFormatCode()
-			);
-	}
-
-	/**
-	 *	Set cell value
-	 *
-	 *	Sets the value for a cell, automatically determining the datatype using the value binder
-	 *
-	 *	@param	mixed	$pValue					Value
-	 *	@return	PHPExcel_Cell
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function setValue($pValue = NULL)
-	{
-		if (!self::getValueBinder()->bindValue($this, $pValue)) {
-			throw new PHPExcel_Exception("Value could not be bound to cell.");
-		}
-		return $this;
-	}
-
-	/**
-	 *	Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder)
-	 *
-	 *	@param	mixed	$pValue			Value
-	 *	@param	string	$pDataType		Explicit data type
-	 *	@return	PHPExcel_Cell
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function setValueExplicit($pValue = NULL, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
-	{
-		// set the value according to data type
-		switch ($pDataType) {
-			case PHPExcel_Cell_DataType::TYPE_NULL:
-				$this->_value = $pValue;
-				break;
-			case PHPExcel_Cell_DataType::TYPE_STRING2:
-				$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
-			case PHPExcel_Cell_DataType::TYPE_STRING:
-			case PHPExcel_Cell_DataType::TYPE_INLINE:
-				$this->_value = PHPExcel_Cell_DataType::checkString($pValue);
-				break;
-			case PHPExcel_Cell_DataType::TYPE_NUMERIC:
-				$this->_value = (float)$pValue;
-				break;
-			case PHPExcel_Cell_DataType::TYPE_FORMULA:
-				$this->_value = (string)$pValue;
-				break;
-			case PHPExcel_Cell_DataType::TYPE_BOOL:
-				$this->_value = (bool)$pValue;
-				break;
-			case PHPExcel_Cell_DataType::TYPE_ERROR:
-				$this->_value = PHPExcel_Cell_DataType::checkErrorCode($pValue);
-				break;
-			default:
-				throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType);
-				break;
-		}
-
-		// set the datatype
-		$this->_dataType = $pDataType;
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	Get calculated cell value
-	 *
-	 *	@deprecated		Since version 1.7.8 for planned changes to cell for array formula handling
-	 *
-	 *	@param	boolean $resetLog  Whether the calculation engine logger should be reset or not
-	 *	@return	mixed
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function getCalculatedValue($resetLog = TRUE)
-	{
-//echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().PHP_EOL;
-		if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
-			try {
-//echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
-				$result = PHPExcel_Calculation::getInstance(
-					$this->getWorksheet()->getParent()
-				)->calculateCellValue($this,$resetLog);
-//echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
-				//	We don't yet handle array returns
-				if (is_array($result)) {
-					while (is_array($result)) {
-						$result = array_pop($result);
-					}
-				}
-			} catch ( PHPExcel_Exception $ex ) {
-				if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->_calculatedValue !== NULL)) {
-//echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
-					return $this->_calculatedValue; // Fallback for calculations referencing external files.
-				}
-//echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
-				$result = '#N/A';
-				throw new PHPExcel_Calculation_Exception(
-					$this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
-				);
-			}
-
-			if ($result === '#Not Yet Implemented') {
-//echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
-				return $this->_calculatedValue; // Fallback if calculation engine does not support the formula.
-			}
-//echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
-			return $result;
-		} elseif($this->_value instanceof PHPExcel_RichText) {
-//		echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->_value.'<br />';
-			return $this->_value->getPlainText();
-		}
-//		echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'<br />';
-		return $this->_value;
-	}
-
-	/**
-	 *	Set old calculated value (cached)
-	 *
-	 *	@param	mixed $pValue	Value
-	 *	@return	PHPExcel_Cell
-	 */
-	public function setCalculatedValue($pValue = NULL)
-	{
-		if ($pValue !== NULL) {
-			$this->_calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
-		}
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	Get old calculated value (cached)
-	 *	This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
-	 *		create the original spreadsheet file.
-	 *	Note that this value is not guaranteed to refelect the actual calculated value because it is
-	 *		possible that auto-calculation was disabled in the original spreadsheet, and underlying data
-	 *		values used by the formula have changed since it was last calculated.
-	 *
-	 *	@return	mixed
-	 */
-	public function getOldCalculatedValue()
-	{
-		return $this->_calculatedValue;
-	}
-
-	/**
-	 *	Get cell data type
-	 *
-	 *	@return string
-	 */
-	public function getDataType()
-	{
-		return $this->_dataType;
-	}
-
-	/**
-	 *	Set cell data type
-	 *
-	 *	@param	string $pDataType
-	 *	@return	PHPExcel_Cell
-	 */
-	public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
-	{
-		if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
-			$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
-
-		$this->_dataType = $pDataType;
-
-		return $this->notifyCacheController();
-	}
-
-    /**
-     *  Identify if the cell contains a formula
-     *
-     *  @return boolean
-     */
-    public function isFormula()
-    {
-        return $this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA;
-    }
-
-	/**
-	 *	Does this cell contain Data validation rules?
-	 *
-	 *	@return	boolean
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function hasDataValidation()
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
-		}
-
-		return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
-	}
-
-	/**
-	 *	Get Data validation rules
-	 *
-	 *	@return	PHPExcel_Cell_DataValidation
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function getDataValidation()
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet');
-		}
-
-		return $this->getWorksheet()->getDataValidation($this->getCoordinate());
-	}
-
-	/**
-	 *	Set Data validation rules
-	 *
-	 *	@param	PHPExcel_Cell_DataValidation	$pDataValidation
-	 *	@return	PHPExcel_Cell
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = NULL)
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
-		}
-
-		$this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	Does this cell contain a Hyperlink?
-	 *
-	 *	@return boolean
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function hasHyperlink()
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
-		}
-
-		return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
-	}
-
-	/**
-	 *	Get Hyperlink
-	 *
-	 *	@return	PHPExcel_Cell_Hyperlink
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function getHyperlink()
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
-		}
-
-		return $this->getWorksheet()->getHyperlink($this->getCoordinate());
-	}
-
-	/**
-	 *	Set Hyperlink
-	 *
-	 *	@param	PHPExcel_Cell_Hyperlink	$pHyperlink
-	 *	@return	PHPExcel_Cell
-	 *	@throws	PHPExcel_Exception
-	 */
-	public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = NULL)
-	{
-		if (!isset($this->_parent)) {
-			throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
-		}
-
-		$this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	Get parent worksheet
-	 *
-	 *	@return PHPExcel_CachedObjectStorage_CacheBase
-	 */
-	public function getParent() {
-		return $this->_parent;
-	}
-
-	/**
-	 *	Get parent worksheet
-	 *
-	 *	@return PHPExcel_Worksheet
-	 */
-	public function getWorksheet() {
-		return $this->_parent->getParent();
-	}
-
-	/**
-	 *	Is this cell in a merge range
-	 *
-	 *	@return boolean
-	 */
-    public function isInMergeRange() {
-        return (boolean) $this->getMergeRange();
-    }
-
-	/**
-	 *	Is this cell the master (top left cell) in a merge range (that holds the actual data value)
-	 *
-	 *	@return boolean
-	 */
-    public function isMergeRangeValueCell() {
-        if ($mergeRange = $this->getMergeRange()) {
-            $mergeRange = PHPExcel_Cell::splitRange($mergeRange);
-            list($startCell) = $mergeRange[0];
-            if ($this->getCoordinate() === $startCell) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-	/**
-	 *	If this cell is in a merge range, then return the range
-	 *
-	 *	@return string
-	 */
-    public function getMergeRange() {
-        foreach($this->getWorksheet()->getMergeCells() as $mergeRange) {
-            if ($this->isInRange($mergeRange)) {
-                return $mergeRange;
-            }
-        }
-        return false;
-    }
-
-	/**
-	 *	Get cell style
-	 *
-	 *	@return	PHPExcel_Style
-	 */
-	public function getStyle()
-	{
-		return $this->getWorksheet()->getStyle($this->getCoordinate());
-	}
-
-	/**
-	 *	Re-bind parent
-	 *
-	 *	@param	PHPExcel_Worksheet $parent
-	 *	@return	PHPExcel_Cell
-	 */
-	public function rebindParent(PHPExcel_Worksheet $parent) {
-		$this->_parent = $parent->getCellCacheController();
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	Is cell in a specific range?
-	 *
-	 *	@param	string	$pRange		Cell range (e.g. A1:A1)
-	 *	@return	boolean
-	 */
-	public function isInRange($pRange = 'A1:A1')
-	{
-		list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
-
-		// Translate properties
-		$myColumn	= self::columnIndexFromString($this->getColumn());
-		$myRow		= $this->getRow();
-
-		// Verify if cell is in range
-		return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
-				($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow)
-			   );
-	}
-
-	/**
-	 *	Coordinate from string
-	 *
-	 *	@param	string	$pCoordinateString
-	 *	@return	array	Array containing column and row (indexes 0 and 1)
-	 *	@throws	PHPExcel_Exception
-	 */
-	public static function coordinateFromString($pCoordinateString = 'A1')
-	{
-		if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
-			return array($matches[1],$matches[2]);
-		} elseif ((strpos($pCoordinateString,':') !== FALSE) || (strpos($pCoordinateString,',') !== FALSE)) {
-			throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
-		} elseif ($pCoordinateString == '') {
-			throw new PHPExcel_Exception('Cell coordinate can not be zero-length string');
-		}
-
-		throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString);
-	}
-
-	/**
-	 *	Make string row, column or cell coordinate absolute
-	 *
-	 *	@param	string	$pCoordinateString		e.g. 'A' or '1' or 'A1'
-	 *					Note that this value can be a row or column reference as well as a cell reference
-	 *	@return	string	Absolute coordinate		e.g. '$A' or '$1' or '$A$1'
-	 *	@throws	PHPExcel_Exception
-	 */
-	public static function absoluteReference($pCoordinateString = 'A1')
-	{
-		if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
-			// Split out any worksheet name from the reference
-			$worksheet = '';
-			$cellAddress = explode('!',$pCoordinateString);
-			if (count($cellAddress) > 1) {
-				list($worksheet,$pCoordinateString) = $cellAddress;
-			}
-			if ($worksheet > '')	$worksheet .= '!';
-
-			// Create absolute coordinate
-			if (ctype_digit($pCoordinateString)) {
-				return $worksheet . '$' . $pCoordinateString;
-			} elseif (ctype_alpha($pCoordinateString)) {
-				return $worksheet . '$' . strtoupper($pCoordinateString);
-			}
-			return $worksheet . self::absoluteCoordinate($pCoordinateString);
-		}
-
-		throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
-	}
-
-	/**
-	 *	Make string coordinate absolute
-	 *
-	 *	@param	string	$pCoordinateString		e.g. 'A1'
-	 *	@return	string	Absolute coordinate		e.g. '$A$1'
-	 *	@throws	PHPExcel_Exception
-	 */
-	public static function absoluteCoordinate($pCoordinateString = 'A1')
-	{
-		if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
-			// Split out any worksheet name from the coordinate
-			$worksheet = '';
-			$cellAddress = explode('!',$pCoordinateString);
-			if (count($cellAddress) > 1) {
-				list($worksheet,$pCoordinateString) = $cellAddress;
-			}
-			if ($worksheet > '')	$worksheet .= '!';
-
-			// Create absolute coordinate
-			list($column, $row) = self::coordinateFromString($pCoordinateString);
-			$column = ltrim($column,'$');
-			$row = ltrim($row,'$');
-			return $worksheet . '$' . $column . '$' . $row;
-		}
-
-		throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
-	}
-
-	/**
-	 *	Split range into coordinate strings
-	 *
-	 *	@param	string	$pRange		e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'
-	 *	@return	array	Array containg one or more arrays containing one or two coordinate strings
-	 *								e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11'))
-	 *										or array('B4')
-	 */
-	public static function splitRange($pRange = 'A1:A1')
-	{
-		// Ensure $pRange is a valid range
-		if(empty($pRange)) {
-			$pRange = self::DEFAULT_RANGE;
-		}
-
-		$exploded = explode(',', $pRange);
-		$counter = count($exploded);
-		for ($i = 0; $i < $counter; ++$i) {
-			$exploded[$i] = explode(':', $exploded[$i]);
-		}
-		return $exploded;
-	}
-
-	/**
-	 *	Build range from coordinate strings
-	 *
-	 *	@param	array	$pRange	Array containg one or more arrays containing one or two coordinate strings
-	 *	@return	string	String representation of $pRange
-	 *	@throws	PHPExcel_Exception
-	 */
-	public static function buildRange($pRange)
-	{
-		// Verify range
-		if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) {
-			throw new PHPExcel_Exception('Range does not contain any information');
-		}
-
-		// Build range
-		$imploded = array();
-		$counter = count($pRange);
-		for ($i = 0; $i < $counter; ++$i) {
-			$pRange[$i] = implode(':', $pRange[$i]);
-		}
-		$imploded = implode(',', $pRange);
-
-		return $imploded;
-	}
-
-	/**
-	 *	Calculate range boundaries
-	 *
-	 *	@param	string	$pRange		Cell range (e.g. A1:A1)
-	 *	@return	array	Range coordinates array(Start Cell, End Cell)
-	 *					where Start Cell and End Cell are arrays (Column Number, Row Number)
-	 */
-	public static function rangeBoundaries($pRange = 'A1:A1')
-	{
-		// Ensure $pRange is a valid range
-		if(empty($pRange)) {
-			$pRange = self::DEFAULT_RANGE;
-		}
-
-		// Uppercase coordinate
-		$pRange = strtoupper($pRange);
-
-		// Extract range
-		if (strpos($pRange, ':') === FALSE) {
-			$rangeA = $rangeB = $pRange;
-		} else {
-			list($rangeA, $rangeB) = explode(':', $pRange);
-		}
-
-		// Calculate range outer borders
-		$rangeStart = self::coordinateFromString($rangeA);
-		$rangeEnd	= self::coordinateFromString($rangeB);
-
-		// Translate column into index
-		$rangeStart[0]	= self::columnIndexFromString($rangeStart[0]);
-		$rangeEnd[0]	= self::columnIndexFromString($rangeEnd[0]);
-
-		return array($rangeStart, $rangeEnd);
-	}
-
-	/**
-	 *	Calculate range dimension
-	 *
-	 *	@param	string	$pRange		Cell range (e.g. A1:A1)
-	 *	@return	array	Range dimension (width, height)
-	 */
-	public static function rangeDimension($pRange = 'A1:A1')
-	{
-		// Calculate range outer borders
-		list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
-
-		return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
-	}
-
-	/**
-	 *	Calculate range boundaries
-	 *
-	 *	@param	string	$pRange		Cell range (e.g. A1:A1)
-	 *	@return	array	Range coordinates array(Start Cell, End Cell)
-	 *					where Start Cell and End Cell are arrays (Column ID, Row Number)
-	 */
-	public static function getRangeBoundaries($pRange = 'A1:A1')
-	{
-		// Ensure $pRange is a valid range
-		if(empty($pRange)) {
-			$pRange = self::DEFAULT_RANGE;
-		}
-
-		// Uppercase coordinate
-		$pRange = strtoupper($pRange);
-
-		// Extract range
-		if (strpos($pRange, ':') === FALSE) {
-			$rangeA = $rangeB = $pRange;
-		} else {
-			list($rangeA, $rangeB) = explode(':', $pRange);
-		}
-
-		return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
-	}
-
-	/**
-	 *	Column index from string
-	 *
-	 *	@param	string $pString
-	 *	@return	int Column index (base 1 !!!)
-	 */
-	public static function columnIndexFromString($pString = 'A')
-	{
-		//	Using a lookup cache adds a slight memory overhead, but boosts speed
-		//	caching using a static within the method is faster than a class static,
-		//		though it's additional memory overhead
-		static $_indexCache = array();
-
-		if (isset($_indexCache[$pString]))
-			return $_indexCache[$pString];
-
-		//	It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
-		//		and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
-		//		memory overhead either
-		static $_columnLookup = array(
-			'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
-			'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
-			'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
-			'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26
-		);
-
-		//	We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
-		//		for improved performance
-		if (isset($pString{0})) {
-			if (!isset($pString{1})) {
-				$_indexCache[$pString] = $_columnLookup[$pString];
-				return $_indexCache[$pString];
-			} elseif(!isset($pString{2})) {
-				$_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
-				return $_indexCache[$pString];
-			} elseif(!isset($pString{3})) {
-				$_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
-				return $_indexCache[$pString];
-			}
-		}
-		throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
-	}
-
-	/**
-	 *	String from columnindex
-	 *
-	 *	@param	int $pColumnIndex Column index (base 0 !!!)
-	 *	@return	string
-	 */
-	public static function stringFromColumnIndex($pColumnIndex = 0)
-	{
-		//	Using a lookup cache adds a slight memory overhead, but boosts speed
-		//	caching using a static within the method is faster than a class static,
-		//		though it's additional memory overhead
-		static $_indexCache = array();
-
-		if (!isset($_indexCache[$pColumnIndex])) {
-			// Determine column string
-			if ($pColumnIndex < 26) {
-				$_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
-			} elseif ($pColumnIndex < 702) {
-				$_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
-											  chr(65 + $pColumnIndex % 26);
-			} else {
-				$_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
-											  chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
-											  chr(65 + $pColumnIndex % 26);
-			}
-		}
-		return $_indexCache[$pColumnIndex];
-	}
-
-	/**
-	 *	Extract all cell references in range
-	 *
-	 *	@param	string	$pRange		Range (e.g. A1 or A1:C10 or A1:E10 A20:E25)
-	 *	@return	array	Array containing single cell references
-	 */
-	public static function extractAllCellReferencesInRange($pRange = 'A1') {
-		// Returnvalue
-		$returnValue = array();
-
-		// Explode spaces
-		$cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange)));
-		foreach ($cellBlocks as $cellBlock) {
-			// Single cell?
-			if (strpos($cellBlock,':') === FALSE && strpos($cellBlock,',') === FALSE) {
-				$returnValue[] = $cellBlock;
-				continue;
-			}
-
-			// Range...
-			$ranges = self::splitRange($cellBlock);
-			foreach($ranges as $range) {
-				// Single cell?
-				if (!isset($range[1])) {
-					$returnValue[] = $range[0];
-					continue;
-				}
-
-				// Range...
-				list($rangeStart, $rangeEnd)	= $range;
-				sscanf($rangeStart,'%[A-Z]%d', $startCol, $startRow);
-				sscanf($rangeEnd,'%[A-Z]%d', $endCol, $endRow);
-				$endCol++;
-
-				// Current data
-				$currentCol	= $startCol;
-				$currentRow	= $startRow;
-
-				// Loop cells
-				while ($currentCol != $endCol) {
-					while ($currentRow <= $endRow) {
-						$returnValue[] = $currentCol.$currentRow;
-						++$currentRow;
-					}
-					++$currentCol;
-					$currentRow = $startRow;
-				}
-			}
-		}
-
-		//	Sort the result by column and row
-		$sortKeys = array();
-		foreach (array_unique($returnValue) as $coord) {
-			sscanf($coord,'%[A-Z]%d', $column, $row);
-			$sortKeys[sprintf('%3s%09d',$column,$row)] = $coord;
-		}
-		ksort($sortKeys);
-
-		// Return value
-		return array_values($sortKeys);
-	}
-
-	/**
-	 * Compare 2 cells
-	 *
-	 * @param	PHPExcel_Cell	$a	Cell a
-	 * @param	PHPExcel_Cell	$b	Cell b
-	 * @return	int		Result of comparison (always -1 or 1, never zero!)
-	 */
-	public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
-	{
-		if ($a->getRow() < $b->getRow()) {
-			return -1;
-		} elseif ($a->getRow() > $b->getRow()) {
-			return 1;
-		} elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) {
-			return -1;
-		} else {
-			return 1;
-		}
-	}
-
-	/**
-	 * Get value binder to use
-	 *
-	 * @return PHPExcel_Cell_IValueBinder
-	 */
-	public static function getValueBinder() {
-		if (self::$_valueBinder === NULL) {
-			self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder();
-		}
-
-		return self::$_valueBinder;
-	}
-
-	/**
-	 * Set value binder to use
-	 *
-	 * @param PHPExcel_Cell_IValueBinder $binder
-	 * @throws PHPExcel_Exception
-	 */
-	public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = NULL) {
-		if ($binder === NULL) {
-			throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
-		}
-
-		self::$_valueBinder = $binder;
-	}
-
-	/**
-	 * 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)) && ($key != '_parent')) {
-				$this->$key = clone $value;
-			} else {
-				$this->$key = $value;
-			}
-		}
-	}
-
-	/**
-	 * Get index to cellXf
-	 *
-	 * @return int
-	 */
-	public function getXfIndex()
-	{
-		return $this->_xfIndex;
-	}
-
-	/**
-	 * Set index to cellXf
-	 *
-	 * @param int $pValue
-	 * @return PHPExcel_Cell
-	 */
-	public function setXfIndex($pValue = 0)
-	{
-		$this->_xfIndex = $pValue;
-
-		return $this->notifyCacheController();
-	}
-
-	/**
-	 *	@deprecated		Since version 1.7.8 for planned changes to cell for array formula handling
-	 */
-	public function setFormulaAttributes($pAttributes)
-	{
-		$this->_formulaAttributes = $pAttributes;
-		return $this;
-	}
-
-	/**
-	 *	@deprecated		Since version 1.7.8 for planned changes to cell for array formula handling
-	 */
-	public function getFormulaAttributes()
-	{
-		return $this->_formulaAttributes;
-	}
-
-    /**
-     * Convert to string
-     *
-     * @return string
-     */
-	public function __toString()
-	{
-		return (string) $this->getValue();
-	}
-
-}
-

+ 0 - 192
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/AdvancedValueBinder.php

@@ -1,192 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-    /**
-     * @ignore
-     */
-    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Cell_AdvancedValueBinder
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell_AdvancedValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
-{
-    /**
-     * Bind value to a cell
-     *
-     * @param  PHPExcel_Cell  $cell  Cell to bind value to
-     * @param  mixed $value          Value to bind in cell
-     * @return boolean
-     */
-    public function bindValue(PHPExcel_Cell $cell, $value = null)
-    {
-        // sanitize UTF-8 strings
-        if (is_string($value)) {
-            $value = PHPExcel_Shared_String::SanitizeUTF8($value);
-        }
-
-        // Find out data type
-        $dataType = parent::dataTypeForValue($value);
-
-        // Style logic - strings
-        if ($dataType === PHPExcel_Cell_DataType::TYPE_STRING && !$value instanceof PHPExcel_RichText) {
-            //    Test for booleans using locale-setting
-            if ($value == PHPExcel_Calculation::getTRUE()) {
-                $cell->setValueExplicit( TRUE, PHPExcel_Cell_DataType::TYPE_BOOL);
-                return true;
-            } elseif($value == PHPExcel_Calculation::getFALSE()) {
-                $cell->setValueExplicit( FALSE, PHPExcel_Cell_DataType::TYPE_BOOL);
-                return true;
-            }
-
-            // Check for number in scientific format
-            if (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
-                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                return true;
-            }
-
-            // Check for fraction
-            if (preg_match('/^([+-]?)\s*([0-9]+)\s?\/\s*([0-9]+)$/', $value, $matches)) {
-                // Convert value to number
-                $value = $matches[2] / $matches[3];
-                if ($matches[1] == '-') $value = 0 - $value;
-                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( '??/??' );
-                return true;
-            } elseif (preg_match('/^([+-]?)([0-9]*) +([0-9]*)\s?\/\s*([0-9]*)$/', $value, $matches)) {
-                // Convert value to number
-                $value = $matches[2] + ($matches[3] / $matches[4]);
-                if ($matches[1] == '-') $value = 0 - $value;
-                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( '# ??/??' );
-                return true;
-            }
-
-            // Check for percentage
-            if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) {
-                // Convert value to number
-                $value = (float) str_replace('%', '', $value) / 100;
-                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00 );
-                return true;
-            }
-
-            // Check for currency
-            $currencyCode = PHPExcel_Shared_String::getCurrencyCode();
-            $decimalSeparator = PHPExcel_Shared_String::getDecimalSeparator();
-            $thousandsSeparator = PHPExcel_Shared_String::getThousandsSeparator();
-            if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
-                // Convert value to number
-                $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
-                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode(
-                        str_replace('$', $currencyCode, PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE )
-                    );
-                return true;
-            } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
-                // Convert value to number
-                $value = (float) trim(str_replace(array('$',','), '', $value));
-                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE );
-                return true;
-            }
-
-            // Check for time without seconds e.g. '9:45', '09:45'
-            if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
-                // Convert value to number
-                list($h, $m) = explode(':', $value);
-                $days = $h / 24 + $m / 1440;
-                $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3 );
-                return true;
-            }
-
-            // Check for time with seconds '9:45:59', '09:45:59'
-            if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
-                // Convert value to number
-                list($h, $m, $s) = explode(':', $value);
-                $days = $h / 24 + $m / 1440 + $s / 86400;
-                // Convert value to number
-                $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4 );
-                return true;
-            }
-
-            // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
-            if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) {
-                // Convert value to number
-                $cell->setValueExplicit($d, PHPExcel_Cell_DataType::TYPE_NUMERIC);
-                // Determine style. Either there is a time part or not. Look for ':'
-                if (strpos($value, ':') !== false) {
-                    $formatCode = 'yyyy-mm-dd h:mm';
-                } else {
-                    $formatCode = 'yyyy-mm-dd';
-                }
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getNumberFormat()->setFormatCode($formatCode);
-                return true;
-            }
-
-            // Check for newline character "\n"
-            if (strpos($value, "\n") !== FALSE) {
-                $value = PHPExcel_Shared_String::SanitizeUTF8($value);
-                $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
-                // Set style
-                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
-                    ->getAlignment()->setWrapText(TRUE);
-                return true;
-            }
-        }
-
-        // Not bound yet? Use parent...
-        return parent::bindValue($cell, $value);
-    }
-}

+ 0 - 122
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataType.php

@@ -1,122 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Cell_DataType
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell_DataType
-{
-    /* Data types */
-    const TYPE_STRING2  = 'str';
-    const TYPE_STRING   = 's';
-    const TYPE_FORMULA  = 'f';
-    const TYPE_NUMERIC  = 'n';
-    const TYPE_BOOL     = 'b';
-    const TYPE_NULL     = 'null';
-    const TYPE_INLINE   = 'inlineStr';
-    const TYPE_ERROR    = 'e';
-
-    /**
-     * List of error codes
-     *
-     * @var array
-     */
-    private static $_errorCodes = array(
-        '#NULL!'  => 0,
-        '#DIV/0!' => 1,
-        '#VALUE!' => 2,
-        '#REF!'   => 3,
-        '#NAME?'  => 4,
-        '#NUM!'   => 5,
-        '#N/A'    => 6
-    );
-
-    /**
-     * Get list of error codes
-     *
-     * @return array
-     */
-    public static function getErrorCodes() {
-        return self::$_errorCodes;
-    }
-
-    /**
-     * DataType for value
-     *
-     * @deprecated  Replaced by PHPExcel_Cell_IValueBinder infrastructure, will be removed in version 1.8.0
-     * @param       mixed  $pValue
-     * @return      string
-     */
-    public static function dataTypeForValue($pValue = null) {
-        return PHPExcel_Cell_DefaultValueBinder::dataTypeForValue($pValue);
-    }
-
-    /**
-     * Check a string that it satisfies Excel requirements
-     *
-     * @param  mixed  Value to sanitize to an Excel string
-     * @return mixed  Sanitized value
-     */
-    public static function checkString($pValue = null)
-    {
-        if ($pValue instanceof PHPExcel_RichText) {
-            // TODO: Sanitize Rich-Text string (max. character count is 32,767)
-            return $pValue;
-        }
-
-        // string must never be longer than 32,767 characters, truncate if necessary
-        $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767);
-
-        // we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
-        $pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);
-
-        return $pValue;
-    }
-
-    /**
-     * Check a value that it is a valid error code
-     *
-     * @param  mixed   Value to sanitize to an Excel error code
-     * @return string  Sanitized value
-     */
-    public static function checkErrorCode($pValue = null)
-    {
-        $pValue = (string) $pValue;
-
-        if ( !array_key_exists($pValue, self::$_errorCodes) ) {
-            $pValue = '#NULL!';
-        }
-
-        return $pValue;
-    }
-
-}

+ 0 - 472
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataValidation.php

@@ -1,472 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Cell_DataValidation
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell_DataValidation
-{
-    /* Data validation types */
-    const TYPE_NONE        = 'none';
-    const TYPE_CUSTOM      = 'custom';
-    const TYPE_DATE        = 'date';
-    const TYPE_DECIMAL     = 'decimal';
-    const TYPE_LIST        = 'list';
-    const TYPE_TEXTLENGTH  = 'textLength';
-    const TYPE_TIME        = 'time';
-    const TYPE_WHOLE       = 'whole';
-
-    /* Data validation error styles */
-    const STYLE_STOP         = 'stop';
-    const STYLE_WARNING      = 'warning';
-    const STYLE_INFORMATION  = 'information';
-
-    /* Data validation operators */
-    const OPERATOR_BETWEEN             = 'between';
-    const OPERATOR_EQUAL               = 'equal';
-    const OPERATOR_GREATERTHAN         = 'greaterThan';
-    const OPERATOR_GREATERTHANOREQUAL  = 'greaterThanOrEqual';
-    const OPERATOR_LESSTHAN            = 'lessThan';
-    const OPERATOR_LESSTHANOREQUAL     = 'lessThanOrEqual';
-    const OPERATOR_NOTBETWEEN          = 'notBetween';
-    const OPERATOR_NOTEQUAL            = 'notEqual';
-
-    /**
-     * Formula 1
-     *
-     * @var string
-     */
-    private $_formula1;
-
-    /**
-     * Formula 2
-     *
-     * @var string
-     */
-    private $_formula2;
-
-    /**
-     * Type
-     *
-     * @var string
-     */
-    private $_type = PHPExcel_Cell_DataValidation::TYPE_NONE;
-
-    /**
-     * Error style
-     *
-     * @var string
-     */
-    private $_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
-
-    /**
-     * Operator
-     *
-     * @var string
-     */
-    private $_operator;
-
-    /**
-     * Allow Blank
-     *
-     * @var boolean
-     */
-    private $_allowBlank;
-
-    /**
-     * Show DropDown
-     *
-     * @var boolean
-     */
-    private $_showDropDown;
-
-    /**
-     * Show InputMessage
-     *
-     * @var boolean
-     */
-    private $_showInputMessage;
-
-    /**
-     * Show ErrorMessage
-     *
-     * @var boolean
-     */
-    private $_showErrorMessage;
-
-    /**
-     * Error title
-     *
-     * @var string
-     */
-    private $_errorTitle;
-
-    /**
-     * Error
-     *
-     * @var string
-     */
-    private $_error;
-
-    /**
-     * Prompt title
-     *
-     * @var string
-     */
-    private $_promptTitle;
-
-    /**
-     * Prompt
-     *
-     * @var string
-     */
-    private $_prompt;
-
-    /**
-     * Create a new PHPExcel_Cell_DataValidation
-     */
-    public function __construct()
-    {
-        // Initialise member variables
-        $this->_formula1          = '';
-        $this->_formula2          = '';
-        $this->_type              = PHPExcel_Cell_DataValidation::TYPE_NONE;
-        $this->_errorStyle        = PHPExcel_Cell_DataValidation::STYLE_STOP;
-        $this->_operator          = '';
-        $this->_allowBlank        = FALSE;
-        $this->_showDropDown      = FALSE;
-        $this->_showInputMessage  = FALSE;
-        $this->_showErrorMessage  = FALSE;
-        $this->_errorTitle        = '';
-        $this->_error             = '';
-        $this->_promptTitle       = '';
-        $this->_prompt            = '';
-    }
-
-    /**
-     * Get Formula 1
-     *
-     * @return string
-     */
-    public function getFormula1() {
-        return $this->_formula1;
-    }
-
-    /**
-     * Set Formula 1
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setFormula1($value = '') {
-        $this->_formula1 = $value;
-        return $this;
-    }
-
-    /**
-     * Get Formula 2
-     *
-     * @return string
-     */
-    public function getFormula2() {
-        return $this->_formula2;
-    }
-
-    /**
-     * Set Formula 2
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setFormula2($value = '') {
-        $this->_formula2 = $value;
-        return $this;
-    }
-
-    /**
-     * Get Type
-     *
-     * @return string
-     */
-    public function getType() {
-        return $this->_type;
-    }
-
-    /**
-     * Set Type
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE) {
-        $this->_type = $value;
-        return $this;
-    }
-
-    /**
-     * Get Error style
-     *
-     * @return string
-     */
-    public function getErrorStyle() {
-        return $this->_errorStyle;
-    }
-
-    /**
-     * Set Error style
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP) {
-        $this->_errorStyle = $value;
-        return $this;
-    }
-
-    /**
-     * Get Operator
-     *
-     * @return string
-     */
-    public function getOperator() {
-        return $this->_operator;
-    }
-
-    /**
-     * Set Operator
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setOperator($value = '') {
-        $this->_operator = $value;
-        return $this;
-    }
-
-    /**
-     * Get Allow Blank
-     *
-     * @return boolean
-     */
-    public function getAllowBlank() {
-        return $this->_allowBlank;
-    }
-
-    /**
-     * Set Allow Blank
-     *
-     * @param  boolean    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setAllowBlank($value = false) {
-        $this->_allowBlank = $value;
-        return $this;
-    }
-
-    /**
-     * Get Show DropDown
-     *
-     * @return boolean
-     */
-    public function getShowDropDown() {
-        return $this->_showDropDown;
-    }
-
-    /**
-     * Set Show DropDown
-     *
-     * @param  boolean    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setShowDropDown($value = false) {
-        $this->_showDropDown = $value;
-        return $this;
-    }
-
-    /**
-     * Get Show InputMessage
-     *
-     * @return boolean
-     */
-    public function getShowInputMessage() {
-        return $this->_showInputMessage;
-    }
-
-    /**
-     * Set Show InputMessage
-     *
-     * @param  boolean    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setShowInputMessage($value = false) {
-        $this->_showInputMessage = $value;
-        return $this;
-    }
-
-    /**
-     * Get Show ErrorMessage
-     *
-     * @return boolean
-     */
-    public function getShowErrorMessage() {
-        return $this->_showErrorMessage;
-    }
-
-    /**
-     * Set Show ErrorMessage
-     *
-     * @param  boolean    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setShowErrorMessage($value = false) {
-        $this->_showErrorMessage = $value;
-        return $this;
-    }
-
-    /**
-     * Get Error title
-     *
-     * @return string
-     */
-    public function getErrorTitle() {
-        return $this->_errorTitle;
-    }
-
-    /**
-     * Set Error title
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setErrorTitle($value = '') {
-        $this->_errorTitle = $value;
-        return $this;
-    }
-
-    /**
-     * Get Error
-     *
-     * @return string
-     */
-    public function getError() {
-        return $this->_error;
-    }
-
-    /**
-     * Set Error
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setError($value = '') {
-        $this->_error = $value;
-        return $this;
-    }
-
-    /**
-     * Get Prompt title
-     *
-     * @return string
-     */
-    public function getPromptTitle() {
-        return $this->_promptTitle;
-    }
-
-    /**
-     * Set Prompt title
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setPromptTitle($value = '') {
-        $this->_promptTitle = $value;
-        return $this;
-    }
-
-    /**
-     * Get Prompt
-     *
-     * @return string
-     */
-    public function getPrompt() {
-        return $this->_prompt;
-    }
-
-    /**
-     * Set Prompt
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_DataValidation
-     */
-    public function setPrompt($value = '') {
-        $this->_prompt = $value;
-        return $this;
-    }
-
-    /**
-     * Get hash code
-     *
-     * @return string    Hash code
-     */
-    public function getHashCode() {
-        return md5(
-              $this->_formula1
-            . $this->_formula2
-            . $this->_type = PHPExcel_Cell_DataValidation::TYPE_NONE
-            . $this->_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP
-            . $this->_operator
-            . ($this->_allowBlank ? 't' : 'f')
-            . ($this->_showDropDown ? 't' : 'f')
-            . ($this->_showInputMessage ? 't' : 'f')
-            . ($this->_showErrorMessage ? 't' : 'f')
-            . $this->_errorTitle
-            . $this->_error
-            . $this->_promptTitle
-            . $this->_prompt
-            . __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;
-            }
-        }
-    }
-}

+ 0 - 110
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php

@@ -1,110 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/** PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-    /**
-     * @ignore
-     */
-    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
-    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-
-/**
- * PHPExcel_Cell_DefaultValueBinder
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
-{
-    /**
-     * Bind value to a cell
-     *
-     * @param  PHPExcel_Cell  $cell   Cell to bind value to
-     * @param  mixed          $value  Value to bind in cell
-     * @return boolean
-     */
-    public function bindValue(PHPExcel_Cell $cell, $value = null)
-    {
-        // sanitize UTF-8 strings
-        if (is_string($value)) {
-            $value = PHPExcel_Shared_String::SanitizeUTF8($value);
-        } elseif (is_object($value)) {
-            // Handle any objects that might be injected
-            if ($value instanceof DateTime) {
-                $value = $value->format('Y-m-d H:i:s');
-            } elseif (!($value instanceof PHPExcel_RichText)) {
-                $value = (string) $value;
-            }
-        }
-
-        // Set value explicit
-        $cell->setValueExplicit( $value, self::dataTypeForValue($value) );
-
-        // Done!
-        return true;
-    }
-
-    /**
-     * DataType for value
-     *
-     * @param   mixed  $pValue
-     * @return  string
-     */
-    public static function dataTypeForValue($pValue = null) {
-        // Match the value against a few data types
-        if ($pValue === null) {
-            return PHPExcel_Cell_DataType::TYPE_NULL;
-        } elseif ($pValue === '') {
-            return PHPExcel_Cell_DataType::TYPE_STRING;
-        } elseif ($pValue instanceof PHPExcel_RichText) {
-            return PHPExcel_Cell_DataType::TYPE_INLINE;
-        } elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
-            return PHPExcel_Cell_DataType::TYPE_FORMULA;
-        } elseif (is_bool($pValue)) {
-            return PHPExcel_Cell_DataType::TYPE_BOOL;
-        } elseif (is_float($pValue) || is_int($pValue)) {
-            return PHPExcel_Cell_DataType::TYPE_NUMERIC;
-        } elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
-            $tValue = ltrim($pValue, '+-');
-            if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.' ) {
-                return PHPExcel_Cell_DataType::TYPE_STRING;
-            } elseif((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) {
-                return PHPExcel_Cell_DataType::TYPE_STRING;
-            }
-            return PHPExcel_Cell_DataType::TYPE_NUMERIC;
-        } elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) {
-            return PHPExcel_Cell_DataType::TYPE_ERROR;
-        }
-
-        return PHPExcel_Cell_DataType::TYPE_STRING;
-    }
-}

+ 0 - 126
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/Hyperlink.php

@@ -1,126 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Cell_Hyperlink
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Cell_Hyperlink
-{
-    /**
-     * URL to link the cell to
-     *
-     * @var string
-     */
-    private $_url;
-
-    /**
-     * Tooltip to display on the hyperlink
-     *
-     * @var string
-     */
-    private $_tooltip;
-
-    /**
-     * Create a new PHPExcel_Cell_Hyperlink
-     *
-     * @param  string  $pUrl      Url to link the cell to
-     * @param  string  $pTooltip  Tooltip to display on the hyperlink
-     */
-    public function __construct($pUrl = '', $pTooltip = '')
-    {
-        // Initialise member variables
-        $this->_url         = $pUrl;
-        $this->_tooltip     = $pTooltip;
-    }
-
-    /**
-     * Get URL
-     *
-     * @return string
-     */
-    public function getUrl() {
-        return $this->_url;
-    }
-
-    /**
-     * Set URL
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_Hyperlink
-     */
-    public function setUrl($value = '') {
-        $this->_url = $value;
-        return $this;
-    }
-
-    /**
-     * Get tooltip
-     *
-     * @return string
-     */
-    public function getTooltip() {
-        return $this->_tooltip;
-    }
-
-    /**
-     * Set tooltip
-     *
-     * @param  string    $value
-     * @return PHPExcel_Cell_Hyperlink
-     */
-    public function setTooltip($value = '') {
-        $this->_tooltip = $value;
-        return $this;
-    }
-
-    /**
-     * Is this hyperlink internal? (to another worksheet)
-     *
-     * @return boolean
-     */
-    public function isInternal() {
-        return strpos($this->_url, 'sheet://') !== false;
-    }
-
-    /**
-     * Get hash code
-     *
-     * @return string    Hash code
-     */
-    public function getHashCode() {
-        return md5(
-              $this->_url
-            . $this->_tooltip
-            . __CLASS__
-        );
-    }
-}

+ 0 - 46
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Cell/IValueBinder.php

@@ -1,46 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Cell_IValueBinder
- *
- * @category   PHPExcel
- * @package    PHPExcel_Cell
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-interface PHPExcel_Cell_IValueBinder
-{
-    /**
-     * Bind value to a cell
-     *
-     * @param  PHPExcel_Cell $cell    Cell to bind value to
-     * @param  mixed $value           Value to bind in cell
-     * @return boolean
-     */
-    public function bindValue(PHPExcel_Cell $cell, $value = NULL);
-}

+ 0 - 635
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart.php

@@ -1,635 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart
-{
-	/**
-	 * Chart Name
-	 *
-	 * @var string
-	 */
-	private $_name = '';
-
-	/**
-	 * Worksheet
-	 *
-	 * @var PHPExcel_Worksheet
-	 */
-	private $_worksheet = null;
-
-	/**
-	 * Chart Title
-	 *
-	 * @var PHPExcel_Chart_Title
-	 */
-	private $_title = null;
-
-	/**
-	 * Chart Legend
-	 *
-	 * @var PHPExcel_Chart_Legend
-	 */
-	private $_legend = null;
-
-	/**
-	 * X-Axis Label
-	 *
-	 * @var PHPExcel_Chart_Title
-	 */
-	private $_xAxisLabel = null;
-
-	/**
-	 * Y-Axis Label
-	 *
-	 * @var PHPExcel_Chart_Title
-	 */
-	private $_yAxisLabel = null;
-
-	/**
-	 * Chart Plot Area
-	 *
-	 * @var PHPExcel_Chart_PlotArea
-	 */
-	private $_plotArea = null;
-
-	/**
-	 * Plot Visible Only
-	 *
-	 * @var boolean
-	 */
-	private $_plotVisibleOnly = true;
-
-	/**
-	 * Display Blanks as
-	 *
-	 * @var string
-	 */
-	private $_displayBlanksAs = '0';
-
-  /**
-   * Chart Asix Y as
-   *
-   * @var PHPExcel_Chart_Axis
-   */
-  private $_yAxis = null;
-
-  /**
-   * Chart Asix X as
-   *
-   * @var PHPExcel_Chart_Axis
-   */
-  private $_xAxis = null;
-
-  /**
-   * Chart Major Gridlines as
-   *
-   * @var PHPExcel_Chart_GridLines
-   */
-  private $_majorGridlines = null;
-
-  /**
-   * Chart Minor Gridlines as
-   *
-   * @var PHPExcel_Chart_GridLines
-   */
-  private $_minorGridlines = null;
-
-	/**
-	 * Top-Left Cell Position
-	 *
-	 * @var string
-	 */
-	private $_topLeftCellRef = 'A1';
-
-
-	/**
-	 * Top-Left X-Offset
-	 *
-	 * @var integer
-	 */
-	private $_topLeftXOffset = 0;
-
-
-	/**
-	 * Top-Left Y-Offset
-	 *
-	 * @var integer
-	 */
-	private $_topLeftYOffset = 0;
-
-
-	/**
-	 * Bottom-Right Cell Position
-	 *
-	 * @var string
-	 */
-	private $_bottomRightCellRef = 'A1';
-
-
-	/**
-	 * Bottom-Right X-Offset
-	 *
-	 * @var integer
-	 */
-	private $_bottomRightXOffset = 10;
-
-
-	/**
-	 * Bottom-Right Y-Offset
-	 *
-	 * @var integer
-	 */
-	private $_bottomRightYOffset = 10;
-
-
-	/**
-	 * Create a new PHPExcel_Chart
-	 */
-	public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
-	{
-		$this->_name = $name;
-		$this->_title = $title;
-		$this->_legend = $legend;
-		$this->_xAxisLabel = $xAxisLabel;
-		$this->_yAxisLabel = $yAxisLabel;
-		$this->_plotArea = $plotArea;
-		$this->_plotVisibleOnly = $plotVisibleOnly;
-		$this->_displayBlanksAs = $displayBlanksAs;
-		$this->_xAxis = $xAxis;
-		$this->_yAxis = $yAxis;
-    $this->_majorGridlines = $majorGridlines;
-    $this->_minorGridlines = $minorGridlines;
-	}
-
-	/**
-	 * Get Name
-	 *
-	 * @return string
-	 */
-	public function getName() {
-		return $this->_name;
-	}
-
-	/**
-	 * Get Worksheet
-	 *
-	 * @return PHPExcel_Worksheet
-	 */
-	public function getWorksheet() {
-		return $this->_worksheet;
-	}
-
-	/**
-	 * Set Worksheet
-	 *
-	 * @param	PHPExcel_Worksheet	$pValue
-	 * @throws	PHPExcel_Chart_Exception
-	 * @return PHPExcel_Chart
-	 */
-	public function setWorksheet(PHPExcel_Worksheet $pValue = null) {
-		$this->_worksheet = $pValue;
-
-		return $this;
-	}
-
-	/**
-	 * Get Title
-	 *
-	 * @return PHPExcel_Chart_Title
-	 */
-	public function getTitle() {
-		return $this->_title;
-	}
-
-	/**
-	 * Set Title
-	 *
-	 * @param	PHPExcel_Chart_Title $title
-	 * @return	PHPExcel_Chart
-	 */
-	public function setTitle(PHPExcel_Chart_Title $title) {
-		$this->_title = $title;
-
-		return $this;
-	}
-
-	/**
-	 * Get Legend
-	 *
-	 * @return PHPExcel_Chart_Legend
-	 */
-	public function getLegend() {
-		return $this->_legend;
-	}
-
-	/**
-	 * Set Legend
-	 *
-	 * @param	PHPExcel_Chart_Legend $legend
-	 * @return	PHPExcel_Chart
-	 */
-	public function setLegend(PHPExcel_Chart_Legend $legend) {
-		$this->_legend = $legend;
-
-		return $this;
-	}
-
-	/**
-	 * Get X-Axis Label
-	 *
-	 * @return PHPExcel_Chart_Title
-	 */
-	public function getXAxisLabel() {
-		return $this->_xAxisLabel;
-	}
-
-	/**
-	 * Set X-Axis Label
-	 *
-	 * @param	PHPExcel_Chart_Title $label
-	 * @return	PHPExcel_Chart
-	 */
-	public function setXAxisLabel(PHPExcel_Chart_Title $label) {
-		$this->_xAxisLabel = $label;
-
-		return $this;
-	}
-
-	/**
-	 * Get Y-Axis Label
-	 *
-	 * @return PHPExcel_Chart_Title
-	 */
-	public function getYAxisLabel() {
-		return $this->_yAxisLabel;
-	}
-
-	/**
-	 * Set Y-Axis Label
-	 *
-	 * @param	PHPExcel_Chart_Title $label
-	 * @return	PHPExcel_Chart
-	 */
-	public function setYAxisLabel(PHPExcel_Chart_Title $label) {
-		$this->_yAxisLabel = $label;
-
-		return $this;
-	}
-
-	/**
-	 * Get Plot Area
-	 *
-	 * @return PHPExcel_Chart_PlotArea
-	 */
-	public function getPlotArea() {
-		return $this->_plotArea;
-	}
-
-	/**
-	 * Get Plot Visible Only
-	 *
-	 * @return boolean
-	 */
-	public function getPlotVisibleOnly() {
-		return $this->_plotVisibleOnly;
-	}
-
-	/**
-	 * Set Plot Visible Only
-	 *
-	 * @param boolean $plotVisibleOnly
-	 * @return PHPExcel_Chart
-	 */
-	public function setPlotVisibleOnly($plotVisibleOnly = true) {
-		$this->_plotVisibleOnly = $plotVisibleOnly;
-
-		return $this;
-	}
-
-	/**
-	 * Get Display Blanks as
-	 *
-	 * @return string
-	 */
-	public function getDisplayBlanksAs() {
-		return $this->_displayBlanksAs;
-	}
-
-	/**
-	 * Set Display Blanks as
-	 *
-	 * @param string $displayBlanksAs
-	 * @return PHPExcel_Chart
-	 */
-	public function setDisplayBlanksAs($displayBlanksAs = '0') {
-		$this->_displayBlanksAs = $displayBlanksAs;
-	}
-
-
-  /**
-   * Get yAxis
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-  public function getChartAxisY() {
-    if($this->_yAxis !== NULL){
-      return $this->_yAxis;
-    }
-
-    return new PHPExcel_Chart_Axis();
-  }
-
-  /**
-   * Get xAxis
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-  public function getChartAxisX() {
-    if($this->_xAxis !== NULL){
-      return $this->_xAxis;
-    }
-
-    return new PHPExcel_Chart_Axis();
-  }
-
-  /**
-   * Get Major Gridlines
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-  public function getMajorGridlines() {
-    if($this->_majorGridlines !== NULL){
-      return $this->_majorGridlines;
-    }
-
-    return new PHPExcel_Chart_GridLines();
-  }
-
-  /**
-   * Get Minor Gridlines
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-  public function getMinorGridlines() {
-    if($this->_minorGridlines !== NULL){
-      return $this->_minorGridlines;
-    }
-
-    return new PHPExcel_Chart_GridLines();
-  }
-
-
-	/**
-	 * Set the Top Left position for the chart
-	 *
-	 * @param	string	$cell
-	 * @param	integer	$xOffset
-	 * @param	integer	$yOffset
-	 * @return PHPExcel_Chart
-	 */
-	public function setTopLeftPosition($cell, $xOffset=null, $yOffset=null) {
-		$this->_topLeftCellRef = $cell;
-		if (!is_null($xOffset))
-			$this->setTopLeftXOffset($xOffset);
-		if (!is_null($yOffset))
-			$this->setTopLeftYOffset($yOffset);
-
-		return $this;
-	}
-
-	/**
-	 * Get the top left position of the chart
-	 *
-	 * @return array	an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
-	 */
-	public function getTopLeftPosition() {
-		return array( 'cell'	=> $this->_topLeftCellRef,
-					  'xOffset'	=> $this->_topLeftXOffset,
-					  'yOffset'	=> $this->_topLeftYOffset
-					);
-	}
-
-	/**
-	 * Get the cell address where the top left of the chart is fixed
-	 *
-	 * @return string
-	 */
-	public function getTopLeftCell() {
-		return $this->_topLeftCellRef;
-	}
-
-	/**
-	 * Set the Top Left cell position for the chart
-	 *
-	 * @param	string	$cell
-	 * @return PHPExcel_Chart
-	 */
-	public function setTopLeftCell($cell) {
-		$this->_topLeftCellRef = $cell;
-
-		return $this;
-	}
-
-	/**
-	 * Set the offset position within the Top Left cell for the chart
-	 *
-	 * @param	integer	$xOffset
-	 * @param	integer	$yOffset
-	 * @return PHPExcel_Chart
-	 */
-	public function setTopLeftOffset($xOffset=null,$yOffset=null) {
-		if (!is_null($xOffset))
-			$this->setTopLeftXOffset($xOffset);
-		if (!is_null($yOffset))
-			$this->setTopLeftYOffset($yOffset);
-
-		return $this;
-	}
-
-	/**
-	 * Get the offset position within the Top Left cell for the chart
-	 *
-	 * @return integer[]
-	 */
-	public function getTopLeftOffset() {
-		return array( 'X' => $this->_topLeftXOffset,
-					  'Y' => $this->_topLeftYOffset
-					);
-	}
-
-	public function setTopLeftXOffset($xOffset) {
-		$this->_topLeftXOffset = $xOffset;
-
-		return $this;
-	}
-
-	public function getTopLeftXOffset() {
-		return $this->_topLeftXOffset;
-	}
-
-	public function setTopLeftYOffset($yOffset) {
-		$this->_topLeftYOffset = $yOffset;
-
-		return $this;
-	}
-
-	public function getTopLeftYOffset() {
-		return $this->_topLeftYOffset;
-	}
-
-	/**
-	 * Set the Bottom Right position of the chart
-	 *
-	 * @param	string	$cell
-	 * @param	integer	$xOffset
-	 * @param	integer	$yOffset
-	 * @return PHPExcel_Chart
-	 */
-	public function setBottomRightPosition($cell, $xOffset=null, $yOffset=null) {
-		$this->_bottomRightCellRef = $cell;
-		if (!is_null($xOffset))
-			$this->setBottomRightXOffset($xOffset);
-		if (!is_null($yOffset))
-			$this->setBottomRightYOffset($yOffset);
-
-		return $this;
-	}
-
-	/**
-	 * Get the bottom right position of the chart
-	 *
-	 * @return array	an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
-	 */
-	public function getBottomRightPosition() {
-		return array( 'cell'	=> $this->_bottomRightCellRef,
-					  'xOffset'	=> $this->_bottomRightXOffset,
-					  'yOffset'	=> $this->_bottomRightYOffset
-					);
-	}
-
-	public function setBottomRightCell($cell) {
-		$this->_bottomRightCellRef = $cell;
-
-		return $this;
-	}
-
-	/**
-	 * Get the cell address where the bottom right of the chart is fixed
-	 *
-	 * @return string
-	 */
-	public function getBottomRightCell() {
-		return $this->_bottomRightCellRef;
-	}
-
-	/**
-	 * Set the offset position within the Bottom Right cell for the chart
-	 *
-	 * @param	integer	$xOffset
-	 * @param	integer	$yOffset
-	 * @return PHPExcel_Chart
-	 */
-	public function setBottomRightOffset($xOffset=null,$yOffset=null) {
-		if (!is_null($xOffset))
-			$this->setBottomRightXOffset($xOffset);
-		if (!is_null($yOffset))
-			$this->setBottomRightYOffset($yOffset);
-
-		return $this;
-	}
-
-	/**
-	 * Get the offset position within the Bottom Right cell for the chart
-	 *
-	 * @return integer[]
-	 */
-	public function getBottomRightOffset() {
-		return array( 'X' => $this->_bottomRightXOffset,
-					  'Y' => $this->_bottomRightYOffset
-					);
-	}
-
-	public function setBottomRightXOffset($xOffset) {
-		$this->_bottomRightXOffset = $xOffset;
-
-		return $this;
-	}
-
-	public function getBottomRightXOffset() {
-		return $this->_bottomRightXOffset;
-	}
-
-	public function setBottomRightYOffset($yOffset) {
-		$this->_bottomRightYOffset = $yOffset;
-
-		return $this;
-	}
-
-	public function getBottomRightYOffset() {
-		return $this->_bottomRightYOffset;
-	}
-
-
-	public function refresh() {
-		if ($this->_worksheet !== NULL) {
-			$this->_plotArea->refresh($this->_worksheet);
-		}
-	}
-
-	public function render($outputDestination = null) {
-		$libraryName = PHPExcel_Settings::getChartRendererName();
-		if (is_null($libraryName)) {
-			return false;
-		}
-		//	Ensure that data series values are up-to-date before we render
-		$this->refresh();
-
-		$libraryPath = PHPExcel_Settings::getChartRendererPath();
-		$includePath = str_replace('\\','/',get_include_path());
-		$rendererPath = str_replace('\\','/',$libraryPath);
-		if (strpos($rendererPath,$includePath) === false) {
-			set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
-		}
-
-		$rendererName = 'PHPExcel_Chart_Renderer_'.$libraryName;
-		$renderer = new $rendererName($this);
-
-		if ($outputDestination == 'php://output') {
-			$outputDestination = null;
-		}
-		return $renderer->render($outputDestination);
-	}
-
-}

+ 0 - 584
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Axis.php

@@ -1,584 +0,0 @@
-<?php
-require_once 'Properties.php';
-
-/**
- * Created by PhpStorm.
- * User: Wiktor Trzonkowski
- * Date: 6/17/14
- * Time: 12:11 PM
- */
-
-class PHPExcel_Chart_Axis extends
-  PHPExcel_Properties {
-
-  /**
-   * Axis Number
-   *
-   * @var  array of mixed
-   */
-
-  private
-      $_axis_number = array(
-      'format' => self::FORMAT_CODE_GENERAL,
-      'source_linked' => 1
-  );
-
-  /**
-   * Axis Options
-   *
-   * @var  array of mixed
-   */
-
-  private $_axis_options = array(
-      'minimum' => NULL,
-      'maximum' => NULL,
-      'major_unit' => NULL,
-      'minor_unit' => NULL,
-      'orientation' => self::ORIENTATION_NORMAL,
-      'minor_tick_mark' => self::TICK_MARK_NONE,
-      'major_tick_mark' => self::TICK_MARK_NONE,
-      'axis_labels' => self::AXIS_LABELS_NEXT_TO,
-      'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO,
-      'horizontal_crosses_value' => NULL
-  );
-
-  /**
-   * Fill Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_fill_properties = array(
-      'type' => self::EXCEL_COLOR_TYPE_ARGB,
-      'value' => NULL,
-      'alpha' => 0
-  );
-
-  /**
-   * Line Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_line_properties = array(
-      'type' => self::EXCEL_COLOR_TYPE_ARGB,
-      'value' => NULL,
-      'alpha' => 0
-  );
-
-  /**
-   * Line Style Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_line_style_properties = array(
-      'width' => '9525',
-      'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
-      'dash' => self::LINE_STYLE_DASH_SOLID,
-      'cap' => self::LINE_STYLE_CAP_FLAT,
-      'join' => self::LINE_STYLE_JOIN_BEVEL,
-      'arrow' => array(
-          'head' => array(
-              'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
-              'size' => self::LINE_STYLE_ARROW_SIZE_5
-          ),
-          'end' => array(
-              'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
-              'size' => self::LINE_STYLE_ARROW_SIZE_8
-          ),
-      )
-  );
-
-  /**
-   * Shadow Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_shadow_properties = array(
-      'presets' => self::SHADOW_PRESETS_NOSHADOW,
-      'effect' => NULL,
-      'color' => array(
-          'type' => self::EXCEL_COLOR_TYPE_STANDARD,
-          'value' => 'black',
-          'alpha' => 40,
-      ),
-      'size' => array(
-          'sx' => NULL,
-          'sy' => NULL,
-          'kx' => NULL
-      ),
-      'blur' => NULL,
-      'direction' => NULL,
-      'distance' => NULL,
-      'algn' => NULL,
-      'rotWithShape' => NULL
-  );
-
-  /**
-   * Glow Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_glow_properties = array(
-      'size' => NULL,
-      'color' => array(
-          'type' => self::EXCEL_COLOR_TYPE_STANDARD,
-          'value' => 'black',
-          'alpha' => 40
-      )
-  );
-
-  /**
-   * Soft Edge Properties
-   *
-   * @var  array of mixed
-   */
-
-  private $_soft_edges = array(
-      'size' => NULL
-  );
-
-  /**
-   * Get Series Data Type
-   *
-   * @return  string
-   */
-
-  public function setAxisNumberProperties($format_code) {
-    $this->_axis_number['format'] = (string) $format_code;
-    $this->_axis_number['source_linked'] = 0;
-  }
-
-  /**
-   * Get Axis Number Format Data Type
-   *
-   * @return  string
-   */
-
-  public function getAxisNumberFormat() {
-    return $this->_axis_number['format'];
-  }
-
-  /**
-   * Get Axis Number Source Linked
-   *
-   * @return  string
-   */
-
-  public function getAxisNumberSourceLinked() {
-    return (string) $this->_axis_number['source_linked'];
-  }
-
-  /**
-   * Set Axis Options Properties
-   *
-   * @param string $axis_labels
-   * @param string $horizontal_crosses_value
-   * @param string $horizontal_crosses
-   * @param string $axis_orientation
-   * @param string $major_tmt
-   * @param string $minor_tmt
-   * @param string $minimum
-   * @param string $maximum
-   * @param string $major_unit
-   * @param string $minor_unit
-   *
-   */
-
-  public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = NULL, $horizontal_crosses = NULL,
-      $axis_orientation = NULL, $major_tmt = NULL, $minor_tmt = NULL, $minimum = NULL, $maximum = NULL, $major_unit = NULL,
-      $minor_unit = NULL) {
-
-    $this->_axis_options['axis_labels'] = (string) $axis_labels;
-    ($horizontal_crosses_value !== NULL)
-        ? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : NULL;
-    ($horizontal_crosses !== NULL) ? $this->_axis_options['horizontal_crosses'] = (string) $horizontal_crosses : NULL;
-    ($axis_orientation !== NULL) ? $this->_axis_options['orientation'] = (string) $axis_orientation : NULL;
-    ($major_tmt !== NULL) ? $this->_axis_options['major_tick_mark'] = (string) $major_tmt : NULL;
-    ($minor_tmt !== NULL) ? $this->_axis_options['minor_tick_mark'] = (string) $minor_tmt : NULL;
-    ($minor_tmt !== NULL) ? $this->_axis_options['minor_tick_mark'] = (string) $minor_tmt : NULL;
-    ($minimum !== NULL) ? $this->_axis_options['minimum'] = (string) $minimum : NULL;
-    ($maximum !== NULL) ? $this->_axis_options['maximum'] = (string) $maximum : NULL;
-    ($major_unit !== NULL) ? $this->_axis_options['major_unit'] = (string) $major_unit : NULL;
-    ($minor_unit !== NULL) ? $this->_axis_options['minor_unit'] = (string) $minor_unit : NULL;
-  }
-
-  /**
-   * Get Axis Options Property
-   *
-   * @param string $property
-   *
-   * @return string
-   */
-
-  public function getAxisOptionsProperty($property) {
-    return $this->_axis_options[$property];
-  }
-
-  /**
-   * Set Axis Orientation Property
-   *
-   * @param string $orientation
-   *
-   */
-
-  public function setAxisOrientation($orientation) {
-    $this->orientation = (string) $orientation;
-  }
-
-  /**
-   * Set Fill Property
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   */
-
-  public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) {
-    $this->_fill_properties = $this->setColorProperties($color, $alpha, $type);
-  }
-
-  /**
-   * Set Line Property
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   */
-
-  public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) {
-    $this->_line_properties = $this->setColorProperties($color, $alpha, $type);
-  }
-
-  /**
-   * Get Fill Property
-   *
-   * @param string $property
-   *
-   * @return string
-   */
-
-  public function getFillProperty($property) {
-    return $this->_fill_properties[$property];
-  }
-
-  /**
-   * Get Line Property
-   *
-   * @param string $property
-   *
-   * @return string
-   */
-
-  public function getLineProperty($property) {
-    return $this->_line_properties[$property];
-  }
-
-  /**
-   * Set Line Style Properties
-   *
-   * @param float $line_width
-   * @param string $compound_type
-   * @param string $dash_type
-   * @param string $cap_type
-   * @param string $join_type
-   * @param string $head_arrow_type
-   * @param string $head_arrow_size
-   * @param string $end_arrow_type
-   * @param string $end_arrow_size
-   *
-   */
-
-  public function setLineStyleProperties($line_width = NULL, $compound_type = NULL,
-      $dash_type = NULL, $cap_type = NULL, $join_type = NULL, $head_arrow_type = NULL,
-      $head_arrow_size = NULL, $end_arrow_type = NULL, $end_arrow_size = NULL) {
-
-    (!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width)
-        : NULL;
-    (!is_null($compound_type)) ? $this->_line_style_properties['compound'] = (string) $compound_type : NULL;
-    (!is_null($dash_type)) ? $this->_line_style_properties['dash'] = (string) $dash_type : NULL;
-    (!is_null($cap_type)) ? $this->_line_style_properties['cap'] = (string) $cap_type : NULL;
-    (!is_null($join_type)) ? $this->_line_style_properties['join'] = (string) $join_type : NULL;
-    (!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type
-        : NULL;
-    (!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size
-        : NULL;
-    (!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type
-        : NULL;
-    (!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size
-        : NULL;
-  }
-
-  /**
-   * Get Line Style Property
-   *
-   * @param array|string $elements
-   *
-   * @return string
-   */
-
-  public function getLineStyleProperty($elements) {
-    return $this->getArrayElementsValue($this->_line_style_properties, $elements);
-  }
-
-  /**
-   * Get Line Style Arrow Excel Width
-   *
-   * @param string $arrow
-   *
-   * @return string
-   */
-
-  public function getLineStyleArrowWidth($arrow) {
-    return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w');
-  }
-
-  /**
-   * Get Line Style Arrow Excel Length
-   *
-   * @param string $arrow
-   *
-   * @return string
-   */
-
-  public function getLineStyleArrowLength($arrow) {
-    return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len');
-  }
-
-  /**
-   * Set Shadow Properties
-   *
-   * @param int $shadow_presets
-   * @param string $sh_color_value
-   * @param string $sh_color_type
-   * @param string $sh_color_alpha
-   * @param float $sh_blur
-   * @param int $sh_angle
-   * @param float $sh_distance
-   *
-   */
-
-  public function setShadowProperties($sh_presets, $sh_color_value = NULL, $sh_color_type = NULL, $sh_color_alpha = NULL, $sh_blur = NULL, $sh_angle = NULL, $sh_distance = NULL) {
-    $this
-        ->_setShadowPresetsProperties((int) $sh_presets)
-        ->_setShadowColor(
-            is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value
-            , is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] : $sh_color_alpha
-            , is_null($sh_color_type) ? $this->_shadow_properties['color']['type'] : $sh_color_type)
-        ->_setShadowBlur($sh_blur)
-        ->_setShadowAngle($sh_angle)
-        ->_setShadowDistance($sh_distance);
-  }
-
-  /**
-   * Set Shadow Color
-   *
-   * @param int $shadow_presets
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowPresetsProperties($shadow_presets) {
-    $this->_shadow_properties['presets'] = $shadow_presets;
-    $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Properties from Maped Values
-   *
-   * @param array $properties_map
-   * @param * $reference
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowProperiesMapValues(array $properties_map, &$reference = NULL) {
-    $base_reference = $reference;
-    foreach ($properties_map as $property_key => $property_val) {
-      if (is_array($property_val)) {
-        if ($reference === NULL) {
-          $reference = & $this->_shadow_properties[$property_key];
-        } else {
-          $reference = & $reference[$property_key];
-        }
-        $this->_setShadowProperiesMapValues($property_val, $reference);
-      } else {
-        if ($base_reference === NULL) {
-          $this->_shadow_properties[$property_key] = $property_val;
-        } else {
-          $reference[$property_key] = $property_val;
-        }
-      }
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Color
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowColor($color, $alpha, $type) {
-    $this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Blur
-   *
-   * @param float $blur
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowBlur($blur) {
-    if ($blur !== NULL) {
-      $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Angle
-   *
-   * @param int $angle
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowAngle($angle) {
-    if ($angle !== NULL) {
-      $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Distance
-   *
-   * @param float $distance
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setShadowDistance($distance) {
-    if ($distance !== NULL) {
-      $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Get Glow Property
-   *
-   * @param float $size
-   * @param string $color_value
-   * @param int $color_alpha
-   * @param string $color_type
-   */
-
-  public function getShadowProperty($elements) {
-    return $this->getArrayElementsValue($this->_shadow_properties, $elements);
-  }
-
-  /**
-   * Set Glow Properties
-   *
-   * @param float $size
-   * @param string $color_value
-   * @param int $color_alpha
-   * @param string $color_type
-   */
-
-  public function setGlowProperties($size, $color_value = NULL, $color_alpha = NULL, $color_type = NULL) {
-    $this
-        ->_setGlowSize($size)
-        ->_setGlowColor(
-            is_null($color_value) ? $this->_glow_properties['color']['value'] : $color_value
-            , is_null($color_alpha) ? (int) $this->_glow_properties['color']['alpha'] : $color_alpha
-            , is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type);
-  }
-
-  /**
-   * Get Glow Property
-   *
-   * @param array|string $property
-   *
-   * @return string
-   */
-
-  public function getGlowProperty($property) {
-    return $this->getArrayElementsValue($this->_glow_properties, $property);
-  }
-
-  /**
-   * Set Glow Color
-   *
-   * @param float $size
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setGlowSize($size) {
-    if (!is_null($size)) {
-      $this->_glow_properties['size'] = $this->getExcelPointsWidth($size);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Glow Color
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   * @return PHPExcel_Chart_Axis
-   */
-
-  private function _setGlowColor($color, $alpha, $type) {
-    $this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
-
-    return $this;
-  }
-
-  /**
-   * Set Soft Edges Size
-   *
-   * @param float $size
-   */
-
-  public function setSoftEdges($size) {
-    if (!is_null($size)) {
-      $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size);
-    }
-  }
-
-  /**
-   * Get Soft Edges Size
-   *
-   * @return string
-   */
-
-  public function getSoftEdgesSize() {
-    return $this->_soft_edges['size'];
-  }
-}

+ 0 - 370
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/DataSeries.php

@@ -1,370 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_DataSeries
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_DataSeries
-{
-
-	const TYPE_BARCHART			= 'barChart';
-	const TYPE_BARCHART_3D		= 'bar3DChart';
-	const TYPE_LINECHART		= 'lineChart';
-	const TYPE_LINECHART_3D		= 'line3DChart';
-	const TYPE_AREACHART		= 'areaChart';
-	const TYPE_AREACHART_3D		= 'area3DChart';
-	const TYPE_PIECHART			= 'pieChart';
-	const TYPE_PIECHART_3D		= 'pie3DChart';
-	const TYPE_DOUGHTNUTCHART	= 'doughnutChart';
-	const TYPE_DONUTCHART		= self::TYPE_DOUGHTNUTCHART;	//	Synonym
-	const TYPE_SCATTERCHART		= 'scatterChart';
-	const TYPE_SURFACECHART		= 'surfaceChart';
-	const TYPE_SURFACECHART_3D	= 'surface3DChart';
-	const TYPE_RADARCHART		= 'radarChart';
-	const TYPE_BUBBLECHART		= 'bubbleChart';
-	const TYPE_STOCKCHART		= 'stockChart';
-	const TYPE_CANDLECHART		= self::TYPE_STOCKCHART;	   //	Synonym
-
-	const GROUPING_CLUSTERED			= 'clustered';
-	const GROUPING_STACKED				= 'stacked';
-	const GROUPING_PERCENT_STACKED		= 'percentStacked';
-	const GROUPING_STANDARD				= 'standard';
-
-	const DIRECTION_BAR			= 'bar';
-	const DIRECTION_HORIZONTAL	= self::DIRECTION_BAR;
-	const DIRECTION_COL			= 'col';
-	const DIRECTION_COLUMN		= self::DIRECTION_COL;
-	const DIRECTION_VERTICAL	= self::DIRECTION_COL;
-
-	const STYLE_LINEMARKER		= 'lineMarker';
-	const STYLE_SMOOTHMARKER	= 'smoothMarker';
-	const STYLE_MARKER			= 'marker';
-	const STYLE_FILLED			= 'filled';
-
-
-	/**
-	 * Series Plot Type
-	 *
-	 * @var string
-	 */
-	private $_plotType = null;
-
-	/**
-	 * Plot Grouping Type
-	 *
-	 * @var boolean
-	 */
-	private $_plotGrouping = null;
-
-	/**
-	 * Plot Direction
-	 *
-	 * @var boolean
-	 */
-	private $_plotDirection = null;
-
-	/**
-	 * Plot Style
-	 *
-	 * @var string
-	 */
-	private $_plotStyle = null;
-
-	/**
-	 * Order of plots in Series
-	 *
-	 * @var array of integer
-	 */
-	private $_plotOrder = array();
-
-	/**
-	 * Plot Label
-	 *
-	 * @var array of PHPExcel_Chart_DataSeriesValues
-	 */
-	private $_plotLabel = array();
-
-	/**
-	 * Plot Category
-	 *
-	 * @var array of PHPExcel_Chart_DataSeriesValues
-	 */
-	private $_plotCategory = array();
-
-	/**
-	 * Smooth Line
-	 *
-	 * @var string
-	 */
-	private $_smoothLine = null;
-
-	/**
-	 * Plot Values
-	 *
-	 * @var array of PHPExcel_Chart_DataSeriesValues
-	 */
-	private $_plotValues = array();
-
-	/**
-	 * Create a new PHPExcel_Chart_DataSeries
-	 */
-	public function __construct($plotType = null, $plotGrouping = null, $plotOrder = array(), $plotLabel = array(), $plotCategory = array(), $plotValues = array(), $plotDirection = null, $smoothLine = null, $plotStyle = null)
-	{
-		$this->_plotType = $plotType;
-		$this->_plotGrouping = $plotGrouping;
-		$this->_plotOrder = $plotOrder;
-		$keys = array_keys($plotValues);
-		$this->_plotValues = $plotValues;
-		if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) {
-			$plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
-		}
-
-		$this->_plotLabel = $plotLabel;
-		if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) {
-			$plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
-		}
-		$this->_plotCategory = $plotCategory;
-		$this->_smoothLine = $smoothLine;
-		$this->_plotStyle = $plotStyle;
-		
-		if (is_null($plotDirection)) {
-			$plotDirection = self::DIRECTION_COL;
-		}
-		$this->_plotDirection = $plotDirection;
-	}
-
-	/**
-	 * Get Plot Type
-	 *
-	 * @return string
-	 */
-	public function getPlotType() {
-		return $this->_plotType;
-	}
-
-	/**
-	 * Set Plot Type
-	 *
-	 * @param string $plotType
-     * @return PHPExcel_Chart_DataSeries
-	 */
-	public function setPlotType($plotType = '') {
-		$this->_plotType = $plotType;
-        return $this;
-	}
-
-	/**
-	 * Get Plot Grouping Type
-	 *
-	 * @return string
-	 */
-	public function getPlotGrouping() {
-		return $this->_plotGrouping;
-	}
-
-	/**
-	 * Set Plot Grouping Type
-	 *
-	 * @param string $groupingType
-     * @return PHPExcel_Chart_DataSeries
-	 */
-	public function setPlotGrouping($groupingType = null) {
-		$this->_plotGrouping = $groupingType;
-        return $this;
-	}
-
-	/**
-	 * Get Plot Direction
-	 *
-	 * @return string
-	 */
-	public function getPlotDirection() {
-		return $this->_plotDirection;
-	}
-
-	/**
-	 * Set Plot Direction
-	 *
-	 * @param string $plotDirection
-     * @return PHPExcel_Chart_DataSeries
-	 */
-	public function setPlotDirection($plotDirection = null) {
-		$this->_plotDirection = $plotDirection;
-        return $this;
-	}
-
-	/**
-	 * Get Plot Order
-	 *
-	 * @return string
-	 */
-	public function getPlotOrder() {
-		return $this->_plotOrder;
-	}
-
-	/**
-	 * Get Plot Labels
-	 *
-	 * @return array of PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotLabels() {
-		return $this->_plotLabel;
-	}
-
-	/**
-	 * Get Plot Label by Index
-	 *
-	 * @return PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotLabelByIndex($index) {
-		$keys = array_keys($this->_plotLabel);
-		if (in_array($index,$keys)) {
-			return $this->_plotLabel[$index];
-		} elseif(isset($keys[$index])) {
-			return $this->_plotLabel[$keys[$index]];
-		}
-		return false;
-	}
-
-	/**
-	 * Get Plot Categories
-	 *
-	 * @return array of PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotCategories() {
-		return $this->_plotCategory;
-	}
-
-	/**
-	 * Get Plot Category by Index
-	 *
-	 * @return PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotCategoryByIndex($index) {
-		$keys = array_keys($this->_plotCategory);
-		if (in_array($index,$keys)) {
-			return $this->_plotCategory[$index];
-		} elseif(isset($keys[$index])) {
-			return $this->_plotCategory[$keys[$index]];
-		}
-		return false;
-	}
-
-	/**
-	 * Get Plot Style
-	 *
-	 * @return string
-	 */
-	public function getPlotStyle() {
-		return $this->_plotStyle;
-	}
-
-	/**
-	 * Set Plot Style
-	 *
-	 * @param string $plotStyle
-     * @return PHPExcel_Chart_DataSeries
-	 */
-	public function setPlotStyle($plotStyle = null) {
-		$this->_plotStyle = $plotStyle;
-        return $this;
-	}
-
-	/**
-	 * Get Plot Values
-	 *
-	 * @return array of PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotValues() {
-		return $this->_plotValues;
-	}
-
-	/**
-	 * Get Plot Values by Index
-	 *
-	 * @return PHPExcel_Chart_DataSeriesValues
-	 */
-	public function getPlotValuesByIndex($index) {
-		$keys = array_keys($this->_plotValues);
-		if (in_array($index,$keys)) {
-			return $this->_plotValues[$index];
-		} elseif(isset($keys[$index])) {
-			return $this->_plotValues[$keys[$index]];
-		}
-		return false;
-	}
-
-	/**
-	 * Get Number of Plot Series
-	 *
-	 * @return integer
-	 */
-	public function getPlotSeriesCount() {
-		return count($this->_plotValues);
-	}
-
-	/**
-	 * Get Smooth Line
-	 *
-	 * @return boolean
-	 */
-	public function getSmoothLine() {
-		return $this->_smoothLine;
-	}
-
-	/**
-	 * Set Smooth Line
-	 *
-	 * @param boolean $smoothLine
-     * @return PHPExcel_Chart_DataSeries
-	 */
-	public function setSmoothLine($smoothLine = TRUE) {
-		$this->_smoothLine = $smoothLine;
-        return $this;
-	}
-
-	public function refresh(PHPExcel_Worksheet $worksheet) {
-	    foreach($this->_plotValues as $plotValues) {
-			if ($plotValues !== NULL)
-				$plotValues->refresh($worksheet, TRUE);
-		}
-		foreach($this->_plotLabel as $plotValues) {
-			if ($plotValues !== NULL)
-				$plotValues->refresh($worksheet, TRUE);
-		}
-		foreach($this->_plotCategory as $plotValues) {
-			if ($plotValues !== NULL)
-				$plotValues->refresh($worksheet, FALSE);
-		}
-	}
-
-}

+ 0 - 327
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/DataSeriesValues.php

@@ -1,327 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_DataSeriesValues
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_DataSeriesValues
-{
-
-	const DATASERIES_TYPE_STRING	= 'String';
-	const DATASERIES_TYPE_NUMBER	= 'Number';
-
-	private static $_dataTypeValues = array(
-		self::DATASERIES_TYPE_STRING,
-		self::DATASERIES_TYPE_NUMBER,
-	);
-
-	/**
-	 * Series Data Type
-	 *
-	 * @var	string
-	 */
-	private $_dataType = null;
-
-	/**
-	 * Series Data Source
-	 *
-	 * @var	string
-	 */
-	private $_dataSource = null;
-
-	/**
-	 * Format Code
-	 *
-	 * @var	string
-	 */
-	private $_formatCode = null;
-
-	/**
-	 * Series Point Marker
-	 *
-	 * @var	string
-	 */
-	private $_marker = null;
-
-	/**
-	 * Point Count (The number of datapoints in the dataseries)
-	 *
-	 * @var	integer
-	 */
-	private $_pointCount = 0;
-
-	/**
-	 * Data Values
-	 *
-	 * @var	array of mixed
-	 */
-	private $_dataValues = array();
-
-	/**
-	 * Create a new PHPExcel_Chart_DataSeriesValues object
-	 */
-	public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = array(), $marker = null)
-	{
-		$this->setDataType($dataType);
-		$this->_dataSource = $dataSource;
-		$this->_formatCode = $formatCode;
-		$this->_pointCount = $pointCount;
-		$this->_dataValues = $dataValues;
-		$this->_marker = $marker;
-	}
-
-	/**
-	 * Get Series Data Type
-	 *
-	 * @return	string
-	 */
-	public function getDataType() {
-		return $this->_dataType;
-	}
-
-	/**
-	 * Set Series Data Type
-	 *
-	 * @param	string	$dataType	Datatype of this data series
-	 *								Typical values are:
-	 *									PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_STRING
-	 *										Normally used for axis point values
-	 *									PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_NUMBER
-	 *										Normally used for chart data values
-	 * @return	PHPExcel_Chart_DataSeriesValues
-	 */
-	public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) {
-		if (!in_array($dataType, self::$_dataTypeValues)) {
-    		throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values');
-		}
-		$this->_dataType = $dataType;
-
-		return $this;
-	}
-
-	/**
-	 * Get Series Data Source (formula)
-	 *
-	 * @return	string
-	 */
-	public function getDataSource() {
-		return $this->_dataSource;
-	}
-
-	/**
-	 * Set Series Data Source (formula)
-	 *
-	 * @param	string	$dataSource
-	 * @return	PHPExcel_Chart_DataSeriesValues
-	 */
-	public function setDataSource($dataSource = null, $refreshDataValues = true) {
-		$this->_dataSource = $dataSource;
-
-		if ($refreshDataValues) {
-			//	TO DO
-		}
-
-		return $this;
-	}
-
-	/**
-	 * Get Point Marker
-	 *
-	 * @return string
-	 */
-	public function getPointMarker() {
-		return $this->_marker;
-	}
-
-	/**
-	 * Set Point Marker
-	 *
-	 * @param	string	$marker
-	 * @return	PHPExcel_Chart_DataSeriesValues
-	 */
-	public function setPointMarker($marker = null) {
-		$this->_marker = $marker;
-
-		return $this;
-	}
-
-	/**
-	 * Get Series Format Code
-	 *
-	 * @return	string
-	 */
-	public function getFormatCode() {
-		return $this->_formatCode;
-	}
-
-	/**
-	 * Set Series Format Code
-	 *
-	 * @param	string	$formatCode
-	 * @return	PHPExcel_Chart_DataSeriesValues
-	 */
-	public function setFormatCode($formatCode = null) {
-		$this->_formatCode = $formatCode;
-
-		return $this;
-	}
-
-	/**
-	 * Get Series Point Count
-	 *
-	 * @return	integer
-	 */
-	public function getPointCount() {
-		return $this->_pointCount;
-	}
-
-	/**
-	 * Identify if the Data Series is a multi-level or a simple series
-	 *
-	 * @return	boolean
-	 */
-	public function isMultiLevelSeries() {
-		if (count($this->_dataValues) > 0) {
-			return is_array($this->_dataValues[0]);
-		}
-		return null;
-	}
-
-	/**
-	 * Return the level count of a multi-level Data Series
-	 *
-	 * @return	boolean
-	 */
-	public function multiLevelCount() {
-		$levelCount = 0;
-		foreach($this->_dataValues as $dataValueSet) {
-			$levelCount = max($levelCount,count($dataValueSet));
-		}
-		return $levelCount;
-	}
-
-	/**
-	 * Get Series Data Values
-	 *
-	 * @return	array of mixed
-	 */
-	public function getDataValues() {
-		return $this->_dataValues;
-	}
-
-	/**
-	 * Get the first Series Data value
-	 *
-	 * @return	mixed
-	 */
-	public function getDataValue() {
-		$count = count($this->_dataValues);
-		if ($count == 0) {
-			return null;
-		} elseif ($count == 1) {
-			return $this->_dataValues[0];
-		}
-		return $this->_dataValues;
-	}
-
-	/**
-	 * Set Series Data Values
-	 *
-	 * @param	array	$dataValues
-	 * @param	boolean	$refreshDataSource
-	 *					TRUE - refresh the value of _dataSource based on the values of $dataValues
-	 *					FALSE - don't change the value of _dataSource
-	 * @return	PHPExcel_Chart_DataSeriesValues
-	 */
-	public function setDataValues($dataValues = array(), $refreshDataSource = TRUE) {
-		$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues);
-		$this->_pointCount = count($dataValues);
-
-		if ($refreshDataSource) {
-			//	TO DO
-		}
-
-		return $this;
-	}
-
-	private function _stripNulls($var) {
-		return $var !== NULL;
-	}
-
-	public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) {
-        if ($this->_dataSource !== NULL) {
-        	$calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
-			$newDataValues = PHPExcel_Calculation::_unwrapResult(
-			    $calcEngine->_calculateFormulaValue(
-			        '='.$this->_dataSource,
-			        NULL,
-			        $worksheet->getCell('A1')
-			    )
-			);
-			if ($flatten) {
-				$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues);
-				foreach($this->_dataValues as &$dataValue) {
-					if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
-						$dataValue = 0.0;
-					}
-				}
-				unset($dataValue);
-			} else {
-				$cellRange = explode('!',$this->_dataSource);
-				if (count($cellRange) > 1) {
-					list(,$cellRange) = $cellRange;
-				}
-
-				$dimensions = PHPExcel_Cell::rangeDimension(str_replace('$','',$cellRange));
-				if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
-					$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues);
-				} else {
-					$newArray = array_values(array_shift($newDataValues));
-					foreach($newArray as $i => $newDataSet) {
-						$newArray[$i] = array($newDataSet);
-					}
-
-					foreach($newDataValues as $newDataSet) {
-						$i = 0;
-						foreach($newDataSet as $newDataVal) {
-							array_unshift($newArray[$i++],$newDataVal);
-						}
-					}
-					$this->_dataValues = $newArray;
-				}
-			}
-			$this->_pointCount = count($this->_dataValues);
-		}
-
-	}
-
-}

+ 0 - 52
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Exception.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_Exception
- *
- * @category   PHPExcel
- * @package    PHPExcel_Chart
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_Exception extends PHPExcel_Exception {
-	/**
-	 * Error handler callback
-	 *
-	 * @param mixed $code
-	 * @param mixed $string
-	 * @param mixed $file
-	 * @param mixed $line
-	 * @param mixed $context
-	 */
-	public static function errorHandlerCallback($code, $string, $file, $line, $context) {
-		$e = new self($string, $code);
-		$e->line = $line;
-		$e->file = $file;
-		throw $e;
-	}
-}

+ 0 - 458
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/GridLines.php

@@ -1,458 +0,0 @@
-<?php
-require_once 'Properties.php';
-/**
- * Created by PhpStorm.
- * User: Wiktor Trzonkowski
- * Date: 7/2/14
- * Time: 2:36 PM
- */
-
-class PHPExcel_Chart_GridLines extends
-  PHPExcel_Properties {
-
-  /**
-   * Properties of Class:
-   * Object State (State for Minor Tick Mark) @var bool
-   * Line Properties @var  array of mixed
-   * Shadow Properties @var  array of mixed
-   * Glow Properties @var  array of mixed
-   * Soft Properties @var  array of mixed
-   *
-   */
-
-  private
-      $_object_state = FALSE,
-      $_line_properties = array(
-          'color' => array(
-              'type' => self::EXCEL_COLOR_TYPE_STANDARD,
-              'value' => NULL,
-              'alpha' => 0
-          ),
-          'style' => array(
-              'width' => '9525',
-              'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
-              'dash' => self::LINE_STYLE_DASH_SOLID,
-              'cap' => self::LINE_STYLE_CAP_FLAT,
-              'join' => self::LINE_STYLE_JOIN_BEVEL,
-              'arrow' => array(
-                  'head' => array(
-                      'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
-                      'size' => self::LINE_STYLE_ARROW_SIZE_5
-                  ),
-                  'end' => array(
-                      'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
-                      'size' => self::LINE_STYLE_ARROW_SIZE_8
-                  ),
-              )
-          )
-      ),
-      $_shadow_properties = array(
-          'presets' => self::SHADOW_PRESETS_NOSHADOW,
-          'effect' => NULL,
-          'color' => array(
-              'type' => self::EXCEL_COLOR_TYPE_STANDARD,
-              'value' => 'black',
-              'alpha' => 85,
-          ),
-          'size' => array(
-              'sx' => NULL,
-              'sy' => NULL,
-              'kx' => NULL
-          ),
-          'blur' => NULL,
-          'direction' => NULL,
-          'distance' => NULL,
-          'algn' => NULL,
-          'rotWithShape' => NULL
-      ),
-      $_glow_properties = array(
-          'size' => NULL,
-          'color' => array(
-              'type' => self::EXCEL_COLOR_TYPE_STANDARD,
-              'value' => 'black',
-              'alpha' => 40
-          )
-      ),
-      $_soft_edges = array(
-          'size' => NULL
-      );
-
-  /**
-   * Get Object State
-   *
-   * @return bool
-   */
-
-  public function getObjectState() {
-    return $this->_object_state;
-  }
-
-  /**
-   * Change Object State to True
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _activateObject() {
-    $this->_object_state = TRUE;
-
-    return $this;
-  }
-
-  /**
-   * Set Line Color Properties
-   *
-   * @param string $value
-   * @param int $alpha
-   * @param string $type
-   */
-
-  public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD) {
-    $this
-        ->_activateObject()
-        ->_line_properties['color'] = $this->setColorProperties(
-        $value,
-        $alpha,
-        $type);
-  }
-
-  /**
-   * Set Line Color Properties
-   *
-   * @param float $line_width
-   * @param string $compound_type
-   * @param string $dash_type
-   * @param string $cap_type
-   * @param string $join_type
-   * @param string $head_arrow_type
-   * @param string $head_arrow_size
-   * @param string $end_arrow_type
-   * @param string $end_arrow_size
-   */
-
-  public function setLineStyleProperties($line_width = NULL, $compound_type = NULL, $dash_type = NULL, $cap_type = NULL, $join_type = NULL, $head_arrow_type = NULL, $head_arrow_size = NULL, $end_arrow_type = NULL, $end_arrow_size = NULL) {
-    $this->_activateObject();
-    (!is_null($line_width))
-        ? $this->_line_properties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
-        : NULL;
-    (!is_null($compound_type))
-        ? $this->_line_properties['style']['compound'] = (string) $compound_type
-        : NULL;
-    (!is_null($dash_type))
-        ? $this->_line_properties['style']['dash'] = (string) $dash_type
-        : NULL;
-    (!is_null($cap_type))
-        ? $this->_line_properties['style']['cap'] = (string) $cap_type
-        : NULL;
-    (!is_null($join_type))
-        ? $this->_line_properties['style']['join'] = (string) $join_type
-        : NULL;
-    (!is_null($head_arrow_type))
-        ? $this->_line_properties['style']['arrow']['head']['type'] = (string) $head_arrow_type
-        : NULL;
-    (!is_null($head_arrow_size))
-        ? $this->_line_properties['style']['arrow']['head']['size'] = (string) $head_arrow_size
-        : NULL;
-    (!is_null($end_arrow_type))
-        ? $this->_line_properties['style']['arrow']['end']['type'] = (string) $end_arrow_type
-        : NULL;
-    (!is_null($end_arrow_size))
-        ? $this->_line_properties['style']['arrow']['end']['size'] = (string) $end_arrow_size
-        : NULL;
-  }
-
-  /**
-   * Get Line Color Property
-   *
-   * @param string $parameter
-   *
-   * @return string
-   */
-
-  public function getLineColorProperty($parameter) {
-    return $this->_line_properties['color'][$parameter];
-  }
-
-  /**
-   * Get Line Style Property
-   *
-   * @param  array|string $elements
-   *
-   * @return string
-   */
-
-  public function getLineStyleProperty($elements) {
-    return $this->getArrayElementsValue($this->_line_properties['style'], $elements);
-  }
-
-  /**
-   * Set Glow Properties
-   *
-   * @param  float $size
-   * @param  string $color_value
-   * @param  int $color_alpha
-   * @param  string $color_type
-   *
-   */
-
-  public function setGlowProperties($size, $color_value = NULL, $color_alpha = NULL, $color_type = NULL) {
-    $this
-        ->_activateObject()
-        ->_setGlowSize($size)
-        ->_setGlowColor($color_value, $color_alpha, $color_type);
-  }
-
-  /**
-   * Get Glow Color Property
-   *
-   * @param string $property
-   *
-   * @return string
-   */
-
-  public function getGlowColor($property) {
-    return $this->_glow_properties['color'][$property];
-  }
-
-  /**
-   * Get Glow Size
-   *
-   * @return string
-   */
-
-  public function getGlowSize() {
-    return $this->_glow_properties['size'];
-  }
-
-  /**
-   * Set Glow Size
-   *
-   * @param float $size
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setGlowSize($size) {
-    $this->_glow_properties['size'] = $this->getExcelPointsWidth((float) $size);
-
-    return $this;
-  }
-
-  /**
-   * Set Glow Color
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setGlowColor($color, $alpha, $type) {
-    if (!is_null($color)) {
-      $this->_glow_properties['color']['value'] = (string) $color;
-    }
-    if (!is_null($alpha)) {
-      $this->_glow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
-    }
-    if (!is_null($type)) {
-      $this->_glow_properties['color']['type'] = (string) $type;
-    }
-
-    return $this;
-  }
-
-  /**
-   * Get Line Style Arrow Parameters
-   *
-   * @param string $arrow_selector
-   * @param string $property_selector
-   *
-   * @return string
-   */
-
-  public function getLineStyleArrowParameters($arrow_selector, $property_selector) {
-    return $this->getLineStyleArrowSize($this->_line_properties['style']['arrow'][$arrow_selector]['size'], $property_selector);
-  }
-
-  /**
-   * Set Shadow Properties
-   *
-   * @param int $sh_presets
-   * @param string $sh_color_value
-   * @param string $sh_color_type
-   * @param int $sh_color_alpha
-   * @param string $sh_blur
-   * @param int $sh_angle
-   * @param float $sh_distance
-   *
-   */
-
-  public function setShadowProperties($sh_presets, $sh_color_value = NULL, $sh_color_type = NULL, $sh_color_alpha = NULL, $sh_blur = NULL, $sh_angle = NULL, $sh_distance = NULL) {
-    $this
-        ->_activateObject()
-        ->_setShadowPresetsProperties((int) $sh_presets)
-        ->_setShadowColor(
-            is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value
-            , is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha']
-                : $this->getTrueAlpha($sh_color_alpha)
-            , is_null($sh_color_type) ? $this->_shadow_properties['color']['type'] : $sh_color_type)
-        ->_setShadowBlur($sh_blur)
-        ->_setShadowAngle($sh_angle)
-        ->_setShadowDistance($sh_distance);
-  }
-
-  /**
-   * Set Shadow Presets Properties
-   *
-   * @param int $shadow_presets
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowPresetsProperties($shadow_presets) {
-    $this->_shadow_properties['presets'] = $shadow_presets;
-    $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Properties Values
-   *
-   * @param array $properties_map
-   * @param * $reference
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowProperiesMapValues(array $properties_map, &$reference = NULL) {
-    $base_reference = $reference;
-    foreach ($properties_map as $property_key => $property_val) {
-      if (is_array($property_val)) {
-        if ($reference === NULL) {
-          $reference = & $this->_shadow_properties[$property_key];
-        } else {
-          $reference = & $reference[$property_key];
-        }
-        $this->_setShadowProperiesMapValues($property_val, $reference);
-      } else {
-        if ($base_reference === NULL) {
-          $this->_shadow_properties[$property_key] = $property_val;
-        } else {
-          $reference[$property_key] = $property_val;
-        }
-      }
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Color
-   *
-   * @param string $color
-   * @param int $alpha
-   * @param string $type
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowColor($color, $alpha, $type) {
-    if (!is_null($color)) {
-      $this->_shadow_properties['color']['value'] = (string) $color;
-    }
-    if (!is_null($alpha)) {
-      $this->_shadow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
-    }
-    if (!is_null($type)) {
-      $this->_shadow_properties['color']['type'] = (string) $type;
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Blur
-   *
-   * @param float $blur
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowBlur($blur) {
-    if ($blur !== NULL) {
-      $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Angle
-   *
-   * @param int $angle
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowAngle($angle) {
-    if ($angle !== NULL) {
-      $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Set Shadow Distance
-   *
-   * @param float $distance
-   *
-   * @return PHPExcel_Chart_GridLines
-   */
-
-  private function _setShadowDistance($distance) {
-    if ($distance !== NULL) {
-      $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Get Shadow Property
-   *
-   * @param string $elements
-   * @param array $elements
-   *
-   * @return string
-   */
-
-  public function getShadowProperty($elements) {
-    return $this->getArrayElementsValue($this->_shadow_properties, $elements);
-  }
-
-  /**
-   * Set Soft Edges Size
-   *
-   * @param float $size
-   */
-
-  public function setSoftEdgesSize($size) {
-    if (!is_null($size)) {
-      $this->_activateObject();
-      $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size);
-    }
-  }
-
-  /**
-   * Get Soft Edges Size
-   *
-   * @return string
-   */
-
-  public function getSoftEdgesSize() {
-    return $this->_soft_edges['size'];
-  }
-}

+ 0 - 445
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Layout.php

@@ -1,445 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_Layout
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_Layout
-{
-	/**
-	 * layoutTarget
-	 *
-	 * @var string
-	 */
-	private $_layoutTarget = NULL;
-
-	/**
-	 * X Mode
-	 *
-	 * @var string
-	 */
-	private $_xMode		= NULL;
-
-	/**
-	 * Y Mode
-	 *
-	 * @var string
-	 */
-	private $_yMode		= NULL;
-
-	/**
-	 * X-Position
-	 *
-	 * @var float
-	 */
-	private $_xPos		= NULL;
-
-	/**
-	 * Y-Position
-	 *
-	 * @var float
-	 */
-	private $_yPos		= NULL;
-
-	/**
-	 * width
-	 *
-	 * @var float
-	 */
-	private $_width		= NULL;
-
-	/**
-	 * height
-	 *
-	 * @var float
-	 */
-	private $_height	= NULL;
-
-	/**
-	 * show legend key
-	 * Specifies that legend keys should be shown in data labels
-	 *
-	 * @var boolean
-	 */
-	private $_showLegendKey	= NULL;
-
-	/**
-	 * show value
-	 * Specifies that the value should be shown in a data label.
-	 *
-	 * @var boolean
-	 */
-	private $_showVal	= NULL;
-
-	/**
-	 * show category name
-	 * Specifies that the category name should be shown in the data label.
-	 *
-	 * @var boolean
-	 */
-	private $_showCatName	= NULL;
-
-	/**
-	 * show data series name
-	 * Specifies that the series name should be shown in the data label.
-	 *
-	 * @var boolean
-	 */
-	private $_showSerName	= NULL;
-
-	/**
-	 * show percentage
-	 * Specifies that the percentage should be shown in the data label.
-	 *
-	 * @var boolean
-	 */
-	private $_showPercent	= NULL;
-
-	/**
-	 * show bubble size
-	 *
-	 * @var boolean
-	 */
-	private $_showBubbleSize	= NULL;
-
-	/**
-	 * show leader lines
-	 * Specifies that leader lines should be shown for the data label.
-	 *
-	 * @var boolean
-	 */
-	private $_showLeaderLines	= NULL;
-
-
-	/**
-	 * Create a new PHPExcel_Chart_Layout
-	 */
-	public function __construct($layout=array())
-	{
-		if (isset($layout['layoutTarget']))	{ $this->_layoutTarget	= $layout['layoutTarget'];	}
-		if (isset($layout['xMode']))		{ $this->_xMode			= $layout['xMode'];			}
-		if (isset($layout['yMode']))		{ $this->_yMode			= $layout['yMode'];			}
-		if (isset($layout['x']))			{ $this->_xPos			= (float) $layout['x'];		}
-		if (isset($layout['y']))			{ $this->_yPos			= (float) $layout['y'];		}
-		if (isset($layout['w']))			{ $this->_width			= (float) $layout['w'];		}
-		if (isset($layout['h']))			{ $this->_height		= (float) $layout['h'];		}
-	}
-
-	/**
-	 * Get Layout Target
-	 *
-	 * @return string
-	 */
-	public function getLayoutTarget() {
-		return $this->_layoutTarget;
-	}
-
-	/**
-	 * Set Layout Target
-	 *
-	 * @param Layout Target $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setLayoutTarget($value) {
-		$this->_layoutTarget = $value;
-        return $this;
-	}
-
-	/**
-	 * Get X-Mode
-	 *
-	 * @return string
-	 */
-	public function getXMode() {
-		return $this->_xMode;
-	}
-
-	/**
-	 * Set X-Mode
-	 *
-	 * @param X-Mode $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setXMode($value) {
-		$this->_xMode = $value;
-        return $this;
-	}
-
-	/**
-	 * Get Y-Mode
-	 *
-	 * @return string
-	 */
-	public function getYMode() {
-		return $this->_yMode;
-	}
-
-	/**
-	 * Set Y-Mode
-	 *
-	 * @param Y-Mode $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setYMode($value) {
-		$this->_yMode = $value;
-        return $this;
-	}
-
-	/**
-	 * Get X-Position
-	 *
-	 * @return number
-	 */
-	public function getXPosition() {
-		return $this->_xPos;
-	}
-
-	/**
-	 * Set X-Position
-	 *
-	 * @param X-Position $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setXPosition($value) {
-		$this->_xPos = $value;
-        return $this;
-	}
-
-	/**
-	 * Get Y-Position
-	 *
-	 * @return number
-	 */
-	public function getYPosition() {
-		return $this->_yPos;
-	}
-
-	/**
-	 * Set Y-Position
-	 *
-	 * @param Y-Position $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setYPosition($value) {
-		$this->_yPos = $value;
-        return $this;
-	}
-
-	/**
-	 * Get Width
-	 *
-	 * @return number
-	 */
-	public function getWidth() {
-		return $this->_width;
-	}
-
-	/**
-	 * Set Width
-	 *
-	 * @param Width $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setWidth($value) {
-		$this->_width = $value;
-        return $this;
-	}
-
-	/**
-	 * Get Height
-	 *
-	 * @return number
-	 */
-	public function getHeight() {
-		return $this->_height;
-	}
-
-	/**
-	 * Set Height
-	 *
-	 * @param Height $value
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setHeight($value) {
-		$this->_height = $value;
-        return $this;
-	}
-
-
-	/**
-	 * Get show legend key
-	 *
-	 * @return boolean
-	 */
-	public function getShowLegendKey() {
-		return $this->_showLegendKey;
-	}
-
-	/**
-	 * Set show legend key
-	 * Specifies that legend keys should be shown in data labels.
-	 *
-	 * @param boolean $value		Show legend key
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowLegendKey($value) {
-		$this->_showLegendKey = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show value
-	 *
-	 * @return boolean
-	 */
-	public function getShowVal() {
-		return $this->_showVal;
-	}
-
-	/**
-	 * Set show val
-	 * Specifies that the value should be shown in data labels.
-	 *
-	 * @param boolean $value		Show val
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowVal($value) {
-		$this->_showVal = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show category name
-	 *
-	 * @return boolean
-	 */
-	public function getShowCatName() {
-		return $this->_showCatName;
-	}
-
-	/**
-	 * Set show cat name
-	 * Specifies that the category name should be shown in data labels.
-	 *
-	 * @param boolean $value		Show cat name
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowCatName($value) {
-		$this->_showCatName = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show data series name
-	 *
-	 * @return boolean
-	 */
-	public function getShowSerName() {
-		return $this->_showSerName;
-	}
-
-	/**
-	 * Set show ser name
-	 * Specifies that the series name should be shown in data labels.
-	 *
-	 * @param boolean $value		Show series name
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowSerName($value) {
-		$this->_showSerName = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show percentage
-	 *
-	 * @return boolean
-	 */
-	public function getShowPercent() {
-		return $this->_showPercent;
-	}
-
-	/**
-	 * Set show percentage
-	 * Specifies that the percentage should be shown in data labels.
-	 *
-	 * @param boolean $value		Show percentage
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowPercent($value) {
-		$this->_showPercent = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show bubble size
-	 *
-	 * @return boolean
-	 */
-	public function getShowBubbleSize() {
-		return $this->_showBubbleSize;
-	}
-
-	/**
-	 * Set show bubble size
-	 * Specifies that the bubble size should be shown in data labels.
-	 *
-	 * @param boolean $value		Show bubble size
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowBubbleSize($value) {
-		$this->_showBubbleSize = $value;
-        return $this;
-	}
-
-	/**
-	 * Get show leader lines
-	 *
-	 * @return boolean
-	 */
-	public function getShowLeaderLines() {
-		return $this->_showLeaderLines;
-	}
-
-	/**
-	 * Set show leader lines
-	 * Specifies that leader lines should be shown in data labels.
-	 *
-	 * @param boolean $value		Show leader lines
-     * @return PHPExcel_Chart_Layout
-	 */
-	public function setShowLeaderLines($value) {
-		$this->_showLeaderLines = $value;
-        return $this;
-	}
-
-}

+ 0 - 171
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Legend.php

@@ -1,171 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_Legend
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_Legend
-{
-	/** Legend positions */
-	const xlLegendPositionBottom	= -4107;	//	Below the chart.
-	const xlLegendPositionCorner	= 2;		//	In the upper right-hand corner of the chart border.
-	const xlLegendPositionCustom	= -4161;	//	A custom position.
-	const xlLegendPositionLeft		= -4131;	//	Left of the chart.
-	const xlLegendPositionRight		= -4152;	//	Right of the chart.
-	const xlLegendPositionTop		= -4160;	//	Above the chart.
-
-	const POSITION_RIGHT	= 'r';
-	const POSITION_LEFT		= 'l';
-	const POSITION_BOTTOM	= 'b';
-	const POSITION_TOP		= 't';
-	const POSITION_TOPRIGHT	= 'tr';
-
-	private static $_positionXLref = array( self::xlLegendPositionBottom	=> self::POSITION_BOTTOM,
-											self::xlLegendPositionCorner	=> self::POSITION_TOPRIGHT,
-											self::xlLegendPositionCustom	=> '??',
-											self::xlLegendPositionLeft		=> self::POSITION_LEFT,
-											self::xlLegendPositionRight		=> self::POSITION_RIGHT,
-											self::xlLegendPositionTop		=> self::POSITION_TOP
-										  );
-
-	/**
-	 * Legend position
-	 *
-	 * @var	string
-	 */
-	private $_position = self::POSITION_RIGHT;
-
-	/**
-	 * Allow overlay of other elements?
-	 *
-	 * @var	boolean
-	 */
-	private $_overlay = TRUE;
-
-	/**
-	 * Legend Layout
-	 *
-	 * @var	PHPExcel_Chart_Layout
-	 */
-	private $_layout = NULL;
-
-
-	/**
-	 *	Create a new PHPExcel_Chart_Legend
-	 */
-	public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = NULL, $overlay = FALSE)
-	{
-		$this->setPosition($position);
-		$this->_layout = $layout;
-		$this->setOverlay($overlay);
-	}
-
-	/**
-	 * Get legend position as an excel string value
-	 *
-	 * @return	string
-	 */
-	public function getPosition() {
-		return $this->_position;
-	}
-
-	/**
-	 * Get legend position using an excel string value
-	 *
-	 * @param	string	$position
-	 */
-	public function setPosition($position = self::POSITION_RIGHT) {
-		if (!in_array($position,self::$_positionXLref)) {
-			return false;
-		}
-
-		$this->_position = $position;
-		return true;
-	}
-
-	/**
-	 * Get legend position as an Excel internal numeric value
-	 *
-	 * @return	number
-	 */
-	public function getPositionXL() {
-		return array_search($this->_position,self::$_positionXLref);
-	}
-
-	/**
-	 * Set legend position using an Excel internal numeric value
-	 *
-	 * @param	number	$positionXL
-	 */
-	public function setPositionXL($positionXL = self::xlLegendPositionRight) {
-		if (!array_key_exists($positionXL,self::$_positionXLref)) {
-			return false;
-		}
-
-		$this->_position = self::$_positionXLref[$positionXL];
-		return true;
-	}
-
-	/**
-	 * Get allow overlay of other elements?
-	 *
-	 * @return	boolean
-	 */
-	public function getOverlay() {
-		return $this->_overlay;
-	}
-
-	/**
-	 * Set allow overlay of other elements?
-	 *
-	 * @param	boolean	$overlay
-	 * @return	boolean
-	 */
-	public function setOverlay($overlay = FALSE) {
-		if (!is_bool($overlay)) {
-			return false;
-		}
-
-		$this->_overlay = $overlay;
-		return true;
-	}
-
-	/**
-	 * Get Layout
-	 *
-	 * @return PHPExcel_Chart_Layout
-	 */
-	public function getLayout() {
-		return $this->_layout;
-	}
-
-}

+ 0 - 128
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/PlotArea.php

@@ -1,128 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_PlotArea
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_PlotArea
-{
-	/**
-	 * PlotArea Layout
-	 *
-	 * @var PHPExcel_Chart_Layout
-	 */
-	private $_layout = null;
-
-	/**
-	 * Plot Series
-	 *
-	 * @var array of PHPExcel_Chart_DataSeries
-	 */
-	private $_plotSeries = array();
-
-	/**
-	 * Create a new PHPExcel_Chart_PlotArea
-	 */
-	public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array())
-	{
-		$this->_layout = $layout;
-		$this->_plotSeries = $plotSeries;
-	}
-
-	/**
-	 * Get Layout
-	 *
-	 * @return PHPExcel_Chart_Layout
-	 */
-	public function getLayout() {
-		return $this->_layout;
-	}
-
-	/**
-	 * Get Number of Plot Groups
-	 *
-	 * @return array of PHPExcel_Chart_DataSeries
-	 */
-	public function getPlotGroupCount() {
-		return count($this->_plotSeries);
-	}
-
-	/**
-	 * Get Number of Plot Series
-	 *
-	 * @return integer
-	 */
-	public function getPlotSeriesCount() {
-		$seriesCount = 0;
-		foreach($this->_plotSeries as $plot) {
-			$seriesCount += $plot->getPlotSeriesCount();
-		}
-		return $seriesCount;
-	}
-
-	/**
-	 * Get Plot Series
-	 *
-	 * @return array of PHPExcel_Chart_DataSeries
-	 */
-	public function getPlotGroup() {
-		return $this->_plotSeries;
-	}
-
-	/**
-	 * Get Plot Series by Index
-	 *
-	 * @return PHPExcel_Chart_DataSeries
-	 */
-	public function getPlotGroupByIndex($index) {
-		return $this->_plotSeries[$index];
-	}
-
-	/**
-	 * Set Plot Series
-	 *
-	 * @param [PHPExcel_Chart_DataSeries]
-     * @return PHPExcel_Chart_PlotArea
-	 */
-	public function setPlotSeries($plotSeries = array()) {
-		$this->_plotSeries = $plotSeries;
-        
-        return $this;
-	}
-
-	public function refresh(PHPExcel_Worksheet $worksheet) {
-	    foreach($this->_plotSeries as $plotSeries) {
-			$plotSeries->refresh($worksheet);
-		}
-	}
-
-}

+ 0 - 359
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Properties.php

@@ -1,359 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: nhw2h8s
- * Date: 7/2/14
- * Time: 5:45 PM
- */
-
-abstract class PHPExcel_Properties {
-
-  const
-      EXCEL_COLOR_TYPE_STANDARD = 'prstClr',
-      EXCEL_COLOR_TYPE_SCHEME = 'schemeClr',
-      EXCEL_COLOR_TYPE_ARGB = 'srgbClr';
-
-  const
-      AXIS_LABELS_LOW = 'low',
-      AXIS_LABELS_HIGH = 'high',
-      AXIS_LABELS_NEXT_TO = 'nextTo',
-      AXIS_LABELS_NONE = 'none';
-
-  const
-      TICK_MARK_NONE = 'none',
-      TICK_MARK_INSIDE = 'in',
-      TICK_MARK_OUTSIDE = 'out',
-      TICK_MARK_CROSS = 'cross';
-
-  const
-      HORIZONTAL_CROSSES_AUTOZERO = 'autoZero',
-      HORIZONTAL_CROSSES_MAXIMUM = 'max';
-
-  const
-      FORMAT_CODE_GENERAL = 'General',
-      FORMAT_CODE_NUMBER = '#,##0.00',
-      FORMAT_CODE_CURRENCY = '$#,##0.00',
-      FORMAT_CODE_ACCOUNTING = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
-      FORMAT_CODE_DATE = 'm/d/yyyy',
-      FORMAT_CODE_TIME = '[$-F400]h:mm:ss AM/PM',
-      FORMAT_CODE_PERCENTAGE = '0.00%',
-      FORMAT_CODE_FRACTION = '# ?/?',
-      FORMAT_CODE_SCIENTIFIC = '0.00E+00',
-      FORMAT_CODE_TEXT = '@',
-      FORMAT_CODE_SPECIAL = '00000';
-
-  const
-      ORIENTATION_NORMAL = 'minMax',
-      ORIENTATION_REVERSED = 'maxMin';
-
-  const
-      LINE_STYLE_COMPOUND_SIMPLE = 'sng',
-      LINE_STYLE_COMPOUND_DOUBLE = 'dbl',
-      LINE_STYLE_COMPOUND_THICKTHIN = 'thickThin',
-      LINE_STYLE_COMPOUND_THINTHICK = 'thinThick',
-      LINE_STYLE_COMPOUND_TRIPLE = 'tri',
-
-      LINE_STYLE_DASH_SOLID = 'solid',
-      LINE_STYLE_DASH_ROUND_DOT = 'sysDot',
-      LINE_STYLE_DASH_SQUERE_DOT = 'sysDash',
-      LINE_STYPE_DASH_DASH = 'dash',
-      LINE_STYLE_DASH_DASH_DOT = 'dashDot',
-      LINE_STYLE_DASH_LONG_DASH = 'lgDash',
-      LINE_STYLE_DASH_LONG_DASH_DOT = 'lgDashDot',
-      LINE_STYLE_DASH_LONG_DASH_DOT_DOT = 'lgDashDotDot',
-
-      LINE_STYLE_CAP_SQUARE = 'sq',
-      LINE_STYLE_CAP_ROUND = 'rnd',
-      LINE_STYLE_CAP_FLAT = 'flat',
-
-      LINE_STYLE_JOIN_ROUND = 'bevel',
-      LINE_STYLE_JOIN_MITER = 'miter',
-      LINE_STYLE_JOIN_BEVEL = 'bevel',
-
-      LINE_STYLE_ARROW_TYPE_NOARROW = NULL,
-      LINE_STYLE_ARROW_TYPE_ARROW = 'triangle',
-      LINE_STYLE_ARROW_TYPE_OPEN = 'arrow',
-      LINE_STYLE_ARROW_TYPE_STEALTH = 'stealth',
-      LINE_STYLE_ARROW_TYPE_DIAMOND = 'diamond',
-      LINE_STYLE_ARROW_TYPE_OVAL = 'oval',
-
-      LINE_STYLE_ARROW_SIZE_1 = 1,
-      LINE_STYLE_ARROW_SIZE_2 = 2,
-      LINE_STYLE_ARROW_SIZE_3 = 3,
-      LINE_STYLE_ARROW_SIZE_4 = 4,
-      LINE_STYLE_ARROW_SIZE_5 = 5,
-      LINE_STYLE_ARROW_SIZE_6 = 6,
-      LINE_STYLE_ARROW_SIZE_7 = 7,
-      LINE_STYLE_ARROW_SIZE_8 = 8,
-      LINE_STYLE_ARROW_SIZE_9 = 9;
-
-  const
-      SHADOW_PRESETS_NOSHADOW = NULL,
-      SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT = 1,
-      SHADOW_PRESETS_OUTER_BOTTOM = 2,
-      SHADOW_PRESETS_OUTER_BOTTOM_LEFT = 3,
-      SHADOW_PRESETS_OUTER_RIGHT = 4,
-      SHADOW_PRESETS_OUTER_CENTER = 5,
-      SHADOW_PRESETS_OUTER_LEFT = 6,
-      SHADOW_PRESETS_OUTER_TOP_RIGHT = 7,
-      SHADOW_PRESETS_OUTER_TOP = 8,
-      SHADOW_PRESETS_OUTER_TOP_LEFT = 9,
-      SHADOW_PRESETS_INNER_BOTTTOM_RIGHT = 10,
-      SHADOW_PRESETS_INNER_BOTTOM = 11,
-      SHADOW_PRESETS_INNER_BOTTOM_LEFT = 12,
-      SHADOW_PRESETS_INNER_RIGHT = 13,
-      SHADOW_PRESETS_INNER_CENTER = 14,
-      SHADOW_PRESETS_INNER_LEFT = 15,
-      SHADOW_PRESETS_INNER_TOP_RIGHT = 16,
-      SHADOW_PRESETS_INNER_TOP = 17,
-      SHADOW_PRESETS_INNER_TOP_LEFT = 18,
-      SHADOW_PRESETS_PERSPECTIVE_BELOW = 19,
-      SHADOW_PRESETS_PERSPECTIVE_UPPER_RIGHT = 20,
-      SHADOW_PRESETS_PERSPECTIVE_UPPER_LEFT = 21,
-      SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22,
-      SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
-
-  protected function  getExcelPointsWidth($width) {
-    return $width * 12700;
-  }
-
-  protected function getExcelPointsAngle($angle) {
-    return $angle * 60000;
-  }
-
-  protected function getTrueAlpha($alpha) {
-    return (string) 100 - $alpha . '000';
-  }
-
-  protected function setColorProperties($color, $alpha, $type) {
-    return array(
-        'type' => (string) $type,
-        'value' => (string) $color,
-        'alpha' => (string) $this->getTrueAlpha($alpha)
-    );
-  }
-
-  protected function getLineStyleArrowSize($array_selector, $array_kay_selector) {
-    $sizes = array(
-        1 => array('w' => 'sm', 'len' => 'sm'),
-        2 => array('w' => 'sm', 'len' => 'med'),
-        3 => array('w' => 'sm', 'len' => 'lg'),
-        4 => array('w' => 'med', 'len' => 'sm'),
-        5 => array('w' => 'med', 'len' => 'med'),
-        6 => array('w' => 'med', 'len' => 'lg'),
-        7 => array('w' => 'lg', 'len' => 'sm'),
-        8 => array('w' => 'lg', 'len' => 'med'),
-        9 => array('w' => 'lg', 'len' => 'lg')
-    );
-
-    return $sizes[$array_selector][$array_kay_selector];
-  }
-
-  protected function getShadowPresetsMap($shadow_presets_option) {
-    $presets_options = array(
-      //OUTER
-      1 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '2700000',
-          'algn' => 'tl',
-          'rotWithShape' => '0'
-      ),
-      2 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '5400000',
-          'algn' => 't',
-          'rotWithShape' => '0'
-      ),
-      3 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '8100000',
-          'algn' => 'tr',
-          'rotWithShape' => '0'
-      ),
-      4 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'algn' => 'l',
-          'rotWithShape' => '0'
-      ),
-      5 => array(
-          'effect' => 'outerShdw',
-          'size' => array(
-              'sx' => '102000',
-              'sy' => '102000'
-          )
-          ,
-          'blur' => '63500',
-          'distance' => '38100',
-          'algn' => 'ctr',
-          'rotWithShape' => '0'
-      ),
-      6 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '10800000',
-          'algn' => 'r',
-          'rotWithShape' => '0'
-      ),
-      7 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '18900000',
-          'algn' => 'bl',
-          'rotWithShape' => '0'
-      ),
-      8 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '16200000',
-          'rotWithShape' => '0'
-      ),
-      9 => array(
-          'effect' => 'outerShdw',
-          'blur' => '50800',
-          'distance' => '38100',
-          'direction' => '13500000',
-          'algn' => 'br',
-          'rotWithShape' => '0'
-      ),
-      //INNER
-      10 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '2700000',
-      ),
-      11 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '5400000',
-      ),
-      12 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '8100000',
-      ),
-      13 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-      ),
-      14 => array(
-          'effect' => 'innerShdw',
-          'blur' => '114300',
-      ),
-      15 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '10800000',
-      ),
-      16 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '18900000',
-      ),
-      17 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '16200000',
-      ),
-      18 => array(
-          'effect' => 'innerShdw',
-          'blur' => '63500',
-          'distance' => '50800',
-          'direction' => '13500000',
-      ),
-      //perspective
-      19 => array(
-          'effect' => 'outerShdw',
-          'blur' => '152400',
-          'distance' => '317500',
-          'size' => array(
-              'sx' => '90000',
-              'sy' => '-19000',
-          ),
-          'direction' => '5400000',
-          'rotWithShape' => '0',
-      ),
-      20 => array(
-          'effect' => 'outerShdw',
-          'blur' => '76200',
-          'direction' => '18900000',
-          'size' => array(
-              'sy' => '23000',
-              'kx' => '-1200000',
-          ),
-          'algn' => 'bl',
-          'rotWithShape' => '0',
-      ),
-      21 => array(
-          'effect' => 'outerShdw',
-          'blur' => '76200',
-          'direction' => '13500000',
-          'size' => array(
-              'sy' => '23000',
-              'kx' => '1200000',
-          ),
-          'algn' => 'br',
-          'rotWithShape' => '0',
-      ),
-      22 => array(
-          'effect' => 'outerShdw',
-          'blur' => '76200',
-          'distance' => '12700',
-          'direction' => '2700000',
-          'size' => array(
-              'sy' => '-23000',
-              'kx' => '-800400',
-          ),
-          'algn' => 'bl',
-          'rotWithShape' => '0',
-      ),
-      23 => array(
-          'effect' => 'outerShdw',
-          'blur' => '76200',
-          'distance' => '12700',
-          'direction' => '8100000',
-          'size' => array(
-              'sy' => '-23000',
-              'kx' => '800400',
-          ),
-          'algn' => 'br',
-          'rotWithShape' => '0',
-      ),
-    );
-
-    return $presets_options[$shadow_presets_option];
-  }
-
-  protected function getArrayElementsValue($properties, $elements) {
-    $reference = & $properties;
-    if (!is_array($elements)) {
-      return $reference[$elements];
-    } else {
-      foreach ($elements as $keys) {
-        $reference = & $reference[$keys];
-      }
-
-      return $reference;
-    }
-
-    return $this;
-  }
-
-} 

+ 0 - 17
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt

@@ -1,17 +0,0 @@
-ChartDirector
-	http://www.advsofteng.com/cdphp.html
-
-GraPHPite
-	http://graphpite.sourceforge.net/
-
-JpGraph
-	http://www.aditus.nu/jpgraph/
-
-LibChart
-	http://naku.dohcrew.com/libchart/pages/introduction/
-
-pChart
-	http://pchart.sourceforge.net/
-
-TeeChart
-	http://www.steema.com/products/teechart/overview.html

+ 0 - 855
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php

@@ -1,855 +0,0 @@
-<?php
-
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart_Renderer
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-require_once(PHPExcel_Settings::getChartRendererPath().'/jpgraph.php');
-
-
-/**
- * PHPExcel_Chart_Renderer_jpgraph
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart_Renderer
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_Renderer_jpgraph
-{
-	private static $_width	= 640;
-
-	private static $_height	= 480;
-
-	private static $_colourSet = array( 'mediumpurple1',	'palegreen3',	'gold1',		'cadetblue1',
-										'darkmagenta',		'coral',		'dodgerblue3',	'eggplant',
-										'mediumblue',		'magenta',		'sandybrown',	'cyan',
-										'firebrick1',		'forestgreen',	'deeppink4',	'darkolivegreen',
-										'goldenrod2'
-									  );
-
-	private static $_markSet = array(	'diamond'	=> MARK_DIAMOND,
-										'square'	=> MARK_SQUARE,
-										'triangle'	=> MARK_UTRIANGLE,
-										'x'			=> MARK_X,
-										'star'		=> MARK_STAR,
-										'dot'		=> MARK_FILLEDCIRCLE,
-										'dash'		=> MARK_DTRIANGLE,
-										'circle'	=> MARK_CIRCLE,
-										'plus'		=> MARK_CROSS
-									);
-
-
-	private $_chart	= null;
-
-	private $_graph	= null;
-
-	private static $_plotColour	= 0;
-
-	private static $_plotMark	= 0;
-
-
-	private function _formatPointMarker($seriesPlot,$markerID) {
-		$plotMarkKeys = array_keys(self::$_markSet);
-		if (is_null($markerID)) {
-			//	Use default plot marker (next marker in the series)
-			self::$_plotMark %= count(self::$_markSet);
-			$seriesPlot->mark->SetType(self::$_markSet[$plotMarkKeys[self::$_plotMark++]]);
-		} elseif ($markerID !== 'none') {
-			//	Use specified plot marker (if it exists)
-			if (isset(self::$_markSet[$markerID])) {
-				$seriesPlot->mark->SetType(self::$_markSet[$markerID]);
-			} else {
-				//	If the specified plot marker doesn't exist, use default plot marker (next marker in the series)
-				self::$_plotMark %= count(self::$_markSet);
-				$seriesPlot->mark->SetType(self::$_markSet[$plotMarkKeys[self::$_plotMark++]]);
-			}
-		} else {
-			//	Hide plot marker
-			$seriesPlot->mark->Hide();
-		}
-		$seriesPlot->mark->SetColor(self::$_colourSet[self::$_plotColour]);
-		$seriesPlot->mark->SetFillColor(self::$_colourSet[self::$_plotColour]);
-		$seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]);
-
-		return $seriesPlot;
-	}	//	function _formatPointMarker()
-
-
-	private function _formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '') {
-		$datasetLabelFormatCode = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
-		if (!is_null($datasetLabelFormatCode)) {
-			//	Retrieve any label formatting code
-			$datasetLabelFormatCode = stripslashes($datasetLabelFormatCode);
-		}
-
-		$testCurrentIndex = 0;
-		foreach($datasetLabels as $i => $datasetLabel) {
-			if (is_array($datasetLabel)) {
-				if ($rotation == 'bar') {
-					$datasetLabels[$i] = implode(" ",$datasetLabel);
-				} else {
-					$datasetLabel = array_reverse($datasetLabel);
-					$datasetLabels[$i] = implode("\n",$datasetLabel);
-				}
-			} else {
-				//	Format labels according to any formatting code
-				if (!is_null($datasetLabelFormatCode)) {
-					$datasetLabels[$i] = PHPExcel_Style_NumberFormat::toFormattedString($datasetLabel,$datasetLabelFormatCode);
-				}
-			}
-			++$testCurrentIndex;
-		}
-
-		return $datasetLabels;
-	}	//	function _formatDataSetLabels()
-
-
-	private function _percentageSumCalculation($groupID,$seriesCount) {
-		//	Adjust our values to a percentage value across all series in the group
-		for($i = 0; $i < $seriesCount; ++$i) {
-			if ($i == 0) {
-				$sumValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-			} else {
-				$nextValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-				foreach($nextValues as $k => $value) {
-					if (isset($sumValues[$k])) {
-						$sumValues[$k] += $value;
-					} else {
-						$sumValues[$k] = $value;
-					}
-				}
-			}
-		}
-
-		return $sumValues;
-	}	//	function _percentageSumCalculation()
-
-
-	private function _percentageAdjustValues($dataValues,$sumValues) {
-		foreach($dataValues as $k => $dataValue) {
-			$dataValues[$k] = $dataValue / $sumValues[$k] * 100;
-		}
-
-		return $dataValues;
-	}	//	function _percentageAdjustValues()
-
-
-	private function _getCaption($captionElement) {
-		//	Read any caption
-		$caption = (!is_null($captionElement)) ? $captionElement->getCaption() : NULL;
-		//	Test if we have a title caption to display
-		if (!is_null($caption)) {
-			//	If we do, it could be a plain string or an array
-			if (is_array($caption)) {
-				//	Implode an array to a plain string
-				$caption = implode('',$caption);
-			}
-		}
-		return $caption;
-	}	//	function _getCaption()
-
-
-	private function _renderTitle() {
-		$title = $this->_getCaption($this->_chart->getTitle());
-		if (!is_null($title)) {
-			$this->_graph->title->Set($title);
-		}
-	}	//	function _renderTitle()
-
-
-	private function _renderLegend() {
-		$legend = $this->_chart->getLegend();
-		if (!is_null($legend)) {
-			$legendPosition = $legend->getPosition();
-			$legendOverlay = $legend->getOverlay();
-			switch ($legendPosition) {
-				case 'r'	:
-					$this->_graph->legend->SetPos(0.01,0.5,'right','center');	//	right
-					$this->_graph->legend->SetColumns(1);
-					break;
-				case 'l'	:
-					$this->_graph->legend->SetPos(0.01,0.5,'left','center');	//	left
-					$this->_graph->legend->SetColumns(1);
-					break;
-				case 't'	:
-					$this->_graph->legend->SetPos(0.5,0.01,'center','top');	//	top
-					break;
-				case 'b'	:
-					$this->_graph->legend->SetPos(0.5,0.99,'center','bottom');	//	bottom
-					break;
-				default		:
-					$this->_graph->legend->SetPos(0.01,0.01,'right','top');	//	top-right
-					$this->_graph->legend->SetColumns(1);
-					break;
-			}
-		} else {
-			$this->_graph->legend->Hide();
-		}
-	}	//	function _renderLegend()
-
-
-	private function _renderCartesianPlotArea($type='textlin') {
-		$this->_graph = new Graph(self::$_width,self::$_height);
-		$this->_graph->SetScale($type);
-
-		$this->_renderTitle();
-
-		//	Rotate for bar rather than column chart
-		$rotation = $this->_chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection();
-		$reverse = ($rotation == 'bar') ? true : false;
-
-		$xAxisLabel = $this->_chart->getXAxisLabel();
-		if (!is_null($xAxisLabel)) {
-			$title = $this->_getCaption($xAxisLabel);
-			if (!is_null($title)) {
-				$this->_graph->xaxis->SetTitle($title,'center');
-				$this->_graph->xaxis->title->SetMargin(35);
-				if ($reverse) {
-					$this->_graph->xaxis->title->SetAngle(90);
-					$this->_graph->xaxis->title->SetMargin(90);
-				}
-			}
-		}
-
-		$yAxisLabel = $this->_chart->getYAxisLabel();
-		if (!is_null($yAxisLabel)) {
-			$title = $this->_getCaption($yAxisLabel);
-			if (!is_null($title)) {
-				$this->_graph->yaxis->SetTitle($title,'center');
-				if ($reverse) {
-					$this->_graph->yaxis->title->SetAngle(0);
-					$this->_graph->yaxis->title->SetMargin(-55);
-				}
-			}
-		}
-	}	//	function _renderCartesianPlotArea()
-
-
-	private function _renderPiePlotArea($doughnut = False) {
-		$this->_graph = new PieGraph(self::$_width,self::$_height);
-
-		$this->_renderTitle();
-	}	//	function _renderPiePlotArea()
-
-
-	private function _renderRadarPlotArea() {
-		$this->_graph = new RadarGraph(self::$_width,self::$_height);
-		$this->_graph->SetScale('lin');
-
-		$this->_renderTitle();
-	}	//	function _renderRadarPlotArea()
-
-
-	private function _renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d') {
-		$grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
-
-        $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
-		if ($labelCount > 0) {
-			$datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
-			$datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount);
-			$this->_graph->xaxis->SetTickLabels($datasetLabels);
-		}
-
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$seriesPlots = array();
-		if ($grouping == 'percentStacked') {
-			$sumValues = $this->_percentageSumCalculation($groupID,$seriesCount);
-		}
-
-		//	Loop through each data series in turn
-		for($i = 0; $i < $seriesCount; ++$i) {
-			$dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-			$marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
-
-			if ($grouping == 'percentStacked') {
-				$dataValues = $this->_percentageAdjustValues($dataValues,$sumValues);
-			}
-
-			//	Fill in any missing values in the $dataValues array
-			$testCurrentIndex = 0;
-			foreach($dataValues as $k => $dataValue) {
-				while($k != $testCurrentIndex) {
-					$dataValues[$testCurrentIndex] = null;
-					++$testCurrentIndex;
-				}
-				++$testCurrentIndex;
-			}
-
-			$seriesPlot = new LinePlot($dataValues);
-			if ($combination) {
-				$seriesPlot->SetBarCenter();
-			}
-
-			if ($filled) {
-				$seriesPlot->SetFilled(true);
-				$seriesPlot->SetColor('black');
-				$seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]);
-			} else {
-				//	Set the appropriate plot marker
-				$this->_formatPointMarker($seriesPlot,$marker);
-			}
-			$dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
-			$seriesPlot->SetLegend($dataLabel);
-
-			$seriesPlots[] = $seriesPlot;
-		}
-
-		if ($grouping == 'standard') {
-			$groupPlot = $seriesPlots;
-		} else {
-			$groupPlot = new AccLinePlot($seriesPlots);
-		}
-		$this->_graph->Add($groupPlot);
-	}	//	function _renderPlotLine()
-
-
-	private function _renderPlotBar($groupID, $dimensions = '2d') {
-		$rotation = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
-		//	Rotate for bar rather than column chart
-		if (($groupID == 0) && ($rotation == 'bar')) {
-			$this->_graph->Set90AndMargin();
-		}
-		$grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
-
-        $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
-		if ($labelCount > 0) {
-			$datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
-			$datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation);
-			//	Rotate for bar rather than column chart
-			if ($rotation == 'bar') {
-				$datasetLabels = array_reverse($datasetLabels);
-				$this->_graph->yaxis->SetPos('max');
-				$this->_graph->yaxis->SetLabelAlign('center','top');
-				$this->_graph->yaxis->SetLabelSide(SIDE_RIGHT);
-			}
-			$this->_graph->xaxis->SetTickLabels($datasetLabels);
-		}
-
-
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$seriesPlots = array();
-		if ($grouping == 'percentStacked') {
-			$sumValues = $this->_percentageSumCalculation($groupID,$seriesCount);
-		}
-
-		//	Loop through each data series in turn
-		for($j = 0; $j < $seriesCount; ++$j) {
-			$dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
-			if ($grouping == 'percentStacked') {
-				$dataValues = $this->_percentageAdjustValues($dataValues,$sumValues);
-			}
-
-			//	Fill in any missing values in the $dataValues array
-			$testCurrentIndex = 0;
-			foreach($dataValues as $k => $dataValue) {
-				while($k != $testCurrentIndex) {
-					$dataValues[$testCurrentIndex] = null;
-					++$testCurrentIndex;
-				}
-				++$testCurrentIndex;
-			}
-
-			//	Reverse the $dataValues order for bar rather than column chart
-			if ($rotation == 'bar') {
-				$dataValues = array_reverse($dataValues);
-			}
-			$seriesPlot = new BarPlot($dataValues);
-			$seriesPlot->SetColor('black');
-			$seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]);
-			if ($dimensions == '3d') {
-				$seriesPlot->SetShadow();
-			}
-			if (!$this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) {
-				$dataLabel = '';
-			} else {
-				$dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue();
-			}
-			$seriesPlot->SetLegend($dataLabel);
-
-			$seriesPlots[] = $seriesPlot;
-		}
-		//	Reverse the plot order for bar rather than column chart
-		if (($rotation == 'bar') && (!($grouping == 'percentStacked'))) {
-			$seriesPlots = array_reverse($seriesPlots);
-		}
-
-		if ($grouping == 'clustered') {
-			$groupPlot = new GroupBarPlot($seriesPlots);
-		} elseif ($grouping == 'standard') {
-			$groupPlot = new GroupBarPlot($seriesPlots);
-		} else {
-			$groupPlot = new AccBarPlot($seriesPlots);
-			if ($dimensions == '3d') {
-				$groupPlot->SetShadow();
-			}
-		}
-
-		$this->_graph->Add($groupPlot);
-	}	//	function _renderPlotBar()
-
-
-	private function _renderPlotScatter($groupID,$bubble) {
-		$grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
-		$scatterStyle = $bubbleSize = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
-
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$seriesPlots = array();
-
-		//	Loop through each data series in turn
-		for($i = 0; $i < $seriesCount; ++$i) {
-			$dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
-			$dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-
-			foreach($dataValuesY as $k => $dataValueY) {
-				$dataValuesY[$k] = $k;
-			}
-
-			$seriesPlot = new ScatterPlot($dataValuesX,$dataValuesY);
-			if ($scatterStyle == 'lineMarker') {
-				$seriesPlot->SetLinkPoints();
-				$seriesPlot->link->SetColor(self::$_colourSet[self::$_plotColour]);
-			} elseif ($scatterStyle == 'smoothMarker') {
-				$spline = new Spline($dataValuesY,$dataValuesX);
-				list($splineDataY,$splineDataX) = $spline->Get(count($dataValuesX) * self::$_width / 20);
-				$lplot = new LinePlot($splineDataX,$splineDataY);
-				$lplot->SetColor(self::$_colourSet[self::$_plotColour]);
-
-				$this->_graph->Add($lplot);
-			}
-
-			if ($bubble) {
-				$this->_formatPointMarker($seriesPlot,'dot');
-				$seriesPlot->mark->SetColor('black');
-				$seriesPlot->mark->SetSize($bubbleSize);
-			} else {
-				$marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
-				$this->_formatPointMarker($seriesPlot,$marker);
-			}
-			$dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
-			$seriesPlot->SetLegend($dataLabel);
-
-			$this->_graph->Add($seriesPlot);
-		}
-	}	//	function _renderPlotScatter()
-
-
-	private function _renderPlotRadar($groupID) {
-		$radarStyle = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
-
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$seriesPlots = array();
-
-		//	Loop through each data series in turn
-		for($i = 0; $i < $seriesCount; ++$i) {
-			$dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
-			$dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-			$marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
-
-			$dataValues = array();
-			foreach($dataValuesY as $k => $dataValueY) {
-				$dataValues[$k] = implode(' ',array_reverse($dataValueY));
-			}
-			$tmp = array_shift($dataValues);
-			$dataValues[] = $tmp;
-			$tmp = array_shift($dataValuesX);
-			$dataValuesX[] = $tmp;
-
-			$this->_graph->SetTitles(array_reverse($dataValues));
-
-			$seriesPlot = new RadarPlot(array_reverse($dataValuesX));
-
-			$dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
-			$seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]);
-			if ($radarStyle == 'filled') {
-				$seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour]);
-			}
-			$this->_formatPointMarker($seriesPlot,$marker);
-			$seriesPlot->SetLegend($dataLabel);
-
-			$this->_graph->Add($seriesPlot);
-		}
-	}	//	function _renderPlotRadar()
-
-
-	private function _renderPlotContour($groupID) {
-		$contourStyle = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
-
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$seriesPlots = array();
-
-		$dataValues = array();
-		//	Loop through each data series in turn
-		for($i = 0; $i < $seriesCount; ++$i) {
-			$dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
-			$dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
-
-			$dataValues[$i] = $dataValuesX;
-		}
-		$seriesPlot = new ContourPlot($dataValues);
-
-		$this->_graph->Add($seriesPlot);
-	}	//	function _renderPlotContour()
-
-
-	private function _renderPlotStock($groupID) {
-		$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-		$plotOrder = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder();
-
-		$dataValues = array();
-		//	Loop through each data series in turn and build the plot arrays
-		foreach($plotOrder as $i => $v) {
-			$dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues();
-			foreach($dataValuesX as $j => $dataValueX) {
-				$dataValues[$plotOrder[$i]][$j] = $dataValueX;
-			}
-		}
-		if(empty($dataValues)) {
-			return;
-		}
-
-		$dataValuesPlot = array();
-        // Flatten the plot arrays to a single dimensional array to work with jpgraph
-		for($j = 0; $j < count($dataValues[0]); $j++) {
-			for($i = 0; $i < $seriesCount; $i++) {
-				$dataValuesPlot[] = $dataValues[$i][$j];
-			}
-		}
-
-        // Set the x-axis labels
-        $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
-		if ($labelCount > 0) {
-			$datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
-			$datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount);
-			$this->_graph->xaxis->SetTickLabels($datasetLabels);
-		}
-
-		$seriesPlot = new StockPlot($dataValuesPlot);
-		$seriesPlot->SetWidth(20);
-
-		$this->_graph->Add($seriesPlot);
-	}	//	function _renderPlotStock()
-
-
-	private function _renderAreaChart($groupCount, $dimensions = '2d') {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
-		$this->_renderCartesianPlotArea();
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotLine($i,True,False,$dimensions);
-		}
-	}	//	function _renderAreaChart()
-
-
-	private function _renderLineChart($groupCount, $dimensions = '2d') {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
-		$this->_renderCartesianPlotArea();
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotLine($i,False,False,$dimensions);
-		}
-	}	//	function _renderLineChart()
-
-
-	private function _renderBarChart($groupCount, $dimensions = '2d') {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php');
-
-		$this->_renderCartesianPlotArea();
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotBar($i,$dimensions);
-		}
-	}	//	function _renderBarChart()
-
-
-	private function _renderScatterChart($groupCount) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
-		$this->_renderCartesianPlotArea('linlin');
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotScatter($i,false);
-		}
-	}	//	function _renderScatterChart()
-
-
-	private function _renderBubbleChart($groupCount) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
-
-		$this->_renderCartesianPlotArea('linlin');
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotScatter($i,true);
-		}
-	}	//	function _renderBubbleChart()
-
-
-	private function _renderPieChart($groupCount, $dimensions = '2d', $doughnut = False, $multiplePlots = False) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie.php');
-		if ($dimensions == '3d') {
-			require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie3d.php');
-		}
-
-		$this->_renderPiePlotArea($doughnut);
-
-		$iLimit = ($multiplePlots) ? $groupCount : 1;
-		for($groupID = 0; $groupID < $iLimit; ++$groupID) {
-			$grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
-			$exploded = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
-			if ($groupID == 0) {
-		        $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
-				if ($labelCount > 0) {
-					$datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
-					$datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount);
-				}
-			}
-
-			$seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
-			$seriesPlots = array();
-			//	For pie charts, we only display the first series: doughnut charts generally display all series
-			$jLimit = ($multiplePlots) ? $seriesCount : 1;
-			//	Loop through each data series in turn
-			for($j = 0; $j < $jLimit; ++$j) {
-				$dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
-
-				//	Fill in any missing values in the $dataValues array
-				$testCurrentIndex = 0;
-				foreach($dataValues as $k => $dataValue) {
-					while($k != $testCurrentIndex) {
-						$dataValues[$testCurrentIndex] = null;
-						++$testCurrentIndex;
-					}
-					++$testCurrentIndex;
-				}
-
-				if ($dimensions == '3d') {
-					$seriesPlot = new PiePlot3D($dataValues);
-				} else {
-					if ($doughnut) {
-						$seriesPlot = new PiePlotC($dataValues);
-					} else {
-						$seriesPlot = new PiePlot($dataValues);
-					}
-				}
-
-				if ($multiplePlots) {
-					$seriesPlot->SetSize(($jLimit-$j) / ($jLimit * 4));
-				}
-
-				if ($doughnut) {
-					$seriesPlot->SetMidColor('white');
-				}
-
-				$seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]);
-				if (count($datasetLabels) > 0)
-					$seriesPlot->SetLabels(array_fill(0,count($datasetLabels),''));
-				if ($dimensions != '3d') {
-					$seriesPlot->SetGuideLines(false);
-				}
-				if ($j == 0) {
-					if ($exploded) {
-						$seriesPlot->ExplodeAll();
-					}
-					$seriesPlot->SetLegends($datasetLabels);
-				}
-
-				$this->_graph->Add($seriesPlot);
-			}
-		}
-	}	//	function _renderPieChart()
-
-
-	private function _renderRadarChart($groupCount) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_radar.php');
-
-		$this->_renderRadarPlotArea();
-
-		for($groupID = 0; $groupID < $groupCount; ++$groupID) {
-			$this->_renderPlotRadar($groupID);
-		}
-	}	//	function _renderRadarChart()
-
-
-	private function _renderStockChart($groupCount) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_stock.php');
-
-		$this->_renderCartesianPlotArea('intint');
-
-		for($groupID = 0; $groupID < $groupCount; ++$groupID) {
-			$this->_renderPlotStock($groupID);
-		}
-	}	//	function _renderStockChart()
-
-
-	private function _renderContourChart($groupCount,$dimensions) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_contour.php');
-
-		$this->_renderCartesianPlotArea('intint');
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$this->_renderPlotContour($i);
-		}
-	}	//	function _renderContourChart()
-
-
-	private function _renderCombinationChart($groupCount,$dimensions,$outputDestination) {
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php');
-		require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
-		$this->_renderCartesianPlotArea();
-
-		for($i = 0; $i < $groupCount; ++$i) {
-			$dimensions = null;
-			$chartType = $this->_chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
-			switch ($chartType) {
-				case 'area3DChart' :
-					$dimensions = '3d';
-				case 'areaChart' :
-					$this->_renderPlotLine($i,True,True,$dimensions);
-					break;
-				case 'bar3DChart' :
-					$dimensions = '3d';
-				case 'barChart' :
-					$this->_renderPlotBar($i,$dimensions);
-					break;
-				case 'line3DChart' :
-					$dimensions = '3d';
-				case 'lineChart' :
-					$this->_renderPlotLine($i,False,True,$dimensions);
-					break;
-				case 'scatterChart' :
-					$this->_renderPlotScatter($i,false);
-					break;
-				case 'bubbleChart' :
-					$this->_renderPlotScatter($i,true);
-					break;
-				default	:
-					$this->_graph = null;
-					return false;
-			}
-		}
-
-		$this->_renderLegend();
-
-		$this->_graph->Stroke($outputDestination);
-		return true;
-	}	//	function _renderCombinationChart()
-
-
-	public function render($outputDestination) {
-        self::$_plotColour = 0;
-
-		$groupCount = $this->_chart->getPlotArea()->getPlotGroupCount();
-
-		$dimensions = null;
-		if ($groupCount == 1) {
-			$chartType = $this->_chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
-		} else {
-			$chartTypes = array();
-			for($i = 0; $i < $groupCount; ++$i) {
-				$chartTypes[] = $this->_chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
-			}
-			$chartTypes = array_unique($chartTypes);
-			if (count($chartTypes) == 1) {
-				$chartType = array_pop($chartTypes);
-			} elseif (count($chartTypes) == 0) {
-				echo 'Chart is not yet implemented<br />';
-				return false;
-			} else {
-				return $this->_renderCombinationChart($groupCount,$dimensions,$outputDestination);
-			}
-		}
-
-		switch ($chartType) {
-			case 'area3DChart' :
-				$dimensions = '3d';
-			case 'areaChart' :
-				$this->_renderAreaChart($groupCount,$dimensions);
-				break;
-			case 'bar3DChart' :
-				$dimensions = '3d';
-			case 'barChart' :
-				$this->_renderBarChart($groupCount,$dimensions);
-				break;
-			case 'line3DChart' :
-				$dimensions = '3d';
-			case 'lineChart' :
-				$this->_renderLineChart($groupCount,$dimensions);
-				break;
-			case 'pie3DChart' :
-				$dimensions = '3d';
-			case 'pieChart' :
-				$this->_renderPieChart($groupCount,$dimensions,False,False);
-				break;
-			case 'doughnut3DChart' :
-				$dimensions = '3d';
-			case 'doughnutChart' :
-				$this->_renderPieChart($groupCount,$dimensions,True,True);
-				break;
-			case 'scatterChart' :
-				$this->_renderScatterChart($groupCount);
-				break;
-			case 'bubbleChart' :
-				$this->_renderBubbleChart($groupCount);
-				break;
-			case 'radarChart' :
-				$this->_renderRadarChart($groupCount);
-				break;
-			case 'surface3DChart' :
-				$dimensions = '3d';
-			case 'surfaceChart' :
-				$this->_renderContourChart($groupCount,$dimensions);
-				break;
-			case 'stockChart' :
-				$this->_renderStockChart($groupCount,$dimensions);
-				break;
-			default	:
-				echo $chartType.' is not yet implemented<br />';
-				return false;
-		}
-		$this->_renderLegend();
-
-		$this->_graph->Stroke($outputDestination);
-		return true;
-	}	//	function render()
-
-
-	/**
-	 * Create a new PHPExcel_Chart_Renderer_jpgraph
-	 */
-	public function __construct(PHPExcel_Chart $chart)
-	{
-		$this->_graph	= null;
-		$this->_chart	= $chart;
-	}	//	function __construct()
-
-}	//	PHPExcel_Chart_Renderer_jpgraph

+ 0 - 92
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Chart/Title.php

@@ -1,92 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version		##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Chart_Title
- *
- * @category	PHPExcel
- * @package		PHPExcel_Chart
- * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Chart_Title
-{
-
-	/**
-	 * Title Caption
-	 *
-	 * @var string
-	 */
-	private $_caption = null;
-
-	/**
-	 * Title Layout
-	 *
-	 * @var PHPExcel_Chart_Layout
-	 */
-	private $_layout = null;
-
-	/**
-	 * Create a new PHPExcel_Chart_Title
-	 */
-	public function __construct($caption = null, PHPExcel_Chart_Layout $layout = null)
-	{
-		$this->_caption = $caption;
-		$this->_layout = $layout;
-	}
-
-	/**
-	 * Get caption
-	 *
-	 * @return string
-	 */
-	public function getCaption() {
-		return $this->_caption;
-	}
-
-	/**
-	 * Set caption
-	 *
-	 * @param string $caption
-     * @return PHPExcel_Chart_Title
-	 */
-	public function setCaption($caption = null) {
-		$this->_caption = $caption;
-        
-        return $this;
-	}
-
-	/**
-	 * Get Layout
-	 *
-	 * @return PHPExcel_Chart_Layout
-	 */
-	public function getLayout() {
-		return $this->_layout;
-	}
-
-}

+ 0 - 327
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Comment.php

@@ -1,327 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Comment
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Comment implements PHPExcel_IComparable
-{
-    /**
-     * Author
-     *
-     * @var string
-     */
-    private $_author;
-
-    /**
-     * Rich text comment
-     *
-     * @var PHPExcel_RichText
-     */
-    private $_text;
-
-    /**
-     * Comment width (CSS style, i.e. XXpx or YYpt)
-     *
-     * @var string
-     */
-    private $_width = '96pt';
-
-    /**
-     * Left margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @var string
-     */
-    private $_marginLeft = '59.25pt';
-
-    /**
-     * Top margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @var string
-     */
-    private $_marginTop = '1.5pt';
-
-    /**
-     * Visible
-     *
-     * @var boolean
-     */
-    private $_visible = false;
-
-    /**
-     * Comment height (CSS style, i.e. XXpx or YYpt)
-     *
-     * @var string
-     */
-    private $_height = '55.5pt';
-
-    /**
-     * Comment fill color
-     *
-     * @var PHPExcel_Style_Color
-     */
-    private $_fillColor;
-
-    /**
-     * Alignment
-     *
-     * @var string
-     */
-    private $_alignment;
-
-    /**
-     * Create a new PHPExcel_Comment
-     *
-     * @throws PHPExcel_Exception
-     */
-    public function __construct()
-    {
-        // Initialise variables
-        $this->_author		= 'Author';
-        $this->_text		= new PHPExcel_RichText();
-        $this->_fillColor	= new PHPExcel_Style_Color('FFFFFFE1');
-        $this->_alignment	= PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
-    }
-
-    /**
-     * Get Author
-     *
-     * @return string
-     */
-    public function getAuthor() {
-        return $this->_author;
-    }
-
-    /**
-     * Set Author
-     *
-     * @param string $pValue
-     * @return PHPExcel_Comment
-     */
-    public function setAuthor($pValue = '') {
-        $this->_author = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Rich text comment
-     *
-     * @return PHPExcel_RichText
-     */
-    public function getText() {
-        return $this->_text;
-    }
-
-    /**
-     * Set Rich text comment
-     *
-     * @param PHPExcel_RichText $pValue
-     * @return PHPExcel_Comment
-     */
-    public function setText(PHPExcel_RichText $pValue) {
-        $this->_text = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get comment width (CSS style, i.e. XXpx or YYpt)
-     *
-     * @return string
-     */
-    public function getWidth() {
-        return $this->_width;
-    }
-
-    /**
-     * Set comment width (CSS style, i.e. XXpx or YYpt)
-     *
-     * @param string $value
-     * @return PHPExcel_Comment
-     */
-    public function setWidth($value = '96pt') {
-        $this->_width = $value;
-        return $this;
-    }
-
-    /**
-     * Get comment height (CSS style, i.e. XXpx or YYpt)
-     *
-     * @return string
-     */
-    public function getHeight() {
-        return $this->_height;
-    }
-
-    /**
-     * Set comment height (CSS style, i.e. XXpx or YYpt)
-     *
-     * @param string $value
-     * @return PHPExcel_Comment
-     */
-    public function setHeight($value = '55.5pt') {
-        $this->_height = $value;
-        return $this;
-    }
-
-    /**
-     * Get left margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @return string
-     */
-    public function getMarginLeft() {
-        return $this->_marginLeft;
-    }
-
-    /**
-     * Set left margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @param string $value
-     * @return PHPExcel_Comment
-     */
-    public function setMarginLeft($value = '59.25pt') {
-        $this->_marginLeft = $value;
-        return $this;
-    }
-
-    /**
-     * Get top margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @return string
-     */
-    public function getMarginTop() {
-        return $this->_marginTop;
-    }
-
-    /**
-     * Set top margin (CSS style, i.e. XXpx or YYpt)
-     *
-     * @param string $value
-     * @return PHPExcel_Comment
-     */
-    public function setMarginTop($value = '1.5pt') {
-        $this->_marginTop = $value;
-        return $this;
-    }
-
-    /**
-     * Is the comment visible by default?
-     *
-     * @return boolean
-     */
-    public function getVisible() {
-        return $this->_visible;
-    }
-
-    /**
-     * Set comment default visibility
-     *
-     * @param boolean $value
-     * @return PHPExcel_Comment
-     */
-    public function setVisible($value = false) {
-        $this->_visible = $value;
-        return $this;
-    }
-
-    /**
-     * Get fill color
-     *
-     * @return PHPExcel_Style_Color
-     */
-    public function getFillColor() {
-        return $this->_fillColor;
-    }
-
-    /**
-     * Set Alignment
-     *
-     * @param string $pValue
-     * @return PHPExcel_Comment
-     */
-    public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) {
-        $this->_alignment = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Alignment
-     *
-     * @return string
-     */
-    public function getAlignment() {
-        return $this->_alignment;
-    }
-
-    /**
-     * Get hash code
-     *
-     * @return string    Hash code
-     */
-    public function getHashCode() {
-        return md5(
-              $this->_author
-            . $this->_text->getHashCode()
-            . $this->_width
-            . $this->_height
-            . $this->_marginLeft
-            . $this->_marginTop
-            . ($this->_visible ? 1 : 0)
-            . $this->_fillColor->getHashCode()
-            . $this->_alignment
-            . __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;
-            }
-        }
-    }
-
-    /**
-     * Convert to string
-     *
-     * @return string
-     */
-    public function __toString() {
-        return $this->_text->getPlainText();
-    }
-
-}

+ 0 - 587
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/DocumentProperties.php

@@ -1,587 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_DocumentProperties
- *
- * @category    PHPExcel
- * @package        PHPExcel
- * @copyright    Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_DocumentProperties
-{
-    /** constants */
-    const PROPERTY_TYPE_BOOLEAN	= 'b';
-    const PROPERTY_TYPE_INTEGER = 'i';
-    const PROPERTY_TYPE_FLOAT   = 'f';
-    const PROPERTY_TYPE_DATE    = 'd';
-    const PROPERTY_TYPE_STRING  = 's';
-    const PROPERTY_TYPE_UNKNOWN = 'u';
-
-    /**
-     * Creator
-     *
-     * @var string
-     */
-    private $_creator    = 'Unknown Creator';
-
-    /**
-     * LastModifiedBy
-     *
-     * @var string
-     */
-    private $_lastModifiedBy;
-
-    /**
-     * Created
-     *
-     * @var datetime
-     */
-    private $_created;
-
-    /**
-     * Modified
-     *
-     * @var datetime
-     */
-    private $_modified;
-
-    /**
-     * Title
-     *
-     * @var string
-     */
-    private $_title            = 'Untitled Spreadsheet';
-
-    /**
-     * Description
-     *
-     * @var string
-     */
-    private $_description    = '';
-
-    /**
-     * Subject
-     *
-     * @var string
-     */
-    private $_subject        = '';
-
-    /**
-     * Keywords
-     *
-     * @var string
-     */
-    private $_keywords        = '';
-
-    /**
-     * Category
-     *
-     * @var string
-     */
-    private $_category        = '';
-
-    /**
-     * Manager
-     *
-     * @var string
-     */
-    private $_manager        = '';
-
-    /**
-     * Company
-     *
-     * @var string
-     */
-    private $_company        = 'Microsoft Corporation';
-
-    /**
-     * Custom Properties
-     *
-     * @var string
-     */
-    private $_customProperties    = array();
-
-
-    /**
-     * Create a new PHPExcel_DocumentProperties
-     */
-    public function __construct()
-    {
-        // Initialise values
-        $this->_lastModifiedBy    = $this->_creator;
-        $this->_created        = time();
-        $this->_modified    = time();
-    }
-
-    /**
-     * Get Creator
-     *
-     * @return string
-     */
-    public function getCreator() {
-        return $this->_creator;
-    }
-
-    /**
-     * Set Creator
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setCreator($pValue = '') {
-        $this->_creator = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Last Modified By
-     *
-     * @return string
-     */
-    public function getLastModifiedBy() {
-        return $this->_lastModifiedBy;
-    }
-
-    /**
-     * Set Last Modified By
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setLastModifiedBy($pValue = '') {
-        $this->_lastModifiedBy = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Created
-     *
-     * @return datetime
-     */
-    public function getCreated() {
-        return $this->_created;
-    }
-
-    /**
-     * Set Created
-     *
-     * @param datetime $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setCreated($pValue = null) {
-        if ($pValue === NULL) {
-            $pValue = time();
-        } elseif (is_string($pValue)) {
-            if (is_numeric($pValue)) {
-                $pValue = intval($pValue);
-            } else {
-                $pValue = strtotime($pValue);
-            }
-        }
-
-        $this->_created = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Modified
-     *
-     * @return datetime
-     */
-    public function getModified() {
-        return $this->_modified;
-    }
-
-    /**
-     * Set Modified
-     *
-     * @param datetime $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setModified($pValue = null) {
-        if ($pValue === NULL) {
-            $pValue = time();
-        } elseif (is_string($pValue)) {
-            if (is_numeric($pValue)) {
-                $pValue = intval($pValue);
-            } else {
-                $pValue = strtotime($pValue);
-            }
-        }
-
-        $this->_modified = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Title
-     *
-     * @return string
-     */
-    public function getTitle() {
-        return $this->_title;
-    }
-
-    /**
-     * Set Title
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setTitle($pValue = '') {
-        $this->_title = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Description
-     *
-     * @return string
-     */
-    public function getDescription() {
-        return $this->_description;
-    }
-
-    /**
-     * Set Description
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setDescription($pValue = '') {
-        $this->_description = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Subject
-     *
-     * @return string
-     */
-    public function getSubject() {
-        return $this->_subject;
-    }
-
-    /**
-     * Set Subject
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setSubject($pValue = '') {
-        $this->_subject = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Keywords
-     *
-     * @return string
-     */
-    public function getKeywords() {
-        return $this->_keywords;
-    }
-
-    /**
-     * Set Keywords
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setKeywords($pValue = '') {
-        $this->_keywords = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Category
-     *
-     * @return string
-     */
-    public function getCategory() {
-        return $this->_category;
-    }
-
-    /**
-     * Set Category
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setCategory($pValue = '') {
-        $this->_category = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Company
-     *
-     * @return string
-     */
-    public function getCompany() {
-        return $this->_company;
-    }
-
-    /**
-     * Set Company
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setCompany($pValue = '') {
-        $this->_company = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get Manager
-     *
-     * @return string
-     */
-    public function getManager() {
-        return $this->_manager;
-    }
-
-    /**
-     * Set Manager
-     *
-     * @param string $pValue
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setManager($pValue = '') {
-        $this->_manager = $pValue;
-        return $this;
-    }
-
-    /**
-     * Get a List of Custom Property Names
-     *
-     * @return array of string
-     */
-    public function getCustomProperties() {
-        return array_keys($this->_customProperties);
-    }
-
-    /**
-     * Check if a Custom Property is defined
-     *
-     * @param string $propertyName
-     * @return boolean
-     */
-    public function isCustomPropertySet($propertyName) {
-        return isset($this->_customProperties[$propertyName]);
-    }
-
-    /**
-     * Get a Custom Property Value
-     *
-     * @param string $propertyName
-     * @return string
-     */
-    public function getCustomPropertyValue($propertyName) {
-        if (isset($this->_customProperties[$propertyName])) {
-            return $this->_customProperties[$propertyName]['value'];
-        }
-
-    }
-
-    /**
-     * Get a Custom Property Type
-     *
-     * @param string $propertyName
-     * @return string
-     */
-    public function getCustomPropertyType($propertyName) {
-        if (isset($this->_customProperties[$propertyName])) {
-            return $this->_customProperties[$propertyName]['type'];
-        }
-
-    }
-
-    /**
-     * Set a Custom Property
-     *
-     * @param string $propertyName
-     * @param mixed $propertyValue
-     * @param string $propertyType
-     * 	 'i'    : Integer
-     *   'f' : Floating Point
-     *   's' : String
-     *   'd' : Date/Time
-     *   'b' : Boolean
-     * @return PHPExcel_DocumentProperties
-     */
-    public function setCustomProperty($propertyName,$propertyValue='',$propertyType=NULL) {
-        if (($propertyType === NULL) || (!in_array($propertyType,array(self::PROPERTY_TYPE_INTEGER,
-                                                                       self::PROPERTY_TYPE_FLOAT,
-                                                                       self::PROPERTY_TYPE_STRING,
-                                                                       self::PROPERTY_TYPE_DATE,
-                                                                       self::PROPERTY_TYPE_BOOLEAN)))) {
-            if ($propertyValue === NULL) {
-                $propertyType = self::PROPERTY_TYPE_STRING;
-            } elseif (is_float($propertyValue)) {
-                $propertyType = self::PROPERTY_TYPE_FLOAT;
-            } elseif(is_int($propertyValue)) {
-                $propertyType = self::PROPERTY_TYPE_INTEGER;
-            } elseif (is_bool($propertyValue)) {
-                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
-            } else {
-                $propertyType = self::PROPERTY_TYPE_STRING;
-            }
-        }
-
-        $this->_customProperties[$propertyName] = array('value' => $propertyValue, 'type' => $propertyType);
-        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;
-            }
-        }
-    }
-
-    public static function convertProperty($propertyValue,$propertyType) {
-        switch ($propertyType) {
-            case 'empty'    :    //    Empty
-                return '';
-                break;
-            case 'null'        :    //    Null
-                return NULL;
-                break;
-            case 'i1'        :    //    1-Byte Signed Integer
-            case 'i2'        :    //    2-Byte Signed Integer
-            case 'i4'        :    //    4-Byte Signed Integer
-            case 'i8'        :    //    8-Byte Signed Integer
-            case 'int'        :    //    Integer
-                return (int) $propertyValue;
-                break;
-            case 'ui1'        :    //    1-Byte Unsigned Integer
-            case 'ui2'        :    //    2-Byte Unsigned Integer
-            case 'ui4'        :    //    4-Byte Unsigned Integer
-            case 'ui8'        :    //    8-Byte Unsigned Integer
-            case 'uint'        :    //    Unsigned Integer
-                return abs((int) $propertyValue);
-                break;
-            case 'r4'        :    //    4-Byte Real Number
-            case 'r8'        :    //    8-Byte Real Number
-            case 'decimal'    :    //    Decimal
-                return (float) $propertyValue;
-                break;
-            case 'lpstr'    :    //    LPSTR
-            case 'lpwstr'    :    //    LPWSTR
-            case 'bstr'        :    //    Basic String
-                return $propertyValue;
-                break;
-            case 'date'        :    //    Date and Time
-            case 'filetime'    :    //    File Time
-                return strtotime($propertyValue);
-                break;
-            case 'bool'        :    //    Boolean
-                return ($propertyValue == 'true') ? True : False;
-                break;
-            case 'cy'        :    //    Currency
-            case 'error'    :    //    Error Status Code
-            case 'vector'    :    //    Vector
-            case 'array'    :    //    Array
-            case 'blob'        :    //    Binary Blob
-            case 'oblob'    :    //    Binary Blob Object
-            case 'stream'    :    //    Binary Stream
-            case 'ostream'    :    //    Binary Stream Object
-            case 'storage'    :    //    Binary Storage
-            case 'ostorage'    :    //    Binary Storage Object
-            case 'vstream'    :    //    Binary Versioned Stream
-            case 'clsid'    :    //    Class ID
-            case 'cf'        :    //    Clipboard Data
-                return $propertyValue;
-                break;
-        }
-        return $propertyValue;
-    }
-
-    public static function convertPropertyType($propertyType) {
-        switch ($propertyType) {
-            case 'i1'        :    //    1-Byte Signed Integer
-            case 'i2'        :    //    2-Byte Signed Integer
-            case 'i4'        :    //    4-Byte Signed Integer
-            case 'i8'        :    //    8-Byte Signed Integer
-            case 'int'        :    //    Integer
-            case 'ui1'        :    //    1-Byte Unsigned Integer
-            case 'ui2'        :    //    2-Byte Unsigned Integer
-            case 'ui4'        :    //    4-Byte Unsigned Integer
-            case 'ui8'        :    //    8-Byte Unsigned Integer
-            case 'uint'        :    //    Unsigned Integer
-                return self::PROPERTY_TYPE_INTEGER;
-                break;
-            case 'r4'        :    //    4-Byte Real Number
-            case 'r8'        :    //    8-Byte Real Number
-            case 'decimal'    :    //    Decimal
-                return self::PROPERTY_TYPE_FLOAT;
-                break;
-            case 'empty'    :    //    Empty
-            case 'null'        :    //    Null
-            case 'lpstr'    :    //    LPSTR
-            case 'lpwstr'    :    //    LPWSTR
-            case 'bstr'        :    //    Basic String
-                return self::PROPERTY_TYPE_STRING;
-                break;
-            case 'date'        :    //    Date and Time
-            case 'filetime'    :    //    File Time
-                return self::PROPERTY_TYPE_DATE;
-                break;
-            case 'bool'        :    //    Boolean
-                return self::PROPERTY_TYPE_BOOLEAN;
-                break;
-            case 'cy'        :    //    Currency
-            case 'error'    :    //    Error Status Code
-            case 'vector'    :    //    Vector
-            case 'array'    :    //    Array
-            case 'blob'        :    //    Binary Blob
-            case 'oblob'    :    //    Binary Blob Object
-            case 'stream'    :    //    Binary Stream
-            case 'ostream'    :    //    Binary Stream Object
-            case 'storage'    :    //    Binary Storage
-            case 'ostorage'    :    //    Binary Storage Object
-            case 'vstream'    :    //    Binary Versioned Stream
-            case 'clsid'    :    //    Class ID
-            case 'cf'        :    //    Clipboard Data
-                return self::PROPERTY_TYPE_UNKNOWN;
-                break;
-        }
-        return self::PROPERTY_TYPE_UNKNOWN;
-    }
-
-}

+ 0 - 218
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/DocumentSecurity.php

@@ -1,218 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_DocumentSecurity
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_DocumentSecurity
-{
-	/**
-	 * LockRevision
-	 *
-	 * @var boolean
-	 */
-	private $_lockRevision;
-
-	/**
-	 * LockStructure
-	 *
-	 * @var boolean
-	 */
-	private $_lockStructure;
-
-	/**
-	 * LockWindows
-	 *
-	 * @var boolean
-	 */
-	private $_lockWindows;
-
-	/**
-	 * RevisionsPassword
-	 *
-	 * @var string
-	 */
-	private $_revisionsPassword;
-
-	/**
-	 * WorkbookPassword
-	 *
-	 * @var string
-	 */
-	private $_workbookPassword;
-
-    /**
-     * Create a new PHPExcel_DocumentSecurity
-     */
-    public function __construct()
-    {
-    	// Initialise values
-    	$this->_lockRevision		= false;
-    	$this->_lockStructure		= false;
-    	$this->_lockWindows			= false;
-    	$this->_revisionsPassword	= '';
-    	$this->_workbookPassword	= '';
-    }
-
-    /**
-     * Is some sort of dcument security enabled?
-     *
-     * @return boolean
-     */
-    function isSecurityEnabled() {
-    	return 	$this->_lockRevision ||
-		    	$this->_lockStructure ||
-		    	$this->_lockWindows;
-    }
-
-    /**
-     * Get LockRevision
-     *
-     * @return boolean
-     */
-    function getLockRevision() {
-    	return $this->_lockRevision;
-    }
-
-    /**
-     * Set LockRevision
-     *
-     * @param boolean $pValue
-     * @return PHPExcel_DocumentSecurity
-     */
-    function setLockRevision($pValue = false) {
-    	$this->_lockRevision = $pValue;
-    	return $this;
-    }
-
-    /**
-     * Get LockStructure
-     *
-     * @return boolean
-     */
-    function getLockStructure() {
-    	return $this->_lockStructure;
-    }
-
-    /**
-     * Set LockStructure
-     *
-     * @param boolean $pValue
-     * @return PHPExcel_DocumentSecurity
-     */
-    function setLockStructure($pValue = false) {
-		$this->_lockStructure = $pValue;
-		return $this;
-    }
-
-    /**
-     * Get LockWindows
-     *
-     * @return boolean
-     */
-    function getLockWindows() {
-    	return $this->_lockWindows;
-    }
-
-    /**
-     * Set LockWindows
-     *
-     * @param boolean $pValue
-     * @return PHPExcel_DocumentSecurity
-     */
-    function setLockWindows($pValue = false) {
-    	$this->_lockWindows = $pValue;
-    	return $this;
-    }
-
-    /**
-     * Get RevisionsPassword (hashed)
-     *
-     * @return string
-     */
-    function getRevisionsPassword() {
-    	return $this->_revisionsPassword;
-    }
-
-    /**
-     * Set RevisionsPassword
-     *
-     * @param string 	$pValue
-     * @param boolean 	$pAlreadyHashed If the password has already been hashed, set this to true
-     * @return PHPExcel_DocumentSecurity
-     */
-    function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) {
-    	if (!$pAlreadyHashed) {
-    		$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
-    	}
-    	$this->_revisionsPassword = $pValue;
-    	return $this;
-    }
-
-    /**
-     * Get WorkbookPassword (hashed)
-     *
-     * @return string
-     */
-    function getWorkbookPassword() {
-    	return $this->_workbookPassword;
-    }
-
-    /**
-     * Set WorkbookPassword
-     *
-     * @param string 	$pValue
-     * @param boolean 	$pAlreadyHashed If the password has already been hashed, set this to true
-     * @return PHPExcel_DocumentSecurity
-     */
-    function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) {
-    	if (!$pAlreadyHashed) {
-    		$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
-    	}
-		$this->_workbookPassword = $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;
-			}
-		}
-	}
-}

+ 0 - 52
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Exception.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_Exception
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_Exception extends Exception {
-    /**
-     * Error handler callback
-     *
-     * @param mixed $code
-     * @param mixed $string
-     * @param mixed $file
-     * @param mixed $line
-     * @param mixed $context
-     */
-    public static function errorHandlerCallback($code, $string, $file, $line, $context) {
-        $e = new self($string, $code);
-        $e->line = $line;
-        $e->file = $file;
-        throw $e;
-    }
-}

+ 0 - 202
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/HashTable.php

@@ -1,202 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version	##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_HashTable
- *
- * @category   PHPExcel
- * @package	PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_HashTable
-{
-	/**
-	 * HashTable elements
-	 *
-	 * @var array
-	 */
-	public $_items = array();
-
-	/**
-	 * HashTable key map
-	 *
-	 * @var array
-	 */
-	public $_keyMap = array();
-
-	/**
-	 * Create a new PHPExcel_HashTable
-	 *
-	 * @param	PHPExcel_IComparable[] $pSource	Optional source array to create HashTable from
-	 * @throws	PHPExcel_Exception
-	 */
-	public function __construct($pSource = null)
-	{
-		if ($pSource !== NULL) {
-			// Create HashTable
-			$this->addFromSource($pSource);
-		}
-	}
-
-	/**
-	 * Add HashTable items from source
-	 *
-	 * @param	PHPExcel_IComparable[] $pSource	Source array to create HashTable from
-	 * @throws	PHPExcel_Exception
-	 */
-	public function addFromSource($pSource = null) {
-		// Check if an array was passed
-		if ($pSource == null) {
-			return;
-		} else if (!is_array($pSource)) {
-			throw new PHPExcel_Exception('Invalid array parameter passed.');
-		}
-
-		foreach ($pSource as $item) {
-			$this->add($item);
-		}
-	}
-
-	/**
-	 * Add HashTable item
-	 *
-	 * @param	PHPExcel_IComparable $pSource	Item to add
-	 * @throws	PHPExcel_Exception
-	 */
-	public function add(PHPExcel_IComparable $pSource = null) {
-		$hash = $pSource->getHashCode();
-		if (!isset($this->_items[$hash])) {
-			$this->_items[$hash] = $pSource;
-			$this->_keyMap[count($this->_items) - 1] = $hash;
-		}
-	}
-
-	/**
-	 * Remove HashTable item
-	 *
-	 * @param	PHPExcel_IComparable $pSource	Item to remove
-	 * @throws	PHPExcel_Exception
-	 */
-	public function remove(PHPExcel_IComparable $pSource = null) {
-		$hash = $pSource->getHashCode();
-		if (isset($this->_items[$hash])) {
-			unset($this->_items[$hash]);
-
-			$deleteKey = -1;
-			foreach ($this->_keyMap as $key => $value) {
-				if ($deleteKey >= 0) {
-					$this->_keyMap[$key - 1] = $value;
-				}
-
-				if ($value == $hash) {
-					$deleteKey = $key;
-				}
-			}
-			unset($this->_keyMap[count($this->_keyMap) - 1]);
-		}
-	}
-
-	/**
-	 * Clear HashTable
-	 *
-	 */
-	public function clear() {
-		$this->_items = array();
-		$this->_keyMap = array();
-	}
-
-	/**
-	 * Count
-	 *
-	 * @return int
-	 */
-	public function count() {
-		return count($this->_items);
-	}
-
-	/**
-	 * Get index for hash code
-	 *
-	 * @param	string	$pHashCode
-	 * @return	int	Index
-	 */
-	public function getIndexForHashCode($pHashCode = '') {
-		return array_search($pHashCode, $this->_keyMap);
-	}
-
-	/**
-	 * Get by index
-	 *
-	 * @param	int	$pIndex
-	 * @return	PHPExcel_IComparable
-	 *
-	 */
-	public function getByIndex($pIndex = 0) {
-		if (isset($this->_keyMap[$pIndex])) {
-			return $this->getByHashCode( $this->_keyMap[$pIndex] );
-		}
-
-		return null;
-	}
-
-	/**
-	 * Get by hashcode
-	 *
-	 * @param	string	$pHashCode
-	 * @return	PHPExcel_IComparable
-	 *
-	 */
-	public function getByHashCode($pHashCode = '') {
-		if (isset($this->_items[$pHashCode])) {
-			return $this->_items[$pHashCode];
-		}
-
-		return null;
-	}
-
-	/**
-	 * HashTable to array
-	 *
-	 * @return PHPExcel_IComparable[]
-	 */
-	public function toArray() {
-		return $this->_items;
-	}
-
-	/**
-	 * 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;
-			}
-		}
-	}
-}

+ 0 - 762
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Helper/HTML.php

@@ -1,762 +0,0 @@
-<?php
-
-class PHPExcel_Helper_HTML
-{
-    protected static $colourMap = array(
-        'aliceblue' => 'f0f8ff', 
-        'antiquewhite' => 'faebd7',
-        'antiquewhite1' => 'ffefdb',
-        'antiquewhite2' => 'eedfcc',
-        'antiquewhite3' => 'cdc0b0',
-        'antiquewhite4' => '8b8378',
-        'aqua' => '00ffff',
-        'aquamarine1' => '7fffd4',
-        'aquamarine2' => '76eec6',
-        'aquamarine4' => '458b74',
-        'azure1' => 'f0ffff',
-        'azure2' => 'e0eeee',
-        'azure3' => 'c1cdcd',
-        'azure4' => '838b8b',
-        'beige' => 'f5f5dc',
-        'bisque1' => 'ffe4c4',
-        'bisque2' => 'eed5b7',
-        'bisque3' => 'cdb79e',
-        'bisque4' => '8b7d6b',
-        'black' => '000000',
-        'blanchedalmond' => 'ffebcd',
-        'blue' => '0000ff',
-        'blue1' => '0000ff',
-        'blue2' => '0000ee',
-        'blue4' => '00008b',
-        'blueviolet' => '8a2be2',
-        'brown' => 'a52a2a',
-        'brown1' => 'ff4040',
-        'brown2' => 'ee3b3b',
-        'brown3' => 'cd3333',
-        'brown4' => '8b2323',
-        'burlywood' => 'deb887',
-        'burlywood1' => 'ffd39b',
-        'burlywood2' => 'eec591',
-        'burlywood3' => 'cdaa7d',
-        'burlywood4' => '8b7355',
-        'cadetblue' => '5f9ea0',
-        'cadetblue1' => '98f5ff',
-        'cadetblue2' => '8ee5ee',
-        'cadetblue3' => '7ac5cd',
-        'cadetblue4' => '53868b',
-        'chartreuse1' => '7fff00',
-        'chartreuse2' => '76ee00',
-        'chartreuse3' => '66cd00',
-        'chartreuse4' => '458b00',
-        'chocolate' => 'd2691e',
-        'chocolate1' => 'ff7f24',
-        'chocolate2' => 'ee7621',
-        'chocolate3' => 'cd661d',
-        'coral' => 'ff7f50',
-        'coral1' => 'ff7256',
-        'coral2' => 'ee6a50',
-        'coral3' => 'cd5b45',
-        'coral4' => '8b3e2f',
-        'cornflowerblue' => '6495ed',
-        'cornsilk1' => 'fff8dc',
-        'cornsilk2' => 'eee8cd',
-        'cornsilk3' => 'cdc8b1',
-        'cornsilk4' => '8b8878',
-        'cyan1' => '00ffff',
-        'cyan2' => '00eeee',
-        'cyan3' => '00cdcd',
-        'cyan4' => '008b8b',
-        'darkgoldenrod' => 'b8860b',
-        'darkgoldenrod1' => 'ffb90f',
-        'darkgoldenrod2' => 'eead0e',
-        'darkgoldenrod3' => 'cd950c',
-        'darkgoldenrod4' => '8b6508',
-        'darkgreen' => '006400',
-        'darkkhaki' => 'bdb76b',
-        'darkolivegreen' => '556b2f',
-        'darkolivegreen1' => 'caff70',
-        'darkolivegreen2' => 'bcee68',
-        'darkolivegreen3' => 'a2cd5a',
-        'darkolivegreen4' => '6e8b3d',
-        'darkorange' => 'ff8c00',
-        'darkorange1' => 'ff7f00',
-        'darkorange2' => 'ee7600',
-        'darkorange3' => 'cd6600',
-        'darkorange4' => '8b4500',
-        'darkorchid' => '9932cc',
-        'darkorchid1' => 'bf3eff',
-        'darkorchid2' => 'b23aee',
-        'darkorchid3' => '9a32cd',
-        'darkorchid4' => '68228b',
-        'darksalmon' => 'e9967a',
-        'darkseagreen' => '8fbc8f',
-        'darkseagreen1' => 'c1ffc1',
-        'darkseagreen2' => 'b4eeb4',
-        'darkseagreen3' => '9bcd9b',
-        'darkseagreen4' => '698b69',
-        'darkslateblue' => '483d8b',
-        'darkslategray' => '2f4f4f',
-        'darkslategray1' => '97ffff',
-        'darkslategray2' => '8deeee',
-        'darkslategray3' => '79cdcd',
-        'darkslategray4' => '528b8b',
-        'darkturquoise' => '00ced1',
-        'darkviolet' => '9400d3',
-        'deeppink1' => 'ff1493',
-        'deeppink2' => 'ee1289',
-        'deeppink3' => 'cd1076',
-        'deeppink4' => '8b0a50',
-        'deepskyblue1' => '00bfff',
-        'deepskyblue2' => '00b2ee',
-        'deepskyblue3' => '009acd',
-        'deepskyblue4' => '00688b',
-        'dimgray' => '696969',
-        'dodgerblue1' => '1e90ff',
-        'dodgerblue2' => '1c86ee',
-        'dodgerblue3' => '1874cd',
-        'dodgerblue4' => '104e8b',
-        'firebrick' => 'b22222',
-        'firebrick1' => 'ff3030',
-        'firebrick2' => 'ee2c2c',
-        'firebrick3' => 'cd2626',
-        'firebrick4' => '8b1a1a',
-        'floralwhite' => 'fffaf0',
-        'forestgreen' => '228b22',
-        'fuchsia' => 'ff00ff',
-        'gainsboro' => 'dcdcdc',
-        'ghostwhite' => 'f8f8ff',
-        'gold1' => 'ffd700',
-        'gold2' => 'eec900',
-        'gold3' => 'cdad00',
-        'gold4' => '8b7500',
-        'goldenrod' => 'daa520',
-        'goldenrod1' => 'ffc125',
-        'goldenrod2' => 'eeb422',
-        'goldenrod3' => 'cd9b1d',
-        'goldenrod4' => '8b6914',
-        'gray' => 'bebebe',
-        'gray1' => '030303',
-        'gray10' => '1a1a1a',
-        'gray11' => '1c1c1c',
-        'gray12' => '1f1f1f',
-        'gray13' => '212121',
-        'gray14' => '242424',
-        'gray15' => '262626',
-        'gray16' => '292929',
-        'gray17' => '2b2b2b',
-        'gray18' => '2e2e2e',
-        'gray19' => '303030',
-        'gray2' => '050505',
-        'gray20' => '333333',
-        'gray21' => '363636',
-        'gray22' => '383838',
-        'gray23' => '3b3b3b',
-        'gray24' => '3d3d3d',
-        'gray25' => '404040',
-        'gray26' => '424242',
-        'gray27' => '454545',
-        'gray28' => '474747',
-        'gray29' => '4a4a4a',
-        'gray3' => '080808',
-        'gray30' => '4d4d4d',
-        'gray31' => '4f4f4f',
-        'gray32' => '525252',
-        'gray33' => '545454',
-        'gray34' => '575757',
-        'gray35' => '595959',
-        'gray36' => '5c5c5c',
-        'gray37' => '5e5e5e',
-        'gray38' => '616161',
-        'gray39' => '636363',
-        'gray4' => '0a0a0a',
-        'gray40' => '666666',
-        'gray41' => '696969',
-        'gray42' => '6b6b6b',
-        'gray43' => '6e6e6e',
-        'gray44' => '707070',
-        'gray45' => '737373',
-        'gray46' => '757575',
-        'gray47' => '787878',
-        'gray48' => '7a7a7a',
-        'gray49' => '7d7d7d',
-        'gray5' => '0d0d0d',
-        'gray50' => '7f7f7f',
-        'gray51' => '828282',
-        'gray52' => '858585',
-        'gray53' => '878787',
-        'gray54' => '8a8a8a',
-        'gray55' => '8c8c8c',
-        'gray56' => '8f8f8f',
-        'gray57' => '919191',
-        'gray58' => '949494',
-        'gray59' => '969696',
-        'gray6' => '0f0f0f',
-        'gray60' => '999999',
-        'gray61' => '9c9c9c',
-        'gray62' => '9e9e9e',
-        'gray63' => 'a1a1a1',
-        'gray64' => 'a3a3a3',
-        'gray65' => 'a6a6a6',
-        'gray66' => 'a8a8a8',
-        'gray67' => 'ababab',
-        'gray68' => 'adadad',
-        'gray69' => 'b0b0b0',
-        'gray7' => '121212',
-        'gray70' => 'b3b3b3',
-        'gray71' => 'b5b5b5',
-        'gray72' => 'b8b8b8',
-        'gray73' => 'bababa',
-        'gray74' => 'bdbdbd',
-        'gray75' => 'bfbfbf',
-        'gray76' => 'c2c2c2',
-        'gray77' => 'c4c4c4',
-        'gray78' => 'c7c7c7',
-        'gray79' => 'c9c9c9',
-        'gray8' => '141414',
-        'gray80' => 'cccccc',
-        'gray81' => 'cfcfcf',
-        'gray82' => 'd1d1d1',
-        'gray83' => 'd4d4d4',
-        'gray84' => 'd6d6d6',
-        'gray85' => 'd9d9d9',
-        'gray86' => 'dbdbdb',
-        'gray87' => 'dedede',
-        'gray88' => 'e0e0e0',
-        'gray89' => 'e3e3e3',
-        'gray9' => '171717',
-        'gray90' => 'e5e5e5',
-        'gray91' => 'e8e8e8',
-        'gray92' => 'ebebeb',
-        'gray93' => 'ededed',
-        'gray94' => 'f0f0f0',
-        'gray95' => 'f2f2f2',
-        'gray97' => 'f7f7f7',
-        'gray98' => 'fafafa',
-        'gray99' => 'fcfcfc',
-        'green' => '00ff00',
-        'green1' => '00ff00',
-        'green2' => '00ee00',
-        'green3' => '00cd00',
-        'green4' => '008b00',
-        'greenyellow' => 'adff2f',
-        'honeydew1' => 'f0fff0',
-        'honeydew2' => 'e0eee0',
-        'honeydew3' => 'c1cdc1',
-        'honeydew4' => '838b83',
-        'hotpink' => 'ff69b4',
-        'hotpink1' => 'ff6eb4',
-        'hotpink2' => 'ee6aa7',
-        'hotpink3' => 'cd6090',
-        'hotpink4' => '8b3a62',
-        'indianred' => 'cd5c5c',
-        'indianred1' => 'ff6a6a',
-        'indianred2' => 'ee6363',
-        'indianred3' => 'cd5555',
-        'indianred4' => '8b3a3a',
-        'ivory1' => 'fffff0',
-        'ivory2' => 'eeeee0',
-        'ivory3' => 'cdcdc1',
-        'ivory4' => '8b8b83',
-        'khaki' => 'f0e68c',
-        'khaki1' => 'fff68f',
-        'khaki2' => 'eee685',
-        'khaki3' => 'cdc673',
-        'khaki4' => '8b864e',
-        'lavender' => 'e6e6fa',
-        'lavenderblush1' => 'fff0f5',
-        'lavenderblush2' => 'eee0e5',
-        'lavenderblush3' => 'cdc1c5',
-        'lavenderblush4' => '8b8386',
-        'lawngreen' => '7cfc00',
-        'lemonchiffon1' => 'fffacd',
-        'lemonchiffon2' => 'eee9bf',
-        'lemonchiffon3' => 'cdc9a5',
-        'lemonchiffon4' => '8b8970',
-        'light' => 'eedd82',
-        'lightblue' => 'add8e6',
-        'lightblue1' => 'bfefff',
-        'lightblue2' => 'b2dfee',
-        'lightblue3' => '9ac0cd',
-        'lightblue4' => '68838b',
-        'lightcoral' => 'f08080',
-        'lightcyan1' => 'e0ffff',
-        'lightcyan2' => 'd1eeee',
-        'lightcyan3' => 'b4cdcd',
-        'lightcyan4' => '7a8b8b',
-        'lightgoldenrod1' => 'ffec8b',
-        'lightgoldenrod2' => 'eedc82',
-        'lightgoldenrod3' => 'cdbe70',
-        'lightgoldenrod4' => '8b814c',
-        'lightgoldenrodyellow' => 'fafad2',
-        'lightgray' => 'd3d3d3',
-        'lightpink' => 'ffb6c1',
-        'lightpink1' => 'ffaeb9',
-        'lightpink2' => 'eea2ad',
-        'lightpink3' => 'cd8c95',
-        'lightpink4' => '8b5f65',
-        'lightsalmon1' => 'ffa07a',
-        'lightsalmon2' => 'ee9572',
-        'lightsalmon3' => 'cd8162',
-        'lightsalmon4' => '8b5742',
-        'lightseagreen' => '20b2aa',
-        'lightskyblue' => '87cefa',
-        'lightskyblue1' => 'b0e2ff',
-        'lightskyblue2' => 'a4d3ee',
-        'lightskyblue3' => '8db6cd',
-        'lightskyblue4' => '607b8b',
-        'lightslateblue' => '8470ff',
-        'lightslategray' => '778899',
-        'lightsteelblue' => 'b0c4de',
-        'lightsteelblue1' => 'cae1ff',
-        'lightsteelblue2' => 'bcd2ee',
-        'lightsteelblue3' => 'a2b5cd',
-        'lightsteelblue4' => '6e7b8b',
-        'lightyellow1' => 'ffffe0',
-        'lightyellow2' => 'eeeed1',
-        'lightyellow3' => 'cdcdb4',
-        'lightyellow4' => '8b8b7a',
-        'lime' => '00ff00',
-        'limegreen' => '32cd32',
-        'linen' => 'faf0e6',
-        'magenta' => 'ff00ff',
-        'magenta2' => 'ee00ee',
-        'magenta3' => 'cd00cd',
-        'magenta4' => '8b008b',
-        'maroon' => 'b03060',
-        'maroon1' => 'ff34b3',
-        'maroon2' => 'ee30a7',
-        'maroon3' => 'cd2990',
-        'maroon4' => '8b1c62',
-        'medium' => '66cdaa',
-        'mediumaquamarine' => '66cdaa',
-        'mediumblue' => '0000cd',
-        'mediumorchid' => 'ba55d3',
-        'mediumorchid1' => 'e066ff',
-        'mediumorchid2' => 'd15fee',
-        'mediumorchid3' => 'b452cd',
-        'mediumorchid4' => '7a378b',
-        'mediumpurple' => '9370db',
-        'mediumpurple1' => 'ab82ff',
-        'mediumpurple2' => '9f79ee',
-        'mediumpurple3' => '8968cd',
-        'mediumpurple4' => '5d478b',
-        'mediumseagreen' => '3cb371',
-        'mediumslateblue' => '7b68ee',
-        'mediumspringgreen' => '00fa9a',
-        'mediumturquoise' => '48d1cc',
-        'mediumvioletred' => 'c71585',
-        'midnightblue' => '191970',
-        'mintcream' => 'f5fffa',
-        'mistyrose1' => 'ffe4e1',
-        'mistyrose2' => 'eed5d2',
-        'mistyrose3' => 'cdb7b5',
-        'mistyrose4' => '8b7d7b',
-        'moccasin' => 'ffe4b5',
-        'navajowhite1' => 'ffdead',
-        'navajowhite2' => 'eecfa1',
-        'navajowhite3' => 'cdb38b',
-        'navajowhite4' => '8b795e',
-        'navy' => '000080',
-        'navyblue' => '000080',
-        'oldlace' => 'fdf5e6',
-        'olive' => '808000',
-        'olivedrab' => '6b8e23',
-        'olivedrab1' => 'c0ff3e',
-        'olivedrab2' => 'b3ee3a',
-        'olivedrab4' => '698b22',
-        'orange' => 'ffa500',
-        'orange1' => 'ffa500',
-        'orange2' => 'ee9a00',
-        'orange3' => 'cd8500',
-        'orange4' => '8b5a00',
-        'orangered1' => 'ff4500',
-        'orangered2' => 'ee4000',
-        'orangered3' => 'cd3700',
-        'orangered4' => '8b2500',
-        'orchid' => 'da70d6',
-        'orchid1' => 'ff83fa',
-        'orchid2' => 'ee7ae9',
-        'orchid3' => 'cd69c9',
-        'orchid4' => '8b4789',
-        'pale' => 'db7093',
-        'palegoldenrod' => 'eee8aa',
-        'palegreen' => '98fb98',
-        'palegreen1' => '9aff9a',
-        'palegreen2' => '90ee90',
-        'palegreen3' => '7ccd7c',
-        'palegreen4' => '548b54',
-        'paleturquoise' => 'afeeee',
-        'paleturquoise1' => 'bbffff',
-        'paleturquoise2' => 'aeeeee',
-        'paleturquoise3' => '96cdcd',
-        'paleturquoise4' => '668b8b',
-        'palevioletred' => 'db7093',
-        'palevioletred1' => 'ff82ab',
-        'palevioletred2' => 'ee799f',
-        'palevioletred3' => 'cd6889',
-        'palevioletred4' => '8b475d',
-        'papayawhip' => 'ffefd5',
-        'peachpuff1' => 'ffdab9',
-        'peachpuff2' => 'eecbad',
-        'peachpuff3' => 'cdaf95',
-        'peachpuff4' => '8b7765',
-        'pink' => 'ffc0cb',
-        'pink1' => 'ffb5c5',
-        'pink2' => 'eea9b8',
-        'pink3' => 'cd919e',
-        'pink4' => '8b636c',
-        'plum' => 'dda0dd',
-        'plum1' => 'ffbbff',
-        'plum2' => 'eeaeee',
-        'plum3' => 'cd96cd',
-        'plum4' => '8b668b',
-        'powderblue' => 'b0e0e6',
-        'purple' => 'a020f0',
-        'rebeccapurple' => '663399',
-        'purple1' => '9b30ff',
-        'purple2' => '912cee',
-        'purple3' => '7d26cd',
-        'purple4' => '551a8b',
-        'red' => 'ff0000',
-        'red1' => 'ff0000',
-        'red2' => 'ee0000',
-        'red3' => 'cd0000',
-        'red4' => '8b0000',
-        'rosybrown' => 'bc8f8f',
-        'rosybrown1' => 'ffc1c1',
-        'rosybrown2' => 'eeb4b4',
-        'rosybrown3' => 'cd9b9b',
-        'rosybrown4' => '8b6969',
-        'royalblue' => '4169e1',
-        'royalblue1' => '4876ff',
-        'royalblue2' => '436eee',
-        'royalblue3' => '3a5fcd',
-        'royalblue4' => '27408b',
-        'saddlebrown' => '8b4513',
-        'salmon' => 'fa8072',
-        'salmon1' => 'ff8c69',
-        'salmon2' => 'ee8262',
-        'salmon3' => 'cd7054',
-        'salmon4' => '8b4c39',
-        'sandybrown' => 'f4a460',
-        'seagreen1' => '54ff9f',
-        'seagreen2' => '4eee94',
-        'seagreen3' => '43cd80',
-        'seagreen4' => '2e8b57',
-        'seashell1' => 'fff5ee',
-        'seashell2' => 'eee5de',
-        'seashell3' => 'cdc5bf',
-        'seashell4' => '8b8682',
-        'sienna' => 'a0522d',
-        'sienna1' => 'ff8247',
-        'sienna2' => 'ee7942',
-        'sienna3' => 'cd6839',
-        'sienna4' => '8b4726',
-        'silver' => 'c0c0c0',
-        'skyblue' => '87ceeb',
-        'skyblue1' => '87ceff',
-        'skyblue2' => '7ec0ee',
-        'skyblue3' => '6ca6cd',
-        'skyblue4' => '4a708b',
-        'slateblue' => '6a5acd',
-        'slateblue1' => '836fff',
-        'slateblue2' => '7a67ee',
-        'slateblue3' => '6959cd',
-        'slateblue4' => '473c8b',
-        'slategray' => '708090',
-        'slategray1' => 'c6e2ff',
-        'slategray2' => 'b9d3ee',
-        'slategray3' => '9fb6cd',
-        'slategray4' => '6c7b8b',
-        'snow1' => 'fffafa',
-        'snow2' => 'eee9e9',
-        'snow3' => 'cdc9c9',
-        'snow4' => '8b8989',
-        'springgreen1' => '00ff7f',
-        'springgreen2' => '00ee76',
-        'springgreen3' => '00cd66',
-        'springgreen4' => '008b45',
-        'steelblue' => '4682b4',
-        'steelblue1' => '63b8ff',
-        'steelblue2' => '5cacee',
-        'steelblue3' => '4f94cd',
-        'steelblue4' => '36648b',
-        'tan' => 'd2b48c',
-        'tan1' => 'ffa54f',
-        'tan2' => 'ee9a49',
-        'tan3' => 'cd853f',
-        'tan4' => '8b5a2b',
-        'teal' => '008080',
-        'thistle' => 'd8bfd8',
-        'thistle1' => 'ffe1ff',
-        'thistle2' => 'eed2ee',
-        'thistle3' => 'cdb5cd',
-        'thistle4' => '8b7b8b',
-        'tomato1' => 'ff6347',
-        'tomato2' => 'ee5c42',
-        'tomato3' => 'cd4f39',
-        'tomato4' => '8b3626',
-        'turquoise' => '40e0d0',
-        'turquoise1' => '00f5ff',
-        'turquoise2' => '00e5ee',
-        'turquoise3' => '00c5cd',
-        'turquoise4' => '00868b',
-        'violet' => 'ee82ee',
-        'violetred' => 'd02090',
-        'violetred1' => 'ff3e96',
-        'violetred2' => 'ee3a8c',
-        'violetred3' => 'cd3278',
-        'violetred4' => '8b2252',
-        'wheat' => 'f5deb3',
-        'wheat1' => 'ffe7ba',
-        'wheat2' => 'eed8ae',
-        'wheat3' => 'cdba96',
-        'wheat4' => '8b7e66',
-        'white' => 'ffffff',
-        'whitesmoke' => 'f5f5f5',
-        'yellow' => 'ffff00',
-        'yellow1' => 'ffff00',
-        'yellow2' => 'eeee00',
-        'yellow3' => 'cdcd00',
-        'yellow4' => '8b8b00',
-        'yellowgreen' => '9acd32',
-    );
-
-    protected $face;
-    protected $size;
-    protected $color;
-
-	protected $bold = false;
-	protected $italic = false;
-	protected $underline = false;
-	protected $superscript = false;
-	protected $subscript = false;
-	protected $strikethrough = false;
-
-    protected $startTagCallbacks = array(
-        'font' => 'startFontTag',
-        'b' => 'startBoldTag',
-        'strong' => 'startBoldTag',
-        'i' => 'startItalicTag',
-        'em' => 'startItalicTag',
-        'u' => 'startUnderlineTag',
-        'ins' => 'startUnderlineTag',
-        'del' => 'startStrikethruTag',
-        'sup' => 'startSuperscriptTag',
-        'sub' => 'startSubscriptTag',
-    );
-
-    protected $endTagCallbacks = array(
-        'font' => 'endFontTag',
-        'b' => 'endBoldTag',
-        'strong' => 'endBoldTag',
-        'i' => 'endItalicTag',
-        'em' => 'endItalicTag',
-        'u' => 'endUnderlineTag',
-        'ins' => 'endUnderlineTag',
-        'del' => 'endStrikethruTag',
-        'sup' => 'endSuperscriptTag',
-        'sub' => 'endSubscriptTag',
-        'br' => 'breakTag',
-        'p' => 'breakTag',
-        'h1' => 'breakTag',
-        'h2' => 'breakTag',
-        'h3' => 'breakTag',
-        'h4' => 'breakTag',
-        'h5' => 'breakTag',
-        'h6' => 'breakTag',
-    );
-
-    protected $stack = array();
-
-    protected $stringData = '';
-
-    protected $richTextObject;
-
-    protected function initialise() {
-        $this->face = $this->size = $this->color = null;
-        $this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
-
-        $this->stack = array();
-
-        $this->stringData = '';
-    }
-
-    public function toRichTextObject($html) {
-        $this->initialise();
-
-        //	Create a new DOM object
-        $dom = new domDocument;
-        //	Load the HTML file into the DOM object
-        //  Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
-        $loaded = @$dom->loadHTML($html);
-
-        //	Discard excess white space
-        $dom->preserveWhiteSpace = false;
-
-        $this->richTextObject = new PHPExcel_RichText();;
-        $this->parseElements($dom);
-        return $this->richTextObject;
-    }
-
-    protected function buildTextRun() {
-        $text = $this->stringData;
-        if (trim($text) === '')
-            return;
-
-        $richtextRun = $this->richTextObject->createTextRun($this->stringData);
-        if ($this->face) {
-            $richtextRun->getFont()->setName($this->face);
-        }
-        if ($this->size) {
-            $richtextRun->getFont()->setSize($this->size);
-        }
-        if ($this->color) {
-            $richtextRun->getFont()->setColor( new PHPExcel_Style_Color( 'ff' . $this->color ) );
-        }
-        if ($this->bold) {
-            $richtextRun->getFont()->setBold(true);
-        }
-        if ($this->italic) {
-            $richtextRun->getFont()->setItalic(true);
-        }
-        if ($this->underline) {
-            $richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
-        }
-        if ($this->superscript) {
-            $richtextRun->getFont()->setSuperScript(true);
-        }
-        if ($this->subscript) {
-            $richtextRun->getFont()->setSubScript(true);
-        }
-        if ($this->strikethrough) {
-            $richtextRun->getFont()->setStrikethrough(true);
-        }
-        $this->stringData = '';
-    }
-
-    protected function rgbToColour($rgb) {
-        preg_match_all('/\d+/', $rgb, $values);
-        foreach($values[0] as &$value) {
-            $value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
-        }
-        return implode($values[0]);
-    }
-
-    protected function colourNameLookup($rgb) {
-        return self::$colourMap[$rgb];
-    }
-
-    protected function startFontTag($tag) {
-        foreach ($tag->attributes as $attribute) {
-            $attributeName = strtolower($attribute->name);
-            $attributeValue = $attribute->value;
-
-            if ($attributeName == 'color') {
-                if (preg_match('/rgb\s*\(/', $attributeValue)) {
-                    $this->$attributeName = $this->rgbToColour($attributeValue);
-                } elseif(strpos(trim($attributeValue), '#') === 0) {
-                    $this->$attributeName = ltrim($attributeValue, '#');
-                } else {
-                    $this->$attributeName = $this->colourNameLookup($attributeValue);
-                }
-            } else {
-                $this->$attributeName = $attributeValue;
-            }
-        }
-    }
-
-    protected function endFontTag() {
-        $this->face = $this->size = $this->color = null;
-    }
-
-    protected function startBoldTag() {
-        $this->bold = true;
-    }
-
-    protected function endBoldTag() {
-        $this->bold = false;
-    }
-
-    protected function startItalicTag() {
-        $this->italic = true;
-    }
-
-    protected function endItalicTag() {
-        $this->italic = false;
-    }
-
-    protected function startUnderlineTag() {
-        $this->underline = true;
-    }
-
-    protected function endUnderlineTag() {
-        $this->underline = false;
-    }
-
-    protected function startSubscriptTag() {
-        $this->subscript = true;
-    }
-
-    protected function endSubscriptTag() {
-        $this->subscript = false;
-    }
-
-    protected function startSuperscriptTag() {
-        $this->superscript = true;
-    }
-
-    protected function endSuperscriptTag() {
-        $this->superscript = false;
-    }
-
-    protected function startStrikethruTag() {
-        $this->strikethrough = true;
-    }
-
-    protected function endStrikethruTag() {
-        $this->strikethrough = false;
-    }
-
-    protected function breakTag() {
-        $this->stringData .= PHP_EOL;
-    }
-
-    protected function parseTextNode(DOMText $textNode) {
-        $domText = preg_replace('/\s+/u', ' ', ltrim($textNode->nodeValue));
-        $this->stringData .= $domText;
-        $this->buildTextRun();
-    }
-
-    protected function handleCallback($element, $callbackTag, $callbacks) {
-        if (isset($callbacks[$callbackTag])) {
-            $elementHandler = $callbacks[$callbackTag];
-            if (method_exists($this, $elementHandler)) {
-                call_user_func(array($this, $elementHandler), $element);
-            }
-        }
-    }
-
-    protected function parseElementNode(DOMElement $element) {
-        $callbackTag = strtolower($element->nodeName);
-        $this->stack[] = $callbackTag;
-
-        $this->handleCallback($element, $callbackTag, $this->startTagCallbacks);
-
-        $this->parseElements($element);
-        $this->stringData .= ' ';
-        array_pop($this->stack);
-
-        $this->handleCallback($element, $callbackTag, $this->endTagCallbacks);
-    }
-
-    protected function parseElements(DOMNode $element) {
-        foreach ($element->childNodes as $child) {
-            if ($child instanceof DOMText) {
-                $this->parseTextNode($child);
-            } elseif ($child instanceof DOMElement) {
-                $this->parseElementNode($child);
-            }
-        }
-    }
-}

+ 0 - 43
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/IComparable.php

@@ -1,43 +0,0 @@
-<?php
-/**
- * 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_IComparable
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-interface PHPExcel_IComparable
-{
-	/**
-	 * Get hash code
-	 *
-	 * @return string	Hash code
-	 */
-	public function getHashCode();
-
-}

+ 0 - 288
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/IOFactory.php

@@ -1,288 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**	PHPExcel root directory */
-if (!defined('PHPEXCEL_ROOT')) {
-	/**
-	 * @ignore
-	 */
-	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
-	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
-}
-
-/**
- * PHPExcel_IOFactory
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_IOFactory
-{
-	/**
-	 * Search locations
-	 *
-	 * @var	array
-	 * @access	private
-	 * @static
-	 */
-	private static $_searchLocations = array(
-		array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
-		array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
-	);
-
-	/**
-	 * Autoresolve classes
-	 *
-	 * @var	array
-	 * @access	private
-	 * @static
-	 */
-	private static $_autoResolveClasses = array(
-		'Excel2007',
-		'Excel5',
-		'Excel2003XML',
-		'OOCalc',
-		'SYLK',
-		'Gnumeric',
-		'HTML',
-		'CSV',
-	);
-
-    /**
-     *	Private constructor for PHPExcel_IOFactory
-     */
-    private function __construct() { }
-
-    /**
-     * Get search locations
-     *
-	 * @static
-	 * @access	public
-     * @return	array
-     */
-	public static function getSearchLocations() {
-		return self::$_searchLocations;
-	}	//	function getSearchLocations()
-
-	/**
-	 * Set search locations
-	 *
-	 * @static
-	 * @access	public
-	 * @param	array $value
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function setSearchLocations($value) {
-		if (is_array($value)) {
-			self::$_searchLocations = $value;
-		} else {
-			throw new PHPExcel_Reader_Exception('Invalid parameter passed.');
-		}
-	}	//	function setSearchLocations()
-
-	/**
-	 * Add search location
-	 *
-	 * @static
-	 * @access	public
-	 * @param	string $type		Example: IWriter
-	 * @param	string $location	Example: PHPExcel/Writer/{0}.php
-	 * @param	string $classname 	Example: PHPExcel_Writer_{0}
-	 */
-	public static function addSearchLocation($type = '', $location = '', $classname = '') {
-		self::$_searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname );
-	}	//	function addSearchLocation()
-
-	/**
-	 * Create PHPExcel_Writer_IWriter
-	 *
-	 * @static
-	 * @access	public
-	 * @param	PHPExcel $phpExcel
-	 * @param	string  $writerType	Example: Excel2007
-	 * @return	PHPExcel_Writer_IWriter
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function createWriter(PHPExcel $phpExcel, $writerType = '') {
-		// Search type
-		$searchType = 'IWriter';
-
-		// Include class
-		foreach (self::$_searchLocations as $searchLocation) {
-			if ($searchLocation['type'] == $searchType) {
-				$className = str_replace('{0}', $writerType, $searchLocation['class']);
-
-				$instance = new $className($phpExcel);
-				if ($instance !== NULL) {
-					return $instance;
-				}
-			}
-		}
-
-		// Nothing found...
-		throw new PHPExcel_Reader_Exception("No $searchType found for type $writerType");
-	}	//	function createWriter()
-
-	/**
-	 * Create PHPExcel_Reader_IReader
-	 *
-	 * @static
-	 * @access	public
-	 * @param	string $readerType	Example: Excel2007
-	 * @return	PHPExcel_Reader_IReader
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function createReader($readerType = '') {
-		// Search type
-		$searchType = 'IReader';
-
-		// Include class
-		foreach (self::$_searchLocations as $searchLocation) {
-			if ($searchLocation['type'] == $searchType) {
-				$className = str_replace('{0}', $readerType, $searchLocation['class']);
-
-				$instance = new $className();
-				if ($instance !== NULL) {
-					return $instance;
-				}
-			}
-		}
-
-		// Nothing found...
-		throw new PHPExcel_Reader_Exception("No $searchType found for type $readerType");
-	}	//	function createReader()
-
-	/**
-	 * Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution
-	 *
-	 * @static
-	 * @access public
-	 * @param 	string 		$pFilename		The name of the spreadsheet file
-	 * @return	PHPExcel
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function load($pFilename) {
-		$reader = self::createReaderForFile($pFilename);
-		return $reader->load($pFilename);
-	}	//	function load()
-
-	/**
-	 * Identify file type using automatic PHPExcel_Reader_IReader resolution
-	 *
-	 * @static
-	 * @access public
-	 * @param 	string 		$pFilename		The name of the spreadsheet file to identify
-	 * @return	string
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function identify($pFilename) {
-		$reader = self::createReaderForFile($pFilename);
-		$className = get_class($reader);
-		$classType = explode('_',$className);
-		unset($reader);
-		return array_pop($classType);
-	}	//	function identify()
-
-	/**
-	 * Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution
-	 *
-	 * @static
-	 * @access	public
-	 * @param 	string 		$pFilename		The name of the spreadsheet file
-	 * @return	PHPExcel_Reader_IReader
-	 * @throws	PHPExcel_Reader_Exception
-	 */
-	public static function createReaderForFile($pFilename) {
-
-		// First, lucky guess by inspecting file extension
-		$pathinfo = pathinfo($pFilename);
-
-		$extensionType = NULL;
-		if (isset($pathinfo['extension'])) {
-			switch (strtolower($pathinfo['extension'])) {
-				case 'xlsx':			//	Excel (OfficeOpenXML) Spreadsheet
-				case 'xlsm':			//	Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
-				case 'xltx':			//	Excel (OfficeOpenXML) Template
-				case 'xltm':			//	Excel (OfficeOpenXML) Macro Template (macros will be discarded)
-					$extensionType = 'Excel2007';
-					break;
-				case 'xls':				//	Excel (BIFF) Spreadsheet
-				case 'xlt':				//	Excel (BIFF) Template
-					$extensionType = 'Excel5';
-					break;
-				case 'ods':				//	Open/Libre Offic Calc
-				case 'ots':				//	Open/Libre Offic Calc Template
-					$extensionType = 'OOCalc';
-					break;
-				case 'slk':
-					$extensionType = 'SYLK';
-					break;
-				case 'xml':				//	Excel 2003 SpreadSheetML
-					$extensionType = 'Excel2003XML';
-					break;
-				case 'gnumeric':
-					$extensionType = 'Gnumeric';
-					break;
-				case 'htm':
-				case 'html':
-					$extensionType = 'HTML';
-					break;
-				case 'csv':
-					// Do nothing
-					// We must not try to use CSV reader since it loads
-					// all files including Excel files etc.
-					break;
-				default:
-					break;
-			}
-
-			if ($extensionType !== NULL) {
-				$reader = self::createReader($extensionType);
-				// Let's see if we are lucky
-				if (isset($reader) && $reader->canRead($pFilename)) {
-					return $reader;
-				}
-			}
-		}
-
-		// If we reach here then "lucky guess" didn't give any result
-		// Try walking through all the options in self::$_autoResolveClasses
-		foreach (self::$_autoResolveClasses as $autoResolveClass) {
-			//	Ignore our original guess, we know that won't work
-			if ($autoResolveClass !== $extensionType) {
-				$reader = self::createReader($autoResolveClass);
-				if ($reader->canRead($pFilename)) {
-					return $reader;
-				}
-			}
-		}
-
-		throw new PHPExcel_Reader_Exception('Unable to identify a reader for this file');
-	}	//	function createReaderForFile()
-}

+ 0 - 246
htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/NamedRange.php

@@ -1,246 +0,0 @@
-<?php
-/**
- * PHPExcel
- *
- * Copyright (c) 2006 - 2014 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 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
- * @version    ##VERSION##, ##DATE##
- */
-
-
-/**
- * PHPExcel_NamedRange
- *
- * @category   PHPExcel
- * @package    PHPExcel
- * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
- */
-class PHPExcel_NamedRange
-{
-	/**
-	 * Range name
-	 *
-	 * @var string
-	 */
-	private $_name;
-
-	/**
-	 * Worksheet on which the named range can be resolved
-	 *
-	 * @var PHPExcel_Worksheet
-	 */
-	private $_worksheet;
-
-	/**
-	 * Range of the referenced cells
-	 *
-	 * @var string
-	 */
-	private $_range;
-
-	/**
-	 * Is the named range local? (i.e. can only be used on $this->_worksheet)
-	 *
-	 * @var bool
-	 */
-	private $_localOnly;
-
-	/**
-	 * Scope
-	 *
-	 * @var PHPExcel_Worksheet
-	 */
-	private $_scope;
-
-    /**
-     * Create a new NamedRange
-     *
-     * @param string $pName
-     * @param PHPExcel_Worksheet $pWorksheet
-     * @param string $pRange
-     * @param bool $pLocalOnly
-     * @param PHPExcel_Worksheet|null $pScope	Scope. Only applies when $pLocalOnly = true. Null for global scope.
-     * @throws PHPExcel_Exception
-     */
-    public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null)
-    {
-    	// Validate data
-    	if (($pName === NULL) || ($pWorksheet === NULL) || ($pRange === NULL)) {
-    		throw new PHPExcel_Exception('Parameters can not be null.');
-    	}
-
-    	// Set local members
-    	$this->_name 		= $pName;
-    	$this->_worksheet 	= $pWorksheet;
-    	$this->_range 		= $pRange;
-    	$this->_localOnly 	= $pLocalOnly;
-    	$this->_scope 		= ($pLocalOnly == true) ?
-								(($pScope == null) ? $pWorksheet : $pScope) : null;
-    }
-
-    /**
-     * Get name
-     *
-     * @return string
-     */
-    public function getName() {
-    	return $this->_name;
-    }
-
-    /**
-     * Set name
-     *
-     * @param string $value
-     * @return PHPExcel_NamedRange
-     */
-    public function setName($value = null) {
-    	if ($value !== NULL) {
-    		// Old title
-    		$oldTitle = $this->_name;
-
-    		// Re-attach
-    		if ($this->_worksheet !== NULL) {
-    			$this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet);
-    		}
-    		$this->_name = $value;
-
-    		if ($this->_worksheet !== NULL) {
-    			$this->_worksheet->getParent()->addNamedRange($this);
-    		}
-
-	    	// New title
-	    	$newTitle = $this->_name;
-	    	PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle);
-    	}
-    	return $this;
-    }
-
-    /**
-     * Get worksheet
-     *
-     * @return PHPExcel_Worksheet
-     */
-    public function getWorksheet() {
-    	return $this->_worksheet;
-    }
-
-    /**
-     * Set worksheet
-     *
-     * @param PHPExcel_Worksheet $value
-     * @return PHPExcel_NamedRange
-     */
-    public function setWorksheet(PHPExcel_Worksheet $value = null) {
-    	if ($value !== NULL) {
-    		$this->_worksheet = $value;
-    	}
-    	return $this;
-    }
-
-    /**
-     * Get range
-     *
-     * @return string
-     */
-    public function getRange() {
-    	return $this->_range;
-    }
-
-    /**
-     * Set range
-     *
-     * @param string $value
-     * @return PHPExcel_NamedRange
-     */
-    public function setRange($value = null) {
-    	if ($value !== NULL) {
-    		$this->_range = $value;
-    	}
-    	return $this;
-    }
-
-    /**
-     * Get localOnly
-     *
-     * @return bool
-     */
-    public function getLocalOnly() {
-    	return $this->_localOnly;
-    }
-
-    /**
-     * Set localOnly
-     *
-     * @param bool $value
-     * @return PHPExcel_NamedRange
-     */
-    public function setLocalOnly($value = false) {
-    	$this->_localOnly = $value;
-    	$this->_scope = $value ? $this->_worksheet : null;
-    	return $this;
-    }
-
-    /**
-     * Get scope
-     *
-     * @return PHPExcel_Worksheet|null
-     */
-    public function getScope() {
-    	return $this->_scope;
-    }
-
-    /**
-     * Set scope
-     *
-     * @param PHPExcel_Worksheet|null $value
-     * @return PHPExcel_NamedRange
-     */
-    public function setScope(PHPExcel_Worksheet $value = null) {
-    	$this->_scope = $value;
-    	$this->_localOnly = ($value == null) ? false : true;
-    	return $this;
-    }
-
-    /**
-     * Resolve a named range to a regular cell range
-     *
-     * @param string $pNamedRange Named range
-     * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope
-     * @return PHPExcel_NamedRange
-     */
-    public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) {
-		return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
-    }
-
-	/**
-	 * 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;
-			}
-		}
-	}
-}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini