作者 王智

baoxiu22

@@ -108,7 +108,8 @@ class Dashboard extends Backend @@ -108,7 +108,8 @@ class Dashboard extends Backend
108 108
109 109
110 //自定义导出 110 //自定义导出
111 - public function exportDayInner(){ 111 + public function exportDayInner()
  112 + {
112 //月 起止时间戳 113 //月 起止时间戳
113 $start_time = mktime(0, 0, 0, date('m'), 1, date('Y')); 114 $start_time = mktime(0, 0, 0, date('m'), 1, date('Y'));
114 $end_time = mktime(23, 59, 59, date('m'), date('t'), date('Y')); 115 $end_time = mktime(23, 59, 59, date('m'), date('t'), date('Y'));
@@ -171,6 +172,22 @@ class Dashboard extends Backend @@ -171,6 +172,22 @@ class Dashboard extends Backend
171 header("Content-Type:application/download");; 172 header("Content-Type:application/download");;
172 header('Content-Disposition:attachment;filename="入库明细表.xls"'); 173 header('Content-Disposition:attachment;filename="入库明细表.xls"');
173 header("Content-Transfer-Encoding:binary"); 174 header("Content-Transfer-Encoding:binary");
174 - echo $table; 175 +// echo $table->downLoad();
  176 + $this->downLoad($table);
  177 + }
  178 +
  179 + private $head;
  180 + private $body;
  181 +
  182 + public function downLoad($filename = '')
  183 + {
  184 + if (!$filename)
  185 + $filename = date('YmdHis', time()) . '.xls';
  186 + header("Content-type:application/vnd.ms-excel");
  187 + header("Content-Disposition:filename=$filename");
  188 + header("Content-Type:charset=gb2312");
  189 + if ($this->head)
  190 + echo $this->head;
  191 + echo $this->body;
175 } 192 }
176 } 193 }