本文整理汇总了PHP中Export::export_table_xls_html方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::export_table_xls_html方法的具体用法?PHP Export::export_table_xls_html怎么用?PHP Export::export_table_xls_html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::export_table_xls_html方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
foreach ($result as $row) {
foreach ($columns as $col) {
$array[$j][] = strip_tags($row[$col]);
}
$j++;
}
switch ($exportFormat) {
case 'xls':
//TODO add date if exists
$file_name = !empty($action) ? $action : 'company_report';
$browser = new Browser();
if ($browser->getPlatform() == Browser::PLATFORM_WINDOWS) {
Export::export_table_xls_html($array, $file_name, 'ISO-8859-15');
} else {
Export::export_table_xls_html($array, $file_name);
}
break;
case 'csv':
default:
//TODO add date if exists
$file_name = !empty($action) ? $action : 'company_report';
Export::arrayToCsv($array, $file_name);
break;
}
exit;
}
$i = 0;
if (!empty($result)) {
foreach ($result as $row) {
// if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
示例2: array
$timeReport->data[] = array('coach' => array('username' => $teacher['username'], 'completeName' => $teacher['completeName']), 'totalTime' => SessionManager::getTotalUserTimeInPlatform($teacher['user_id'], $selectedFrom, $selectedUntil));
}
}
$timeReport->sortData($withFilter);
if (isset($_GET['export'])) {
$dataToExport = $timeReport->prepareDataToExport($withFilter);
$fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
switch ($_GET['export']) {
case 'pdf':
$params = array('add_signatures' => false, 'filename' => $fileName, 'pdf_title' => "{$reportTitle} - {$reportSubTitle}", 'pdf_description' => get_lang('TeacherTimeReport'), 'format' => 'A4-L', 'orientation' => 'L');
$pdfContent = Export::convert_array_to_html($dataToExport);
Export::export_html_to_pdf($pdfContent, $params);
break;
case 'xls':
array_unshift($dataToExport, array($reportTitle), array($reportSubTitle), array());
Export::export_table_xls_html($dataToExport, $fileName);
break;
}
die;
}
$form->addSelect('course', get_lang('Course'), $optionsCourses, ['id' => 'courses']);
$form->addSelect('session', get_lang('Session'), $optionsSessions, ['id' => 'session']);
$form->addSelect('teacher', get_lang('Teacher'), $optionsTeachers, ['id' => 'teacher']);
$form->addDateRangePicker('daterange', get_lang('Date'), false, ['id' => 'daterange', 'maxDate' => $limitDate->format('Y-m-d'), 'format' => 'YYYY-MM-DD', 'timePicker' => 'false', 'value' => "{$selectedFrom} / {$selectedUntil}"]);
$form->addButtonFilter(get_lang('Filter'));
$form->addHidden('from', '');
$form->addHidden('until', '');
$form->setDefaults(['course' => $selectedCourse, 'session' => $selectedSession, 'teacher' => $selectedTeacher, 'date_range' => "{$selectedFrom} / {$selectedUntil}", 'from' => $selectedFrom, 'until' => $selectedUntil]);
$tpl = new Template($toolName);
$tpl->assign('reportTitle', $reportTitle);
$tpl->assign('reportSubTitle', $reportSubTitle);