本文整理汇总了PHP中Export::export_table_xls方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::export_table_xls方法的具体用法?PHP Export::export_table_xls怎么用?PHP Export::export_table_xls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::export_table_xls方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$user_pdf = array($counter, $user_image, $user['official_code'], $user['lastname'] . ', ' . $user['firstname']);
}
$a_users[] = $user_pdf;
} else {
$a_users[] = $user;
}
$data[] = $user;
$counter++;
}
}
switch ($_GET['type']) {
case 'csv':
Export::export_table_csv_utf8($a_users);
exit;
case 'xls':
Export::export_table_xls($a_users);
exit;
case 'pdf':
$description = '<table class="data_table_no_border">';
if (api_get_session_id()) {
$description .= '<tr><td>' . get_lang('Session') . ': </td><td class="highlight">' . api_get_session_name(api_get_session_id()) . '</td>';
}
$description .= '<tr><td>' . get_lang('Course') . ': </td><td class="highlight">' . $course_info['name'] . '</td>';
$teachers = CourseManager::get_teacher_list_from_course_code($course_info['real_id']);
//If I'm a teacher in this course show just my name
if (isset($teachers[$user_id])) {
if (!empty($teachers)) {
$teacher_info = $teachers[$user_id];
$description .= '<tr><td>' . get_lang('Teacher') . ': </td><td class="highlight">' . api_get_person_name($teacher_info['firstname'], $teacher_info['lastname']) . '</td>';
}
} else {
示例2: api_get_course_id
background-color:white;
z-index:99; padding: 3px;
display: inline;
}
.blackboard_hide {
display: none;
}
.reportes{
border:1px ;
}
.reportes th {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}
</style>';
$course_code = api_get_course_id();
$resultado = inicializarReporte($course_code);
if (isset($_GET['action'])) {
Export::export_table_xls($resultado['exportar'], "REPORTE ALUMNOS CURSO" . $course_code);
} else {
Display::display_header();
api_protect_course_script();
if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
echo $resultado['mostrar'];
Display::display_footer();
}
示例3: get_lang
$extra = '<div style="text-align:center"><h2>' . get_lang('GroupList') . '</h2></div>';
$extra .= '<strong>' . get_lang('Course') . ': </strong>' . $courseInfo['title'] . ' (' . $courseInfo['code'] . ')';
$content = $extra . $content;
$pdf->content_to_pdf($content, null, null, api_get_course_id());
break;
case 'export':
$groupId = isset($_GET['id']) ? intval($_GET['id']) : null;
$data = GroupManager::exportCategoriesAndGroupsToArray($groupId, true);
switch ($_GET['type']) {
case 'csv':
Export::export_table_csv($data);
exit;
break;
case 'xls':
if (!empty($data)) {
Export::export_table_xls($data);
exit;
}
break;
}
break;
}
}
/* Header */
$interbreadcrumb[] = array('url' => 'group.php', 'name' => get_lang('Groups'));
if (!isset($_GET['origin']) || $_GET['origin'] != 'learnpath') {
// So we are not in learnpath tool
if (!$is_allowed_in_course) {
api_not_allowed(true);
}
if (!api_is_allowed_to_edit(false, true)) {
示例4: foreach
if (empty($column_names)) {
$column_names = $columns;
}
//Headers
foreach ($column_names as $col) {
$array[0][] = $col;
}
foreach ($result as $row) {
foreach ($columns as $col) {
$array[$j][] = strip_tags($row[$col]);
}
$j++;
}
switch ($export_format) {
case 'xls':
Export::export_table_xls($array, 'company_report');
break;
case 'csv':
default:
Export::export_table_csv($array, 'company_report');
break;
}
exit;
}
$i = 0;
if (!empty($result)) {
foreach ($result as $row) {
//print_r($row);
// if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
if (!isset($row['id']) || isset($row['id']) && $row['id'] == "") {
$response->rows[$i]['id'] = $i;
示例5: array
}
break;
case 'alert':
if (!$isAdmin && isset($_GET['ticket_id'])) {
TicketManager::send_alert($_GET['ticket_id'], $user_id);
}
break;
case 'export':
$data = array(array($plugin->get_lang('TicketNum'), $plugin->get_lang('Date'), $plugin->get_lang('DateLastEdition'), $plugin->get_lang('Category'), $plugin->get_lang('User'), $plugin->get_lang('Program'), $plugin->get_lang('Responsible'), $plugin->get_lang('Status'), $plugin->get_lang('Message'), $plugin->get_lang('Description')));
$datos = $table->get_clean_html();
foreach ($datos as $ticket) {
$ticket[0] = substr(strip_tags($ticket[0]), 0, 12);
$ticket_rem = array(utf8_decode(strip_tags($ticket[0])), utf8_decode(api_html_entity_decode($ticket[1])), utf8_decode(strip_tags($ticket[2])), utf8_decode(strip_tags($ticket[3])), utf8_decode(strip_tags($ticket[4])), utf8_decode(strip_tags($ticket[5])), utf8_decode(strip_tags($ticket[6])), utf8_decode(strip_tags($ticket[7])), utf8_decode(strip_tags($ticket[8])), utf8_decode(strip_tags($ticket[10])));
$data[] = $ticket_rem;
}
Export::export_table_xls($data, $plugin->get_lang('Tickets'));
exit;
break;
case 'close_tickets':
TicketManager::close_old_tickets();
break;
default:
break;
}
}
//$nameTools = api_xml_http_response_encode($plugin->get_lang('MyTickets'));
$user_id = api_get_user_id();
$isAdmin = api_is_platform_admin();
Display::display_header($plugin->get_lang('MyTickets'));
if ($isAdmin) {
$get_parameter = '&keyword=' . $_GET['keyword'] . '&keyword_status=' . $_GET['keyword_status'] . '&keyword_category=' . $_GET['keyword_category'] . '&keyword_request_user=' . $_GET['keyword_request_user'];
示例6: api_get_course_id
display: inline;
}
.blackboard_hide {
display: none;
}
.reports{
border:1px ;
}
.reports th {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}
</style>';
$course_code = api_get_course_id();
$results = initializeReport($course_code);
if (isset($_GET['action'])) {
Export::export_table_xls($results['export'], "COURSE_USER_REPORT" . $course_code);
} else {
Display::display_header();
api_protect_course_script();
if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
echo $results['show'];
Display::display_footer();
}
示例7: indexAction
//.........这里部分代码省略.........
$item['field_filter'] = $item['field_filter'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
$new_result[] = $item;
}
$result = $new_result;
}*/
break;
case 'get_usergroups_teacher':
$columns = array('name', 'users', 'actions');
$options = array('order' => "name {$sord}", 'LIMIT' => "{$start} , {$limit}");
$options['course_id'] = $course_id;
switch ($type) {
case 'not_registered':
$options['where'] = array(" (course_id IS NULL OR course_id != ?) " => $course_id);
$result = $obj->get_usergroup_not_in_course($options);
break;
case 'registered':
$options['where'] = array(" usergroup.course_id = ? " => $course_id);
$result = $obj->get_usergroup_in_course($options);
break;
}
$new_result = array();
if (!empty($result)) {
foreach ($result as $group) {
$group['users'] = count($obj->get_users_by_usergroup($group['id']));
if ($obj->usergroup_was_added_in_course($group['id'], $course_id)) {
$url = 'class.php?action=remove_class_from_course&id=' . $group['id'];
$icon = Display::return_icon('delete.png', get_lang('Remove'));
} else {
$url = 'class.php?action=add_class_to_course&id=' . $group['id'];
$icon = Display::return_icon('add.png', get_lang('Add'));
}
$group['actions'] = Display::url($icon, $url);
$new_result[] = $group;
}
$result = $new_result;
}
if (!in_array($sidx, $columns)) {
$sidx = 'name';
}
//Multidimensional sort
\ArrayClass::msort($result, $sidx);
break;
default:
exit;
}
$allowed_actions = array('get_careers', 'get_promotions', 'get_usergroups', 'get_usergroups_teacher', 'get_gradebooks', 'get_sessions', 'get_exercise_results', 'get_hotpotatoes_exercise_results', 'get_work_user_list', 'get_timelines', 'get_grade_models', 'get_event_email_template', 'get_user_skill_ranking', 'get_extra_fields', 'get_extra_field_options', 'get_course_exercise_medias', 'get_user_course_report', 'get_user_course_report_resumed', 'get_group_reporting', 'get_question_list', 'get_user_list_plugin_widescale', 'get_questions');
//5. Creating an obj to return a json
if (in_array($action, $allowed_actions)) {
$response = new \stdClass();
$response->page = $page;
$response->total = $total_pages;
$response->records = $count;
if ($operation && $operation == 'excel') {
$j = 1;
$array = array();
if (empty($column_names)) {
$column_names = $columns;
}
//Headers
foreach ($column_names as $col) {
$array[0][] = $col;
}
foreach ($result as $row) {
foreach ($columns as $col) {
$array[$j][] = strip_tags($row[$col]);
}
$j++;
}
switch ($export_format) {
case 'xls':
Export::export_table_xls($array, 'company_report');
break;
case 'csv':
default:
Export::export_table_csv($array, 'company_report');
break;
}
exit;
}
$i = 0;
if (!empty($result)) {
foreach ($result as $row) {
//print_r($row);
// if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
if (!isset($row['id']) || isset($row['id']) && $row['id'] == "") {
$response->rows[$i]['id'] = $i;
} else {
$response->rows[$i]['id'] = $row['id'];
}
$array = array();
foreach ($columns as $col) {
$array[] = isset($row[$col]) ? $row[$col] : null;
}
$response->rows[$i]['cell'] = $array;
$i++;
}
}
return json_encode($response);
}
}