[ "a", "b" ]
[],
[ "A", "B" ]
+ [ "a", ["test", "left"] ] << sub array [text, formatname]
],
* cols : array(
array(
}
+
+ static function date($str)
+ {
+
+ return (strtotime($str . ' UTC') + (86400 * 25569)) / 86400;
+
+ }
+
+
function buildpage($workbook, $formats , $data,$cfg)
{
//echo '<PRE>'; print_R($cfg);
if (!empty($cfg['head'])) {
foreach($cfg['head'] as $row) {
foreach($row as $c => $col) {
+ if (is_array($col)) {
+ $format = isset($formats[$col[1]] ) ? $formats[$col[1]] : false;
+ $worksheet->write($start_row, $c, $col[0], $format);
+ continue;
+ }
+
$worksheet->write($start_row, $c, $col);
}
foreach($cfg['foot'] as $row) {
foreach($row as $c => $col) {
// if it's an array? - formated ???
+ if (is_array($col)) {
+ $format = isset($formats[$col[1]] ) ? $formats[$col[1]] : false;
+ $worksheet->write($start_row, $c, $col[0], $format);
+ continue;
+ }
$worksheet->write($start_row, $c, $col);
}