本文整理汇总了PHP中Export::export_table_xml方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::export_table_xml方法的具体用法?PHP Export::export_table_xml怎么用?PHP Export::export_table_xml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::export_table_xml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
// export results to xml or csv file
foreach ($results as $result) {
$userinfo = api_get_user_info($result->get_user_id());
$data['username'] = $userinfo['username'];
//$result->get_user_id();
$data['official_code'] = $userinfo['official_code'];
$data['lastname'] = $userinfo['lastname'];
$data['firstname'] = $userinfo['firstname'];
$data['score'] = $result->get_score();
$data['date'] = api_format_date($result->get_date(), "%d/%m/%Y %R");
$alldata[] = $data;
}
switch ($file_type) {
case 'xml':
Export::export_table_xml($alldata, $filename, 'Result', 'XMLResults');
exit;
break;
case 'csv':
Export::export_table_csv($alldata, $filename);
exit;
break;
}
}
}
if (isset($_GET['resultdelete'])) {
$result = Result::load($_GET['resultdelete']);
$result[0]->delete();
header('Location: gradebook_view_result.php?deleteresult=&selecteval=' . Security::remove_XSS($_GET['selecteval']));
exit;
}
示例2: foreach
foreach ($extra_fields as $extra) {
$data[0][] = $extra[1];
}
}
$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::export_table_xml($data, $filename, 'Contact', 'Contacts');
exit;
break;
case 'csv':
Export::export_table_csv($data, $filename);
exit;
break;
}
}
Display::display_header($tool_name);
$form->display();
Display::display_footer();