本文整理汇总了PHP中Export::addRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::addRow方法的具体用法?PHP Export::addRow怎么用?PHP Export::addRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::addRow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
function export($from, $to)
{
$productId = $this->common->getCurrentProduct()->id;
$productName = $this->common->getCurrentProduct()->name;
$data = $this->device->getDeviceTypeDetail($productId);
$this->load->library('export');
$export = new Export();
//设定文件名
$export->setFileName($productName . '_' . $from . '_' . $to . '.csv');
//输出列名第一种方法
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
//输出列名第二种方法
// $excel_title = array (iconv("UTF-8", "GBK", "设备型号"),iconv("UTF-8", "GBK", "总数"),iconv("UTF-8", "GBK", "用户比例") );
// $export->setTitle ($excel_title );
//输出内容
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
示例2: export
function export($from, $to)
{
$this->load->library('export');
$productId = $this->common->getCurrentProduct()->id;
$productName = $this->common->getCurrentProduct()->name;
$data = $this->os->getTotalUserPercentByOS($productId);
$export = new Export();
//设定文件名
$export->setFileName($productName . '.csv');
// //输出列名第一种方法
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
//输出列名第二种方法
// $excel_title = array (iconv("UTF-8", "GBK", "操作系统版本"),iconv("UTF-8", "GBK", "用户比例") );
// $export->setTitle ($excel_title );
//输出内容
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
示例3: export
function export()
{
$this->load->library('export');
$fromTime = $this->common->getFromTime();
$toTime = $this->common->getToTime();
$productId = $this->common->getCurrentProduct();
$productId = $productId->id;
$productName = $this->common->getCurrentProduct()->name;
$data = $this->orientationmodel->getTotalUsersPercentByResolution($fromTime, $toTime, $productId);
$export = new Export();
$titlename = getExportReportTitle($productName, lang('v_rpt_re_details'), $fromTime, $toTime);
$title = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($title);
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
示例4: exportComparedata
/**
* ExportComparedata funciton
* Export the compares error data
*
* @return query result
*/
function exportComparedata()
{
$fromTime = $this->common->getFromTime();
$toTime = $this->common->getToTime();
$products = $this->common->getCompareProducts();
if (empty($products)) {
$this->common->requireProduct();
return;
}
$this->load->library('export');
$export = new Export();
$titlename = getExportReportTitle("Compare", lang("m_rpt_errors"), $fromTime, $toTime);
$titlename = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($titlename);
$j = 0;
$mk = 0;
$maxlength = 0;
$title[$j++] = iconv("UTF-8", "GBK", '');
$space[$mk++] = lang('g_date');
for ($i = 0; $i < count($products); $i++) {
$detailData[$i] = $this->errormodel->getCompareErrorData($products[$i]->id, $fromTime, $toTime);
$maxlength = count($detailData[$i]['content']);
$title[$j++] = iconv("UTF-8", "GBK", $products[$i]->name);
$title[$j++] = iconv("UTF-8", "GBK", '');
$space[$mk++] = lang('v_rpt_err_errorNums');
$space[$mk++] = lang('v_rpt_err_errorNumsInSessions');
}
$export->setTitle($title);
$export->addRow($space);
$k = 0;
$j = 0;
for ($m = 0; $m < $maxlength; $m++) {
$detailcontent = array();
for ($j = 0; $j < count($products); $j++) {
$obj = $detailData[$j]['content'];
if ($j == 0) {
array_push($detailcontent, $obj[$m]['date']);
}
array_push($detailcontent, $obj[$m]['count']);
array_push($detailcontent, $obj[$m]['percentage']);
}
$export->addRow($detailcontent);
}
$export->export();
die;
}
示例5: export
/**
* Export
*
* @return void
*/
function export()
{
$this->load->library('export');
$productId = $this->common->getCurrentProduct();
$this->common->requireProduct();
$productId = $productId->id;
$productName = $this->common->getCurrentProduct()->name;
$fromTime = $this->common->getFromTime();
$toTime = $this->common->getToTime();
$data = $this->os->getTotalUserPercentByOS($productId, $fromTime, $toTime);
if ($data != null && $data->num_rows() > 0) {
$export = new Export();
// set file name
$titlename = getExportReportTitle($productName, lang('v_rpt_os_version'), $fromTime, $toTime);
$title = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($title);
// set title name
$excel_title = array(iconv("UTF-8", "GBK", lang("v_rpt_os_version")), iconv("UTF-8", "GBK", lang("t_sessions")), iconv("UTF-8", "GBK", lang("t_sessionsP")), iconv("UTF-8", "GBK", lang("t_newUsers")), iconv("UTF-8", "GBK", lang("t_newUsersP")));
$export->setTitle($excel_title);
////
$Total = $this->os->getOsSessionNewuserTotal($productId, $fromTime, $toTime);
if ($Total) {
$sessions = $Total->first_row()->sessions;
$newusers = $Total->first_row()->newusers;
} else {
$sessions = 0;
$newusers = 0;
}
foreach ($data->result() as $row) {
if (!$row->deviceos_name) {
$row->deviceos_name = 'unknown';
}
$rowadd['deviceos_name'] = $row->deviceos_name;
$rowadd['sessions'] = $row->sessions;
$rowadd['sessions_p'] = $sessions > 0 ? round(100 * $row->sessions / $sessions, 1) . '%' : '0%';
$rowadd['newusers'] = $row->newusers;
$rowadd['newusers_p'] = $newusers > 0 ? round(100 * $row->newusers / $newusers, 1) . '%' : '0%';
$export->addRow($rowadd);
}
$export->export();
die;
} else {
$this->load->view("usage/nodataview");
}
}
示例6: exportComparePhaseusetime
function exportComparePhaseusetime($timePhase, $fromDate = '', $toDate = '')
{
$time = $this->changeDate($timePhase, $fromDate, $toDate);
$fromTime = $time['fromTime'];
$toTime = $time['toTime'];
$products = $this->common->getCompareProducts();
if (empty($products)) {
$this->common->requireProduct();
return;
}
$this->load->library('export');
$export = new Export();
$titlename = getExportReportTitle("Compare", lang("v_rpt_pb_timeTrendOfUsers_detail"), $fromTime, $toTime);
$titlename = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($titlename);
$j = 0;
$mk = 0;
$maxlength = 0;
$title[$j++] = iconv("UTF-8", "GBK", '');
$space[$mk++] = lang('t_date_part');
for ($i = 0; $i < count($products); $i++) {
$detailData[$i] = $this->product->getStarterUserCountByTime($fromTime, $toTime, $products[$i]->id)->result_array();
$maxlength = count($detailData[$i]);
$title[$j++] = iconv("UTF-8", "GBK", $products[$i]->name);
$title[$j++] = iconv("UTF-8", "GBK", '');
$space[$mk++] = lang('t_activeUsers');
$space[$mk++] = lang('t_newUsers');
}
$export->setTitle($title);
$export->addRow($space);
$k = 0;
$j = 0;
for ($m = 0; $m < $maxlength; $m++) {
$detailcontent = array();
for ($j = 0; $j < count($products); $j++) {
$obj = $detailData[$j];
if ($j == 0) {
array_push($detailcontent, $obj[$m]['hour'] . ":00");
}
array_push($detailcontent, $obj[$m]['startusers']);
array_push($detailcontent, $obj[$m]['newusers']);
}
$export->addRow($detailcontent);
}
$export->export();
die;
}
示例7: export
function export($from, $to, $data)
{
$productId = $this->getCurrentProduct()->id;
$productName = $this->getCurrentProduct()->name;
$export = new Export();
// 设定文件名
$export->setFileName($productName . '_' . $from . '_' . $to . '.xls');
// 输出列名
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
// 输出内容
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}
示例8: export
function export()
{
$this->load->library('export');
$productId = $this->common->getCurrentProduct();
$this->common->requireProduct();
$productId = $productId->id;
$productName = $this->common->getCurrentProduct()->name;
$fromTime = $this->common->getFromTime();
$toTime = $this->common->getToTime();
$data = $this->network->getALlNetWorkData($productId, $fromTime, $toTime);
$export = new Export();
// set file name
$titlename = getExportReportTitle($productName, lang('v_rpt_nw_details'), $fromTime, $toTime);
$title = iconv("UTF-8", "GBK", $titlename);
$export->setFileName($title);
$fields = array();
foreach ($data->list_fields() as $field) {
array_push($fields, $field);
}
$export->setTitle($fields);
foreach ($data->result() as $row) {
$export->addRow($row);
}
$export->export();
die;
}