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


PHP Excel::addRows方法代码示例

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


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

示例1: onlogView

 function onlogView($msg = '', $ty = '')
 {
     $action = "index.php?admin_log/logView";
     $hasLogViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "logView");
     $hasLogViewPrivilege['url'] = "?admin_main";
     $hasLogViewPrivilege['return'] = true;
     !$hasLogViewPrivilege['return'] && __msg($hasLogViewPrivilege);
     $LogTypeList = $this->ask_config->getLogType();
     $operator_list = $_ENV['operator']->getList(0, 0);
     $ConditionList['StartDate'] = isset($this->post['StartDate']) ? $this->post['StartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time()));
     $ConditionList['EndDate'] = isset($this->post['EndDate']) ? $this->post['EndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time()));
     $ConditionList['EndDate'] = min($ConditionList['EndDate'], date("Y-m-d", time()), date("Y-m-t", strtotime($ConditionList['StartDate'])));
     $ConditionList['operatorId'] = isset($this->post['operatorId']) ? intval(urldecode($this->post['operatorId'])) : (isset($this->get[4]) ? intval(urldecode($this->get[4])) : 0);
     $ConditionList['operator'] = !in_array($ConditionList['operatorId'], array(-2, -1, 0)) ? $operator_list[$ConditionList['operatorId']]['login_name'] : $ConditionList['operatorId'];
     $ConditionList['QuestionId'] = isset($this->post['QuestionId']) ? intval($this->post['QuestionId']) : (isset($this->get[5]) ? intval($this->get[5]) : 0);
     $ConditionList['log_type_id'] = isset($this->post['log_type_id']) ? intval(urldecode($this->post['log_type_id'])) : (isset($this->get[6]) ? intval(urldecode($this->get[6])) : 0);
     $ConditionList['AuthorName'] = isset($this->post['AuthorName']) ? trim(urldecode($this->post['AuthorName'])) : (isset($this->get[7]) ? trim(urldecode($this->get[7])) : '');
     $ConditionList['log_type'] = $ConditionList['log_type_id'] ? $LogTypeList[$ConditionList['log_type_id']] : $ConditionList['log_type_id'];
     @($page = max(1, intval($this->get[8])));
     $export = trim($this->get[9]) == "export" ? 1 : 0;
     $setting = $this->setting;
     if (!$export) {
         $pagesize = $this->setting['list_default'];
         $pagesize = 20;
         $log_list = $_ENV['log']->getLogList($ConditionList, $page, $pagesize);
         $departstr = page($log_list['LogCount'], $pagesize, $page, "admin_log/logView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['operatorId']) . "/" . $ConditionList['QuestionId'] . "/" . $ConditionList['log_type_id'] . "/" . urlencode($ConditionList['AuthorName']));
         $downloadstr = page_url("<下载EXCEL表格>", "admin_log/logView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['operatorId']) . "/" . $ConditionList['QuestionId'] . "/" . $ConditionList['log_type_id'] . "/" . urlencode($ConditionList['AuthorName']) . "/" . $page . "/export");
         $msg && ($message = $msg);
         $ty && ($type = $ty);
     } else {
         set_time_limit(0);
         $page = 1;
         $pagesize = 1000;
         $num = 1;
         require TIPASK_ROOT . '/lib/Excel.php';
         $oExcel = new Excel();
         $FileName = '操作日志表';
         $oExcel->download($FileName)->addSheet('日志表');
         //标题栏
         $title = array("日志ID", "对应问题ID", "用户名", "操作人", "操作时间", "日志内容");
         $oExcel->addRows(array($title));
         while ($num > 0) {
             $log_list = $_ENV['log']->getLogList($ConditionList, $page, $pagesize);
             foreach ($log_list['LogList'] as $key => $value) {
                 $value['message'] = htmlspecialchars_decode($value['message']);
                 $log_list['LogList'][$key]['message'] = preg_replace("/<(.*?)>/", "", $value['message']);
                 $excelArr = array("id" => $log_list['LogList'][$key]['id'], "qid" => $log_list['LogList'][$key]['qid'], "AuthorName" => $log_list['LogList'][$key]['AuthorName'], "user" => $log_list['LogList'][$key]['user'], "time" => date("Y-m-d H:i:s", $log_list['LogList'][$key]['time']), "message" => $log_list['LogList'][$key]['message']);
                 $oExcel->addRows(array($excelArr));
             }
             $page++;
             $num = count($order_list['OrderList']);
         }
         $oExcel->closeSheet()->close();
     }
     include template('logview', 'admin');
 }
开发者ID:eappl,项目名称:prototype,代码行数:56,代码来源:log.php

示例2: onbindLogView

 function onbindLogView($msg = '', $ty = '')
 {
     $action = "index.php?admin_binding/bindLogView";
     $hasOrderLogViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "bindLogView");
     $hasOrderLogViewPrivilege['url'] = "?admin_main";
     !$hasOrderLogViewPrivilege['return'] && __msg($hasOrderLogViewPrivilege);
     $ConditionList['StartDate'] = isset($this->post['StartDate']) ? $this->post['StartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time()));
     $ConditionList['EndDate'] = isset($this->post['EndDate']) ? $this->post['EndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time()));
     $ConditionList['author'] = isset($this->post['author']) ? trim(urldecode($this->post['author'])) : (isset($this->get[4]) ? trim(urldecode($this->get[4])) : "");
     $ConditionList['EndDate'] = min($ConditionList['EndDate'], date("Y-m-d", time()), date("Y-m-t", strtotime($ConditionList['StartDate'])));
     $OperatorInfo = $_ENV['operator']->getByColumn("login_name", urldecode($this->ask_login_name));
     $ConditionList['operator_loginId'] = isset($this->post['operator_loginId']) ? trim(urldecode($this->post['operator_loginId'])) : (isset($this->get[5]) ? trim(urldecode($this->get[5])) : "");
     if ($ConditionList['operator_loginId'] != "") {
         $OperatorInfo = $_ENV['operator']->getByColumn("login_name", urldecode($ConditionList['operator_loginId']));
         if ($OperatorInfo['id']) {
             $ConditionList['scopid'] = $OperatorInfo['id'];
         } else {
             $ConditionList['operator_loginId'] = "";
         }
     }
     $ConditionList['bid'] = isset($this->post['bid']) ? trim($this->post['bid']) : (isset($this->get[6]) ? trim($this->get[6]) : 'all');
     $BindTypeList = $this->ask_config->getBindOperateType();
     @($page = max(1, intval($this->get[7])));
     $export = trim($this->get[8]) == "export" ? 1 : 0;
     $setting = $this->setting;
     if (!$export) {
         $pagesize = $this->setting['list_default'];
         $pagesize = 20;
         $bind_log_list = $_ENV['bind_log']->getBindLogList($ConditionList, $page, $pagesize);
         foreach ($bind_log_list['BindLogList'] as $key => $value) {
             if (!isset($OperatorList[$value['scopid']])) {
                 $OperatorList[$value['scid']] = $_ENV['operator']->get($value['scid']);
             }
             $bind_log_list['BindLogList'][$key]['login_name'] = $OperatorList[$value['scid']]['login_name'];
             $bind_log_list['BindLogList'][$key]['bind_type'] = $BindTypeList[$value['bind_type']];
         }
         $departstr = page($bind_log_list['BindLogCount'], $pagesize, $page, "admin_binding/bindLogView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['author']) . "/" . urlencode($ConditionList['operator_loginId']) . "/" . $ConditionList['bid']);
         $downloadstr = page_url("<下载EXCEL表格>", "admin_binding/bindLogView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['author']) . "/" . urlencode($ConditionList['operator_loginId']) . "/" . $ConditionList['bid'] . "/" . $page . "/export");
         $msg && ($message = $msg);
         $ty && ($type = $ty);
     } else {
         set_time_limit(0);
         $page = 1;
         $pagesize = 1000;
         $num = 1;
         require TIPASK_ROOT . '/lib/Excel.php';
         $oExcel = new Excel();
         $FileName = '专属客服绑定记录表';
         $oExcel->download($FileName)->addSheet('绑定记录表');
         //标题栏
         $title = array("客服账号", "被绑定用户帐号", "操作类型", "操作时间");
         $oExcel->addRows(array($title));
         while ($num > 0) {
             $bind_log_list = $_ENV['bind_log']->getBindLogList($ConditionList, $page, $pagesize);
             foreach ($bind_log_list['BindLogList'] as $key => $value) {
                 if (!isset($OperatorList[$value['scopid']])) {
                     $OperatorList[$value['scid']] = $_ENV['operator']->get($value['scid']);
                 }
                 $bind_log_list['BindLogList'][$key]['login_name'] = $OperatorList[$value['scid']]['login_name'];
                 $bind_log_list['BindLogList'][$key]['bind_type'] = $BindTypeList[$value['bind_type']];
                 $excelArr = array("login_name" => $bind_log_list['BindLogList'][$key]['login_name'], "author" => $bind_log_list['BindLogList'][$key]['author'], "bind_type" => $bind_log_list['BindLogList'][$key]['bind_type'], "time" => date("Y-m-d H:i:s", $bind_log_list['BindLogList'][$key]['time']));
                 $oExcel->addRows(array($excelArr));
             }
             $page++;
             $num = count($bind_log_list['BindLogList']);
         }
         $oExcel->closeSheet()->close();
     }
     include template('bindLogview', 'admin');
 }
开发者ID:eappl,项目名称:prototype,代码行数:70,代码来源:binding.php

示例3: ondatamonth

 function ondatamonth()
 {
     set_time_limit(0);
     $year = trim($this->get[2]);
     $data_arr = $_ENV['question']->getDataMonth($year);
     require TIPASK_ROOT . '/lib/Excel.php';
     $oExcel = new Excel();
     $FileName = $year . "年每月数据";
     $oExcel->download($FileName);
     $sheetArr = array('total_count' => '总咨询量', 'handle_count' => '已处理', 'yes' => '满意', 'no' => '不满意', 'none' => '未评价');
     foreach ($sheetArr as $key => $value) {
         $oExcel->addSheet($value);
         $title = array('-1' => $value);
         for ($i = 1; $i <= 12; $i++) {
             $title[$i] = "第" . $i . "月";
         }
         $oExcel->addRows(array($title));
         ksort($data_arr);
         foreach ($data_arr as $cid => $cid_info) {
             $d = array('-1' => $cid_info['name']);
             for ($i = 1; $i <= 12; $i++) {
                 $d[$i] = $cid_info[$key][$i];
             }
             $oExcel->addRows(array($d));
             ksort($cid_info['sub']);
             foreach ($cid_info['sub'] as $cid1 => $cid1_info) {
                 $d = array('-1' => $cid1_info['name']);
                 for ($i = 1; $i <= 12; $i++) {
                     $d[$i] = $cid1_info[$key][$i];
                 }
                 $oExcel->addRows(array($d));
                 ksort($cid1_info['sub']);
                 foreach ($cid1_info['sub'] as $cid2 => $cid2_info) {
                     $d = array('-1' => $cid2_info['name']);
                     for ($i = 1; $i <= 12; $i++) {
                         $d[$i] = $cid2_info[$key][$i];
                     }
                     $oExcel->addRows(array($d));
                     ksort($cid2_info['sub']);
                     foreach ($cid2_info['sub'] as $cid3 => $cid3_info) {
                         $d = array('-1' => $cid3_info['name']);
                         for ($i = 1; $i <= 12; $i++) {
                             $d[$i] = $cid3_info[$key][$i];
                         }
                         $oExcel->addRows(array($d));
                         ksort($cid3_info['sub']);
                         foreach ($cid3_info['sub'] as $cid4 => $cid4_info) {
                             $d = array('-1' => $cid4_info['name']);
                             for ($i = 1; $i <= 12; $i++) {
                                 $d[$i] = $cid4_info[$key][$i];
                             }
                             $oExcel->addRows(array($d));
                         }
                     }
                 }
             }
         }
         $oExcel->closeSheet();
     }
     $oExcel->close();
 }
开发者ID:032404cxd,项目名称:prototype_main,代码行数:61,代码来源:question.php

示例4: ontransformedComplainView


//.........这里部分代码省略.........
                 if ($value['status'] == 2) {
                     $complain_list['ComplainList'][$key]['title'] = '撤销理由:"' . ($Comment['revoke']['revokeReason'] ? urldecode($Comment['revoke']['revokeReason']) : '无') . '",客户端IP:' . ($Comment['revoke']['ip'] ? $Comment['revoke']['ip'] : '无');
                     $complain_list['ComplainList'][$key]['AnswerTimeLag'] = "用户于" . date("Y-m-d H:i:s", $value['rtime']) . "撤销";
                 } else {
                     $complain_list['ComplainList'][$key]['AnswerTimeLag'] = $statusList[$value['status']];
                 }
             } else {
                 if ($answer['time'] > 0) {
                     $complain_list['ComplainList'][$key]['AnswerTimeLag'] = $this->timeLagToText($value['time'], $answer['time']);
                 } else {
                     $complain_list['ComplainList'][$key]['AnswerTimeLag'] = "尚未回复";
                 }
             }
             $complain_list['ComplainList'][$key]['reason'] = $Comment['convert']['reason'];
             $complain_list['ComplainList'][$key]['url'] = $value['public'] == 1 ? "已隐藏" : "<a href = '" . $_ENV['question']->getQuestionLink($value['id'], "complain") . "' target='_BLANK'><查看></a>";
             $complain_list['ComplainList'][$key]['SyncInfo'] = $_ENV['complain']->get_ComplainSyncInfo($value['id']);
             $complain_list['ComplainList'][$key]['SyncInfo']['cpid'] = $complain_list['ComplainList'][$key]['SyncInfo']['cpid'] ? "SC000" . $complain_list['ComplainList'][$key]['SyncInfo']['cpid'] : "无";
         }
         $departstr = page($complain_list['ComplainCount'], $pagesize, $page, "admin_complain/transformedComplainView/" . $ConditionList['ComplainStartDate'] . "/" . $ConditionList['ComplainEndDate'] . "/" . $ConditionList['AnswerStartDate'] . "/" . $ConditionList['AnswerEndDate'] . "/" . urlencode($ConditionList['author']) . "/" . $ConditionList['author_id'] . "/" . $ConditionList['operator_loginId'] . "/" . $ConditionList['complainId'] . "/" . $ConditionList['jid'] . "/" . $ConditionList['status'] . "/" . $ConditionList['Assess'] . "/" . $ConditionList['sid'] . "/" . $ConditionList['transformed']);
         $downloadstr = page_url("<下载EXCEL表格>", "admin_complain/transformedComplainView/" . $ConditionList['ComplainStartDate'] . "/" . $ConditionList['ComplainEndDate'] . "/" . $ConditionList['AnswerStartDate'] . "/" . $ConditionList['AnswerEndDate'] . "/" . urlencode($ConditionList['author']) . "/" . $ConditionList['author_id'] . "/" . $ConditionList['operator_loginId'] . "/" . $ConditionList['complainId'] . "/" . $ConditionList['jid'] . "/" . $ConditionList['status'] . "/" . $ConditionList['Assess'] . "/" . $ConditionList['sid'] . "/" . $ConditionList['transformed'] . "/" . $page . "/export");
         $msg && ($message = $msg);
         $ty && ($type = $ty);
     } else {
         set_time_limit(0);
         $page = 1;
         $pagesize = 1000;
         $num = 1;
         require TIPASK_ROOT . '/lib/Excel.php';
         $oExcel = new Excel();
         $FileName = 'SC与酷宝后台类别转换查询下载';
         $oExcel->download($FileName)->addSheet('投诉详情列表');
         //标题栏
         $title = array("SC投诉单号", "交易/物品订单号", "关联投诉单号", "问题描述", "用户名", "身份类型", "交易类型", "投诉时间", "回复时间", "转单客服", "转单时间", "转单说明", "转单理由", "浏览量", "是否隐藏", "接手客服账号", "评价", "同步状态", "回复客服", "回复内容", "撤销时间", "撤销理由", "撤销客户端IP", "浏览器", "操作系统");
         $oExcel->addRows(array($title));
         while ($num > 0) {
             $complain_list = $_ENV['complain']->getComplainList($ConditionList, $page, $pagesize);
             foreach ($complain_list['ComplainList'] as $key => $value) {
                 $value['description'] = preg_replace('/[\\s"]/', '', $value['description']);
                 $complain_list['ComplainList'][$key]['author'] = str_replace('<x>', '<?>', $value['author']);
                 $value['description'] = preg_replace('/[&amp;&nbsp;&quot;]/', '', $value['description']);
                 $complain_list['ComplainList'][$key]['description'] = strip_tags($value['description']);
                 $complain_list['ComplainList'][$key]['qtypeName'] = isset($qtypeList[$value['qtype']]) ? $qtypeList[$value['qtype']]['name'] : "其他分类";
                 $complain_list['ComplainList'][$key]['publicStatus'] = $PublicStatusList[$value['public']];
                 $complain_list['ComplainList'][$key]['asnum'] = $assessStatusList[$value['assess']] . ($value['asnum'] > 0 ? "/" . $value['asnum'] . "次" : "");
                 if ($value['sync'] == 0) {
                     $complain_list['ComplainList'][$key]['syncStatus'] = "未同步";
                 } elseif ($value['sync'] == 1) {
                     $complain_list['ComplainList'][$key]['syncStatus'] = "已同步";
                 } elseif ($value['sync'] < 0) {
                     $complain_list['ComplainList'][$key]['syncStatus'] = "失败" . -1 * $value['sync'] . "次/最大" . $setting['ts_warn_maxNum'] . "次";
                 }
                 if (in_array($value['status'], array(1, 3))) {
                     $answer = $_ENV['complain']->get_ComplainAnInfo($complain_list['ComplainList'][$key]['id']);
                     $answer['content'] = preg_replace('/[\\s"]/', '', $answer['content']);
                     $answer['content'] = preg_replace('/[&amp;&nbsp;&quot;]/', '', $answer['content']);
                     $answer['content'] = strip_tags($answer['content']);
                 }
                 $Comment = unserialize($value['comment']);
                 if (isset($Comment['convert']['from_type'])) {
                     $complain_list['ComplainList'][$key]['convertion'] = "来自 " . $question_type_list[$Comment['convert']['from_type']] . ",问题ID:" . $Comment['convert']['from_id'];
                     $complain_list['ComplainList'][$key]['transformTime'] = $Comment['convert']['transformTime'];
                     $complain_list['ComplainList'][$key]['transformloginId'] = $Comment['convert']['loginId'];
                 } else {
                     $complain_list['ComplainList'][$key]['convertion'] = "转为 " . $question_type_list[$Comment['convert']['to_type']] . ",问题ID:" . $Comment['convert']['to_id'];
                     $complain_list['ComplainList'][$key]['transformTime'] = $Comment['convert']['transformTime'];
                     $complain_list['ComplainList'][$key]['transformloginId'] = $Comment['convert']['loginId'];
开发者ID:eappl,项目名称:prototype,代码行数:67,代码来源:complain.php

示例5: onpageViewDetail

 function onpageViewDetail($msg = '', $ty = '')
 {
     //只查询转为投诉的问题
     $action = "index.php?admin_data/PageViewDetail";
     $hasIntoViewDetailPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoPageViewDetail");
     $hasIntoResponseDayDataPrivilege['url'] = "?admin_main";
     !$hasIntoViewDetailPrivilege['return'] && __msg($hasIntoViewDetailPrivilege);
     $ConditionList['StartDate'] = isset($this->post['StartDate']) ? $this->post['StartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time()));
     $ConditionList['EndDate'] = isset($this->post['EndDate']) ? $this->post['EndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time()));
     $ConditionList['PageId'] = isset($this->post['PageId']) ? intval($this->post['PageId']) : (isset($this->get[4]) ? intval($this->get[4]) : 0);
     $ConditionList['EndDate'] = min($ConditionList['EndDate'], date("Y-m-t", strtotime($ConditionList['StartDate'])), date("Y-m-d", time()));
     $PageList = $_ENV['view']->GetAllPage();
     $export = trim($this->get[6]) == "export" ? 1 : 0;
     @($page = max(1, intval($this->get[5])));
     if (!$export) {
         $pagesize = $this->setting['list_default'];
         $pagesize = 10;
         $PageViewDetail = $_ENV['view']->getPageViewDetail($ConditionList, $page, $pagesize);
         foreach ($PageViewDetail['PageViewList'] as $key => $value) {
             $PageViewDetail['PageViewList'][$key]['PageName'] = isset($PageList[$value['PageId']]) ? $PageList[$value['PageId']]['PageName'] : '未知页面';
         }
         $downloadstr = page_url("<下载EXCEL表格>", "admin_data/PageViewDetail/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . $ConditionList['PageId'] . "/" . $page . "/export");
         $departstr = page($PageViewDetail['PageViewCount'], $pagesize, $page, "admin_data/PageViewDetail/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . $ConditionList['PageId']);
         $msg && ($message = $msg);
         $ty && ($type = $ty);
     } else {
         set_time_limit(0);
         $page = 1;
         $pagesize = 1000;
         $num = 1;
         require TIPASK_ROOT . '/lib/Excel.php';
         $oExcel = new Excel();
         $FileName = '页面浏览记录';
         $oExcel->download($FileName)->addSheet('页面浏览记录');
         //标题栏
         $title = array("页面", "浏览IP", "浏览时间");
         $oExcel->addRows(array($title));
         while ($num > 0) {
             $PageViewDetail = $_ENV['view']->getPageViewDetail($ConditionList, $page, $pagesize);
             foreach ($PageViewDetail['PageViewList'] as $key => $value) {
                 $excelArr = array("PageName" => isset($PageList[$value['PageId']]) ? $PageList[$value['PageId']]['PageName'] : '未知页面', "ViewIP" => long2ip($value['ViewIP']), "ViewTime" => date('Y-m-d H:i:s', $value['Time']));
                 $oExcel->addRows(array($excelArr));
             }
             $page++;
             $num = count($PageViewDetail['PageViewList']);
         }
         $oExcel->closeSheet()->close();
     }
     include template('PageViewDetail', 'admin');
 }
开发者ID:eappl,项目名称:prototype,代码行数:50,代码来源:data.php


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