当前位置: 首页>>代码示例>>PHP>>正文


PHP Excel::downLoad方法代码示例

本文整理汇总了PHP中Excel::downLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Excel::downLoad方法的具体用法?PHP Excel::downLoad怎么用?PHP Excel::downLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Excel的用法示例。


在下文中一共展示了Excel::downLoad方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: webcountexportAction

 /**
  * 流程导出功能
  */
 public function webcountexportAction()
 {
     $stationid = reqnum('stationid', 1);
     $model = new Psys_StationModel();
     $stationname = $model->GetOne(array('id' => $stationid), 'stationname', 'rha_station');
     $data = $model->webcountexport($stationid, $page, $pagesize);
     $databody = array();
     foreach ($data as $k => $v) {
         $databody[$k][] = $v['date'];
         $databody[$k][] = $v['link'];
         $databody[$k][] = $v['ad'];
         $databody[$k][] = $v['reg'];
         $databody[$k][] = $v['login'];
         $databody[$k][] = $v['sindex'];
     }
     $header = array('日期', 'WIFI连接', '广告页1/uv', '注册页/uv', '注册成功数/uv', '首页/uv');
     require COMMON_PATH . 'XExportExcel.php';
     $excel = new Excel();
     $excel->addHeader($header);
     $excel->addBody($databody);
     $excel->downLoad($stationname['stationname']);
 }
开发者ID:haitao1880,项目名称:study,代码行数:25,代码来源:stationController.php

示例2: charset

    {
        if (!$filename) {
            $filename = date('YmdHis', time()) . '.xls';
        }
        header("Content-type:application/vnd.ms-excel");
        header("Content-Disposition:attachment;filename={$filename}");
        header("Content-Type:charset=utf-8");
        if ($this->head) {
            echo $this->head;
        }
        echo $this->body;
    }
    public function charset($string)
    {
        return mb_convert_encoding($string, 'utf-8', 'auto');
    }
}
$excel = new Excel();
$excel->addHeader(array('title', 'source', 'pubtime', 'writer', 'body'));
global $dsql;
$sql = "select dede_archives.title,dede_archives.source,dede_archives.pubdate,dede_archives.writer,dede_addonarticle.body from dede_archives,dede_addonarticle where dede_addonarticle.aid=dede_archives.id";
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
    $row[body] = base64_encode($row[body]);
    $list[] = $row;
}
unset($row);
$excel->addBody($list);
$excel->downLoad();
开发者ID:Miliup,项目名称:miliofficeweb,代码行数:30,代码来源:toexcel.php

示例3: exportphoneAction

 /**
  * 导出电话号码到excel
  */
 public function exportphoneAction()
 {
     $sdate = reqstr('sdate');
     $edate = reqstr('edate');
     $carid = reqstr('carid');
     if (!$sdate || !$edate || !$carid) {
         return array('status' => 0, 'msg' => '非法操作');
     }
     $where['date_>='] = $sdate;
     $where['date_<='] = $edate;
     $where['carid'] = $carid;
     $obj = new PSys_BusModel();
     $obj->SetDb('bus_db');
     $res = $obj->GetList($where, '', 0, 0, 'date,phone,gonettime', 'rb_gonet_time');
     $carname = $this->GetBusName($carid, 'bus');
     if (empty($res['allrow'])) {
         return array('status' => 0, 'msg' => '没有数据');
     }
     foreach ($res['allrow'] as &$v) {
         array_push($v, $carname);
         $v = array_values($v);
     }
     $result['table_title'] = array('日期', '手机号', '获取验证码到成功上网的时间', '汽车');
     $result['table_data'] = $res['allrow'];
     require COMMON_PATH . 'XExportExcel.php';
     $excel = new Excel();
     $excel->addHeader($result['table_title']);
     $excel->addBody($result['table_data']);
     $excel->downLoad($carname . '手机号');
 }
开发者ID:haitao1880,项目名称:study,代码行数:33,代码来源:busController.php

示例4: exportbddataAction

 /**
  * 导出保单流程数据
  */
 public function exportbddataAction()
 {
     $data = reqstr('data');
     $data = urldecode($data);
     $info = array();
     parse_str($data, $info);
     $sdate = reqstr('sdate', '');
     $edate = reqstr('edate', '');
     if (!$sdate || !$edate) {
         if (!$sdate) {
             $sdate = date('Y-m-d', strtotime('-1 day'));
         }
         $edate = $sdate;
     }
     if ($edate < $sdate) {
         return array('status' => 0, 'msg' => '时间区间选择有误');
     }
     $stationids = reqstr('stationid', '');
     $stationids = rtrim($stationids, ',');
     $where['cday_>='] = $sdate;
     $where['cday_<='] = $edate;
     $where['station_id_IN'] = $stationids;
     $where['type'] = 4;
     $fild = 'cday,station_id,connect_wifi,ad1_page,register_page,send_sms_success,register_success,free_wifi_click,sindex';
     $res = $this->obj->GetList($where, 'station_id ASC', 0, 0, $fild, 'rha_allprocess');
     //表格数据展示
     $result['table_title'] = array('日期', '车站', '连接数', '广告1', '人寿保单注册页', '短信发送成功', '保单领取成功', '点击上网人数', '首页');
     foreach ($res['allrow'] as $key => &$val) {
         $val['station_id'] = $this->obj->GetStationName($val['station_id']);
         $val = array_values($val);
     }
     $table_data = $res['allrow'];
     $isexport = reqnum('isexport', 0);
     if ($isexport) {
         require COMMON_PATH . 'XExportExcel.php';
         $excel = new Excel();
         $excel->addHeader($result['table_title']);
         $excel->addBody($table_data);
         $excel->downLoad('人寿保单注册流程');
     }
 }
开发者ID:haitao1880,项目名称:study,代码行数:44,代码来源:trainstationController.php


注:本文中的Excel::downLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。