Pman/Roo.php wip_edward_T5642_Report_designer_hebe
authorEdward <edward@roojs.com>
Mon, 7 Jan 2019 07:07:32 +0000 (15:07 +0800)
committerEdward <edward@roojs.com>
Mon, 7 Jan 2019 07:07:32 +0000 (15:07 +0800)
Pman/Roo.php

index 362dfb7..78c897f 100644 (file)
@@ -502,7 +502,23 @@ class Pman_Roo extends Pman
             //echo "<PRE>"; print_r(array($_REQUEST['csvCols'], $x->toArray())); exit;
             $line = array();
             
+            if ($cols== '*') {
+                $cols= array_keys($x);
+            }
+            
+            if(!is_array($cols)) {
+                $cols = explode(',', $cols);
+            }
+
             if ($titles !== false) {
+                if ($titles== '*') {
+                    $titles= array_keys($x);
+                }
+
+                if(!is_array($titles)) {
+                    $titles = explode(',', $titles);
+                }
+
                 foreach($cols as $i=>$col) {
                     $se_config['cols'][] = array(
                         'header'=> isset($titles[$i]) ? $titles[$i] : $col,
@@ -522,17 +538,15 @@ class Pman_Roo extends Pman
                 $titles = false;
             }
             
-            
-            
             $se->addLine($se_config['workbook'], $x);
         }
+        
         if(!$se){
             $this->jerr('no data found');
         }
+        
         $se->send($fn .'.xls');
         exit;
-    
-        
         
     }