本文整理汇总了PHP中Export::arrayToXls方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::arrayToXls方法的具体用法?PHP Export::arrayToXls怎么用?PHP Export::arrayToXls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::arrayToXls方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$user_pdf = array($counter, $user_image, $user['official_code'], $user['lastname'] . ', ' . $user['firstname'], $user['email'], $user['phone']);
}
$a_users[] = $user_pdf;
} else {
$a_users[] = $user;
}
$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())) {
示例2: fputs
$add .= "\t</Session>\n";
fputs($fp, $add);
}
}
switch ($file_type) {
case 'xml':
fputs($fp, "</Sessions>\n");
fclose($fp);
$errorMsg = get_lang('UserListHasBeenExported') . '<br/>
<a class="btn btn-default" href="' . $archiveURL . $archiveFile . '">' . get_lang('ClickHereToDownloadTheFile') . '</a>';
break;
case 'csv':
Export::arrayToCsv($sessionListToExport, $archiveFile);
exit;
case 'xls':
Export::arrayToXls($sessionListToExport, $archiveFile);
exit;
break;
}
}
}
// display the header
Display::display_header($tool_name);
//select of sessions
$sql = "SELECT id, name FROM {$tbl_session} ORDER BY name";
if (api_is_multiple_url_enabled()) {
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$sql = "SELECT s.id, name FROM {$tbl_session} s\n\t\t\tINNER JOIN {$tbl_session_rel_access_url} as session_rel_url\n\t\t\tON (s.id = session_rel_url.session_id)\n\t\t\tWHERE access_url_id = {$access_url_id}\n\t\t\tORDER BY name";
}
示例3: while
}
$res = Database::query($sql);
while ($user = Database::fetch_array($res, 'ASSOC')) {
$student_data = UserManager::get_extra_user_data($user['UserId'], true, false);
foreach ($student_data as $key => $value) {
$key = substr($key, 6);
if (is_array($value)) {
$user[$key] = $value[$key];
} else {
$user[$key] = $value;
}
}
$data[] = $user;
}
switch ($file_type) {
case 'xml':
Export::arrayToXml($data, $filename, 'Contact', 'Contacts');
exit;
break;
case 'csv':
Export::arrayToCsv($data, $filename);
exit;
case 'xls':
Export::arrayToXls($data, $filename);
exit;
break;
}
}
Display::display_header($tool_name);
$form->display();
Display::display_footer();
示例4: 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::arrayToCsv($data);
exit;
break;
case 'xls':
if (!empty($data)) {
Export::arrayToXls($data);
exit;
}
break;
}
break;
}
}
/* Header */
$interbreadcrumb[] = array('url' => 'group.php?' . api_get_cidReq(), '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)) {
示例5: get_lang
<td><?php
echo get_lang('ChatLastConnection');
?>
</td>
<td><?php
echo $chat_last_connection;
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
//end details
}
if ($export) {
ob_end_clean();
switch ($export) {
case 'csv':
Export::arrayToCsv($csv_content, 'reporting_student');
break;
case 'xls':
Export::arrayToXls($csv_content, 'reporting_student');
break;
}
exit;
}
Display::display_footer();
示例6: get_lang
$data[] = $user;
$counter++;
}
}
$fileName = get_lang('StudentList');
$pdfTitle = get_lang('StudentList');
if ($type == COURSEMANAGER) {
$fileName = get_lang('Teachers');
$pdfTitle = get_lang('Teachers');
}
switch ($_GET['format']) {
case 'csv':
Export::arrayToCsv($a_users, $fileName);
exit;
case 'xls':
Export::arrayToXls($a_users, $fileName);
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' => $fileName, 'pdf_title' => $pdfTitle, '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())) {
示例7: substr
}
}
$dataToExport['students'] = substr($dataToExport['students'], 0, -1);
$dataToExport['teachers'] = substr($dataToExport['teachers'], 0, -1);
$listToExport[] = $dataToExport;
}
switch ($file_type) {
case 'xml':
// Remove header
unset($listToExport[0]);
Export::arrayToXml($listToExport, $archiveFile);
break;
case 'csv':
Export::arrayToCsv($listToExport, $archiveFile);
case 'xls':
Export::arrayToXls($listToExport, $archiveFile);
break;
}
} else {
Display::addFlash(Display::return_message(get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty')));
}
}
Display::display_header($tool_name);
$form = new FormValidator('export', 'post', api_get_self());
$form->addHeader($tool_name);
$form->addHidden('formSent', 1);
$form->addElement('radio', 'select_type', get_lang('Option'), get_lang('ExportAllCoursesList'), '1', ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"]);
$form->addElement('radio', 'select_type', '', get_lang('ExportSelectedCoursesFromCoursesList'), '2', ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"]);
if (!empty($course_list)) {
$form->addHtml('<div id="div-course-list" style="display:none">');
$coursesInList = [];
示例8: 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('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(str_replace(' ', ' ', $ticket[9]))));
$data[] = $ticket_rem;
}
Export::arrayToXls($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) {
$getParameters = ['keyword', 'keyword_status', 'keyword_category', 'keyword_request_user', 'keyword_admin', 'keyword_start_date', 'keyword_unread', 'Tickets_per_page', 'Tickets_column'];
示例9: api_get_course_id
background-color:white;
z-index:99; padding: 3px;
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::arrayToXls($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();
}