本文整理汇总了PHP中HTML_Table类的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table类的具体用法?PHP HTML_Table怎么用?PHP HTML_Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML_Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lp_upload_quiz_main
function lp_upload_quiz_main()
{
// variable initialisation
$lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : null;
$form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id=' . $lp_id, '', array('enctype' => 'multipart/form-data'));
$form->addElement('header', get_lang('ImportExcelQuiz'));
$form->addElement('file', 'user_upload_quiz', get_lang('FileUpload'));
$link = '<a href="../exercice/quiz_template.xls">' . Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')) . get_lang('DownloadExcelTemplate') . '</a>';
$form->addElement('label', '', $link);
$table = new HTML_Table(array('class' => 'table'));
$tableList = array(UNIQUE_ANSWER => get_lang('UniqueSelect'), MULTIPLE_ANSWER => get_lang('MultipleSelect'), FILL_IN_BLANKS => get_lang('FillBlanks'), MATCHING => get_lang('Matching'), FREE_ANSWER => get_lang('FreeAnswer'), GLOBAL_MULTIPLE_ANSWER => get_lang('GlobalMultipleAnswer'));
$table->setHeaderContents(0, 0, get_lang('QuestionType'));
$table->setHeaderContents(0, 1, '#');
$row = 1;
foreach ($tableList as $key => $label) {
$table->setCellContents($row, 0, $label);
$table->setCellContents($row, 1, $key);
$row++;
}
$table = $table->toHtml();
$form->addElement('label', get_lang('QuestionType'), $table);
$form->addElement('checkbox', 'user_custom_score', null, get_lang('UseCustomScoreForAllQuestions'), array('id' => 'user_custom_score'));
$form->addElement('html', '<div id="options" style="display:none">');
$form->addElement('text', 'correct_score', get_lang('CorrectScore'));
$form->addElement('text', 'incorrect_score', get_lang('IncorrectScore'));
$form->addElement('html', '</div>');
$form->addRule('user_upload_quiz', get_lang('ThisFieldIsRequired'), 'required');
$form->add_progress_bar();
$form->addButtonUpload(get_lang('Upload'), 'submit_upload_quiz');
// Display the upload field
$form->display();
}
示例2: __construct
public function __construct()
{
parent::__construct('aicml_staff');
if ($this->loginError) {
return;
}
echo '<h1>AICML Staff</h1>';
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Name', 'Start', 'End', 'Num Pubs', 'Pub Ids'));
$table->setRowType(0, 'th');
//pdDb::debugOn();
$staff_list = pdAicmlStaffList::create($this->db);
foreach ($staff_list as $staff_id => $author_id) {
$staff = pdAicmlStaff::newFromDb($this->db, $staff_id, pdAicmlStaff::DB_LOAD_PUBS_MIN);
$author = pdAuthor::newFromDb($this->db, $author_id, pdAuthor::DB_LOAD_MIN);
//debugVar('staff', array($staff, $author));
$pub_links = array();
if (isset($staff->pub_ids)) {
foreach ($staff->pub_ids as $pub_id) {
$pub_links[] = '<a href="../view_publication.php?pub_id=' . $pub_id . '">' . $pub_id . '</a>';
}
}
$table->addRow(array($author->name, $staff->start_date, $staff->end_date, count($staff->pub_ids), implode(', ', $pub_links)), array('class' => 'stats_odd'));
}
echo $table->toHtml();
}
示例3: imprimirFormularioLogin
/**
* Muestra el formulario para iniciar sesión.
*/
private function imprimirFormularioLogin()
{
imprimirTabulados(5);
echo '<div class="tablaTituloBotones">';
imprimirTabulados(6);
echo '<h2>Iniciar sesión</h2>';
imprimirTabulados(6);
echo '<form action="index.php" method="post">';
imprimirTabulados(6);
echo '<fieldset class="login">';
imprimirTabulados(6);
$clase = array('class' => 'tablaCarga');
$tabla = new HTML_Table($clase);
$tabla->setAutoGrow(true);
$tabla->setHeaderContents(0, 0, 'Usuario');
$tabla->setCellContents(0, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="username" value="" />');
$tabla->setHeaderContents(1, 0, 'Contraseña');
$tabla->setCellContents(1, 1, '<input class="campoTexto campoTextoAlineado" type="password" name="password" value="" />');
$tabla->setColAttributes(0, $clase);
$tabla->setColAttributes(1, $clase);
echo $tabla->toHtml();
imprimirTabulados(6);
echo '<br /><input type="submit" name="botonIniciarSesion" value="Iniciar sesión" >';
imprimirTabulados(6);
echo '</fieldset>';
imprimirTabulados(6);
echo '</form>';
imprimirTabulados(5);
echo '</div>';
}
示例4: pubByYears
private function pubByYears()
{
$pub_years = pdPubList::create($this->db, array('year_list' => true));
if (empty($pub_years) || count($pub_years) == 0) {
return;
}
$table = new HTML_Table(array('class' => 'nomargins', 'width' => '60%'));
$text = '';
foreach (array_values($pub_years) as $item) {
$text .= '<a href="list_publication.php?year=' . $item['year'] . '">' . $item['year'] . '</a> ';
}
$table->addRow(array($text));
echo '<h2>Publications by Year:</h2>', $table->toHtml();
}
示例5: __construct
public function __construct()
{
parent::__construct('auth_success', 'Authorization Success', 'Admin/auth_success.php');
if ($this->loginError) {
return;
}
echo "<h2>Authorization Successful</h2>" . "\n<p>The following users have been granted access.</p>";
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Access Level', 'Login', 'Name', 'Conf. Email'));
$table->setRowType(0, 'th');
foreach ($_SESSION['auth_success'] as $auth) {
$table->addRow(array(AccessLevel::getAccessLevelStr($auth['user']->access_level), $auth['user']->login, $auth['user']->name, $auth['email']), array('class' => 'stats_odd'));
}
echo $table->toHtml();
}
示例6: show_html
public function show_html()
{
$sections = array('chamilo', 'php', 'database', 'webserver', 'paths');
$currentSection = isset($_GET['section']) ? $_GET['section'] : 'chamilo';
if (!in_array(trim($currentSection), $sections)) {
$currentSection = 'chamilo';
}
$html = '<div class="tabbable"><ul class="nav nav-tabs">';
foreach ($sections as $section) {
if ($currentSection === $section) {
$html .= '<li class="active">';
} else {
$html .= '<li>';
}
$params['section'] = $section;
$html .= '<a href="system_status.php?section=' . $section . '">' . get_lang($section) . '</a></li>';
}
$html .= '</ul><div class="tab-pane">';
$data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
echo $html;
if ($currentSection != 'paths') {
$table = new SortableTableFromArray($data, 1, 100);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('Section'), false);
$table->set_header(2, get_lang('Setting'), false);
$table->set_header(3, get_lang('Current'), false);
$table->set_header(4, get_lang('Expected'), false);
$table->set_header(5, get_lang('Comment'), false);
$table->display();
} else {
$headers = $data['headers'];
$results = $data['data'];
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
foreach ($headers as $header) {
$table->setHeaderContents(0, $column, $header);
$column++;
}
$row = 1;
foreach ($results as $index => $rowData) {
$table->setCellContents($row, 0, $rowData);
$table->setCellContents($row, 1, $index);
$row++;
}
echo $table->display();
}
echo '</div></div>';
}
示例7: __construct
public function __construct()
{
parent::__construct('auth_error', 'Authorization Error', 'Admin/auth_error.php');
if ($this->loginError) {
return;
}
echo "<h2>Invalid Access Level</h2>" . "\n<p>The following users have incorrect access level.</p>";
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Access Level', 'Login', 'Name'));
$table->setRowType(0, 'th');
foreach ($_SESSION['auth_errors'] as $auth_err) {
$table->addRow(array(AccessLevel::getAccessLevelStr($auth_err['access']), $auth_err['user']->login, $auth_err['user']->name), array('class' => 'stats_odd'));
}
echo $table->toHtml();
echo '<p><a href="authorize_new_users.php">Authorize new users</a></p>';
}
示例8: __construct
public function __construct()
{
parent::__construct('all_categories');
if ($this->loginError) {
return;
}
$cat_list = pdCatList::create($this->db);
echo '<h1>Publication Categories</h1>';
foreach (array_keys($cat_list) as $cat_id) {
unset($fields);
unset($cells);
$category = new pdCategory();
$result = $category->dbLoad($this->db, $cat_id);
assert('$result');
$table = new HTML_Table(array('class' => 'publist'));
$table->setAutoGrow(true);
$cells[] = '<b>' . $category->category . '</b><br/>';
if (count($category->info) > 0) {
foreach ($category->info as $info_id => $name) {
$fields[] = $name;
}
$cells[] = 'Fields: ' . implode(', ', $fields);
} else {
$cells[] = '';
}
if ($this->access_level > 0) {
$cells[] = $this->getCategoryIcons($category);
}
$table->addRow($cells);
$table->updateColAttributes(0, array('class' => 'category'), NULL);
$table->updateColAttributes(2, array('class' => 'icons'), NULL);
echo $table->toHtml();
unset($table);
}
}
示例9: __construct
public function __construct()
{
parent::__construct('all_authors');
if ($this->loginError) {
return;
}
$this->loadHttpVars(true, false);
if (!isset($this->tab)) {
$this->tab = 'A';
} else {
$tab = strtoupper($this->tab);
if (strlen($tab) != 1 || ord($tab) < ord('A') || ord($tab) > ord('Z')) {
$this->pageError = true;
return;
}
}
$auth_list = pdAuthorList::create($this->db, null, $this->tab);
echo $this->alphaSelMenu($this->tab, get_class($this) . '.php');
echo "<h2>Authors</h2>";
if (empty($auth_list) || count($auth_list) == 0) {
echo 'No authors with last name starting with ', $this->tab, '<br/>';
return;
}
foreach ($auth_list as $author_id => $name) {
$author = new pdAuthor();
$author->dbLoad($this->db, $author_id, pdAuthor::DB_LOAD_BASIC | pdAuthor::DB_LOAD_PUBS_MIN);
$name = '<span class="emph"><a href="view_author.php?author_id=' . $author_id . '">' . $name . '</a> ';
$icons = $this->getAuthorIcons($author) . '</span>';
$info = array();
if ($author->title != '') {
$info[] = '<span class="small">' . $author->title . '</span>';
}
if ($author->organization != '') {
$info[] = '<span class="small">' . $author->organization . '</span>';
}
$info[] .= '<a href="list_publication.php?author_id=' . $author_id . '&menu=0"><span class="small" style="color:#000;font-weight:normal;">' . 'Publication entries in database: ' . $author->totalPublications . '</span>';
$table = new HTML_Table(array('class' => 'publist'));
$table->addRow(array($name . '<br/>' . implode('<br/>', $info), $icons));
$table->updateColAttributes(1, array('class' => 'icons'), NULL);
echo $table->toHtml();
unset($table);
}
}
示例10: __construct
public function __construct()
{
parent::__construct('delete_author', 'Delete Author', 'Admin/delete_author.php');
if ($this->loginError) {
return;
}
$this->loadHttpVars();
if (!isset($this->author_id) || !is_numeric($this->author_id)) {
$this->pageError = true;
return;
}
$author = new pdAuthor();
$result = $author->dbLoad($this->db, $this->author_id);
if (!$result) {
$this->pageError = true;
return;
}
$pub_list = pdPubList::create($this->db, array('author_id' => $this->author_id));
if (isset($pub_list) && count($pub_list) > 0) {
echo 'Cannot delete Author <b>', $author->name, '</b>.<p/>', 'The author has the following publications in the database:', displayPubList($this->db, $pub_list, true, -1, null, null, '../');
return;
}
$form =& $this->confirmForm('deleter');
$form->addElement('hidden', 'author_id', $this->author_id);
if ($form->validate()) {
$values = $form->exportValues();
// This is where the actual deletion happens.
$name = $author->name;
$author->dbDelete($this->db);
echo 'You have successfully removed the following author from the database:', '<p/><b>', $name, '</b>';
} else {
if (!isset($this->author_id) || !is_numeric($this->author_id)) {
$this->pageError = true;
return;
}
$renderer = new HTML_QuickForm_Renderer_QuickHtml();
$form->accept($renderer);
$table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$table->addRow(array('Name:', $author->name));
if (isset($author->title) && trim($author->title != '')) {
$table->addRow(array('Title:', $author->title));
}
$table->addRow(array('Email:', $author->email));
$table->addRow(array('Organization:', $author->organization));
$cell = '';
if (isset($author->webpage) && trim($author->webpage != '')) {
$cell = '<a href="' . $author->webpage . '">' . $author->webpage . '</a>';
} else {
$cell = "none";
}
$table->addRow(array('Web page:', $cell));
$table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%'));
echo '<h3>Delete Author</h3><p/>Delete the following author?';
$this->form =& $form;
$this->renderer =& $renderer;
$this->table =& $table;
}
}
示例11: viewList
/**
* View list
*
* @author John.meng
* @since version - Dec 23, 2005
* @param datatype paramname description
* @return datatype description
*/
function viewList()
{
global $__Lang__, $UrlParameter, $FlushPHPObj, $table, $page_data, $all_data, $links, $form, $smarty;
include_once PEAR_DIR . 'HTML/QuickForm.php';
include_once PEAR_DIR . "HTML/Table.php";
require_once PEAR_DIR . 'Pager/Pager.php';
$form = new HTML_QuickForm('viewList');
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n{content}\n</table>\n</form>");
$tableAttrs = array("class" => "grid_table");
$table = new HTML_Table($tableAttrs);
$table->setAutoGrow(true);
// $table->setAutoFill("n/a");
$hrAttrs = array("class" => "grid_table_head");
$table->setRowAttributes(0, $hrAttrs, true);
$params = array('itemData' => $all_data, 'perPage' => 10, 'delta' => 3, 'append' => true, 'separator' => ' . ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'prevImg' => $__Lang__['langPaginationPrev'], 'nextImg' => $__Lang__['langPaginationNext']);
$pager =& Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();
$selectBox = $pager->getPerPageSelectBox();
}
示例12: __construct
public function __construct()
{
parent::__construct('bibtex', null, false);
if ($this->loginError) {
return;
}
$this->loadHttpVars();
if (!isset($this->pub_ids)) {
$this->pageError = true;
return;
}
$pubs = explode(',', $this->pub_ids);
if (!is_array($pubs) || count($pubs) == 0) {
$this->pageError = true;
return;
}
$pub_list = pdPubList::create($this->db, array('pub_ids' => $pubs));
if (!is_array($pub_list) || count($pub_list) == 0) {
$this->pageError = true;
return;
}
$table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '0', 'cellspacing' => '0'));
$table->setAutoGrow(true);
$pub_count = 0;
foreach ($pub_list as $pub) {
$pub_count++;
$result = $pub->dbLoad($this->db, $pub->pub_id);
if ($result === false) {
$this->pageError = true;
return;
}
$table->addRow(array('<pre>' . $pub->getBibtex() . '</pre>'));
}
// now assign table attributes including highlighting for even and odd
// rows
for ($i = 0; $i < $table->getRowCount(); $i++) {
if ($i & 1) {
$table->updateRowAttributes($i, array('class' => 'even'), true);
} else {
$table->updateRowAttributes($i, array('class' => 'odd'), true);
}
}
$table->updateColAttributes(0, array('class' => 'publist'), true);
echo $table->toHtml();
}
示例13: HTML_Table
<?php
$tbl = new HTML_Table('', 'table table-striped table-bordered');
$tbl->addRow();
$tbl->addCell('FY ID', '', 'header');
$tbl->addCell('FY Description', '', 'header');
$tbl->addCell('Start Date', '', 'header');
$tbl->addCell('End Date', '', 'header');
$tbl->addCell('Status', '', 'header');
$tbl->addCell('Actions', '', 'header');
?>
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'fiscal_years ORDER by fiscal_year_start_date';
$get_fy = DB::query($sql);
foreach ($get_fy as $fy) {
$tbl->addRow();
$tbl->addCell($fy['fiscal_year_id']);
$tbl->addCell($fy['fiscal_year_desc']);
$tbl->addCell(getDateTime($fy['fiscal_year_start_date'], "dLong"));
$tbl->addCell(getDateTime($fy['fiscal_year_end_date'], "dLong"));
$tbl->addCell($fy['fy_status']);
$tbl->addCell("<a class='pull btn btn-danger btn-xs' href ='" . $_SERVER['PHP_SELF'] . "?route=modules/gl/setup/financial_periods/edit_fiscal_year&fisca_year_id=" . $fy['fiscal_year_id'] . "'>Edit Fiscal Year <span class='glyphicon glyphicon-edit'></span></a>\n\t\t\t ");
}
?>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Fiscal Years
<small>Defined Fiscal Years for Company Accounts.</small>
</h1>
示例14: listCategories
/**
* @param string $categorySource
*
* @return string
*/
function listCategories($categorySource)
{
$categorySource = isset($categorySource) ? $categorySource : null;
$categories = self::getCategories($categorySource);
if (count($categories) > 0) {
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
$row = 0;
$headers = array(get_lang('Category'), get_lang('CategoriesNumber'), get_lang('Courses'), get_lang('Actions'));
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
$column++;
}
$row++;
$mainUrl = api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $categorySource;
$editIcon = Display::return_icon('edit.png', get_lang('EditNode'), null, ICON_SIZE_SMALL);
$deleteIcon = Display::return_icon('delete.png', get_lang('DeleteNode'), null, ICON_SIZE_SMALL);
$moveIcon = Display::return_icon('up.png', get_lang('UpInSameLevel'), null, ICON_SIZE_SMALL);
foreach ($categories as $category) {
$editUrl = $mainUrl . '&id=' . $category['code'] . '&action=edit';
$moveUrl = $mainUrl . '&id=' . $category['code'] . '&action=moveUp&tree_pos=' . $category['tree_pos'];
$deleteUrl = $mainUrl . '&id=' . $category['code'] . '&action=delete';
$actions = Display::url($editIcon, $editUrl) . Display::url($moveIcon, $moveUrl) . Display::url($deleteIcon, $deleteUrl);
$url = api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $category['code'];
$title = Display::url(Display::return_icon('folder_document.gif', get_lang('OpenNode'), null, ICON_SIZE_SMALL) . ' ' . $category['name'], $url);
$content = array($title, $category['children_count'], $category['nbr_courses'], $actions);
$column = 0;
foreach ($content as $value) {
$table->setCellContents($row, $column, $value);
$column++;
}
$row++;
}
return $table->toHtml();
} else {
return Display::return_message(get_lang("NoCategories"), 'warning');
}
}
示例15: foreach
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'journal_vouchers WHERE voucher_status="draft" ORDER by voucher_id DESC';
$draft_jvs = DB::query($sql);
foreach ($draft_jvs as $draft_jv) {
$tbl_draft->addRow();
$tbl_draft->addCell($draft_jv['voucher_id']);
$tbl_draft->addCell(getDateTime($draft_jv['voucher_date'], "dShort"));
$tbl_draft->addCell($draft_jv['voucher_ref_no']);
$tbl_draft->addCell($draft_jv['voucher description']);
$tbl_draft->addCell($draft_jv['debits_total']);
$tbl_draft->addCell($draft_jv['credits_total']);
$tbl_draft->addCell("More info here like created on, last modify etc");
$tbl_draft->addCell("<a class='pull btn btn-primary btn-xs' href ='" . SITE_ROOT . "?route=modules/gl/transactions/journal_vouchers/add_journal_voucher_detail&voucher_id=" . $draft_jv['voucher_id'] . "'>Edit <span class='glyphicon glyphicon-edit'></span></a> <a class='pull btn btn-danger btn-xs' href ='#'>Delete <span class='glyphicon glyphicon-trash'></span></a>");
}
//Journal Vouchers Pending Approvel
$tbl_pending = new HTML_Table('', 'table table-striped table-bordered');
$tbl_pending->addRow();
$tbl_pending->addCell('Voucher ID', '', 'header');
$tbl_pending->addCell('Ref #', '', 'header');
$tbl_pending->addCell('Voucher Description', '', 'header');
$tbl_pending->addCell('Total Amount', '', 'header');
$tbl_pending->addCell('Voucher Approved By', '', 'header');
$tbl_pending->addCell('Voucher Status', '', 'header');
$tbl_pending->addCell('Actions', '', 'header');
?>
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'journal_vouchers WHERE voucher_status = "pending" ORDER by voucher_id DESC';
$pending_jvs = DB::query($sql);
foreach ($pending_jvs as $pending_jv) {
$tbl_pending->addRow();