本文整理汇总了PHP中Export::export_table_pdf方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::export_table_pdf方法的具体用法?PHP Export::export_table_pdf怎么用?PHP Export::export_table_pdf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::export_table_pdf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
}
$data[] = $user;
$counter++;
}
}
switch ($_GET['type']) {
case 'csv':
Export::arrayToCsv($a_users);
exit;
case 'xls':
Export::arrayToXls($a_users);
exit;
case 'pdf':
$header_attributes = array(array('style' => 'width:10px'), array('style' => 'width:30px'), array('style' => 'width:50px'), array('style' => 'width:500px'));
$params = array('add_signatures' => false, 'filename' => get_lang('UserList'), 'pdf_title' => get_lang('StudentList'), 'header_attributes' => $header_attributes);
Export::export_table_pdf($a_users, $params);
exit;
}
}
}
}
// end if allowed to edit
if (api_is_allowed_to_edit(null, true)) {
// Unregister user from course
if (isset($_REQUEST['unregister']) && $_REQUEST['unregister']) {
if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && ($_GET['user_id'] != $_user['user_id'] || api_is_platform_admin())) {
$user_id = intval($_GET['user_id']);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$sql = 'SELECT user.user_id
示例2: thematic
//.........这里部分代码省略.........
break;
case 'thematic_export':
$list = $thematic->get_thematic_list();
$csv = array();
$csv[] = array('type', 'data1', 'data2', 'data3');
foreach ($list as $theme) {
$csv[] = array('title', $theme['title'], $theme['content']);
$data = $thematic->get_thematic_plan_data($theme['id']);
if (!empty($data)) {
foreach ($data as $plan) {
$csv[] = array('plan', $plan['title'], $plan['description']);
}
}
$data = $thematic->get_thematic_advance_by_thematic_id($theme['id']);
if (!empty($data)) {
foreach ($data as $advance) {
$csv[] = array('progress', $advance['start_date'], $advance['duration'], $advance['content']);
}
}
}
Export::arrayToCsv($csv);
exit;
// Don't continue building a normal page.
return;
case 'thematic_export_pdf':
$list = $thematic->get_thematic_list();
$table = array();
$table[] = array(get_lang('Thematic'), get_lang('ThematicPlan'), get_lang('ThematicAdvance'));
foreach ($list as $theme) {
$data = $thematic->get_thematic_plan_data($theme['id']);
$plan_html = null;
if (!empty($data)) {
foreach ($data as $plan) {
$plan_html .= '<strong>' . $plan['title'] . '</strong><br /> ' . $plan['description'] . '<br />';
}
}
$data = $thematic->get_thematic_advance_by_thematic_id($theme['id']);
$advance_html = null;
if (!empty($data)) {
foreach ($data as $advance) {
$advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG) . ' (' . $advance['duration'] . ' ' . get_lang('HourShort') . ')<br />' . $advance['content'] . '<br />';
}
}
$table[] = array($theme['title'], $plan_html, $advance_html);
}
$params = array('filename' => get_lang('Thematic') . '-' . api_get_local_time(), 'pdf_title' => get_lang('Thematic'), 'add_signatures' => true, 'format' => 'A4-L', 'orientation' => 'L');
Export::export_table_pdf($table, $params);
break;
case 'moveup':
$thematic->move_thematic('up', $thematic_id);
$action = 'thematic_details';
$thematic_id = null;
break;
case 'movedown':
$thematic->move_thematic('down', $thematic_id);
$action = 'thematic_details';
$thematic_id = null;
break;
}
Security::clear_token();
} else {
$action = 'thematic_details';
$thematic_id = null;
}
if (isset($thematic_id)) {
$data['thematic_data'] = $thematic->get_thematic_list($thematic_id);
$data['thematic_id'] = $thematic_id;
}
if ($action == 'thematic_details') {
if (isset($thematic_id)) {
$thematic_data_result = $thematic->get_thematic_list($thematic_id);
if (!empty($thematic_data_result)) {
$thematic_data[$thematic_id] = $thematic_data_result;
}
$data['total_average_of_advances'] = $thematic->get_average_of_advances_by_thematic($thematic_id);
} else {
$thematic_data = $thematic->get_thematic_list(null, api_get_course_id(), api_get_session_id());
$data['max_thematic_item'] = $thematic->get_max_thematic_item();
$data['last_done_thematic_advance'] = $thematic->get_last_done_thematic_advance();
$data['total_average_of_advances'] = $thematic->get_total_average_of_thematic_advances();
}
// Second column
$thematic_plan_data = $thematic->get_thematic_plan_data();
// Third column
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
$data['thematic_plan_div'] = $thematic->get_thematic_plan_div($thematic_plan_data);
$data['thematic_advance_div'] = $thematic->get_thematic_advance_div($thematic_advance_data);
$data['thematic_plan_data'] = $thematic_plan_data;
$data['thematic_advance_data'] = $thematic_advance_data;
$data['thematic_data'] = $thematic_data;
}
$data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title();
$data['action'] = $action;
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
// render to the view
$this->view->set_data($data);
$this->view->set_layout($layoutName);
$this->view->set_template('thematic');
$this->view->render();
}