Bladeren bron

更新代码

caipin 8 jaren geleden
bovenliggende
commit
b0d376d83b
100 gewijzigde bestanden met toevoegingen van 55638 en 0 verwijderingen
  1. 336 0
      protected/cache/categoryCollect/categoryCollectDetail_2014_0.htmls
  2. 109 0
      protected/cache/myReceipt/past_2014_3.htmls
  3. 112 0
      protected/cache/myReceipt/past_2015.htmls
  4. 112 0
      protected/cache/myReceipt/withdraw_2014.htmls
  5. 109 0
      protected/cache/myReceipt/withdraw_2014_2.htmls
  6. 109 0
      protected/cache/myReceipt/withdraw_2014_3.htmls
  7. 112 0
      protected/cache/myReceipt/withdraw_2015.htmls
  8. 112 0
      protected/cache/myReceipt/withdraw_2016_2.htmls
  9. 157 0
      protected/cache/personalCollect/personalCollect_2015.htmls
  10. 157 0
      protected/cache/personalCollect/personalCollect_2016.htmls
  11. 572 0
      protected/cache/staffCollect/staffCollect_2014_1.htmls
  12. 574 0
      protected/cache/staffCollect/staffCollect_2014_2.htmls
  13. 574 0
      protected/cache/staffCollect/staffCollect_2014_3.htmls
  14. 572 0
      protected/cache/staffCollect/staffCollect_2014_4.htmls
  15. 238 0
      protected/cache/staffCollect/staffCollect_2015_.htmls
  16. 271 0
      protected/class/Excel/oleread.php
  17. 1084 0
      protected/class/Excel/reader.php
  18. 39 0
      protected/class/MobileApi/Service.php
  19. 126 0
      protected/class/MobileApi/SoapDiscovery.class.php
  20. 42 0
      protected/class/MobileApi/creatWsdl.wsdl
  21. 61 0
      protected/class/MobileApi/interfaceDetail.wsdl
  22. 8148 0
      protected/class/MobileApi/nusoap.php
  23. 796 0
      protected/class/PHPExcel.php
  24. 60 0
      protected/class/PHPExcel/Autoloader.php
  25. 368 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/entries
  26. 218 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/APC.php.svn-base
  27. 172 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/CacheBase.php.svn-base
  28. 157 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/DiscISAM.php.svn-base
  29. 104 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/ICache.php.svn-base
  30. 236 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Memcache.php.svn-base
  31. 98 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Memory.php.svn-base
  32. 107 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/MemoryGZip.php.svn-base
  33. 107 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/MemorySerialized.php.svn-base
  34. 157 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/PHPTemp.php.svn-base
  35. 230 0
      protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Wincache.php.svn-base
  36. 218 0
      protected/class/PHPExcel/CachedObjectStorage/APC.php
  37. 172 0
      protected/class/PHPExcel/CachedObjectStorage/CacheBase.php
  38. 157 0
      protected/class/PHPExcel/CachedObjectStorage/DiscISAM.php
  39. 104 0
      protected/class/PHPExcel/CachedObjectStorage/ICache.php
  40. 236 0
      protected/class/PHPExcel/CachedObjectStorage/Memcache.php
  41. 98 0
      protected/class/PHPExcel/CachedObjectStorage/Memory.php
  42. 107 0
      protected/class/PHPExcel/CachedObjectStorage/MemoryGZip.php
  43. 107 0
      protected/class/PHPExcel/CachedObjectStorage/MemorySerialized.php
  44. 157 0
      protected/class/PHPExcel/CachedObjectStorage/PHPTemp.php
  45. 230 0
      protected/class/PHPExcel/CachedObjectStorage/Wincache.php
  46. 131 0
      protected/class/PHPExcel/CachedObjectStorageFactory.php
  47. 3827 0
      protected/class/PHPExcel/Calculation.php
  48. 572 0
      protected/class/PHPExcel/Calculation/.svn/entries
  49. 384 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Database.php.svn-base
  50. 1178 0
      protected/class/PHPExcel/Calculation/.svn/text-base/DateTime.php.svn-base
  51. 2174 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Engineering.php.svn-base
  52. 52 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Exception.php.svn-base
  53. 49 0
      protected/class/PHPExcel/Calculation/.svn/text-base/ExceptionHandler.php.svn-base
  54. 1818 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Financial.php.svn-base
  55. 614 0
      protected/class/PHPExcel/Calculation/.svn/text-base/FormulaParser.php.svn-base
  56. 176 0
      protected/class/PHPExcel/Calculation/.svn/text-base/FormulaToken.php.svn-base
  57. 149 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Function.php.svn-base
  58. 803 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Functions.php.svn-base
  59. 290 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Logical.php.svn-base
  60. 746 0
      protected/class/PHPExcel/Calculation/.svn/text-base/LookupRef.php.svn-base
  61. 1241 0
      protected/class/PHPExcel/Calculation/.svn/text-base/MathTrig.php.svn-base
  62. 3643 0
      protected/class/PHPExcel/Calculation/.svn/text-base/Statistical.php.svn-base
  63. 588 0
      protected/class/PHPExcel/Calculation/.svn/text-base/TextData.php.svn-base
  64. 351 0
      protected/class/PHPExcel/Calculation/.svn/text-base/functionlist.txt.svn-base
  65. 384 0
      protected/class/PHPExcel/Calculation/Database.php
  66. 1178 0
      protected/class/PHPExcel/Calculation/DateTime.php
  67. 2174 0
      protected/class/PHPExcel/Calculation/Engineering.php
  68. 52 0
      protected/class/PHPExcel/Calculation/Exception.php
  69. 49 0
      protected/class/PHPExcel/Calculation/ExceptionHandler.php
  70. 1818 0
      protected/class/PHPExcel/Calculation/Financial.php
  71. 614 0
      protected/class/PHPExcel/Calculation/FormulaParser.php
  72. 176 0
      protected/class/PHPExcel/Calculation/FormulaToken.php
  73. 149 0
      protected/class/PHPExcel/Calculation/Function.php
  74. 803 0
      protected/class/PHPExcel/Calculation/Functions.php
  75. 290 0
      protected/class/PHPExcel/Calculation/Logical.php
  76. 746 0
      protected/class/PHPExcel/Calculation/LookupRef.php
  77. 1241 0
      protected/class/PHPExcel/Calculation/MathTrig.php
  78. 3643 0
      protected/class/PHPExcel/Calculation/Statistical.php
  79. 588 0
      protected/class/PHPExcel/Calculation/TextData.php
  80. 351 0
      protected/class/PHPExcel/Calculation/functionlist.txt
  81. 860 0
      protected/class/PHPExcel/Cell.php
  82. 232 0
      protected/class/PHPExcel/Cell/.svn/entries
  83. 140 0
      protected/class/PHPExcel/Cell/.svn/text-base/AdvancedValueBinder.php.svn-base
  84. 114 0
      protected/class/PHPExcel/Cell/.svn/text-base/DataType.php.svn-base
  85. 474 0
      protected/class/PHPExcel/Cell/.svn/text-base/DataValidation.php.svn-base
  86. 106 0
      protected/class/PHPExcel/Cell/.svn/text-base/DefaultValueBinder.php.svn-base
  87. 127 0
      protected/class/PHPExcel/Cell/.svn/text-base/Hyperlink.php.svn-base
  88. 46 0
      protected/class/PHPExcel/Cell/.svn/text-base/IValueBinder.php.svn-base
  89. 140 0
      protected/class/PHPExcel/Cell/AdvancedValueBinder.php
  90. 114 0
      protected/class/PHPExcel/Cell/DataType.php
  91. 474 0
      protected/class/PHPExcel/Cell/DataValidation.php
  92. 106 0
      protected/class/PHPExcel/Cell/DefaultValueBinder.php
  93. 127 0
      protected/class/PHPExcel/Cell/Hyperlink.php
  94. 46 0
      protected/class/PHPExcel/Cell/IValueBinder.php
  95. 317 0
      protected/class/PHPExcel/Comment.php
  96. 588 0
      protected/class/PHPExcel/DocumentProperties.php
  97. 218 0
      protected/class/PHPExcel/DocumentSecurity.php
  98. 202 0
      protected/class/PHPExcel/HashTable.php
  99. 43 0
      protected/class/PHPExcel/IComparable.php
  100. 0 0
      protected/class/PHPExcel/IOFactory.php

+ 336 - 0
protected/cache/categoryCollect/categoryCollectDetail_2014_0.htmls

@@ -0,0 +1,336 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="#" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"  class=news ><a href="/myReceipt" class="icon-  selected " >U</a></li>  
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+					</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine  news "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+												</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fL"><a class="icon- crumb"
+	href="saea-dlist-year-dm.html" title="返回上级">b</a></div>
+ 
+ 安徽办  
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 全年报销单汇总</legend>
+<div class="demandCate">
+<form action="/categoryCollectDetail" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect" class="now">按办事处</a><a
+		href="/staffCollect">按员工</a></li>
+	<li><select name="cid" onchange="receiptYear();">
+				<option		selected  value="2"
+		>安徽办</option>
+				<option value="3"
+		>甘肃办</option>
+				<option value="4"
+		>广东办</option>
+				<option value="5"
+		>广西办</option>
+				<option value="6"
+		>江西办</option>
+				<option value="7"
+		>四川办</option>
+				<option value="8"
+		>重庆办</option>
+				<option value="9"
+		>内蒙办</option>
+				<option value="10"
+		>浙江办</option>
+				<option value="11"
+		>山东办</option>
+				<option value="12"
+		>总部</option>
+				<option value="13"
+		>云南办</option>
+				<option value="14"
+		>贵州办</option>
+			</select></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+		<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	</select></li>
+	<li>报销总计:¥6975.00</li>
+	<li>同意支付:<span class="colGreen">¥6975.00</span></li>
+	<li>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+		<tr>
+			<th width="110" class="taC">日常相关费用</th>
+			<th class="taC" width="80">1月</th>
+			<th class="taC" width="80">2月</th>
+			<th class="taC" width="80">3月</th>
+			<th class="taC" width="80">4月</th>
+			<th class="taC" width="80">5月</th>
+			<th class="taC" width="80">6月</th>
+			<th class="taC" width="80">7月</th>
+			<th class="taC" width="80">8月</th>
+			<th class="taC" width="80">9月</th>
+			<th class="taC" width="80">10月</th>
+			<th class="taC" width="80">11月</th>
+			<th class="taC" width="80">12月</th>
+			<th class="taC" width="110">总计</th>
+		</tr>
+					<tr>
+			<th>市内交通费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>市内出租费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥452.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥452</b></td>			</tr>
+					<tr>
+			<th>办事处房租</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>电话费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>水费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>电费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>办公费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>邮寄费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>其他费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>车辆费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>广告费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>团队建设费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+				<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥452.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥452</td>		</tr>
+		<tr>
+			<th width="120" class="taC">差旅相关费用</th>
+			<th class="taC" width="80">1月</th>
+			<th class="taC" width="80">2月</th>
+			<th class="taC" width="80">3月</th>
+			<th class="taC" width="80">4月</th>
+			<th class="taC" width="80">5月</th>
+			<th class="taC" width="80">6月</th>
+			<th class="taC" width="80">7月</th>
+			<th class="taC" width="80">8月</th>
+			<th class="taC" width="80">9月</th>
+			<th class="taC" width="80">10月</th>
+			<th class="taC" width="80">11月</th>
+			<th class="taC" width="80">12月</th>
+			<th class="taC">总计</th>
+		</tr>
+					<tr>
+			<th>往来交通费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥4521.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥4521</b></td>			</tr>
+					<tr>
+			<th>市内交通费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>出差住宿费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>出差补助</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>其他费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+				<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥4521.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥4521</td>		</tr>
+		<tr>
+			<th width="120" class="taC">培训班费用</th>
+			<th class="taC" width="80">1月</th>
+			<th class="taC" width="80">2月</th>
+			<th class="taC" width="80">3月</th>
+			<th class="taC" width="80">4月</th>
+			<th class="taC" width="80">5月</th>
+			<th class="taC" width="80">6月</th>
+			<th class="taC" width="80">7月</th>
+			<th class="taC" width="80">8月</th>
+			<th class="taC" width="80">9月</th>
+			<th class="taC" width="80">10月</th>
+			<th class="taC" width="80">11月</th>
+			<th class="taC" width="80">12月</th>
+			<th class="taC">总计</th>
+		</tr>
+					<tr>
+			<th>场租费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>薪酬</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥456.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥456</b></td>			</tr>
+					<tr>
+			<th>住宿费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>交通费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>餐饮费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>办公费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>公关费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+					<tr>
+			<th>其他</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+				<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥456.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥456</td>		</tr>
+		<tr>
+			<th width="120" class="taC">其他</th>
+			<th class="taC" width="80">1月</th>
+			<th class="taC" width="80">2月</th>
+			<th class="taC" width="80">3月</th>
+			<th class="taC" width="80">4月</th>
+			<th class="taC" width="80">5月</th>
+			<th class="taC" width="80">6月</th>
+			<th class="taC" width="80">7月</th>
+			<th class="taC" width="80">8月</th>
+			<th class="taC" width="80">9月</th>
+			<th class="taC" width="80">10月</th>
+			<th class="taC" width="80">11月</th>
+			<th class="taC" width="80">12月</th>
+			<th class="taC">总计</th>
+		</tr>
+					<tr>
+			<th>公关费</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥1546.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥1546</b></td>			</tr>
+					<tr>
+			<th>可自加费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>			</tr>
+				<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥1546.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥1546</td>		</tr>
+		<tr>
+			<th width="120" class="taC">报销金额调整</th>
+			<th class="taC" width="80">1月</th>
+			<th class="taC" width="80">2月</th>
+			<th class="taC" width="80">3月</th>
+			<th class="taC" width="80">4月</th>
+			<th class="taC" width="80">5月</th>
+			<th class="taC" width="80">6月</th>
+			<th class="taC" width="80">7月</th>
+			<th class="taC" width="80">8月</th>
+			<th class="taC" width="80">9月</th>
+			<th class="taC" width="80">10月</th>
+			<th class="taC" width="80">11月</th>
+			<th class="taC" width="80">12月</th>
+			<th class="taC">总计</th>
+		</tr>
+		<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr class="warning">
+			<td class="taR"><b>全年费用合计</b></td>
+			<td class="colGreed taR" colspan="13"><b style="font-size: 24px">¥6975</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 109 - 0
protected/cache/myReceipt/past_2014_3.htmls

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="bottom" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<-- 
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+-->
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/saeaCreate" >创建报销单</a></li>
+						
+												<li class="topLine"><a  href="/approval">报销单审批</a></li>
+						<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+											</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="past"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  class="now"  >已支付</a>
+	  					<a href="/myReceipt/withdraw"  >退回</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+	  					<option  value="2015">2015</option>
+	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option value="2">2月</option><option selected value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥0</li>
+	  					<li>同意支付:<span class="colGreen">¥0</span></li>
+	  					<li>审批中:¥0</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 112 - 0
protected/cache/myReceipt/past_2015.htmls

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"  class=news ><a href="/myReceipt" class="icon-  selected " >U</a></li>  
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+									</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine  news "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+												</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="past"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  class="now"  >同意支付</a>
+	  					<a href="/myReceipt/withdraw"  >撤回</a>
+	  					<a href="/myReceipt/withdraw"  >终止</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  selected  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option value="2">2月</option><option value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥93343.00</li>
+	  					<li>同意支付:<span class="colGreen">¥54512.00</span></li>
+	  					<li>审批中:¥38831</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 112 - 0
protected/cache/myReceipt/withdraw_2014.htmls

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"  class=news ><a href="/myReceipt" class="icon-  selected " >U</a></li>  
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+									</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine  news "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+												</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="withdraw"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  >同意支付</a>
+	  					<a href="/myReceipt/whdw"  >撤回</a>
+	  					<a href="/myReceipt/withdraw"  class="now"  >终止</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option value="2">2月</option><option value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥16763.88</li>
+	  					<li>同意支付:<span class="colGreen">¥14463.88</span></li>
+	  					<li>审批中:¥2300</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 109 - 0
protected/cache/myReceipt/withdraw_2014_2.htmls

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="bottom" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<-- 
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+-->
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/saeaCreate" >创建报销单</a></li>
+						
+												<li class="topLine"><a  href="/approval">报销单审批</a></li>
+						<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+											</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="withdraw"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  >已支付</a>
+	  					<a href="/myReceipt/withdraw"  class="now"  >退回</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+	  					<option  value="2015">2015</option>
+	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option selected value="2">2月</option><option value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥0</li>
+	  					<li>同意支付:<span class="colGreen">¥0</span></li>
+	  					<li>审批中:¥0</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 109 - 0
protected/cache/myReceipt/withdraw_2014_3.htmls

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="bottom" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<-- 
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+-->
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/saeaCreate" >创建报销单</a></li>
+						
+												<li class="topLine"><a  href="/approval">报销单审批</a></li>
+						<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+											</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="withdraw"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  >已支付</a>
+	  					<a href="/myReceipt/withdraw"  class="now"  >退回</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+	  					<option  value="2015">2015</option>
+	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option value="2">2月</option><option selected value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥0</li>
+	  					<li>同意支付:<span class="colGreen">¥0</span></li>
+	  					<li>审批中:¥0</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 112 - 0
protected/cache/myReceipt/withdraw_2015.htmls

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"  class=news ><a href="/myReceipt" class="icon-  selected " >U</a></li>  
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+									</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine  news "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+												</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="withdraw"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  >同意支付</a>
+	  					<a href="/myReceipt/whdw"  >撤回</a>
+	  					<a href="/myReceipt/withdraw"  class="now"  >终止</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  selected  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option value="2">2月</option><option value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥93343.00</li>
+	  					<li>同意支付:<span class="colGreen">¥54512.00</span></li>
+	  					<li>审批中:¥38831</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 112 - 0
protected/cache/myReceipt/withdraw_2016_2.htmls

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"  class=news ><a href="/myReceipt" class="icon-  selected " >U</a></li>  
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+									</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  class="selected"  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine  news "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  >公司汇总</a></li>
+												</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>以下是您的报销单</legend>
+				<div class="demandCate">
+				<form action="/myReceipt" id="up" method="post">
+					<input type="hidden" name="item"  value="withdraw"   />
+					
+					<ul class="cateList ">
+	  					<li>
+	  					<a href="/myReceipt/all" >所有</a>
+	  					<a href="/myReceipt/approval"  >审批中</a>
+	  					<a href="/myReceipt/past"  >同意支付</a>
+	  					<a href="/myReceipt/whdw"  >撤回</a>
+	  					<a href="/myReceipt/withdraw"  class="now"  >终止</a>
+	  					</li>
+	  					<li>
+	  					<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  selected  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  					<select name="moth" id="M" onchange="receiptMoth();">
+	  					<option value="">所有月份</option>
+	  					<option value="1">1月</option><option selected value="2">2月</option><option value="3">3月</option><option value="4">4月</option><option value="5">5月</option><option value="6">6月</option><option value="7">7月</option><option value="8">8月</option><option value="9">9月</option><option value="10">10月</option><option value="11">11月</option><option value="12">12月</option>	  					</select>
+	  					</li>
+	  					<li>报销总计:¥0</li>
+	  					<li>同意支付:<span class="colGreen">¥0</span></li>
+	  					<li>审批中:¥-20160630.1</li>
+	  			</ul>
+	  			</form>
+	  		</div>
+	  		<div class="saeaList">
+	  				  			
+			</div>
+		</div>
+	</div>
+	<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+    <div class="modal-header">
+    <h3>添加批注</h3>
+    </div>
+    <div class="modal-body">
+    <form class="">
+	    	<div class="control-group">
+				<div class="controls clearfix">
+					<label>
+	                	批注内容
+	              	</label>
+	              	<textarea rows="8" class="span6"></textarea>
+				</div>
+	    	</div>
+    </form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
+	   	<a href="#" class="button">确定</a>
+	</div>
+</div>
+    <!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 157 - 0
protected/cache/personalCollect/personalCollect_2015.htmls

@@ -0,0 +1,157 @@
+
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="/" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+
+<li data-placement="right" class="topLine" data-toggle="ctooltip" data-original-title="报销单" ><a href="/saeaBorad" class="icon-  selected " >U</a></li>  
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+					</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+<li class="saeaTitle">费用管理</li>
+						<li><a   href="/saeaBorad" >公布板</a></li>
+						<li><a  href="/expenses">我的费用</a></li>
+						<li><a href="/personalCollect"  class="selected"  >费用汇总</a></li>
+						
+												
+						
+						
+						
+	
+				
+				
+				
+				
+						
+				
+				
+				
+				
+				
+				</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fR"></div>
+以下是您的个人报销单汇总</legend>
+<div class="demandCate">
+<form action="/personalCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/personalCollect" class="now">汇总</a><a
+		href="/personalCollectDetail">细则</a></li>
+	<li>		
+	<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  selected  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>
+<option  value="2017">2018</option>	  					</select>
+	</li>
+	<li>报销总计:¥0</li>
+	<li>同意支付:<span class="colGreen">¥0</span></li>
+	<li>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+		<tr>
+			<th width="110" class="taC"></th>
+			<th class="taC" width="80">1</th>
+			<th class="taC" width="80">2</th>
+			<th class="taC" width="80">3</th>
+			<th class="taC" width="80">4</th>
+			<th class="taC" width="80">5</th>
+			<th class="taC" width="80">6</th>
+			<th class="taC" width="80">7</th>
+			<th class="taC" width="80">8</th>
+			<th class="taC" width="80">9</th>
+			<th class="taC" width="80">10</th>
+			<th class="taC" width="80">11</th>
+			<th class="taC" width="80">12</th>
+			<th class="taC" width="110">总计</th>
+		</tr>
+		<tr>
+			<th>日常相关费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>差旅相关费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>培训班费用</th>
+				<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>其他</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>报销金额调整</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr class="warning">
+			<td class="taR"><b>全年费用合计</b></td>
+			<td class="colGreed taR" colspan="13"><b style="font-size: 24px">¥0</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 157 - 0
protected/cache/personalCollect/personalCollect_2016.htmls

@@ -0,0 +1,157 @@
+
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+ <script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="/" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
+<a href="/keyonline" class="icon- ">C</a></li>
+
+<li class="hide"><a href="#">E</a></li>
+<li class="hide"><a href="#">D</a></li> 
+
+<li data-placement="right" class="topLine" data-toggle="ctooltip" data-original-title="报销单" ><a href="/saeaBorad" class="icon-  selected " >U</a></li>  
+ <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+					</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+<li class="saeaTitle">费用管理</li>
+						<li><a   href="/saeaBorad" >公布板</a></li>
+						<li><a  href="/expenses">我的费用</a></li>
+						<li><a href="/personalCollect"  class="selected"  >费用汇总</a></li>
+						
+												
+						
+						
+						
+	
+				
+				
+				
+				
+						
+				
+				
+				
+				
+				
+				</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fR"></div>
+以下是您的个人报销单汇总</legend>
+<div class="demandCate">
+<form action="/personalCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/personalCollect" class="now">汇总</a><a
+		href="/personalCollectDetail">细则</a></li>
+	<li>		
+	<select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  selected  value="2016">2016</option>
+<option  value="2017">2017</option>
+<option  value="2017">2018</option>	  					</select>
+	</li>
+	<li>报销总计:¥0</li>
+	<li>同意支付:<span class="colGreen">¥0</span></li>
+	<li>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+		<tr>
+			<th width="110" class="taC"></th>
+			<th class="taC" width="80">1</th>
+			<th class="taC" width="80">2</th>
+			<th class="taC" width="80">3</th>
+			<th class="taC" width="80">4</th>
+			<th class="taC" width="80">5</th>
+			<th class="taC" width="80">6</th>
+			<th class="taC" width="80">7</th>
+			<th class="taC" width="80">8</th>
+			<th class="taC" width="80">9</th>
+			<th class="taC" width="80">10</th>
+			<th class="taC" width="80">11</th>
+			<th class="taC" width="80">12</th>
+			<th class="taC" width="110">总计</th>
+		</tr>
+		<tr>
+			<th>日常相关费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>差旅相关费用</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>培训班费用</th>
+				<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>其他</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th>报销金额调整</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr>
+			<th class="taR">合计</th>
+			<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥0</td>		</tr>
+		<tr class="warning">
+			<td class="taR"><b>全年费用合计</b></td>
+			<td class="colGreed taR" colspan="13"><b style="font-size: 24px">¥0</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 572 - 0
protected/cache/staffCollect/staffCollect_2014_1.htmls

@@ -0,0 +1,572 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="#" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="bottom" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<-- 
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+-->
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/saeaCreate" >创建报销单</a></li>
+						
+												<li class="topLine"><a  href="/approval">报销单审批</a></li>
+						<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+											</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fL"></div>
+员工每月报销单汇总</legend>
+<div class="demandCate">
+<form action="/staffCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect">按办事处</a><a href="#"
+		class="now">按员工</a></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  <select name="month" id="M" onchange="receiptYear();">
+		<option selected value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>	</select></li>
+
+	<li><b>1月</b>报销总计:¥0</li>
+	<li><b>1月</b>同意支付:<span class="colGreen">¥0</span></li>
+	<li><b>1月</b>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+				<tr>
+			<th class="taC" width="110">安徽办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈帅">陈帅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/范月光">范月光</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/林森">林森</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/xmlwww">xmlwww</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">甘肃办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王涛">王涛</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/苟彦刚">苟彦刚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/舒媚">舒媚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李满花">李满花</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广东办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘飞">刘飞</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王洪生">王洪生</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/姜栋">姜栋</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘庆">刘庆</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/封冬梅">封冬梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广西办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄巾桃">黄巾桃</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈叶婷">陈叶婷</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">江西办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/祝海宾">祝海宾</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王文鹏">王文鹏</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡晚君">蔡晚君</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">四川办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗杰">罗杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/全冰">全冰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/汪琴">汪琴</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">重庆办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王星植">王星植</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张文远">张文远</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/方淑静">方淑静</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李清学">李清学</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/周洪波">周洪波</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">内蒙办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗发明">罗发明</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/孙燕娇">孙燕娇</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张晓娟">张晓娟</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨卫东">杨卫东</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">浙江办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">山东办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">总部</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/谭玉堂">谭玉堂</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/何银龄">何银龄</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张引">张引</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨福芳">杨福芳</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/赵淑燕">赵淑燕</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈世龙">陈世龙</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/冷淑梅">冷淑梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/麦心蓉">麦心蓉</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈特">陈特</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/任杰">任杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡频">蔡频</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王晶">王晶</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张少珊">张少珊</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄爱玲">黄爱玲</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/欧汝">欧汝</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/付青青">付青青</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王丰">王丰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">云南办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">贵州办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						
+		<tr class="warning">
+			<td class="taR"><b>2014年1月费用合计</b></td>
+			<td class="colGreed taR" colspan="11"><b style="font-size: 24px">¥0</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 574 - 0
protected/cache/staffCollect/staffCollect_2014_2.htmls

@@ -0,0 +1,574 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="#" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine"><a  href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+												</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fL"></div>
+员工每月报销单汇总</legend>
+<div class="demandCate">
+<form action="/staffCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect">按办事处</a><a href="#"
+		class="now">按员工</a></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  <select name="month" id="M" onchange="receiptYear();">
+		<option value="1">1</option><option selected value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>	</select></li>
+
+	<li><b>2月</b>报销总计:¥0</li>
+	<li><b>2月</b>同意支付:<span class="colGreen">¥0</span></li>
+	<li><b>2月</b>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+				<tr>
+			<th class="taC" width="110">安徽办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈帅">陈帅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/范月光">范月光</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/林森">林森</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/xmlwww">xmlwww</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">甘肃办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王涛">王涛</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/苟彦刚">苟彦刚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/舒媚">舒媚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李满花">李满花</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广东办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘飞">刘飞</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王洪生">王洪生</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/姜栋">姜栋</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘庆">刘庆</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/封冬梅">封冬梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广西办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄巾桃">黄巾桃</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈叶婷">陈叶婷</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">江西办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/祝海宾">祝海宾</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王文鹏">王文鹏</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡晚君">蔡晚君</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">四川办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗杰">罗杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/全冰">全冰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/汪琴">汪琴</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">重庆办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王星植">王星植</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张文远">张文远</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/方淑静">方淑静</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李清学">李清学</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/周洪波">周洪波</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">内蒙办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗发明">罗发明</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/孙燕娇">孙燕娇</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张晓娟">张晓娟</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨卫东">杨卫东</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">浙江办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">山东办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">总部</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/谭玉堂">谭玉堂</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/何银龄">何银龄</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张引">张引</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨福芳">杨福芳</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/赵淑燕">赵淑燕</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈世龙">陈世龙</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/冷淑梅">冷淑梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/麦心蓉">麦心蓉</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈特">陈特</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/任杰">任杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡频">蔡频</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王晶">王晶</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张少珊">张少珊</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄爱玲">黄爱玲</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/欧汝">欧汝</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/付青青">付青青</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王丰">王丰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">云南办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">贵州办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						
+		<tr class="warning">
+			<td class="taR"><b>2014年2月费用合计</b></td>
+			<td class="colGreed taR" colspan="11"><b style="font-size: 24px">¥0</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 574 - 0
protected/cache/staffCollect/staffCollect_2014_3.htmls

@@ -0,0 +1,574 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="#" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine"><a  href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+												</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fL"></div>
+员工每月报销单汇总</legend>
+<div class="demandCate">
+<form action="/staffCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect">按办事处</a><a href="#"
+		class="now">按员工</a></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  <select name="month" id="M" onchange="receiptYear();">
+		<option value="1">1</option><option value="2">2</option><option selected value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>	</select></li>
+
+	<li><b>3月</b>报销总计:¥0</li>
+	<li><b>3月</b>同意支付:<span class="colGreen">¥0</span></li>
+	<li><b>3月</b>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+				<tr>
+			<th class="taC" width="110">安徽办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈帅">陈帅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/范月光">范月光</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/林森">林森</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/xmlwww">xmlwww</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">甘肃办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王涛">王涛</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/苟彦刚">苟彦刚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/舒媚">舒媚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李满花">李满花</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广东办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘飞">刘飞</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王洪生">王洪生</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/姜栋">姜栋</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘庆">刘庆</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/封冬梅">封冬梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广西办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄巾桃">黄巾桃</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈叶婷">陈叶婷</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">江西办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/祝海宾">祝海宾</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王文鹏">王文鹏</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡晚君">蔡晚君</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">四川办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗杰">罗杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/全冰">全冰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/汪琴">汪琴</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">重庆办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王星植">王星植</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张文远">张文远</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/方淑静">方淑静</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李清学">李清学</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/周洪波">周洪波</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">内蒙办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗发明">罗发明</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/孙燕娇">孙燕娇</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张晓娟">张晓娟</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨卫东">杨卫东</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">浙江办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">山东办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">总部</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/谭玉堂">谭玉堂</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/何银龄">何银龄</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张引">张引</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨福芳">杨福芳</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/赵淑燕">赵淑燕</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈世龙">陈世龙</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/冷淑梅">冷淑梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/麦心蓉">麦心蓉</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈特">陈特</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/任杰">任杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡频">蔡频</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王晶">王晶</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张少珊">张少珊</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄爱玲">黄爱玲</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/欧汝">欧汝</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/付青青">付青青</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王丰">王丰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">云南办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">贵州办</th>
+			<th class="taC" width="110">日常相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						
+		<tr class="warning">
+			<td class="taR"><b>2014年3月费用合计</b></td>
+			<td class="colGreed taR" colspan="11"><b style="font-size: 24px">¥0</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 572 - 0
protected/cache/staffCollect/staffCollect_2014_4.htmls

@@ -0,0 +1,572 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+<div class="mainLayout">
+<div class="mainMenu">
+<div class="menuItem"><a href="#" class="mLogo">CLD</a>
+<ul>
+	<li data-placement="bottom" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<-- 
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="报销单"><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+-->
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="bottom" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+</ul>
+</div>
+</div>
+<div class="warpContent">
+<div class="subMenu fL">
+<div class="menuItem">
+<ul>
+	<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/saeaCreate" >创建报销单</a></li>
+						
+												<li class="topLine"><a  href="/approval">报销单审批</a></li>
+						<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+											</ul></ul>
+</div>
+</div>
+<div class="adminContent autoHeight" style="height: 821px;"><legend>
+<div class="fL"></div>
+员工每月报销单汇总</legend>
+<div class="demandCate">
+<form action="/staffCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect">按办事处</a><a href="#"
+		class="now">按员工</a></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+	  					<option  selected  value="2014"  >2014</option>
+<option  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  <select name="month" id="M" onchange="receiptYear();">
+		<option value="1">1</option><option value="2">2</option><option value="3">3</option><option selected value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>	</select></li>
+
+	<li><b>4月</b>报销总计:¥745.88</li>
+	<li><b>4月</b>同意支付:<span class="colGreen">¥745.88</span></li>
+	<li><b>4月</b>审批中:¥0</li>
+</ul>
+</form>
+</div>
+<div class="saeaList">
+<div class="entry">
+<table class="table table-bordered table-condensed table-hover">
+	<tbody>
+				<tr>
+			<th class="taC" width="110">安徽办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈帅">陈帅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/范月光">范月光</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/林森">林森</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/xmlwww">xmlwww</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">甘肃办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王涛">王涛</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/苟彦刚">苟彦刚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/舒媚">舒媚</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李满花">李满花</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广东办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘飞">刘飞</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王洪生">王洪生</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/姜栋">姜栋</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/刘庆">刘庆</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/封冬梅">封冬梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">广西办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄巾桃">黄巾桃</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈叶婷">陈叶婷</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">江西办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/祝海宾">祝海宾</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王文鹏">王文鹏</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡晚君">蔡晚君</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">四川办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗杰">罗杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/全冰">全冰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/汪琴">汪琴</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">重庆办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王星植">王星植</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张文远">张文远</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/方淑静">方淑静</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/李清学">李清学</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/周洪波">周洪波</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">内蒙办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/罗发明">罗发明</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/孙燕娇">孙燕娇</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张晓娟">张晓娟</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨卫东">杨卫东</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">浙江办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">山东办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">总部</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/谭玉堂">谭玉堂</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/何银龄">何银龄</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张引">张引</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/杨福芳">杨福芳</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/赵淑燕">赵淑燕</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈世龙">陈世龙</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/冷淑梅">冷淑梅</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/麦心蓉">麦心蓉</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/陈特">陈特</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/任杰">任杰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/蔡频">蔡频</a>
+				</th>
+						<td class="taR">¥378.48</td><td class="taR">¥56.20</td><td class="taR">¥300.00</td><td class="taR">¥21.20</td><td class="taR">¥-10.00</td><td class="colGreen taR">¥745.88</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王晶">王晶</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/张少珊">张少珊</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/黄爱玲">黄爱玲</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/欧汝">欧汝</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/付青青">付青青</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+							<th>
+					<a href="/staffCollectDetail/王丰">王丰</a>
+				</th>
+						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">¥378.48</td><td class="colGreen taR">¥56.20</td><td class="colGreen taR">¥300.00</td><td class="colGreen taR">¥21.20</td><td class="colGreen taR">¥-10.00</td><td class="colGreen taR">¥745.88</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">云南办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						<tr>
+			<th class="taC" width="110">贵州办</th>
+			<th class="taC" width="110">办事处相关费用</th>
+			<th class="taC" width="110">差旅相关费用</th>
+			<th class="taC" width="110">培训班费用</th>
+			<th class="taC" width="110">其他</th>
+			<th class="taC" width="110">报销金额调整</th>
+			<th class="taC" width="110">合计</th>
+		</tr>
+					<tr >
+						<th class="taR">
+				合计			</th>
+						<td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">-</td><td class="colGreen taR">¥0</td>			</tr>
+			
+						
+		<tr class="warning">
+			<td class="taR"><b>2014年4月费用合计</b></td>
+			<td class="colGreed taR" colspan="11"><b style="font-size: 24px">¥745.88</b></td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+</div>
+<!--弹出-->
+<div class="modal hide fade" id="addCallout">
+<div class="modal-header">
+<h3>添加批注</h3>
+</div>
+<div class="modal-body">
+<form class="">
+<div class="control-group">
+<div class="controls clearfix"><label> 批注内容 </label> <textarea
+	rows="8" class="span6"></textarea></div>
+</div>
+</form>
+</div>
+<div class="modal-footer"><a href="#" class="button btn-gray"
+	data-dismiss="modal" aria-hidden="true">取消</a> <a href="#"
+	class="button">确定</a></div>
+</div>
+<!--弹出内容--> <script type="text/javascript">
+	autoFlashHeight();
+</script>
+</body>

+ 238 - 0
protected/cache/staffCollect/staffCollect_2015_.htmls

@@ -0,0 +1,238 @@
+<!DOCTYPE html>
+<html lang=zh-cn> 
+<head>
+	<meta charset=utf-8> 
+	<title>CLD.System</title> 
+	<meta name=description content=电子版晴雨表,在线晴雨表,网页晴雨表> 
+	<link rel="shortcut icon" href="images/favicon.ico"> 
+	<meta name=copyright content=smartcost.com.cn> 
+	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
+	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/global.js"></script>
+</head>
+<script src="http://cld.com/global/js/receipt.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon- " >B</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon-">A</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库"><a href="/keyonline" class="icon- ">C</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
+<a href="/app" class="icon- ">Y</a></li>
+<li class="hide"><a href="#" class="icon-">E</a></li>
+<li class="hide"><a href="#" class="icon-">D</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">
+<a href="/eMailTask" class="icon- ">Z</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="报销单"    ><a href="/myReceipt" class="icon-  selected ">U</a></li> 
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminlock" class="icon- ">F</a></li>
+<li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
+
+
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<ul>
+						<li class="saeaTitle">报销单</li>
+						<li><a  href="/myReceipt">我的报销单</a></li>
+						<li><a href="/personalCollect" >个人汇总</a></li>
+						<li><a href="/referReceipt" >创建报销单</a></li>
+						
+								
+				<li class="topLine "><a   href="/approval">报销单审批</a></li>
+								<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>
+												</ul>					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fL"></div>员工 全年报销单汇总</legend>
+				<div class="demandCate">
+					<form action="/staffCollect" id="up" method="post">
+<ul class="cateList">
+	<li><a href="/companyCategoryCollect">按办事处</a><a href="/staffCollect"
+		class="now">按员工</a></li>
+	<li><select name="year" id="Y" onchange="receiptYear();">
+	  					<option  value="2014"  >2014</option>
+<option  selected  value="2015">2015</option>
+<option  value="2016">2016</option>
+<option  value="2017">2017</option>	  					</select> 
+	  </li>
+
+	<li>报销总计:¥52600.00</li>
+	<li>同意支付:<span class="colGreen">¥50000.00</span></li>
+	<li>审批中:¥2600</li>
+</ul>
+</form>
+	  		</div>
+	  		<div class="saeaList">
+	  			<div class="entry">	  			    
+	  				<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  						<tr>
+	  						<th  class="taC"></th>
+	  						<th width="110" class="taC">员工/月</th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/1">1月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/2">2月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/3">3月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/4">4月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/5">5月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/6">6月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/7">7月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/8">8月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/9">9月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/10">10月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/11">11月</a></th>
+	  						<th class="taC" width="80"><a href="/staffCollectMonthDetail/2015/12">12月</a></th>
+	  						<th class="taC" width="110">总计</th>
+	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="5">安徽办</th><td><a href="/staffCollectDetail/陈帅">陈帅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/范月光">范月光</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/林森">林森</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/xmlwww">xmlwww</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="5">甘肃办</th><td><a href="/staffCollectDetail/王涛">王涛</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/苟彦刚">苟彦刚</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/舒媚">舒媚</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/李满花">李满花</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="6">广东办</th><td><a href="/staffCollectDetail/刘飞">刘飞</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/王洪生">王洪生</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/姜栋">姜栋</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/刘庆">刘庆</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/封冬梅">封冬梅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="3">广西办</th><td><a href="/staffCollectDetail/黄巾桃">黄巾桃</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/陈叶婷">陈叶婷</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="4">江西办</th><td><a href="/staffCollectDetail/祝海宾">祝海宾</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/王文鹏">王文鹏</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/蔡晚君">蔡晚君</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="4">四川办</th><td><a href="/staffCollectDetail/罗杰">罗杰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/全冰">全冰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/汪琴">汪琴</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="6">重庆办</th><td><a href="/staffCollectDetail/王星植">王星植</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/张文远">张文远</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/方淑静">方淑静</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/李清学">李清学</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/周洪波">周洪波</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="5">内蒙办</th><td><a href="/staffCollectDetail/罗发明">罗发明</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/孙燕娇">孙燕娇</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/张晓娟">张晓娟</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/杨卫东">杨卫东</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
+	  							  						<tr>
+	  						<th rowspan="18">总部</th><td><a href="/staffCollectDetail/谭玉堂">谭玉堂</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/何银龄">何银龄</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/张引">张引</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/杨福芳">杨福芳</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/赵淑燕">赵淑燕</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/陈世龙">陈世龙</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/冷淑梅">冷淑梅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/麦心蓉">麦心蓉</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/陈特">陈特</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/任杰">任杰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/蔡频">蔡频</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥50000.00</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥50000</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/王晶">王晶</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/张少珊">张少珊</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/黄爱玲">黄爱玲</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/欧汝">欧汝</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/付青青">付青青</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/王丰">王丰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥50000</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
+				<td class="taR">¥0</td><td class="taR">¥50000</td>	  						</tr>
+	  							  						
+	  						<tr><th></th>
+	  						<td class="taR">合计</td>
+	  						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">¥50000</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen">¥50000</td>							</tr>
+	  						<tr class="warning"><th></th><td class="taR"><b>全年费用合计</b></td><td colspan="13" class="colGreed taR"><b style="font-size:24px">¥50000</b></td></tr>
+	  						</tbody>
+	  					</table>
+	  			</div>
+			</div>
+		</div>
+	</div>
+	
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 271 - 0
protected/class/Excel/oleread.php

@@ -0,0 +1,271 @@
+<?php
+define('NUM_BIG_BLOCK_DEPOT_BLOCKS_POS', 0x2c);
+define('SMALL_BLOCK_DEPOT_BLOCK_POS', 0x3c);
+define('ROOT_START_BLOCK_POS', 0x30);
+define('BIG_BLOCK_SIZE', 0x200);
+define('SMALL_BLOCK_SIZE', 0x40);
+define('EXTENSION_BLOCK_POS', 0x44);
+define('NUM_EXTENSION_BLOCK_POS', 0x48);
+define('PROPERTY_STORAGE_BLOCK_SIZE', 0x80);
+define('BIG_BLOCK_DEPOT_BLOCKS_POS', 0x4c);
+define('SMALL_BLOCK_THRESHOLD', 0x1000);
+// property storage offsets
+define('SIZE_OF_NAME_POS', 0x40);
+define('TYPE_POS', 0x42);
+define('START_BLOCK_POS', 0x74);
+define('SIZE_POS', 0x78);
+define('IDENTIFIER_OLE', pack("CCCCCCCC",0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1));
+
+//echo 'ROOT_START_BLOCK_POS = '.ROOT_START_BLOCK_POS."\n";
+
+//echo bin2hex($data[ROOT_START_BLOCK_POS])."\n";
+//echo "a=";
+//echo $data[ROOT_START_BLOCK_POS];
+//function log
+
+function GetInt4d($data, $pos)
+{
+	$value = ord($data[$pos]) | (ord($data[$pos+1])	<< 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24);
+	if ($value>=4294967294)
+	{
+		$value=-2;
+	}
+	return $value;
+}
+
+
+class OLERead {
+    var $data = '';
+    
+    
+    function OLERead(){
+        
+        
+    }
+    
+    function read($sFileName){
+        
+    	// check if file exist and is readable (Darko Miljanovic)
+    	if(!is_readable($sFileName)) {
+    		$this->error = 1;
+    		return false;
+    	}
+    	
+    	$this->data = @file_get_contents($sFileName);
+    	if (!$this->data) { 
+    		$this->error = 1; 
+    		return false; 
+   		}
+   		//echo IDENTIFIER_OLE;
+   		//echo 'start';
+   		if (substr($this->data, 0, 8) != IDENTIFIER_OLE) {
+    		$this->error = 1; 
+    		return false; 
+   		}
+        $this->numBigBlockDepotBlocks = GetInt4d($this->data, NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);
+        $this->sbdStartBlock = GetInt4d($this->data, SMALL_BLOCK_DEPOT_BLOCK_POS);
+        $this->rootStartBlock = GetInt4d($this->data, ROOT_START_BLOCK_POS);
+        $this->extensionBlock = GetInt4d($this->data, EXTENSION_BLOCK_POS);
+        $this->numExtensionBlocks = GetInt4d($this->data, NUM_EXTENSION_BLOCK_POS);
+        
+	/*
+        echo $this->numBigBlockDepotBlocks." ";
+        echo $this->sbdStartBlock." ";
+        echo $this->rootStartBlock." ";
+        echo $this->extensionBlock." ";
+        echo $this->numExtensionBlocks." ";
+        */
+        //echo "sbdStartBlock = $this->sbdStartBlock\n";
+        $bigBlockDepotBlocks = array();
+        $pos = BIG_BLOCK_DEPOT_BLOCKS_POS;
+       // echo "pos = $pos";
+	$bbdBlocks = $this->numBigBlockDepotBlocks;
+        
+            if ($this->numExtensionBlocks != 0) {
+                $bbdBlocks = (BIG_BLOCK_SIZE - BIG_BLOCK_DEPOT_BLOCKS_POS)/4; 
+            }
+        
+        for ($i = 0; $i < $bbdBlocks; $i++) {
+              $bigBlockDepotBlocks[$i] = GetInt4d($this->data, $pos);
+              $pos += 4;
+        }
+        
+        
+        for ($j = 0; $j < $this->numExtensionBlocks; $j++) {
+            $pos = ($this->extensionBlock + 1) * BIG_BLOCK_SIZE;
+            $blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, BIG_BLOCK_SIZE / 4 - 1);
+
+            for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; $i++) {
+                $bigBlockDepotBlocks[$i] = GetInt4d($this->data, $pos);
+                $pos += 4;
+            }   
+
+            $bbdBlocks += $blocksToRead;
+            if ($bbdBlocks < $this->numBigBlockDepotBlocks) {
+                $this->extensionBlock = GetInt4d($this->data, $pos);
+            }
+        }
+
+       // var_dump($bigBlockDepotBlocks);
+        
+        // readBigBlockDepot
+        $pos = 0;
+        $index = 0;
+        $this->bigBlockChain = array();
+        
+        for ($i = 0; $i < $this->numBigBlockDepotBlocks; $i++) {
+            $pos = ($bigBlockDepotBlocks[$i] + 1) * BIG_BLOCK_SIZE;
+            //echo "pos = $pos";	
+            for ($j = 0 ; $j < BIG_BLOCK_SIZE / 4; $j++) {
+                $this->bigBlockChain[$index] = GetInt4d($this->data, $pos);
+                $pos += 4 ;
+                $index++;
+            }
+        }
+
+	//var_dump($this->bigBlockChain);
+        //echo '=====2';
+        // readSmallBlockDepot();
+        $pos = 0;
+	    $index = 0;
+	    $sbdBlock = $this->sbdStartBlock;
+	    $this->smallBlockChain = array();
+	
+	    while ($sbdBlock != -2) {
+	
+	      $pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
+	
+	      for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
+	        $this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
+	        $pos += 4;
+	        $index++;
+	      }
+	
+	      $sbdBlock = $this->bigBlockChain[$sbdBlock];
+	    }
+
+        
+        // readData(rootStartBlock)
+        $block = $this->rootStartBlock;
+        $pos = 0;
+        $this->entry = $this->__readData($block);
+        
+        /*
+        while ($block != -2)  {
+            $pos = ($block + 1) * BIG_BLOCK_SIZE;
+            $this->entry = $this->entry.substr($this->data, $pos, BIG_BLOCK_SIZE);
+            $block = $this->bigBlockChain[$block];
+        }
+        */
+        //echo '==='.$this->entry."===";
+        $this->__readPropertySets();
+
+    }
+    
+     function __readData($bl) {
+        $block = $bl;
+        $pos = 0;
+        $data = '';
+        
+        while ($block != -2)  {
+            $pos = ($block + 1) * BIG_BLOCK_SIZE;
+            $data = $data.substr($this->data, $pos, BIG_BLOCK_SIZE);
+            //echo "pos = $pos data=$data\n";	
+	    $block = $this->bigBlockChain[$block];
+        }
+		return $data;
+     }
+        
+    function __readPropertySets(){
+        $offset = 0;
+        //var_dump($this->entry);
+        while ($offset < strlen($this->entry)) {
+              $d = substr($this->entry, $offset, PROPERTY_STORAGE_BLOCK_SIZE);
+            
+              $nameSize = ord($d[SIZE_OF_NAME_POS]) | (ord($d[SIZE_OF_NAME_POS+1]) << 8);
+              
+              $type = ord($d[TYPE_POS]);
+              //$maxBlock = strlen($d) / BIG_BLOCK_SIZE - 1;
+        
+              $startBlock = GetInt4d($d, START_BLOCK_POS);
+              $size = GetInt4d($d, SIZE_POS);
+        
+            $name = '';
+            for ($i = 0; $i < $nameSize ; $i++) {
+              $name .= $d[$i];
+            }
+            
+            $name = str_replace("\x00", "", $name);
+            
+            $this->props[] = array (
+                'name' => $name, 
+                'type' => $type,
+                'startBlock' => $startBlock,
+                'size' => $size);
+
+            if (($name == "Workbook") || ($name == "Book")) {
+                $this->wrkbook = count($this->props) - 1;
+            }
+
+            if ($name == "Root Entry") {
+                $this->rootentry = count($this->props) - 1;
+            }
+            
+            //echo "name ==$name=\n";
+
+            
+            $offset += PROPERTY_STORAGE_BLOCK_SIZE;
+        }   
+        
+    }
+    
+    
+    function getWorkBook(){
+    	if ($this->props[$this->wrkbook]['size'] < SMALL_BLOCK_THRESHOLD){
+//    	  getSmallBlockStream(PropertyStorage ps)
+
+			$rootdata = $this->__readData($this->props[$this->rootentry]['startBlock']);
+	        
+			$streamData = '';
+	        $block = $this->props[$this->wrkbook]['startBlock'];
+	        //$count = 0;
+	        $pos = 0;
+		    while ($block != -2) {
+      	          $pos = $block * SMALL_BLOCK_SIZE;
+		          $streamData .= substr($rootdata, $pos, SMALL_BLOCK_SIZE);
+
+			      $block = $this->smallBlockChain[$block];
+		    }
+			
+		    return $streamData;
+    		
+
+    	}else{
+    	
+	        $numBlocks = $this->props[$this->wrkbook]['size'] / BIG_BLOCK_SIZE;
+	        if ($this->props[$this->wrkbook]['size'] % BIG_BLOCK_SIZE != 0) {
+	            $numBlocks++;
+	        }
+	        
+	        if ($numBlocks == 0) return '';
+	        
+	        //echo "numBlocks = $numBlocks\n";
+	    //byte[] streamData = new byte[numBlocks * BIG_BLOCK_SIZE];
+	        //print_r($this->wrkbook);
+	        $streamData = '';
+	        $block = $this->props[$this->wrkbook]['startBlock'];
+	        //$count = 0;
+	        $pos = 0;
+	        //echo "block = $block";
+	        while ($block != -2) {
+	          $pos = ($block + 1) * BIG_BLOCK_SIZE;
+	          $streamData .= substr($this->data, $pos, BIG_BLOCK_SIZE);
+	          $block = $this->bigBlockChain[$block];
+	        }   
+	        //echo 'stream'.$streamData;
+	        return $streamData;
+    	}
+    }
+    
+}
+?>

File diff suppressed because it is too large
+ 1084 - 0
protected/class/Excel/reader.php


+ 39 - 0
protected/class/MobileApi/Service.php

@@ -0,0 +1,39 @@
+<?php
+/*
+ * 生成WSDL文件
+ */
+Doo::loadClass ( "MobileApi/nusoap" );
+
+$server = new soap_server ();
+$server->configureWSDL ( 'CLDwsdl', 'urn:CLDwsdl' );
+
+$server->register ( 'register', // method name  
+array ('username' => 'xsd:string', 'game_id' => 'xsd:int', 'fromurl' => 'xsd:string', 'advertiser' => 'xsd:string', 'adFrom' => 'xsd:string', 'adType' => 'xsd:string', 'pageName' => 'xsd:string', 'wordid' => 'xsd:string', 'ip' => 'xsd:string', 'registertime' => 'xsd:time' ), // input parameters  
+array ('return' => 'xsd:array' ), // output parameters  
+'urn:registerwsdl', // namespace  
+'urn:registerwsdl#register', // soapaction  
+'rpc', // style  
+'encoded' );// use;
+
+$server->register ( 'login',
+array ('user' => 'xsd:string', 'pw' => 'xsd:string'),
+array ('return' => 'xsd:array' ), 
+'urn:loginwsdl', 
+'urn:loginwsdl#login',
+'rpc',
+'encoded' );
+
+//function login($user, $pw) {
+//	return array('status'=>1,'msg'=>'登陆成功','userList'=>array());
+//}
+
+function register($username, $game_id, $fromurl, $advertiser, $adFrom, $adType, $pageName, $wordid, $ip, $registertime) {
+	$param = array ('tg_account' => $username, 'tg_gameID' => $game_id, 'tg_advertiser' => $advertiser, 'tg_adFrom' => $adFrom, 'tg_pageParam' => $fromurl, 'tg_adType' => $adType, 
+	'tg_adsID' => $wordid, 'tg_ip' => $ip, 'tg_registerTime' => $registertime );
+	return $param;
+}
+// Use the request to (try to) invoke the service  
+$HTTP_RAW_POST_DATA = isset ( $HTTP_RAW_POST_DATA ) ? $HTTP_RAW_POST_DATA : '';
+$server->service ( $HTTP_RAW_POST_DATA );
+
+?>

File diff suppressed because it is too large
+ 126 - 0
protected/class/MobileApi/SoapDiscovery.class.php


+ 42 - 0
protected/class/MobileApi/creatWsdl.wsdl

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:registerwsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:registerwsdl">
+<types>
+<xsd:schema targetNamespace="urn:registerwsdl"
+>
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+</xsd:schema>
+</types>
+<message name="registerRequest">
+  <part name="username" type="xsd:string" />
+  <part name="game_id" type="xsd:int" />
+  <part name="fromurl" type="xsd:string" />
+  <part name="advertiser" type="xsd:string" />
+  <part name="adFrom" type="xsd:string" />
+  <part name="adType" type="xsd:string" />
+  <part name="pageName" type="xsd:string" />
+  <part name="wordid" type="xsd:string" />
+  <part name="ip" type="xsd:string" />
+  <part name="registertime" type="xsd:time" /></message>
+<message name="registerResponse">
+  <part name="return" type="xsd:array" /></message>
+<portType name="registerwsdlPortType">
+  <operation name="register">
+    <input message="tns:registerRequest"/>
+    <output message="tns:registerResponse"/>
+  </operation>
+</portType>
+<binding name="registerwsdlBinding" type="tns:registerwsdlPortType">
+  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+  <operation name="register">
+    <soap:operation soapAction="urn:registerwsdl#register" style="rpc"/>
+    <input><soap:body use="encoded" namespace="urn:registerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
+    <output><soap:body use="encoded" namespace="urn:registerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
+  </operation>
+</binding>
+<service name="registerwsdl">
+  <port name="registerwsdlPort" binding="tns:registerwsdlBinding">
+    <soap:address location="http://cld.com/index.php//api/creatWsdl"/>
+  </port>
+</service>
+</definitions>

+ 61 - 0
protected/class/MobileApi/interfaceDetail.wsdl

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:CLDwsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:CLDwsdl">
+<types>
+<xsd:schema targetNamespace="urn:CLDwsdl"
+>
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ <xsd:complexType name="userInfo">
+ 	<xsd:sequence>
+ 		<xsd:element name="userId" type="xsd:string"></xsd:element>
+ 	</xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
+</types>
+<message name="registerRequest">
+  <part name="username" type="tns:userInfo" />
+  <part name="game_id" type="xsd:int" />
+  <part name="fromurl" type="xsd:string" />
+  <part name="advertiser" type="xsd:string" />
+  <part name="adFrom" type="xsd:string" />
+  <part name="adType" type="xsd:string" />
+  <part name="pageName" type="xsd:string" />
+  <part name="wordid" type="xsd:string" />
+  <part name="ip" type="xsd:string" />
+  <part name="registertime" type="xsd:time" /></message>
+<message name="registerResponse">
+  <part name="return" type="xsd:array" /></message>
+<message name="loginRequest">
+  <part name="user" type="xsd:string" />
+  <part name="pw" type="xsd:string" /></message>
+<message name="loginResponse">
+  <part name="return" type="xsd:array" /></message>
+<portType name="CLDwsdlPortType">
+  <operation name="register">
+    <input message="tns:registerRequest"/>
+    <output message="tns:registerResponse"/>
+  </operation>
+  <operation name="login">
+    <input message="tns:loginRequest"/>
+    <output message="tns:loginResponse"/>
+  </operation>
+</portType>
+<binding name="CLDwsdlBinding" type="tns:CLDwsdlPortType">
+  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+  <operation name="register">
+    <soap:operation soapAction="urn:registerwsdl#register" style="rpc"/>
+    <input><soap:body use="encoded" namespace="urn:registerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
+    <output><soap:body use="encoded" namespace="urn:registerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
+  </operation>
+  <operation name="login">
+    <soap:operation soapAction="urn:loginwsdl#login" style="rpc"/>
+    <input><soap:body use="encoded" namespace="urn:loginwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
+    <output><soap:body use="encoded" namespace="urn:loginwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
+  </operation>
+</binding>
+<service name="CLDwsdl">
+  <port name="CLDwsdlPort" binding="tns:CLDwsdlBinding">
+    <soap:address location="http://cld.com/index.php/api/interfaceDetail"/>
+  </port>
+</service>
+</definitions>

File diff suppressed because it is too large
+ 8148 - 0
protected/class/MobileApi/nusoap.php


+ 796 - 0
protected/class/PHPExcel.php

@@ -0,0 +1,796 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel
+{
+	/**
+	 * Document properties
+	 *
+	 * @var PHPExcel_DocumentProperties
+	 */
+	private $_properties;
+
+	/**
+	 * Document security
+	 *
+	 * @var PHPExcel_DocumentSecurity
+	 */
+	private $_security;
+
+	/**
+	 * Collection of Worksheet objects
+	 *
+	 * @var PHPExcel_Worksheet[]
+	 */
+	private $_workSheetCollection = array();
+
+	/**
+	 * 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();
+
+	/**
+	 * Create a new PHPExcel with one Worksheet
+	 */
+	public function __construct()
+	{
+		// 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);
+	}
+
+
+	public function disconnectWorksheets() {
+		foreach($this->_workSheetCollection as $k => &$worksheet) {
+			$worksheet->disconnectCells();
+			$this->_workSheetCollection[$k] = null;
+		}
+		unset($worksheet);
+		$this->_workSheetCollection = array();
+	}
+
+	/**
+	 * 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
+	 */
+	public function getActiveSheet()
+	{
+		return $this->_workSheetCollection[$this->_activeSheetIndex];
+	}
+
+    /**
+     * Create sheet and add it to this workbook
+     *
+     * @return PHPExcel_Worksheet
+     */
+    public function createSheet($iSheetIndex = null)
+    {
+        $newSheet = new PHPExcel_Worksheet($this);
+        $this->addSheet($newSheet, $iSheetIndex);
+        return $newSheet;
+    }
+
+    /**
+     * 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 Exception
+     */
+    public function addSheet(PHPExcel_Worksheet $pSheet = null, $iSheetIndex = null)
+    {
+        if(is_null($iSheetIndex))
+        {
+            $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;
+			}
+
+        }
+		return $pSheet;
+    }
+
+	/**
+	 * Remove sheet by index
+	 *
+	 * @param int $pIndex Active sheet index
+	 * @throws Exception
+	 */
+	public function removeSheetByIndex($pIndex = 0)
+	{
+		if ($pIndex > count($this->_workSheetCollection) - 1) {
+			throw new Exception("Sheet index is out of bounds.");
+		} else {
+			array_splice($this->_workSheetCollection, $pIndex, 1);
+		}
+	}
+
+	/**
+	 * Get sheet by index
+	 *
+	 * @param int $pIndex Sheet index
+	 * @return PHPExcel_Worksheet
+	 * @throws Exception
+	 */
+	public function getSheet($pIndex = 0)
+	{
+		if ($pIndex > count($this->_workSheetCollection) - 1) {
+			throw new Exception("Sheet index is out of bounds.");
+		} else {
+			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
+	 * @throws Exception
+	 */
+	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 Exception
+	 */
+	public function getIndex(PHPExcel_Worksheet $pSheet)
+	{
+		foreach ($this->_workSheetCollection as $key => $value) {
+			if ($value->getHashCode() == $pSheet->getHashCode()) {
+				return $key;
+			}
+		}
+	}
+
+    /**
+	 * 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 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 Exception
+	 * @return PHPExcel_Worksheet
+	 */
+	public function setActiveSheetIndex($pIndex = 0)
+	{
+		if ($pIndex > count($this->_workSheetCollection) - 1) {
+			throw new Exception("Active sheet index is out of bounds.");
+		} else {
+			$this->_activeSheetIndex = $pIndex;
+		}
+		return $this->getActiveSheet();
+	}
+
+	/**
+	 * Set active sheet index by name
+	 *
+	 * @param string $pValue Sheet title
+	 * @return PHPExcel_Worksheet
+	 * @throws Exception
+	 */
+	public function setActiveSheetIndexByName($pValue = '')
+	{
+		if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) {
+			$this->setActiveSheetIndex($worksheet->getParent()->getIndex($worksheet));
+			return $worksheet;
+		}
+
+		throw new 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) {
+			array_push($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 Exception
+	 * @return PHPExcel_Worksheet
+	 */
+	public function addExternalSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null) {
+		if (!is_null($this->getSheetByName($pSheet->getTitle()))) {
+			throw new 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 != '' && !is_null($namedRange)) {
+			// 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 (!is_null($pSheet) && 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 (is_null($pSheet)) {
+			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 $index
+	 * @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;
+	}
+
+	/**
+	 * Get default style
+	 *
+	 * @return PHPExcel_Style
+	 * @throws Exception
+	 */
+	public function getDefaultStyle()
+	{
+		if (isset($this->_cellXfCollection[0])) {
+			return $this->_cellXfCollection[0];
+		}
+		throw new Exception('No default style found for this workbook');
+	}
+
+	/**
+	 * Add a cellXf to the workbook
+	 *
+	 * @param PHPExcel_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 Exception
+	 */
+	public function removeCellXfByIndex($pIndex = 0)
+	{
+		if ($pIndex > count($this->_cellXfCollection) - 1) {
+			throw new 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->_cellXfStyleCollection 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 Exception
+	 */
+	public function removeCellStyleXfByIndex($pIndex = 0)
+	{
+		if ($pIndex > count($this->_cellStyleXfCollection) - 1) {
+			throw new 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 (count($this->_cellXfCollection) == 0) {
+			$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
+		foreach ($this->getWorksheetIterator() as $sheet) {
+			$sheet->garbageCollect();
+		}
+	}
+
+}

+ 60 - 0
protected/class/PHPExcel/Autoloader.php

@@ -0,0 +1,60 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+PHPExcel_Autoloader::Register();
+PHPExcel_Shared_ZipStreamWrapper::register();
+// check mbstring.func_overload
+if (ini_get('mbstring.func_overload') & 2) {
+	throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
+}
+PHPExcel_Shared_String::buildCharacterSets();
+
+
+class PHPExcel_Autoloader
+{
+	public static function Register() {
+		return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
+	}	//	function Register()
+
+
+	public static function Load($pObjectName){
+		if ((class_exists($pObjectName)) || (strpos($pObjectName, 'PHPExcel') === False)) {
+			return false;
+		}
+
+		$pObjectFilePath =	PHPEXCEL_ROOT.
+							str_replace('_',DIRECTORY_SEPARATOR,$pObjectName).
+							'.php';
+
+		if ((file_exists($pObjectFilePath) === false) || (is_readable($pObjectFilePath) === false)) {
+			return false;
+		}
+
+		require($pObjectFilePath);
+	}	//	function Load()
+
+}

+ 368 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/entries

@@ -0,0 +1,368 @@
+10
+
+dir
+161
+svn://192.168.1.106/zhask/cost/protected/class/PHPExcel/CachedObjectStorage
+svn://192.168.1.106
+
+
+
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+72704985-c26a-2542-8164-61969eb8b6cb
+
+DiscISAM.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+549965c37fc5c161b14a2ac588d5a925
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5184
+
+ICache.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+9d157fe125b342f8df32f42155bf9a83
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3054
+
+PHPTemp.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+04df7ccb7e112abb18747904e701b2c3
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5163
+
+CacheBase.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+aebbd7b016c411ef212208924624da35
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4770
+
+Wincache.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+22d0187f8dbdaa74416d882b978b8dad
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7527
+
+Memcache.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+39d728bff3369bc46ba06248ba391711
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8033
+
+MemoryGZip.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+02c03d32853d085f7f2e56c21ee22a82
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3599
+
+APC.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+e0eee86926a71ad951159f3aa32113d4
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7029
+
+MemorySerialized.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+c790868200346a900822d998d4e1d9cb
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3589
+
+Memory.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+882f3e2230aff1ca72627ab1163c2c63
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3232
+

+ 218 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/APC.php.svn-base

@@ -0,0 +1,218 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_APC
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
+			$this->__destruct();
+			throw new Exception('Failed to store cell '.$cellID.' in APC');
+		}
+		$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	void
+     *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+			}
+			return true;
+		}
+		return false;
+	}	//	function isDataSet()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+			}
+		} 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+    /**
+     *	Delete a cell in cache identified by coordinate address
+     *
+     *	@param	string			$pCoord		Coordinate address of the cell to delete
+     *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+				}
+				if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in APC');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	public function unsetWorksheetCells() {
+		if(!is_null($this->_currentObject)) {
+			$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()
+
+
+	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()
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			apc_delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 172 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/CacheBase.php.svn-base

@@ -0,0 +1,172 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_CacheBase
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+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;
+
+
+	/**
+	 *	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();
+
+
+	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()
+
+
+	/**
+	 *	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	void
+	 *	@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()
+
+
+    /**
+     *	Add or Update a cell in cache
+     *
+     *	@param	PHPExcel_Cell	$cell		Cell to update
+	 *	@return	void
+     *	@throws	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	Exception
+     */
+	public function deleteCacheData($pCoord) {
+		if ($pCoord === $this->_currentObjectID) {
+			$this->_currentObject->detach();
+			$this->_currentObjectID = $this->_currentObject = null;
+		}
+
+		if (is_object($this->_cellCache[$pCoord])) {
+			$this->_cellCache[$pCoord]->detach();
+			unset($this->_cellCache[$pCoord]);
+		}
+	}	//	function deleteCacheData()
+
+
+	/**
+	 *	Get a list of all cell addresses currently held in cache
+	 *
+	 *	@return	array of 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	void
+	 */
+	public function getSortedCellList() {
+		$sortKeys = array();
+		foreach (array_keys($this->_cellCache) as $coord) {
+			list($column,$row) = sscanf($coord,'%[A-Z]%d');
+			$sortKeys[sprintf('%09d%3s',$row,$column)] = $coord;
+		}
+		ksort($sortKeys);
+
+		return array_values($sortKeys);
+	}	//	function sortCellList()
+
+
+	protected function _getUniqueID() {
+		if (function_exists('posix_getpid')) {
+			$baseUnique = posix_getpid();
+		} else {
+			$baseUnique = mt_rand();
+		}
+		return uniqid($baseUnique,true);
+	}
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		$this->_parent = $parent;
+		if ((!is_null($this->_currentObject)) && (is_object($this->_currentObject))) {
+			$this->_currentObject->attach($parent);
+		}
+	}	//	function copyCellCollection()
+
+}

+ 157 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/DiscISAM.php.svn-base

@@ -0,0 +1,157 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_DiscISAM
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_fileName = null;
+	private $_fileHandle = null;
+
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		fseek($this->_fileHandle,0,SEEK_END);
+		$offset = ftell($this->_fileHandle);
+		fwrite($this->_fileHandle, serialize($this->_currentObject));
+		$this->_cellCache[$this->_currentObjectID]	= array('ptr' => $offset,
+															'sz'  => ftell($this->_fileHandle) - $offset
+														   );
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		parent::copyCellCollection($parent);
+		//	Get a new id for the new file name
+		$baseUnique = $this->_getUniqueID();
+		$newFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/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()
+
+
+	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()
+
+
+	public function __construct(PHPExcel_Worksheet $parent) {
+		parent::__construct($parent);
+		if (is_null($this->_fileHandle)) {
+			$baseUnique = $this->_getUniqueID();
+			$this->_fileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache';
+			$this->_fileHandle = fopen($this->_fileName,'a+');
+		}
+	}	//	function __construct()
+
+
+	public function __destruct() {
+		if (!is_null($this->_fileHandle)) {
+			fclose($this->_fileHandle);
+			unlink($this->_fileName);
+		}
+		$this->_fileHandle = null;
+	}	//	function __destruct()
+
+}

+ 104 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/ICache.php.svn-base

@@ -0,0 +1,104 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_ICache
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell);
+
+    /**
+     *	Add or Update a cell in cache
+     *
+     *	@param	PHPExcel_Cell	$cell		Cell to update
+	 *	@return	void
+     *	@throws	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	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	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	void
+	 *	@return	boolean
+	 */
+	public function isDataSet($pCoord);
+
+	/**
+	 *	Get a list of all cell addresses currently held in cache
+	 *
+	 *	@return	array of string
+	 */
+	public function getCellList();
+
+	/**
+	 *	Get the list of all cell addresses currently held in cache sorted by column and row
+	 *
+	 *	@return	void
+	 */
+	public function getSortedCellList();
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent);
+
+}

+ 236 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Memcache.php.svn-base

@@ -0,0 +1,236 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Memcache
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+	private $_memcache = null;
+
+
+	private function _storeData() {
+		$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 Exception('Failed to store cell '.$cellID.' in MemCache');
+			}
+		}
+		$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	void
+     *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' 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 	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 Exception('Cell entry '.$cellID.' 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+    /**
+     *	Delete a cell in cache identified by coordinate address
+     *
+     *	@param	string			$pCoord		Coordinate address of the cell to delete
+     *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in MemCache');
+				}
+				if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in MemCache');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	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()
+
+
+	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 Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort);
+			}
+			$this->_cacheTime = $cacheTime;
+
+			parent::__construct($parent);
+		}
+	}	//	function __construct()
+
+
+	public function failureCallback($host, $port) {
+		throw new Exception('memcache '.$host.':'.$port.' failed');
+	}
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			$this->_memcache->delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 98 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Memory.php.svn-base

@@ -0,0 +1,98 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Memory
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements 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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		$this->_cellCache[$pCoord] = $cell;
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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])) {
+			//	Return null if requested entry doesn't exist in cache
+			return null;
+		}
+
+		//	Return requested entry
+		return $this->_cellCache[$pCoord];
+	}	//	function getCacheData()
+
+
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		parent::copyCellCollection($parent);
+
+		$newCollection = array();
+		foreach($this->_cellCache as $k => &$cell) {
+			$newCollection[$k] = clone $cell;
+			$newCollection[$k]->attach($parent);
+		}
+
+		$this->_cellCache = $newCollection;
+	}
+
+
+	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()
+
+}

+ 107 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/MemoryGZip.php.svn-base

@@ -0,0 +1,107 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_MemoryGZip
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	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()
+
+}

+ 107 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/MemorySerialized.php.svn-base

@@ -0,0 +1,107 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_MemorySerialized
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	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()
+
+}

+ 157 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/PHPTemp.php.svn-base

@@ -0,0 +1,157 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_PHPTemp
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_fileHandle = null;
+
+
+	private $_memoryCacheSize = null;
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		fseek($this->_fileHandle,0,SEEK_END);
+		$offset = ftell($this->_fileHandle);
+		fwrite($this->_fileHandle, serialize($this->_currentObject));
+		$this->_cellCache[$this->_currentObjectID]	= array('ptr' => $offset,
+															'sz'  => ftell($this->_fileHandle) - $offset
+														   );
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@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()
+
+
+	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()
+
+
+	public function __construct(PHPExcel_Worksheet $parent, $memoryCacheSize = '1MB') {
+		$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()
+
+
+	public function __destruct() {
+		if (!is_null($this->_fileHandle)) {
+			fclose($this->_fileHandle);
+		}
+		$this->_fileHandle = null;
+	}	//	function __destruct()
+
+}

+ 230 - 0
protected/class/PHPExcel/CachedObjectStorage/.svn/text-base/Wincache.php.svn-base

@@ -0,0 +1,230 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Wincache
+ *
+ * @category   PHPExcel
+ * @package	PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+
+	private function _storeData() {
+		$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 Exception('Failed to store cell '.$cellID.' in WinCache');
+			}
+		} else {
+			if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
+				$this->__destruct();
+				throw new Exception('Failed to store cell '.$cellID.' in WinCache');
+			}
+		}
+
+		$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	void
+	 *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' 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	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 Exception('Cell entry '.$cellID.' 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Delete a cell in cache identified by coordinate address
+	 *
+	 *	@param	string			$pCoord		Coordinate address of the cell to delete
+	 *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in Wincache');
+				}
+				if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in Wincache');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	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()
+
+
+	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()
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 218 - 0
protected/class/PHPExcel/CachedObjectStorage/APC.php

@@ -0,0 +1,218 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_APC
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
+			$this->__destruct();
+			throw new Exception('Failed to store cell '.$cellID.' in APC');
+		}
+		$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	void
+     *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+			}
+			return true;
+		}
+		return false;
+	}	//	function isDataSet()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+			}
+		} 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+    /**
+     *	Delete a cell in cache identified by coordinate address
+     *
+     *	@param	string			$pCoord		Coordinate address of the cell to delete
+     *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in APC');
+				}
+				if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in APC');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	public function unsetWorksheetCells() {
+		if(!is_null($this->_currentObject)) {
+			$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()
+
+
+	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()
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			apc_delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 172 - 0
protected/class/PHPExcel/CachedObjectStorage/CacheBase.php

@@ -0,0 +1,172 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_CacheBase
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+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;
+
+
+	/**
+	 *	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();
+
+
+	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()
+
+
+	/**
+	 *	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	void
+	 *	@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()
+
+
+    /**
+     *	Add or Update a cell in cache
+     *
+     *	@param	PHPExcel_Cell	$cell		Cell to update
+	 *	@return	void
+     *	@throws	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	Exception
+     */
+	public function deleteCacheData($pCoord) {
+		if ($pCoord === $this->_currentObjectID) {
+			$this->_currentObject->detach();
+			$this->_currentObjectID = $this->_currentObject = null;
+		}
+
+		if (is_object($this->_cellCache[$pCoord])) {
+			$this->_cellCache[$pCoord]->detach();
+			unset($this->_cellCache[$pCoord]);
+		}
+	}	//	function deleteCacheData()
+
+
+	/**
+	 *	Get a list of all cell addresses currently held in cache
+	 *
+	 *	@return	array of 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	void
+	 */
+	public function getSortedCellList() {
+		$sortKeys = array();
+		foreach (array_keys($this->_cellCache) as $coord) {
+			list($column,$row) = sscanf($coord,'%[A-Z]%d');
+			$sortKeys[sprintf('%09d%3s',$row,$column)] = $coord;
+		}
+		ksort($sortKeys);
+
+		return array_values($sortKeys);
+	}	//	function sortCellList()
+
+
+	protected function _getUniqueID() {
+		if (function_exists('posix_getpid')) {
+			$baseUnique = posix_getpid();
+		} else {
+			$baseUnique = mt_rand();
+		}
+		return uniqid($baseUnique,true);
+	}
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		$this->_parent = $parent;
+		if ((!is_null($this->_currentObject)) && (is_object($this->_currentObject))) {
+			$this->_currentObject->attach($parent);
+		}
+	}	//	function copyCellCollection()
+
+}

+ 157 - 0
protected/class/PHPExcel/CachedObjectStorage/DiscISAM.php

@@ -0,0 +1,157 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_DiscISAM
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_fileName = null;
+	private $_fileHandle = null;
+
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		fseek($this->_fileHandle,0,SEEK_END);
+		$offset = ftell($this->_fileHandle);
+		fwrite($this->_fileHandle, serialize($this->_currentObject));
+		$this->_cellCache[$this->_currentObjectID]	= array('ptr' => $offset,
+															'sz'  => ftell($this->_fileHandle) - $offset
+														   );
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		parent::copyCellCollection($parent);
+		//	Get a new id for the new file name
+		$baseUnique = $this->_getUniqueID();
+		$newFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/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()
+
+
+	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()
+
+
+	public function __construct(PHPExcel_Worksheet $parent) {
+		parent::__construct($parent);
+		if (is_null($this->_fileHandle)) {
+			$baseUnique = $this->_getUniqueID();
+			$this->_fileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache';
+			$this->_fileHandle = fopen($this->_fileName,'a+');
+		}
+	}	//	function __construct()
+
+
+	public function __destruct() {
+		if (!is_null($this->_fileHandle)) {
+			fclose($this->_fileHandle);
+			unlink($this->_fileName);
+		}
+		$this->_fileHandle = null;
+	}	//	function __destruct()
+
+}

+ 104 - 0
protected/class/PHPExcel/CachedObjectStorage/ICache.php

@@ -0,0 +1,104 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_ICache
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell);
+
+    /**
+     *	Add or Update a cell in cache
+     *
+     *	@param	PHPExcel_Cell	$cell		Cell to update
+	 *	@return	void
+     *	@throws	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	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	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	void
+	 *	@return	boolean
+	 */
+	public function isDataSet($pCoord);
+
+	/**
+	 *	Get a list of all cell addresses currently held in cache
+	 *
+	 *	@return	array of string
+	 */
+	public function getCellList();
+
+	/**
+	 *	Get the list of all cell addresses currently held in cache sorted by column and row
+	 *
+	 *	@return	void
+	 */
+	public function getSortedCellList();
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@return	void
+	 */
+	public function copyCellCollection(PHPExcel_Worksheet $parent);
+
+}

+ 236 - 0
protected/class/PHPExcel/CachedObjectStorage/Memcache.php

@@ -0,0 +1,236 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Memcache
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+	private $_memcache = null;
+
+
+	private function _storeData() {
+		$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 Exception('Failed to store cell '.$cellID.' in MemCache');
+			}
+		}
+		$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	void
+     *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' 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 	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 Exception('Cell entry '.$cellID.' 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+    /**
+     *	Delete a cell in cache identified by coordinate address
+     *
+     *	@param	string			$pCoord		Coordinate address of the cell to delete
+     *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in MemCache');
+				}
+				if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in MemCache');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	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()
+
+
+	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 Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort);
+			}
+			$this->_cacheTime = $cacheTime;
+
+			parent::__construct($parent);
+		}
+	}	//	function __construct()
+
+
+	public function failureCallback($host, $port) {
+		throw new Exception('memcache '.$host.':'.$port.' failed');
+	}
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			$this->_memcache->delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 98 - 0
protected/class/PHPExcel/CachedObjectStorage/Memory.php

@@ -0,0 +1,98 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Memory
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements 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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		$this->_cellCache[$pCoord] = $cell;
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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])) {
+			//	Return null if requested entry doesn't exist in cache
+			return null;
+		}
+
+		//	Return requested entry
+		return $this->_cellCache[$pCoord];
+	}	//	function getCacheData()
+
+
+	public function copyCellCollection(PHPExcel_Worksheet $parent) {
+		parent::copyCellCollection($parent);
+
+		$newCollection = array();
+		foreach($this->_cellCache as $k => &$cell) {
+			$newCollection[$k] = clone $cell;
+			$newCollection[$k]->attach($parent);
+		}
+
+		$this->_cellCache = $newCollection;
+	}
+
+
+	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()
+
+}

+ 107 - 0
protected/class/PHPExcel/CachedObjectStorage/MemoryGZip.php

@@ -0,0 +1,107 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_MemoryGZip
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	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()
+
+}

+ 107 - 0
protected/class/PHPExcel/CachedObjectStorage/MemorySerialized.php

@@ -0,0 +1,107 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_MemorySerialized
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	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()
+
+}

+ 157 - 0
protected/class/PHPExcel/CachedObjectStorage/PHPTemp.php

@@ -0,0 +1,157 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_PHPTemp
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_fileHandle = null;
+
+
+	private $_memoryCacheSize = null;
+
+	private function _storeData() {
+		$this->_currentObject->detach();
+
+		fseek($this->_fileHandle,0,SEEK_END);
+		$offset = ftell($this->_fileHandle);
+		fwrite($this->_fileHandle, serialize($this->_currentObject));
+		$this->_cellCache[$this->_currentObjectID]	= array('ptr' => $offset,
+															'sz'  => ftell($this->_fileHandle) - $offset
+														   );
+		$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	void
+     *	@throws	Exception
+     */
+	public function addCacheData($pCoord, PHPExcel_Cell $cell) {
+		if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
+			$this->_storeData();
+		}
+
+		$this->_currentObjectID = $pCoord;
+		$this->_currentObject = $cell;
+
+		return $cell;
+	}	//	function addCacheData()
+
+
+    /**
+     * Get cell at a specific coordinate
+     *
+     * @param 	string 			$pCoord		Coordinate of the cell
+     * @throws 	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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Clone the cell collection
+	 *
+	 *	@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()
+
+
+	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()
+
+
+	public function __construct(PHPExcel_Worksheet $parent, $memoryCacheSize = '1MB') {
+		$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()
+
+
+	public function __destruct() {
+		if (!is_null($this->_fileHandle)) {
+			fclose($this->_fileHandle);
+		}
+		$this->_fileHandle = null;
+	}	//	function __destruct()
+
+}

+ 230 - 0
protected/class/PHPExcel/CachedObjectStorage/Wincache.php

@@ -0,0 +1,230 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_CachedObjectStorage_Wincache
+ *
+ * @category   PHPExcel
+ * @package	PHPExcel_CachedObjectStorage
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
+
+	private $_cachePrefix = null;
+
+	private $_cacheTime = 600;
+
+
+	private function _storeData() {
+		$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 Exception('Failed to store cell '.$cellID.' in WinCache');
+			}
+		} else {
+			if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
+				$this->__destruct();
+				throw new Exception('Failed to store cell '.$cellID.' in WinCache');
+			}
+		}
+
+		$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	void
+	 *	@throws	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;
+
+		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	void
+	 *	@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 Exception('Cell entry '.$cellID.' 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	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 Exception('Cell entry '.$cellID.' 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 the parent worksheet
+		$this->_currentObject->attach($this->_parent);
+
+		//	Return requested entry
+		return $this->_currentObject;
+	}	//	function getCacheData()
+
+
+	/**
+	 *	Delete a cell in cache identified by coordinate address
+	 *
+	 *	@param	string			$pCoord		Coordinate address of the cell to delete
+	 *	@throws	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
+	 *
+	 *	@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 Exception('Cell entry '.$cellID.' no longer exists in Wincache');
+				}
+				if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
+					$this->__destruct();
+					throw new Exception('Failed to store cell '.$cellID.' in Wincache');
+				}
+			}
+		}
+		$this->_cachePrefix = $newCachePrefix;
+	}	//	function copyCellCollection()
+
+
+	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()
+
+
+	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()
+
+
+	public function __destruct() {
+		$cacheList = $this->getCellList();
+		foreach($cacheList as $cellID) {
+			wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
+		}
+	}	//	function __destruct()
+
+}

+ 131 - 0
protected/class/PHPExcel/CachedObjectStorageFactory.php

@@ -0,0 +1,131 @@
+<?php
+
+class PHPExcel_CachedObjectStorageFactory {
+	const cache_in_memory				= 'Memory';
+	const cache_in_memory_gzip			= 'MemoryGZip';
+	const cache_in_memory_serialized	= 'MemorySerialized';
+	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';
+
+
+	private static $_cacheStorageMethod = null;
+
+	private static $_cacheStorageClass = null;
+
+
+	private static $_storageMethods = array(
+		self::cache_in_memory,
+		self::cache_in_memory_gzip,
+		self::cache_in_memory_serialized,
+		self::cache_to_phpTemp,
+		self::cache_to_discISAM,
+		self::cache_to_apc,
+		self::cache_to_memcache,
+		self::cache_to_wincache,
+	);
+
+
+	private static $_storageMethodDefaultParameters = array(
+		self::cache_in_memory				=> array(
+													),
+		self::cache_in_memory_gzip			=> array(
+													),
+		self::cache_in_memory_serialized	=> array(
+													),
+		self::cache_to_phpTemp				=> array( 'memoryCacheSize'	=> '1MB'
+													),
+		self::cache_to_discISAM				=> array(
+													),
+		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
+													)
+	);
+
+
+	private static $_storageMethodParameters = array();
+
+
+	public static function getCacheStorageMethod() {
+		if (!is_null(self::$_cacheStorageMethod)) {
+			return self::$_cacheStorageMethod;
+		}
+		return null;
+	}	//	function getCacheStorageMethod()
+
+
+	public static function getCacheStorageClass() {
+		if (!is_null(self::$_cacheStorageClass)) {
+			return self::$_cacheStorageClass;
+		}
+		return null;
+	}	//	function getCacheStorageClass()
+
+
+	public static function getCacheStorageMethods() {
+		return self::$_storageMethods;
+	}	//	function getCacheStorageMethods()
+
+
+	public static function initialize($method = self::cache_in_memory, $arguments = array()) {
+		if (!in_array($method,self::$_storageMethods)) {
+			return false;
+		}
+
+		switch($method) {
+			case self::cache_to_apc	:
+				if (!function_exists('apc_store')) {
+					return false;
+				}
+				if (apc_sma_info() === false) {
+					return false;
+				}
+				break;
+			case self::cache_to_memcache :
+				if (!function_exists('memcache_add')) {
+					return false;
+				}
+				break;
+			case self::cache_to_wincache :
+				if (!function_exists('wincache_ucache_add')) {
+					return false;
+				}
+				break;
+		}
+
+		self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
+		foreach($arguments as $k => $v) {
+			if (isset(self::$_storageMethodParameters[$method][$k])) {
+				self::$_storageMethodParameters[$method][$k] = $v;
+			}
+		}
+
+		if (is_null(self::$_cacheStorageMethod)) {
+			self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
+			self::$_cacheStorageMethod = $method;
+		}
+		return true;
+	}	//	function initialize()
+
+
+	public static function getInstance(PHPExcel_Worksheet $parent) {
+		if (is_null(self::$_cacheStorageMethod)) {
+			self::initialize();
+		}
+
+		$instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]);
+		if (!is_null($instance)) {
+			return $instance;
+		}
+
+		return false;
+	}	//	function getInstance()
+
+}

File diff suppressed because it is too large
+ 3827 - 0
protected/class/PHPExcel/Calculation.php


+ 572 - 0
protected/class/PHPExcel/Calculation/.svn/entries

@@ -0,0 +1,572 @@
+10
+
+dir
+161
+svn://192.168.1.106/zhask/cost/protected/class/PHPExcel/Calculation
+svn://192.168.1.106
+
+
+
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+72704985-c26a-2542-8164-61969eb8b6cb
+
+Engineering.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+a900301b65939c4e8ed8bdf7ed621695
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+79791
+
+ExceptionHandler.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+7827ec64e5cbe9478179c93894cb4c9b
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1572
+
+DateTime.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+1159566d458ba3f03e9a9919d78da5fa
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+40428
+
+Exception.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+d7b26683566db9b2c73f2a58840efdff
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1648
+
+Database.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+52492c73bccf0d17e5cac7686b104e9c
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10454
+
+LookupRef.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+96c365ee084a8036bb2ead3c96576ae6
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+26664
+
+FormulaToken.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+f3bbe458e1bd4dbecd3a7c8f986c31d4
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5507
+
+Functions.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+9fe0d726d3ecfcda1fb3cf8028e8759e
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+20111
+
+functionlist.txt
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+a44608185f9bc21f28dd0173739f023b
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2511
+
+Logical.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+fca7444266f36f76d31414beeae024a2
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10185
+
+TextData.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+4f86f9f1888f60eeb6614e3660aaae81
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16957
+
+MathTrig.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+766772433aa1cfd0c5ee5cf40bf1e1be
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+34145
+
+FormulaParser.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+e9c0e6a12acc257cd3886f9b111e4d06
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+22063
+
+Statistical.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+2b43157d04f52547e4d3dd0f81aac675
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+109004
+
+Financial.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+b34848903a36ae229c65216fbffea68c
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+70665
+
+Function.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+7f724f970c73e80e032705a5e2809f42
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3902
+

+ 384 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Database.php.svn-base

@@ -0,0 +1,384 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_Database {
+
+
+	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;
+	}
+
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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

File diff suppressed because it is too large
+ 1178 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/DateTime.php.svn-base


File diff suppressed because it is too large
+ 2174 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Engineering.php.svn-base


+ 52 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Exception.php.svn-base

@@ -0,0 +1,52 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Calculation_Exception
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_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;
+	}	
+}

+ 49 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/ExceptionHandler.php.svn-base

@@ -0,0 +1,49 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+/**
+ * PHPExcel_Calculation_ExceptionHandler
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 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();
+	}
+}

File diff suppressed because it is too large
+ 1818 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Financial.php.svn-base


+ 614 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/FormulaParser.php.svn-base

@@ -0,0 +1,614 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/*
+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 - 2011 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 	Exception
+     */
+    public function __construct($pFormula = '')
+    {
+    	// Check parameters
+    	if (is_null($pFormula)) {
+    		throw new 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  Exception
+     */
+    public function getToken($pId = 0) {
+    	if (isset($this->_tokens[$pId])) {
+    		return $this->_tokens[$pId];
+    	} else {
+    		throw new 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;
+		}
+    }
+}

+ 176 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/FormulaToken.php.svn-base

@@ -0,0 +1,176 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/*
+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 - 2011 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;
+    }
+}

+ 149 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Function.php.svn-base

@@ -0,0 +1,149 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Calculation_Function
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 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 	Exception
+     */
+    public function __construct($pCategory = null, $pExcelName = null, $pPHPExcelName = null)
+    {
+    	if (!is_null($pCategory) && !is_null($pExcelName) && !is_null($pPHPExcelName)) {
+    		// Initialise values
+    		$this->_category 		= $pCategory;
+    		$this->_excelName 		= $pExcelName;
+    		$this->_phpExcelName 	= $pPHPExcelName;
+    	} else {
+    		throw new 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 	Exception
+     */
+    public function setCategory($value = null) {
+    	if (!is_null($value)) {
+    		$this->_category = $value;
+    	} else {
+    		throw new 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;
+    }
+}

+ 803 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Functions.php.svn-base

@@ -0,0 +1,803 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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	#REF!
+	 */
+	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 (!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 = 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::$_errorCodes['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);
+
+		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::$_errorCodes['na']);
+	}	//	function IS_NA()
+
+
+	/**
+	 *	IS_EVEN
+	 *
+	 *	@param	mixed	$value	Value to check
+	 *	@return	boolean
+	 */
+	public static function IS_EVEN($value = 0) {
+		$value		= self::flattenSingleValue($value);
+
+		if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+			return self::$_errorCodes['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 ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+			return self::$_errorCodes['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 = 0) {
+		$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 = true) {
+		$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 = '') {
+		$value		= self::flattenSingleValue($value);
+
+		return is_string($value);
+	}	//	function IS_TEXT()
+
+
+	/**
+	 *	IS_NONTEXT
+	 *
+	 *	@param	mixed	$value		Value to check
+	 *	@return	boolean
+	 */
+	public static function IS_NONTEXT($value = '') {
+		return !self::IS_TEXT($value);
+	}	//	function IS_NONTEXT()
+
+
+	/**
+	 *	VERSION
+	 *
+	 *	@return	string	Version information
+	 */
+	public static function VERSION() {
+		return 'PHPExcel 1.7.6, 2011-02-27';
+	}	//	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) {
+		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) {
+		$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(count($value) == 0) {
+			//	Empty Cell
+			return 1;
+		}
+		$value	= self::flattenSingleValue($value);
+
+		if ((is_float($value)) || (is_int($value))) {
+				return 1;
+		} elseif(is_bool($value)) {
+				return 4;
+		} elseif(is_array($value)) {
+				return 64;
+				break;
+		} 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()
+}
+
+if (!function_exists('money_format')) {
+	function money_format($format, $number) {
+		$regex = array( '/%((?:[\^!\-]|\+|\(|\=.)*)([0-9]+)?(?:#([0-9]+))?',
+						 '(?:\.([0-9]+))?([in%])/'
+					  );
+		$regex = implode('', $regex);
+		if (setlocale(LC_MONETARY, null) == '') {
+			setlocale(LC_MONETARY, '');
+		}
+		$locale = localeconv();
+		$number = floatval($number);
+		if (!preg_match($regex, $format, $fmatch)) {
+			trigger_error("No format specified or invalid format", E_USER_WARNING);
+			return $number;
+		}
+		$flags = array( 'fillchar'	=> preg_match('/\=(.)/', $fmatch[1], $match) ? $match[1] : ' ',
+						'nogroup'	=> preg_match('/\^/', $fmatch[1]) > 0,
+						'usesignal'	=> preg_match('/\+|\(/', $fmatch[1], $match) ? $match[0] : '+',
+						'nosimbol'	=> preg_match('/\!/', $fmatch[1]) > 0,
+						'isleft'	=> preg_match('/\-/', $fmatch[1]) > 0
+					  );
+		$width	= trim($fmatch[2]) ? (int)$fmatch[2] : 0;
+		$left	= trim($fmatch[3]) ? (int)$fmatch[3] : 0;
+		$right	= trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits'];
+		$conversion = $fmatch[5];
+		$positive = true;
+		if ($number < 0) {
+			$positive = false;
+			$number *= -1;
+		}
+		$letter = $positive ? 'p' : 'n';
+		$prefix = $suffix = $cprefix = $csuffix = $signal = '';
+		if (!$positive) {
+			$signal = $locale['negative_sign'];
+			switch (true) {
+				case $locale['n_sign_posn'] == 0 || $flags['usesignal'] == '(':
+					$prefix = '(';
+					$suffix = ')';
+					break;
+				case $locale['n_sign_posn'] == 1:
+					$prefix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 2:
+					$suffix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 3:
+					$cprefix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 4:
+					$csuffix = $signal;
+					break;
+			}
+		}
+		if (!$flags['nosimbol']) {
+			$currency = $cprefix;
+			$currency .= ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']);
+			$currency .= $csuffix;
+			$currency = iconv('ISO-8859-1','UTF-8',$currency);
+		} else {
+			$currency = '';
+		}
+		$space = $locale["{$letter}_sep_by_space"] ? ' ' : '';
+
+		$number = number_format($number, $right, $locale['mon_decimal_point'], $flags['nogroup'] ? '' : $locale['mon_thousands_sep'] );
+		$number = explode($locale['mon_decimal_point'], $number);
+
+		$n = strlen($prefix) + strlen($currency);
+		if ($left > 0 && $left > $n) {
+			if ($flags['isleft']) {
+				$number[0] .= str_repeat($flags['fillchar'], $left - $n);
+			} else {
+				$number[0] = str_repeat($flags['fillchar'], $left - $n) . $number[0];
+			}
+		}
+		$number = implode($locale['mon_decimal_point'], $number);
+		if ($locale["{$letter}_cs_precedes"]) {
+			$number = $prefix . $currency . $space . $number . $suffix;
+		} else {
+			$number = $prefix . $number . $space . $currency . $suffix;
+		}
+		if ($width > 0) {
+			$number = str_pad($number, $width, $flags['fillchar'], $flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);
+		}
+		$format = str_replace($fmatch[0], $number, $format);
+		return $format;
+	}	//	function money_format()
+}
+
+
+//
+//	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 == '') {
+				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;
+	}
+}

+ 290 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Logical.php.svn-base

@@ -0,0 +1,290 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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 = 0;
+		foreach ($aArgs as $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);
+			}
+			++$argCount;
+		}
+
+		// 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 = 0;
+		foreach ($aArgs as $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);
+			}
+			++$argCount;
+		}
+
+		// 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) {
+		$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

+ 746 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/LookupRef.php.svn-base

@@ -0,0 +1,746 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_LookupRef {
+
+
+	/**
+	 *	CELL_ADDRESS
+	 *
+	 *	Creates a cell address as text, given specified row and column numbers.
+	 *
+	 *	@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.
+	 *
+	 *	@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.
+	 *
+	 *	@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
+	 */
+	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.
+	 *
+	 *	@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.
+	 *
+	 *	@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
+	 */
+	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
+	 *	@return	mixed	The value of errorpart or testValue determined by error condition
+	 */
+	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 number of rows in an array or reference.
+	 *
+	 *	@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
+	 */
+	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)))) {
+			return PHPExcel_Calculation_Functions::REF();
+		}
+
+		if (strpos($cellAddress,'!') !== false) {
+			list($sheetName,$cellAddress) = explode('!',$cellAddress);
+			$pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName);
+		} else {
+			$pSheet = $pCell->getParent();
+		}
+
+		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.
+	 *
+	 *	@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);
+		}
+		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->getParent()->getParent()->getSheetByName($sheetName);
+		} else {
+			$pSheet = $pCell->getParent();
+		}
+
+		return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False);
+	}	//	function OFFSET()
+
+
+	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
+	 *
+	 *	@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
+	 * implemented: Return the value of a specified cell or array of cells	Array form
+	 * not implemented: Return a reference to specified cells	Reference form
+	 *
+	 * @param	range_array	a range of cells or an array constant
+	 * @param	row_num		selects the row in array from which to return a value. If row_num is omitted, column_num is required.
+	 * @param	column_num	selects the column in array from which to return a value. If column_num is omitted, row_num is required.
+	 */
+	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)) || (count($lookup_array) < 1)) {
+			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 (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()
+
+
+	/**
+	 * 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

File diff suppressed because it is too large
+ 1241 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/MathTrig.php.svn-base


File diff suppressed because it is too large
+ 3643 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/Statistical.php.svn-base


+ 588 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/TextData.php.svn-base

@@ -0,0 +1,588 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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	$value	Value to check
+	 *	@return	string
+	 */
+	public static function TRIMNONPRINTABLE($stringValue = '') {
+		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
+
+		if (is_bool($stringValue)) {
+			$stringValue = ($stringValue) ? 'TRUE' : 'FALSE';
+		}
+
+		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	$value	Value to check
+	 *	@return	string
+	 */
+	public static function TRIMSPACES($stringValue = '') {
+		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
+
+		if (is_string($stringValue) || is_numeric($stringValue)) {
+			return trim(preg_replace('/  +/',' ',$stringValue));
+		}
+		return Null;
+	}	//	function TRIMSPACES()
+
+
+	/**
+	 * ASCIICODE
+	 *
+	 * @param	string	$character	Value
+	 * @return	int
+	 */
+	public static function ASCIICODE($characters) {
+		$characters	= PHPExcel_Calculation_Functions::flattenSingleValue($characters);
+		if (is_bool($characters)) {
+			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
+				$characters = (int) $characters;
+			} else {
+				if ($characters) {
+					$characters = 'True';
+				} else {
+					$characters = 'False';
+				}
+			}
+		}
+
+		$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 {
+					if ($arg) {
+						$arg = 'TRUE';
+					} else {
+						$arg = 'FALSE';
+					}
+				}
+			}
+			$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);
+
+		if ($decimals > 0) {
+			return money_format('%.'.$decimals.'n',$value);
+		} else {
+			$round = pow(10,abs($decimals));
+			if ($value < 0) { $round = 0-$round; }
+			$value = PHPExcel_Calculation_MathTrig::MROUND($value,$round);
+			//	The implementation of money_format used if the standard PHP function is not available can't handle decimal places of 0,
+			//		so we display to 1 dp and chop off that character and the decimal separator using substr
+			return substr(money_format('%.1n',$value),0,-2);
+		}
+	}	//	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) ? 'TRUE' : 'FALSE';
+			}
+
+			if (($offset > 0) && (strlen($haystack) > $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) ? 'TRUE' : 'FALSE';
+			}
+
+			if (($offset > 0) && (strlen($haystack) > $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
+	 *	@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);
+
+		$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) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		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
+	 * @param	int		$chars	Number of characters
+	 * @return	string
+	 */
+	public static function STRINGLENGTH($value = '') {
+		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
+
+		if (is_bool($value)) {
+			$value = ($value) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_LOWER, 'UTF-8');
+		} else {
+			return strtoupper($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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_UPPER, 'UTF-8');
+		} else {
+			return 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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_TITLE, 'UTF-8');
+		} else {
+			return ucwords($mixedCaseString);
+		}
+	}	//	function PROPERCASE()
+
+
+	/**
+	 *	REPLACE
+	 *
+	 *	@param	string	$value	Value
+	 *	@param	int		$start	Start character
+	 *	@param	int		$chars	Number of characters
+	 *	@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 $left.$newText.$right;
+	}	//	function SUBSTITUTE()
+
+
+	/**
+	 *	RETURNSTRING
+	 *
+	 *	@param	mixed	$value	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
+	 *	@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()
+
+}	//	class PHPExcel_Calculation_TextData

+ 351 - 0
protected/class/PHPExcel/Calculation/.svn/text-base/functionlist.txt.svn-base

@@ -0,0 +1,351 @@
+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

+ 384 - 0
protected/class/PHPExcel/Calculation/Database.php

@@ -0,0 +1,384 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_Database {
+
+
+	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;
+	}
+
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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
+	 *
+	 */
+	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

File diff suppressed because it is too large
+ 1178 - 0
protected/class/PHPExcel/Calculation/DateTime.php


File diff suppressed because it is too large
+ 2174 - 0
protected/class/PHPExcel/Calculation/Engineering.php


+ 52 - 0
protected/class/PHPExcel/Calculation/Exception.php

@@ -0,0 +1,52 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Calculation_Exception
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_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;
+	}	
+}

+ 49 - 0
protected/class/PHPExcel/Calculation/ExceptionHandler.php

@@ -0,0 +1,49 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+/**
+ * PHPExcel_Calculation_ExceptionHandler
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 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();
+	}
+}

File diff suppressed because it is too large
+ 1818 - 0
protected/class/PHPExcel/Calculation/Financial.php


+ 614 - 0
protected/class/PHPExcel/Calculation/FormulaParser.php

@@ -0,0 +1,614 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/*
+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 - 2011 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 	Exception
+     */
+    public function __construct($pFormula = '')
+    {
+    	// Check parameters
+    	if (is_null($pFormula)) {
+    		throw new 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  Exception
+     */
+    public function getToken($pId = 0) {
+    	if (isset($this->_tokens[$pId])) {
+    		return $this->_tokens[$pId];
+    	} else {
+    		throw new 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;
+		}
+    }
+}

+ 176 - 0
protected/class/PHPExcel/Calculation/FormulaToken.php

@@ -0,0 +1,176 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/*
+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 - 2011 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;
+    }
+}

+ 149 - 0
protected/class/PHPExcel/Calculation/Function.php

@@ -0,0 +1,149 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Calculation_Function
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Calculation
+ * @copyright  Copyright (c) 2006 - 2011 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 	Exception
+     */
+    public function __construct($pCategory = null, $pExcelName = null, $pPHPExcelName = null)
+    {
+    	if (!is_null($pCategory) && !is_null($pExcelName) && !is_null($pPHPExcelName)) {
+    		// Initialise values
+    		$this->_category 		= $pCategory;
+    		$this->_excelName 		= $pExcelName;
+    		$this->_phpExcelName 	= $pPHPExcelName;
+    	} else {
+    		throw new 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 	Exception
+     */
+    public function setCategory($value = null) {
+    	if (!is_null($value)) {
+    		$this->_category = $value;
+    	} else {
+    		throw new 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;
+    }
+}

+ 803 - 0
protected/class/PHPExcel/Calculation/Functions.php

@@ -0,0 +1,803 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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	#REF!
+	 */
+	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 (!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 = 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::$_errorCodes['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);
+
+		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::$_errorCodes['na']);
+	}	//	function IS_NA()
+
+
+	/**
+	 *	IS_EVEN
+	 *
+	 *	@param	mixed	$value	Value to check
+	 *	@return	boolean
+	 */
+	public static function IS_EVEN($value = 0) {
+		$value		= self::flattenSingleValue($value);
+
+		if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+			return self::$_errorCodes['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 ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+			return self::$_errorCodes['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 = 0) {
+		$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 = true) {
+		$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 = '') {
+		$value		= self::flattenSingleValue($value);
+
+		return is_string($value);
+	}	//	function IS_TEXT()
+
+
+	/**
+	 *	IS_NONTEXT
+	 *
+	 *	@param	mixed	$value		Value to check
+	 *	@return	boolean
+	 */
+	public static function IS_NONTEXT($value = '') {
+		return !self::IS_TEXT($value);
+	}	//	function IS_NONTEXT()
+
+
+	/**
+	 *	VERSION
+	 *
+	 *	@return	string	Version information
+	 */
+	public static function VERSION() {
+		return 'PHPExcel 1.7.6, 2011-02-27';
+	}	//	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) {
+		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) {
+		$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(count($value) == 0) {
+			//	Empty Cell
+			return 1;
+		}
+		$value	= self::flattenSingleValue($value);
+
+		if ((is_float($value)) || (is_int($value))) {
+				return 1;
+		} elseif(is_bool($value)) {
+				return 4;
+		} elseif(is_array($value)) {
+				return 64;
+				break;
+		} 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()
+}
+
+if (!function_exists('money_format')) {
+	function money_format($format, $number) {
+		$regex = array( '/%((?:[\^!\-]|\+|\(|\=.)*)([0-9]+)?(?:#([0-9]+))?',
+						 '(?:\.([0-9]+))?([in%])/'
+					  );
+		$regex = implode('', $regex);
+		if (setlocale(LC_MONETARY, null) == '') {
+			setlocale(LC_MONETARY, '');
+		}
+		$locale = localeconv();
+		$number = floatval($number);
+		if (!preg_match($regex, $format, $fmatch)) {
+			trigger_error("No format specified or invalid format", E_USER_WARNING);
+			return $number;
+		}
+		$flags = array( 'fillchar'	=> preg_match('/\=(.)/', $fmatch[1], $match) ? $match[1] : ' ',
+						'nogroup'	=> preg_match('/\^/', $fmatch[1]) > 0,
+						'usesignal'	=> preg_match('/\+|\(/', $fmatch[1], $match) ? $match[0] : '+',
+						'nosimbol'	=> preg_match('/\!/', $fmatch[1]) > 0,
+						'isleft'	=> preg_match('/\-/', $fmatch[1]) > 0
+					  );
+		$width	= trim($fmatch[2]) ? (int)$fmatch[2] : 0;
+		$left	= trim($fmatch[3]) ? (int)$fmatch[3] : 0;
+		$right	= trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits'];
+		$conversion = $fmatch[5];
+		$positive = true;
+		if ($number < 0) {
+			$positive = false;
+			$number *= -1;
+		}
+		$letter = $positive ? 'p' : 'n';
+		$prefix = $suffix = $cprefix = $csuffix = $signal = '';
+		if (!$positive) {
+			$signal = $locale['negative_sign'];
+			switch (true) {
+				case $locale['n_sign_posn'] == 0 || $flags['usesignal'] == '(':
+					$prefix = '(';
+					$suffix = ')';
+					break;
+				case $locale['n_sign_posn'] == 1:
+					$prefix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 2:
+					$suffix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 3:
+					$cprefix = $signal;
+					break;
+				case $locale['n_sign_posn'] == 4:
+					$csuffix = $signal;
+					break;
+			}
+		}
+		if (!$flags['nosimbol']) {
+			$currency = $cprefix;
+			$currency .= ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']);
+			$currency .= $csuffix;
+			$currency = iconv('ISO-8859-1','UTF-8',$currency);
+		} else {
+			$currency = '';
+		}
+		$space = $locale["{$letter}_sep_by_space"] ? ' ' : '';
+
+		$number = number_format($number, $right, $locale['mon_decimal_point'], $flags['nogroup'] ? '' : $locale['mon_thousands_sep'] );
+		$number = explode($locale['mon_decimal_point'], $number);
+
+		$n = strlen($prefix) + strlen($currency);
+		if ($left > 0 && $left > $n) {
+			if ($flags['isleft']) {
+				$number[0] .= str_repeat($flags['fillchar'], $left - $n);
+			} else {
+				$number[0] = str_repeat($flags['fillchar'], $left - $n) . $number[0];
+			}
+		}
+		$number = implode($locale['mon_decimal_point'], $number);
+		if ($locale["{$letter}_cs_precedes"]) {
+			$number = $prefix . $currency . $space . $number . $suffix;
+		} else {
+			$number = $prefix . $number . $space . $currency . $suffix;
+		}
+		if ($width > 0) {
+			$number = str_pad($number, $width, $flags['fillchar'], $flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);
+		}
+		$format = str_replace($fmatch[0], $number, $format);
+		return $format;
+	}	//	function money_format()
+}
+
+
+//
+//	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 == '') {
+				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;
+	}
+}

+ 290 - 0
protected/class/PHPExcel/Calculation/Logical.php

@@ -0,0 +1,290 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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 = 0;
+		foreach ($aArgs as $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);
+			}
+			++$argCount;
+		}
+
+		// 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 = 0;
+		foreach ($aArgs as $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);
+			}
+			++$argCount;
+		}
+
+		// 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) {
+		$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

+ 746 - 0
protected/class/PHPExcel/Calculation/LookupRef.php

@@ -0,0 +1,746 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Calculation_LookupRef {
+
+
+	/**
+	 *	CELL_ADDRESS
+	 *
+	 *	Creates a cell address as text, given specified row and column numbers.
+	 *
+	 *	@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.
+	 *
+	 *	@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.
+	 *
+	 *	@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
+	 */
+	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.
+	 *
+	 *	@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.
+	 *
+	 *	@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
+	 */
+	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
+	 *	@return	mixed	The value of errorpart or testValue determined by error condition
+	 */
+	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 number of rows in an array or reference.
+	 *
+	 *	@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
+	 */
+	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)))) {
+			return PHPExcel_Calculation_Functions::REF();
+		}
+
+		if (strpos($cellAddress,'!') !== false) {
+			list($sheetName,$cellAddress) = explode('!',$cellAddress);
+			$pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName);
+		} else {
+			$pSheet = $pCell->getParent();
+		}
+
+		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.
+	 *
+	 *	@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);
+		}
+		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->getParent()->getParent()->getSheetByName($sheetName);
+		} else {
+			$pSheet = $pCell->getParent();
+		}
+
+		return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False);
+	}	//	function OFFSET()
+
+
+	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
+	 *
+	 *	@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
+	 * implemented: Return the value of a specified cell or array of cells	Array form
+	 * not implemented: Return a reference to specified cells	Reference form
+	 *
+	 * @param	range_array	a range of cells or an array constant
+	 * @param	row_num		selects the row in array from which to return a value. If row_num is omitted, column_num is required.
+	 * @param	column_num	selects the column in array from which to return a value. If column_num is omitted, row_num is required.
+	 */
+	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)) || (count($lookup_array) < 1)) {
+			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 (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()
+
+
+	/**
+	 * 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

File diff suppressed because it is too large
+ 1241 - 0
protected/class/PHPExcel/Calculation/MathTrig.php


File diff suppressed because it is too large
+ 3643 - 0
protected/class/PHPExcel/Calculation/Statistical.php


+ 588 - 0
protected/class/PHPExcel/Calculation/TextData.php

@@ -0,0 +1,588 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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	$value	Value to check
+	 *	@return	string
+	 */
+	public static function TRIMNONPRINTABLE($stringValue = '') {
+		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
+
+		if (is_bool($stringValue)) {
+			$stringValue = ($stringValue) ? 'TRUE' : 'FALSE';
+		}
+
+		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	$value	Value to check
+	 *	@return	string
+	 */
+	public static function TRIMSPACES($stringValue = '') {
+		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
+
+		if (is_string($stringValue) || is_numeric($stringValue)) {
+			return trim(preg_replace('/  +/',' ',$stringValue));
+		}
+		return Null;
+	}	//	function TRIMSPACES()
+
+
+	/**
+	 * ASCIICODE
+	 *
+	 * @param	string	$character	Value
+	 * @return	int
+	 */
+	public static function ASCIICODE($characters) {
+		$characters	= PHPExcel_Calculation_Functions::flattenSingleValue($characters);
+		if (is_bool($characters)) {
+			if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
+				$characters = (int) $characters;
+			} else {
+				if ($characters) {
+					$characters = 'True';
+				} else {
+					$characters = 'False';
+				}
+			}
+		}
+
+		$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 {
+					if ($arg) {
+						$arg = 'TRUE';
+					} else {
+						$arg = 'FALSE';
+					}
+				}
+			}
+			$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);
+
+		if ($decimals > 0) {
+			return money_format('%.'.$decimals.'n',$value);
+		} else {
+			$round = pow(10,abs($decimals));
+			if ($value < 0) { $round = 0-$round; }
+			$value = PHPExcel_Calculation_MathTrig::MROUND($value,$round);
+			//	The implementation of money_format used if the standard PHP function is not available can't handle decimal places of 0,
+			//		so we display to 1 dp and chop off that character and the decimal separator using substr
+			return substr(money_format('%.1n',$value),0,-2);
+		}
+	}	//	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) ? 'TRUE' : 'FALSE';
+			}
+
+			if (($offset > 0) && (strlen($haystack) > $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) ? 'TRUE' : 'FALSE';
+			}
+
+			if (($offset > 0) && (strlen($haystack) > $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
+	 *	@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);
+
+		$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) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		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
+	 * @param	int		$chars	Number of characters
+	 * @return	string
+	 */
+	public static function STRINGLENGTH($value = '') {
+		$value		= PHPExcel_Calculation_Functions::flattenSingleValue($value);
+
+		if (is_bool($value)) {
+			$value = ($value) ? 'TRUE' : 'FALSE';
+		}
+
+		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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_LOWER, 'UTF-8');
+		} else {
+			return strtoupper($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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_UPPER, 'UTF-8');
+		} else {
+			return 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) ? 'TRUE' : 'FALSE';
+		}
+
+		if (function_exists('mb_convert_case')) {
+			return mb_convert_case($mixedCaseString, MB_CASE_TITLE, 'UTF-8');
+		} else {
+			return ucwords($mixedCaseString);
+		}
+	}	//	function PROPERCASE()
+
+
+	/**
+	 *	REPLACE
+	 *
+	 *	@param	string	$value	Value
+	 *	@param	int		$start	Start character
+	 *	@param	int		$chars	Number of characters
+	 *	@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 $left.$newText.$right;
+	}	//	function SUBSTITUTE()
+
+
+	/**
+	 *	RETURNSTRING
+	 *
+	 *	@param	mixed	$value	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
+	 *	@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()
+
+}	//	class PHPExcel_Calculation_TextData

+ 351 - 0
protected/class/PHPExcel/Calculation/functionlist.txt

@@ -0,0 +1,351 @@
+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

+ 860 - 0
protected/class/PHPExcel/Cell.php

@@ -0,0 +1,860 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version		1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell
+ *
+ * @category   PHPExcel
+ * @package	PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ */
+class PHPExcel_Cell
+{
+	/**
+	 * Value binder to use
+	 *
+	 * @var PHPExcel_Cell_IValueBinder
+	 */
+	private static $_valueBinder = null;
+
+	/**
+	 * Column of the cell
+	 *
+	 * @var string
+	 */
+	private $_column;
+
+	/**
+	 * Row of the cell
+	 *
+	 * @var int
+	 */
+	private $_row;
+
+	/**
+	 * Value of the cell
+	 *
+	 * @var mixed
+	 */
+	private $_value;
+
+	/**
+	 * Calculated value of the cell (used for caching)
+	 *
+	 * @var mixed
+	 */
+	private $_calculatedValue = null;
+
+	/**
+	 * Type of the cell data
+	 *
+	 * @var string
+	 */
+	private $_dataType;
+
+	/**
+	 * Parent worksheet
+	 *
+	 * @var PHPExcel_Worksheet
+	 */
+	private $_parent;
+
+	/**
+	 * Index to cellXf
+	 *
+	 * @var int
+	 */
+	private $_xfIndex;
+
+	/**
+	 * Attributes of the formula
+	 *
+	 *
+	 */
+	private $_formulaAttributes;
+
+
+	/**
+	 * Send notification to the cache controller
+	 * @return void
+	 **/
+	public function notifyCacheController() {
+		$this->_parent->getCellCacheController()->updateCacheData($this);
+		return $this;
+	}
+
+	public function detach() {
+		$this->_parent = null;
+	}
+
+	public function attach($parent) {
+		$this->_parent = $parent;
+	}
+
+
+	/**
+	 * Create a new Cell
+	 *
+	 * @param	string				$pColumn
+	 * @param	int				$pRow
+	 * @param	mixed				$pValue
+	 * @param	string				$pDataType
+	 * @param	PHPExcel_Worksheet	$pSheet
+	 * @throws	Exception
+	 */
+	public function __construct($pColumn = 'A', $pRow = 1, $pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null)
+	{
+		// Initialise cell coordinate
+		$this->_column = strtoupper($pColumn);
+		$this->_row = $pRow;
+
+		// Initialise cell value
+		$this->_value = $pValue;
+
+		// Set worksheet
+		$this->_parent = $pSheet;
+
+		// Set datatype?
+		if ($pDataType !== null) {
+			if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
+				$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
+			$this->_dataType = $pDataType;
+		} else {
+			if (!self::getValueBinder()->bindValue($this, $pValue)) {
+				throw new Exception("Value could not be bound to cell.");
+			}
+		}
+
+		// set default index to cellXf
+		$this->_xfIndex = 0;
+	}
+
+	/**
+	 * Get cell coordinate column
+	 *
+	 * @return string
+	 */
+	public function getColumn()
+	{
+		return $this->_column;
+	}
+
+	/**
+	 * Get cell coordinate row
+	 *
+	 * @return int
+	 */
+	public function getRow()
+	{
+		return $this->_row;
+	}
+
+	/**
+	 * Get cell coordinate
+	 *
+	 * @return string
+	 */
+	public function getCoordinate()
+	{
+		return $this->_column . $this->_row;
+	}
+
+	/**
+	 * Get cell value
+	 *
+	 * @return mixed
+	 */
+	public function getValue()
+	{
+		return $this->_value;
+	}
+
+	/**
+	 * Get cell value with formatting
+	 *
+	 * @return string
+	 */
+	public function getFormattedValue()
+	{
+		return PHPExcel_Style_NumberFormat::toFormattedString( $this->getCalculatedValue(),
+						$this->_parent->getParent()->getCellXfByIndex($this->getXfIndex())->getNumberFormat()->getFormatCode()
+			   );
+	}
+
+	/**
+	 * Set cell value
+	 *
+	 * This clears the cell formula.
+	 *
+	 * @param mixed	$pValue					Value
+	 * @return PHPExcel_Cell
+	 */
+	public function setValue($pValue = null)
+	{
+		if (!self::getValueBinder()->bindValue($this, $pValue)) {
+			throw new Exception("Value could not be bound to cell.");
+		}
+		return $this;
+	}
+
+	/**
+	 * Set cell value (with explicit data type given)
+	 *
+	 * @param mixed	$pValue			Value
+	 * @param string	$pDataType		Explicit data type
+	 * @return PHPExcel_Cell
+	 * @throws 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_STRING2:
+				$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
+			case PHPExcel_Cell_DataType::TYPE_STRING:
+			case PHPExcel_Cell_DataType::TYPE_NULL:
+			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 Exception('Invalid datatype: ' . $pDataType);
+				break;
+		}
+
+		// set the datatype
+		$this->_dataType = $pDataType;
+
+		return $this->notifyCacheController();
+	}
+
+	/**
+	 * Get calculated cell value
+	 *
+	 * @return mixed
+	 */
+	public function getCalculatedValue($resetLog=true)
+	{
+//		echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().'<br />';
+		if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
+			try {
+//				echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value<br />';
+				$result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog);
+//				echo $this->getCoordinate().' calculation result is '.$result.'<br />';
+			} catch ( Exception $ex ) {
+//				echo 'Calculation Exception: '.$ex->getMessage().'<br />';
+				$result = '#N/A';
+				throw(new Exception($this->getParent()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()));
+			}
+
+			if ($result === '#Not Yet Implemented') {
+//				echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().'<br />';
+				return $this->_calculatedValue; // Fallback if calculation engine does not support the formula.
+			}
+//			echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().'<br />';
+			return $result;
+		}
+
+//		if (is_null($this->_value)) {
+//			echo 'Cell '.$this->getCoordinate().' has no value, formula or otherwise<br />';
+//			return null;
+//		}
+//		echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'<br />';
+		return $this->_value;
+	}
+
+	/**
+	 * Set calculated value (used for caching)
+	 *
+	 * @param mixed $pValue	Value
+	 * @return PHPExcel_Cell
+	 */
+	public function setCalculatedValue($pValue = null)
+	{
+		if (!is_null($pValue)) {
+			$this->_calculatedValue = $pValue;
+		}
+
+		return $this->notifyCacheController();
+	}
+
+	/**
+	 * Get old calculated value (cached)
+	 *
+	 * @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();
+	}
+
+	/**
+	 * Has Data validation?
+	 *
+	 * @return boolean
+	 */
+	public function hasDataValidation()
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot check for data validation when cell is not bound to a worksheet');
+		}
+
+		return $this->_parent->dataValidationExists($this->getCoordinate());
+	}
+
+	/**
+	 * Get Data validation
+	 *
+	 * @return PHPExcel_Cell_DataValidation
+	 */
+	public function getDataValidation()
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot get data validation for cell that is not bound to a worksheet');
+		}
+
+		return $this->_parent->getDataValidation($this->getCoordinate());
+	}
+
+	/**
+	 * Set Data validation
+	 *
+	 * @param	PHPExcel_Cell_DataValidation	$pDataValidation
+	 * @throws	Exception
+	 * @return PHPExcel_Cell
+	 */
+	public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null)
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot set data validation for cell that is not bound to a worksheet');
+		}
+
+		$this->_parent->setDataValidation($this->getCoordinate(), $pDataValidation);
+
+		return $this->notifyCacheController();
+	}
+
+	/**
+	 * Has Hyperlink
+	 *
+	 * @return boolean
+	 */
+	public function hasHyperlink()
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
+		}
+
+		return $this->_parent->hyperlinkExists($this->getCoordinate());
+	}
+
+	/**
+	 * Get Hyperlink
+	 *
+	 * @throws Exception
+	 * @return PHPExcel_Cell_Hyperlink
+	 */
+	public function getHyperlink()
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
+		}
+
+		return $this->_parent->getHyperlink($this->getCoordinate());
+	}
+
+	/**
+	 * Set Hyperlink
+	 *
+	 * @param	PHPExcel_Cell_Hyperlink	$pHyperlink
+	 * @throws	Exception
+	 * @return PHPExcel_Cell
+	 */
+	public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null)
+	{
+		if (!isset($this->_parent)) {
+			throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
+		}
+
+		$this->_parent->setHyperlink($this->getCoordinate(), $pHyperlink);
+
+		return $this->notifyCacheController();
+	}
+
+	/**
+	 * Get parent
+	 *
+	 * @return PHPExcel_Worksheet
+	 */
+	public function getParent() {
+		return $this->_parent;
+	}
+
+	/**
+	 * Re-bind parent
+	 *
+	 * @param PHPExcel_Worksheet $parent
+	 * @return PHPExcel_Cell
+	 */
+	public function rebindParent(PHPExcel_Worksheet $parent) {
+		$this->_parent = $parent;
+
+		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) = PHPExcel_Cell::rangeBoundaries($pRange);
+
+		// Translate properties
+		$myColumn	= PHPExcel_Cell::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	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 Exception('Cell coordinate string can not be a range of cells.');
+		} elseif ($pCoordinateString == '') {
+			throw new Exception('Cell coordinate can not be zero-length string.');
+		} else {
+			throw new Exception('Invalid cell coordinate '.$pCoordinateString);
+		}
+	}
+
+	/**
+	 * Make string row, column or cell coordinate absolute
+	 *
+	 * @param	string	$pCoordinateString		e.g. 'A' or '1' or 'A1'
+	 * @return	string	Absolute coordinate		e.g. '$A' or '$1' or '$A$1'
+	 * @throws	Exception
+	 */
+	public static function absoluteReference($pCoordinateString = 'A1')
+	{
+		if (strpos($pCoordinateString,':') === false && strpos($pCoordinateString,',') === false) {
+			// Create absolute coordinate
+			if (ctype_digit($pCoordinateString)) {
+				return '$'.$pCoordinateString;
+			} elseif (ctype_alpha($pCoordinateString)) {
+				return '$'.strtoupper($pCoordinateString);
+			}
+			return self::absoluteCoordinate($pCoordinateString);
+		} else {
+			throw new Exception("Coordinate string should not be a cell range.");
+		}
+	}
+
+	/**
+	 * Make string coordinate absolute
+	 *
+	 * @param	string	$pCoordinateString		e.g. 'A1'
+	 * @return	string	Absolute coordinate		e.g. '$A$1'
+	 * @throws	Exception
+	 */
+	public static function absoluteCoordinate($pCoordinateString = 'A1')
+	{
+		if (strpos($pCoordinateString,':') === false && strpos($pCoordinateString,',') === false) {
+			// Create absolute coordinate
+			list($column, $row) = PHPExcel_Cell::coordinateFromString($pCoordinateString);
+			if ($column[0] == '$')	$column = substr($column,1);
+			if ($row[0] == '$')		$row = substr($row,1);
+			return '$' . $column . '$' . $row;
+		} else {
+			throw new Exception("Coordinate string should not be a cell range.");
+		}
+	}
+
+	/**
+	 * Split range into coordinate strings
+	 *
+	 * @param	string	$pRange
+	 * @return	array	Array containg one or more arrays containing one or two coordinate strings
+	 */
+	public static function splitRange($pRange = 'A1:A1')
+	{
+		$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	Exception
+	 */
+	public static function buildRange($pRange)
+	{
+		// Verify range
+		if (!is_array($pRange) || count($pRange) == 0 || !is_array($pRange[0])) {
+			throw new 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 (Start Cell, End Cell) where Start Cell and End Cell are arrays (Column Number, Row Number)
+	 */
+	public static function rangeBoundaries($pRange = 'A1:A1')
+	{
+		// 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 = PHPExcel_Cell::coordinateFromString($rangeA);
+		$rangeEnd	= PHPExcel_Cell::coordinateFromString($rangeB);
+
+		// Translate column into index
+		$rangeStart[0]	= PHPExcel_Cell::columnIndexFromString($rangeStart[0]);
+		$rangeEnd[0]	= PHPExcel_Cell::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) = PHPExcel_Cell::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 boundaries (staring Column, starting Row, Final Column, Final Row)
+	 */
+	public static function getRangeBoundaries($pRange = 'A1:A1')
+	{
+		// 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 !!!)
+	 * @throws	Exception
+	 */
+	public static function columnIndexFromString($pString = 'A')
+	{
+		//	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})) {
+				return $_columnLookup[$pString];
+			} elseif(!isset($pString{2})) {
+				return $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
+			} elseif(!isset($pString{3})) {
+				return $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
+			}
+		}
+		throw new 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)
+	{
+		// Determine column string
+		if ($pColumnIndex < 26) {
+			return chr(65 + $pColumnIndex);
+		} elseif ($pColumnIndex < 702) {
+			return chr(64 + ($pColumnIndex / 26)).chr(65 + $pColumnIndex % 26);
+		}
+		return chr(64 + (($pColumnIndex - 26) / 676)).chr(65 + ((($pColumnIndex - 26) % 676) / 26)).chr(65 + $pColumnIndex % 26);
+	}
+
+	/**
+	 * Extract all cell references in range
+	 *
+	 * @param	string	$pRange		Range (e.g. A1 or A1:A10 or A1:A10 A100:A1000)
+	 * @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 = PHPExcel_Cell::splitRange($cellBlock);
+			foreach($ranges as $range) {
+				// Single cell?
+				if (!isset($range[1])) {
+					$returnValue[] = $range[0];
+					continue;
+				}
+
+				// Range...
+				list($rangeStart, $rangeEnd)	= $range;
+				list($startCol, $startRow)	= sscanf($rangeStart,'%[A-Z]%d');
+				list($endCol, $endRow)		= sscanf($rangeEnd,'%[A-Z]%d');
+				$endCol++;
+
+				// Current data
+				$currentCol	= $startCol;
+				$currentRow	= $startRow;
+
+				// Loop cells
+				while ($currentCol != $endCol) {
+					while ($currentRow <= $endRow) {
+						$returnValue[] = $currentCol.$currentRow;
+						++$currentRow;
+					}
+					++$currentCol;
+					$currentRow = $startRow;
+				}
+			}
+		}
+
+		// Return value
+		return $returnValue;
+	}
+
+	/**
+	 * Compare 2 cells
+	 *
+	 * @param	PHPExcel_Cell	$a	Cell a
+	 * @param	PHPExcel_Cell	$a	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->_row < $b->_row) {
+			return -1;
+		} elseif ($a->_row > $b->_row) {
+			return 1;
+		} elseif (PHPExcel_Cell::columnIndexFromString($a->_column) < PHPExcel_Cell::columnIndexFromString($b->_column)) {
+			return -1;
+		} else {
+			return 1;
+		}
+	}
+
+	/**
+	 * Get value binder to use
+	 *
+	 * @return PHPExcel_Cell_IValueBinder
+	 */
+	public static function getValueBinder() {
+		if (is_null(self::$_valueBinder)) {
+			self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder();
+		}
+
+		return self::$_valueBinder;
+	}
+
+	/**
+	 * Set value binder to use
+	 *
+	 * @param PHPExcel_Cell_IValueBinder $binder
+	 * @throws Exception
+	 */
+	public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null) {
+		if (is_null($binder)) {
+			throw new 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();
+	}
+
+
+	public function setFormulaAttributes($pAttributes)
+	{
+		$this->_formulaAttributes = $pAttributes;
+		return $this;
+	}
+
+	public function getFormulaAttributes()
+	{
+		return $this->_formulaAttributes;
+	}
+
+}
+

+ 232 - 0
protected/class/PHPExcel/Cell/.svn/entries

@@ -0,0 +1,232 @@
+10
+
+dir
+161
+svn://192.168.1.106/zhask/cost/protected/class/PHPExcel/Cell
+svn://192.168.1.106
+
+
+
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+72704985-c26a-2542-8164-61969eb8b6cb
+
+IValueBinder.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+58c74b45bdb60cdbb340a1be493ee8ba
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1505
+
+DataType.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+5159efff1e1050a1a5d44a47a2855907
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3151
+
+DataValidation.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+eb9353878bf004d782b4ae4ceb9065c6
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9148
+
+DefaultValueBinder.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+fbf92282f7564783ec50e328516da277
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3080
+
+Hyperlink.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+adaa0295d0b142c5dd31bcf08967c2a6
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2753
+
+AdvancedValueBinder.php
+file
+
+
+
+
+2011-02-27T08:37:50.000000Z
+5beb16b466aca22cd3f7d6b3b87d67fc
+2012-10-11T09:52:50.414311Z
+109
+admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5122
+

+ 140 - 0
protected/class/PHPExcel/Cell/.svn/text-base/AdvancedValueBinder.php.svn-base

@@ -0,0 +1,140 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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 percentage
+			if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) {
+				// Convert value to number
+				$cell->setValueExplicit( (float)str_replace('%', '', $value) / 100, PHPExcel_Cell_DataType::TYPE_NUMERIC);
+				// Set style
+				$cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE );
+				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)) {
+				list($h, $m) = explode(':', $value);
+				$days = $h / 24 + $m / 1440;
+				// Convert value to number
+				$cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
+				// Set style
+				$cell->getParent()->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)) {
+				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->getParent()->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->getParent()->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->getParent()->getStyle( $cell->getCoordinate() )->getAlignment()->setWrapText(true);
+				return true;
+			}
+		}
+
+		// Not bound yet? Use parent...
+		return parent::bindValue($cell, $value);
+	}
+}

+ 114 - 0
protected/class/PHPExcel/Cell/.svn/text-base/DataType.php.svn-base

@@ -0,0 +1,114 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_DataType
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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			= 's';
+    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
+	 * @param	mixed 	$pValue
+	 * @return 	int
+	 */
+	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;
+	}
+
+}

+ 474 - 0
protected/class/PHPExcel/Cell/.svn/text-base/DataValidation.php.svn-base

@@ -0,0 +1,474 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_DataValidation
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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
+     *
+     * @throws	Exception
+     */
+    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;
+			}
+		}
+	}
+}

+ 106 - 0
protected/class/PHPExcel/Cell/.svn/text-base/DefaultValueBinder.php.svn-base

@@ -0,0 +1,106 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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);
+		}
+
+		// Set value explicit
+		$cell->setValueExplicit( $value, PHPExcel_Cell_DataType::dataTypeForValue($value) );
+
+		// Done!
+		return true;
+	}
+
+	/**
+	 * DataType for value
+	 *
+	 * @param	mixed 	$pValue
+	 * @return 	int
+	 */
+	public static function dataTypeForValue($pValue = null) {
+		// Match the value against a few data types
+		if (is_null($pValue)) {
+			return PHPExcel_Cell_DataType::TYPE_NULL;
+
+		} elseif ($pValue === '') {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		} elseif ($pValue instanceof PHPExcel_RichText) {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		} 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]+)$/', $pValue)) {
+			return PHPExcel_Cell_DataType::TYPE_NUMERIC;
+
+		} elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) {
+			return PHPExcel_Cell_DataType::TYPE_ERROR;
+
+		} else {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		}
+	}
+}

+ 127 - 0
protected/class/PHPExcel/Cell/.svn/text-base/Hyperlink.php.svn-base

@@ -0,0 +1,127 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_Hyperlink
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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
+     * @throws	Exception
+     */
+    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 sheet)
+	 *
+	 * @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__
+    	);
+    }
+}

+ 46 - 0
protected/class/PHPExcel/Cell/.svn/text-base/IValueBinder.php.svn-base

@@ -0,0 +1,46 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_IValueBinder
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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);
+}

+ 140 - 0
protected/class/PHPExcel/Cell/AdvancedValueBinder.php

@@ -0,0 +1,140 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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 percentage
+			if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) {
+				// Convert value to number
+				$cell->setValueExplicit( (float)str_replace('%', '', $value) / 100, PHPExcel_Cell_DataType::TYPE_NUMERIC);
+				// Set style
+				$cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE );
+				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)) {
+				list($h, $m) = explode(':', $value);
+				$days = $h / 24 + $m / 1440;
+				// Convert value to number
+				$cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
+				// Set style
+				$cell->getParent()->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)) {
+				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->getParent()->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->getParent()->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->getParent()->getStyle( $cell->getCoordinate() )->getAlignment()->setWrapText(true);
+				return true;
+			}
+		}
+
+		// Not bound yet? Use parent...
+		return parent::bindValue($cell, $value);
+	}
+}

+ 114 - 0
protected/class/PHPExcel/Cell/DataType.php

@@ -0,0 +1,114 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_DataType
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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			= 's';
+    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
+	 * @param	mixed 	$pValue
+	 * @return 	int
+	 */
+	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;
+	}
+
+}

+ 474 - 0
protected/class/PHPExcel/Cell/DataValidation.php

@@ -0,0 +1,474 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_DataValidation
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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
+     *
+     * @throws	Exception
+     */
+    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;
+			}
+		}
+	}
+}

+ 106 - 0
protected/class/PHPExcel/Cell/DefaultValueBinder.php

@@ -0,0 +1,106 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/** 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 - 2011 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);
+		}
+
+		// Set value explicit
+		$cell->setValueExplicit( $value, PHPExcel_Cell_DataType::dataTypeForValue($value) );
+
+		// Done!
+		return true;
+	}
+
+	/**
+	 * DataType for value
+	 *
+	 * @param	mixed 	$pValue
+	 * @return 	int
+	 */
+	public static function dataTypeForValue($pValue = null) {
+		// Match the value against a few data types
+		if (is_null($pValue)) {
+			return PHPExcel_Cell_DataType::TYPE_NULL;
+
+		} elseif ($pValue === '') {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		} elseif ($pValue instanceof PHPExcel_RichText) {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		} 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]+)$/', $pValue)) {
+			return PHPExcel_Cell_DataType::TYPE_NUMERIC;
+
+		} elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) {
+			return PHPExcel_Cell_DataType::TYPE_ERROR;
+
+		} else {
+			return PHPExcel_Cell_DataType::TYPE_STRING;
+
+		}
+	}
+}

+ 127 - 0
protected/class/PHPExcel/Cell/Hyperlink.php

@@ -0,0 +1,127 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_Hyperlink
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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
+     * @throws	Exception
+     */
+    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 sheet)
+	 *
+	 * @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__
+    	);
+    }
+}

+ 46 - 0
protected/class/PHPExcel/Cell/IValueBinder.php

@@ -0,0 +1,46 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Cell_IValueBinder
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel_Cell
+ * @copyright  Copyright (c) 2006 - 2011 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);
+}

+ 317 - 0
protected/class/PHPExcel/Comment.php

@@ -0,0 +1,317 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_Comment
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel
+ * @copyright  Copyright (c) 2006 - 2011 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	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;
+			}
+		}
+	}
+}

+ 588 - 0
protected/class/PHPExcel/DocumentProperties.php

@@ -0,0 +1,588 @@
+<?php
+/**
+ *	PHPExcel
+ *
+ *	Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ *	@license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ *	@version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_DocumentProperties
+ *
+ * @category	PHPExcel
+ * @package		PHPExcel
+ * @copyright	Copyright (c) 2006 - 2011 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 (is_null($pValue)) {
+			$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 (is_null($pValue)) {
+			$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 ((is_null($propertyType)) || (!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 (is_null($propertyValue)) {
+				$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;
+	}
+
+}

+ 218 - 0
protected/class/PHPExcel/DocumentSecurity.php

@@ -0,0 +1,218 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version    1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_DocumentSecurity
+ *
+ * @category   PHPExcel
+ * @package    PHPExcel
+ * @copyright  Copyright (c) 2006 - 2011 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;
+			}
+		}
+	}
+}

+ 202 - 0
protected/class/PHPExcel/HashTable.php

@@ -0,0 +1,202 @@
+<?php
+/**
+ * PHPExcel
+ *
+ * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @license	http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
+ * @version	1.7.6, 2011-02-27
+ */
+
+
+/**
+ * PHPExcel_HashTable
+ *
+ * @category   PHPExcel
+ * @package	PHPExcel
+ * @copyright  Copyright (c) 2006 - 2011 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	Exception
+	 */
+	public function __construct($pSource = null)
+	{
+		if (!is_null($pSource)) {
+			// Create HashTable
+			$this->addFromSource($pSource);
+		}
+	}
+
+	/**
+	 * Add HashTable items from source
+	 *
+	 * @param	PHPExcel_IComparable[] $pSource	Source array to create HashTable from
+	 * @throws	Exception
+	 */
+	public function addFromSource($pSource = null) {
+		// Check if an array was passed
+		if ($pSource == null) {
+			return;
+		} else if (!is_array($pSource)) {
+			throw new Exception('Invalid array parameter passed.');
+		}
+
+		foreach ($pSource as $item) {
+			$this->add($item);
+		}
+	}
+
+	/**
+	 * Add HashTable item
+	 *
+	 * @param	PHPExcel_IComparable $pSource	Item to add
+	 * @throws	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	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;
+			}
+		}
+	}
+}

+ 43 - 0
protected/class/PHPExcel/IComparable.php

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

+ 0 - 0
protected/class/PHPExcel/IOFactory.php


Some files were not shown because too many files changed in this diff