本文整理汇总了PHP中print_table函数的典型用法代码示例。如果您正苦于以下问题:PHP print_table函数的具体用法?PHP print_table怎么用?PHP print_table使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_results
function print_results($results)
{
foreach ($results as $id => $data) {
printf("<h2>%s</h2>\n", $id);
print_table($data);
}
}
示例2: print_results
function print_results($results)
{
printf("<h1>%d servers in list</h1>\n", count($results));
foreach ($results as $id => $data) {
printf("<h2>%s</h2>\n", $id);
print_table($data);
}
}
示例3: print_results
function print_results($gamequery)
{
foreach ($gamequery as $id => $data) {
if ($id != $_GET['id']) {
continue;
}
print_table($data);
}
}
示例4: render
function render()
{
$text = "Lorem ipsum";
$im = new \Imagick();
$draw = new \ImagickDraw();
$draw->setStrokeColor("none");
$draw->setFont("../fonts/Arial.ttf");
$draw->setFontSize(96);
$draw->setTextAlignment(\Imagick::ALIGN_LEFT);
$metrics = $im->queryFontMetrics($draw, $text);
return print_table($metrics);
}
示例5: display
function display()
{
global $CFG, $PAGE, $COURSE;
$moving = optional_param('moving', 0, PARAM_INT);
require_capability('format/page:managepages', $this->context);
$PAGE->print_tabs('manage');
if ($pages = page_get_all_pages($COURSE->id, 'flat')) {
$table->head = array(get_string('pagename', 'format_page'), get_string('pageoptions', 'format_page'), get_string('displaytheme', 'format_page'), get_string('displaymenu', 'format_page'), get_string('publish', 'format_page'), get_string('locks', 'format_page'));
$table->align = array('left', 'center', 'center', 'center', 'center', 'center');
$table->width = '70%';
$table->cellspacing = '0';
$table->id = 'editing-table';
$table->class = 'generaltable pageeditingtable';
$table->data = array();
foreach ($pages as $page) {
$a = strip_tags(format_string($page->nameone));
$editalt = get_string('edita', 'format_page', $a);
$movealt = get_string('movea', 'format_page', $a);
$delealt = get_string('deletea', 'format_page', $a);
// Page link/name
$name = page_pad_string('<a href="' . $PAGE->url_build('page', $page->id) . '" title="' . $a . '">' . format_string($page->nameone) . '</a>', $page->depth);
// Edit, move and delete widgets
$widgets = '<a title="' . $editalt . '" href="' . $PAGE->url_build('page', $page->id, 'action', 'editpage', 'returnaction', 'manage') . '" class="icon edit"><img src="' . $CFG->pixpath . '/t/edit.gif" alt="' . $editalt . '" /></a> ';
$widgets .= '<a title="' . $movealt . '" href="' . $PAGE->url_build('action', 'moving', 'moving', $page->id, 'sesskey', sesskey()) . '" class="icon move"><img src="' . $CFG->pixpath . '/t/move.gif" alt="' . $movealt . '" /></a> ';
$widgets .= '<a title="' . $delealt . '" href="' . $PAGE->url_build('action', 'confirmdelete', 'page', $page->id, 'sesskey', sesskey()) . '" class="icon delete"><img src="' . $CFG->pixpath . '/t/delete.gif" alt="' . $delealt . '" /></a>';
// Theme, menu and publish widgets
if ($page->parent == 0) {
// Only master pages get this one
$theme = $this->manage_showhide($page, DISP_THEME);
} else {
//$theme = '';
$theme = $this->manage_showhide($page, DISP_THEME);
}
$menu = $this->manage_showhide($page, DISP_MENU);
$publish = $this->manage_showhide($page, DISP_PUBLISH);
if (empty($page->locks)) {
$lockalt = get_string('notlockedalt', 'format_page');
$lockicon = 'lock.gif';
} else {
$lockalt = get_string('lockedalt', 'format_page');
$lockicon = 'unlock.gif';
}
$lock = '<a title="' . $lockalt . '" href="' . $PAGE->url_build('page', $page->id, 'action', 'lock') . '" class="icon lock"><img src="' . $CFG->pixpath . '/t/' . $lockicon . '" alt="' . $lockalt . '" /></a>';
$table->data[] = array($name, $widgets, $theme, $menu, $publish, $lock);
}
print_table($table);
} else {
error(get_string('nopages', 'format_page'), $PAGE->url_build('action', 'editpage'));
}
}
示例6: calculate_page_content
/**
* @param $print_flag
*/
function calculate_page_content($print_flag)
{
$specmanagement_print_api = new specmanagement_print_api();
html_page_top1(plugin_lang_get('menu_versgraph'));
echo '<link rel="stylesheet" href="' . SPECMANAGEMENT_PLUGIN_URL . 'files/specmanagement.css">';
if (!$print_flag) {
html_page_top2();
if (plugin_is_installed('WhiteboardMenu') && file_exists(config_get_global('plugin_path') . 'WhiteboardMenu')) {
require_once WHITEBOARDMENU_CORE_URI . 'whiteboard_print_api.php';
$whiteboard_print_api = new whiteboard_print_api();
$whiteboard_print_api->printWhiteboardMenu();
}
$specmanagement_print_api->print_plugin_menu();
echo '<div align="center">';
echo '<hr size="1" width="100%" />';
}
print_table($print_flag);
if (!$print_flag) {
html_page_bottom1();
}
}
示例7: display
function display()
{
global $PAGE, $COURSE;
$moving = required_param('moving', PARAM_INT);
require_capability('format/page:managepages', $this->context);
$PAGE->print_tabs('manage');
if ($pages = page_get_all_pages($COURSE->id)) {
if (!($name = get_field('format_page', 'nameone', 'id', $moving))) {
error('Cannot get the name of the page');
}
$a = new stdClass();
$a->name = format_string($name);
$a->url = $PAGE->url_get_full(array('action' => 'manage'));
$table->head = array(get_string('movingpage', 'format_page', $a));
$table->cellpadding = '2px';
$table->cellspacing = '0';
$table->width = '30%';
$table->wrap = array('nowrap');
$table->id = 'editing-table';
$table->class = 'pageeditingtable';
$table->data = array();
$sortorder = 1;
$data = array();
$data[] = $this->movehere_widget($moving, 0, 0, -2, get_string('asamasterpageone', 'format_page'));
foreach ($pages as $page) {
if ($page->id != $moving) {
$data = array_merge($data, $this->print_moving_hierarchy($page, $moving));
$data[] = $this->movehere_widget($moving, 0, $sortorder, -2, get_string('asamasterpageafter', 'format_page', format_string($page->nameone)));
$sortorder++;
}
}
// Convert each item in $data into a table row
foreach ($data as $row) {
$table->data[] = array($row);
}
print_table($table);
} else {
error(get_string('nopages', 'format_page'), $PAGE->url_build('action', 'editpage'));
}
}
示例8: make_html
function make_html($link, $data_date, $base_table)
{
if ($base_table == 'okato') {
$classif = "ОКАТО";
} else {
$classif = "ОКТМО";
}
echo date("H:i:s") . " Генерация html для классификатора {$classif}\n\n";
$time = -time();
print_table($link, $data_date, $base_table, '', 'html');
$i = 1;
$query = 'SELECT mergedcode FROM ' . $base_table . ' WHERE mergedcode<>\'00000000\' AND exist<>0';
$result = mysqli_query($link, $query);
$num_pages = mysqli_num_rows($result);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$percents = 100 * $i / $num_pages;
$status = sprintf("%3d", $percents) . '% Обработано ' . sprintf("%7d", $i) . ' из ' . sprintf("%7d", $num_pages) . ' ';
fwrite(STDERR, "\r{$status}");
print_table($link, $data_date, $base_table, $row['mergedcode'], 'html');
$i++;
}
$time += time();
echo "\n\n" . date("H:i:s") . " Генерация html для {$classif} выполнена за " . hms($time) . "\n\n";
}
示例9: print_aside_deck
function print_aside_deck($id)
{
global $DECK_SINGLE_TABLE_ATTR;
$table = get_deck_table_name($id);
print_msg(get_deck_name_by_id($id));
$total = print_table($table, $DECK_SINGLE_TABLE_ATTR, 'print_single_deck_table_callback');
print_msg("total = {$total}");
}
示例10: survey_print_all_responses
function survey_print_all_responses($cmid, $results, $courseid)
{
$table->head = array("", get_string("name"), get_string("time"));
$table->align = array("", "left", "left");
$table->size = array(35, "", "");
foreach ($results as $a) {
$table->data[] = array(print_user_picture($a->id, $courseid, $a->picture, false, true, false), "<a href=\"report.php?action=student&student={$a->id}&id={$cmid}\">" . fullname($a) . "</a>", userdate($a->time));
}
print_table($table);
}
示例11: view_summary
/**
* Display auto generated info about the assignment
*/
function view_summary($submission = null, $return = false)
{
global $USER, $CFG;
$table = new Object();
$table->id = 'summary';
$table->class = 'generaltable';
$table->align = array('right', 'left');
$table->size = array('20%', '');
$table->width = '100%';
// Language
$item_name = get_string('assignmentlangs', 'assignment_onlinejudge') . ':';
$lang = get_string('lang' . $this->onlinejudge->language, 'assignment_onlinejudge');
$table->data[] = array($item_name, $lang);
if (is_null($submission)) {
$submission = $this->get_submission();
}
// Status
$item_name = get_string('status') . helpbutton('status', get_string('status'), 'assignment_onlinejudge', true, false, '', true) . ':';
$item = get_string('notavailable');
if (!empty($submission->status)) {
$item = get_string('status' . $submission->status, 'assignment_onlinejudge');
}
$table->data[] = array($item_name, $item);
// Judge time
$item_name = get_string('judgetime', 'assignment_onlinejudge') . ':';
$item = get_string('notavailable');
if (isset($submission->judgetime)) {
$item = userdate($submission->judgetime) . ' (' . get_string('early', 'assignment', format_time(time() - $submission->judgetime)) . ')';
}
$table->data[] = array($item_name, $item);
// Information
$item_name = get_string('info', 'assignment_onlinejudge') . ':';
$item = get_string('notavailable');
if (isset($submission->status)) {
if ($submission->status === 'pending') {
if (empty($CFG->assignment_oj_daemon_pid)) {
//Judge from cron
$lastcron = get_field('modules', 'lastcron', 'name', 'assignment');
$left = ceil(($lastcron + $CFG->assignment_oj_cronfreq - time()) / 60);
$left = $left > 0 ? $left : 0;
$submission->info = get_string('infopending', 'assignment_onlinejudge', $left);
} else {
$submission->info = get_string('notavailable');
}
} else {
if ($submission->status !== 'ac' && $submission->status !== 'ce' && empty($submission->info)) {
$submission->info = get_string('info' . $submission->status, 'assignment_onlinejudge');
}
}
if (!empty($submission->info)) {
$item = $submission->info;
}
}
$options = new stdClass();
$options->para = false;
$table->data[] = array($item_name, format_text(stripslashes($item), FORMAT_MOODLE, $options));
// Statistics
$item_name = get_string('statistics', 'assignment_onlinejudge') . ':';
$item = get_string('notavailable');
if (isset($submission->id)) {
$item = '';
$ac_rate = $this->get_statistics($submission, &$item);
if (!empty($item)) {
$item .= '<br />' . get_string('successrate', 'assignment_onlinejudge') . ': ' . round($ac_rate * 100, 2) . '%';
}
}
$table->data[] = array($item_name, $item);
// Output (Show to teacher only)
$context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
if (has_capability('mod/assignment:grade', $context) && isset($submission->output)) {
$table->data[] = array(get_string('output', 'assignment_onlinejudge') . ':', format_text(stripslashes($submission->output), FORMAT_PLAIN));
}
$output = print_table($table, true);
if ($return) {
return $output;
}
echo $output;
}
示例12: print_topic
<?php
print_topic("VIEWING MEMBERS");
include get_file_loc('menue.inc');
print_galactic_post_menue();
$container = array();
$container["url"] = "skeleton.php";
$container["body"] = "galactic_post_view_members.php";
if ($action == "Remove") {
$db->query("DELETE FROM galactic_post_writer WHERE game_id = {$player->game_id} AND account_id = {$var['id']}");
}
$db->query("SELECT * FROM galactic_post_writer WHERE game_id = {$player->game_id} AND account_id != {$player->account_id}");
if ($db->nf()) {
print_table();
print "<tr>";
print "<th align=\"center\">Player Name</th>";
print "<th align=\"center\">Last Wrote</th>";
print "<th align=\"center\">Options</th>";
print "</tr>";
while ($db->next_record()) {
$curr_writter = new SMR_PLAYER($db->f("account_id"), $player->game_id);
$time = $db->f("last_wrote");
print "<tr>";
print "<td align=\"center\">{$curr_writter->player_name}</td>";
print "<td align=\"center\"> " . date("n/j/Y g:i:s A", $time) . "</td>";
$container["id"] = $curr_writter->account_id;
print_form($container);
print "<td>";
print_submit("Remove");
print "</td>";
print "</tr>";
示例13: history
function history($question, $state, $number, $cmoptions, $options)
{
$history = '';
if (isset($options->history) and $options->history) {
if ($options->history == 'all') {
// show all states
$states = get_records_select('question_states', "attempt = '{$state->attempt}' AND question = '{$question->id}' AND event > '0'", 'seq_number ASC');
} else {
// show only graded states
$states = get_records_select('question_states', "attempt = '{$state->attempt}' AND question = '{$question->id}' AND event IN (" . QUESTION_EVENTS_GRADED . ")", 'seq_number ASC');
}
if (count($states) > 1) {
$strreviewquestion = get_string('reviewresponse', 'quiz');
$table = new stdClass();
$table->width = '100%';
if ($options->scores) {
$table->head = array(get_string('numberabbr', 'quiz'), get_string('action', 'quiz'), get_string('response', 'quiz'), get_string('time'), get_string('score', 'quiz'), get_string('grade', 'quiz'));
} else {
$table->head = array(get_string('numberabbr', 'quiz'), get_string('action', 'quiz'), get_string('response', 'quiz'), get_string('time'));
}
foreach ($states as $st) {
$st->responses[''] = $st->answer;
$this->restore_session_and_responses($question, $st);
$b = $state->id == $st->id ? '<b>' : '';
$be = $state->id == $st->id ? '</b>' : '';
if ($state->id == $st->id) {
$link = '<b>' . $st->seq_number . '</b>';
} else {
if (isset($options->questionreviewlink)) {
$link = link_to_popup_window($options->questionreviewlink . '?state=' . $st->id . '&number=' . $number, 'reviewquestion', $st->seq_number, 450, 650, $strreviewquestion, 'none', true);
} else {
$link = $st->seq_number;
}
}
if ($options->scores) {
$table->data[] = array($link, $b . get_string('event' . $st->event, 'quiz') . $be, $b . $this->response_summary($question, $st) . $be, $b . userdate($st->timestamp, get_string('timestr', 'quiz')) . $be, $b . round($st->raw_grade, $cmoptions->decimalpoints) . $be, $b . round($st->grade, $cmoptions->decimalpoints) . $be);
} else {
$table->data[] = array($link, $b . get_string('event' . $st->event, 'quiz') . $be, $b . $this->response_summary($question, $st) . $be, $b . userdate($st->timestamp, get_string('timestr', 'quiz')) . $be);
}
}
$history = print_table($table, true);
}
}
return $history;
}
示例14: DataForm
$export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self() . '?exportpdf=&offset=' . intval($_GET['offset']) . '&selectcat=' . intval($_GET['selectcat']) . '&' . api_get_cidreq(), '_blank', '');
if ($export_pdf_form->validate()) {
$params = $export_pdf_form->exportValues();
Display::set_header(null, false, false);
$params['join_firstname_lastname'] = true;
$params['show_official_code'] = true;
$params['export_pdf'] = true;
$params['only_total_category'] = false;
GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
} else {
Display::display_header(get_lang('ExportPDF'));
}
}
if (isset($_GET['print'])) {
$printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
echo print_table($printable_data[1], $printable_data[0], get_lang('FlatView'), $cat[0]->get_name());
exit;
}
if (!empty($_GET['export_report']) && $_GET['export_report'] == 'export_report') {
if (api_is_platform_admin() || api_is_course_admin() || api_is_course_coach() || $isDrhOfCourse) {
$user_id = null;
if (empty($_SESSION['export_user_fields'])) {
$_SESSION['export_user_fields'] = false;
}
if (!api_is_allowed_to_edit(false, false) and !api_is_course_tutor()) {
$user_id = api_get_user_id();
}
$printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
switch ($_GET['export_format']) {
case 'xls':
$export = new GradeBookResult();
示例15: dialogue_list_conversations_inout
function dialogue_list_conversations_inout($dialogue, $inout)
{
// list open conversations of the current user awaiting their reply
global $USER, $CFG;
if (!($course = get_record("course", "id", $dialogue->course))) {
error("Course is misconfigured");
}
if (!($cm = get_coursemodule_from_instance("dialogue", $dialogue->id, $course->id))) {
error("Course Module ID was incorrect");
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$dialoguemanagers = array_keys(get_users_by_capability($context, 'mod/dialogue:manage'));
$params->pane = optional_param('pane', '', PARAM_TEXT);
$timenow = time();
$showbutton = false;
if (empty($params->order)) {
$params->order = 'c.timemodified ASC';
} else {
$params->order = rtrim(ltrim(optional_param('order', '', PARAM_TEXT), "\\'"), "\\'");
}
// list the conversations requiring a resonse from this user in full
if ($conversations = dialogue_get_conversations_unique_subject($dialogue, $USER, 'closed = 0 ', $params->order)) {
// reorder the conversations by (other) name
foreach ($conversations as $conversation) {
if ($inout == 'outgoing' && !($USER->id == $conversation->userid)) {
continue;
}
if ($inout == 'incoming' && !($USER->id == $conversation->recipientid)) {
continue;
}
if (in_array($USER->id, $dialoguemanagers)) {
if (!in_array($conversation->userid, $dialoguemanagers)) {
if (!($with = get_record("user", "id", $conversation->userid))) {
error("User's record not found");
}
} else {
if (!($with = get_record("user", "id", $conversation->recipientid))) {
//continue;
error("User's record not found");
}
}
} else {
if ($USER->id != $conversation->userid) {
if (!($with = get_record("user", "id", $conversation->userid))) {
error("User's record not found");
}
} else {
if (!($with = get_record("user", "id", $conversation->recipientid))) {
error("User's record not found");
}
}
}
$names[$conversation->id] = fullname($with);
}
// used to sord by names, i disabled it to have the table be sorted by clicking the arrows
// on each column's header title.
//natcasesort($names);
print_simple_box_start("center");
$table->head = array(get_string("dialoguewith", "dialogue"), get_string("subject", "dialogue"), get_string("lastentry", "dialogue") . "<a href=\"view.php?id={$cm->id}&pane={$params->pane}&order='c.timemodified ASC'\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/arrow-down.png\" height=16 width=16></a>" . "<a href=\"view.php?id={$cm->id}&pane={$params->pane}&order='c.timemodified DESC'\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/arrow-up.png\" height=16 width=16></a>", get_string("actions", "dialogue"));
$table->width = "80%";
$table->align = array("left", "left", "left", "center");
$table->size = array("*", "*", "*", "*");
$table->cellpadding = 2;
$table->cellspacing = 0;
foreach ($names as $cid => $name) {
$conversation = $conversations[$cid];
$hasattachmenticon = " ";
if ($entries = get_records_select("dialogue_entries", "conversationid = {$conversation->id}", "id")) {
foreach ($entries as $entry) {
if (!empty($entry->attachment)) {
$hasattachmenticon = " <img src=\"{$CFG->wwwroot}/mod/dialogue/pix/paperclip.gif\" height=11 width=14> ";
}
}
}
if ($conversation->total - $conversation->readings > 0) {
$mailstatusicon = "pix/pmmail.gif";
$unread = '<span class="unread">' . ($conversation->total - $conversation->readings) . '</span>';
} else {
$unread = 0;
$mailstatusicon = "pix/answermail.gif";
}
$actions = " ";
$actions .= "<a href=\"dialogues.php?id={$cm->id}&action=deleteconversation&cid={$conversation->id}\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/mail-delete.png\" height=11 width=14 alt=\"" . get_string("deleteconversation", "dialogue") . "\" title=\"" . get_string("deleteconversation", "dialogue") . "\" > </a>";
// $actions .= "<a href=\"dialogues.php?id=$cm->id&action=confirmclose&cid=$conversation->id&pane=2\">".
// "<img src=\"$CFG->wwwroot/mod/dialogue/pix/mail-archive.png\" height=11 width=14 alt=\"".get_string("archiveconversation", "dialogue")."\" title=\"".get_string("archiveconversation", "dialogue")."\" > </a>";
$table->data[] = array($name, "<img src=\"{$CFG->wwwroot}/mod/dialogue/{$mailstatusicon}\" height=14 width=15> " . "<a href=\"dialogues.php?id={$cm->id}&action=printdialogue&cid={$conversation->id}\">" . clean_text($conversation->subject) . "</a>" . $hasattachmenticon, userdate($conversation->timemodified), $actions);
}
print_table($table);
print_simple_box_end();
}
}