本文整理汇总了PHP中HTML_Table::toHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::toHtml方法的具体用法?PHP HTML_Table::toHtml怎么用?PHP HTML_Table::toHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Table
的用法示例。
在下文中一共展示了HTML_Table::toHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: imprimir
public function imprimir()
{
// Implementada en la subclase
$this->imprimirCabecera();
for ($index = 0; $index < count($this->horarios); $index++) {
$horario = $this->horarios[$index];
// Implementada en la subclase
$this->imprimirFila($horario, $index);
}
imprimirTabulados(6);
echo $this->tabla->toHtml();
}
示例2: 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>';
}
示例3: __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);
}
}
示例4: __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();
}
示例5: imprimir
public function imprimir()
{
// Implementada en la subclase
$this->imprimirCabecera();
for ($index = 0; $index < count($this->listaHorasAsignadas); $index++) {
$horasAsignadas = $this->listaHorasAsignadas[$index];
// El usuario pidio editar este horario
if (isset($_REQUEST['botonEditarHoras'])) {
$this->filaTablaHorasAsignadasEditar($horasAsignadas, $index);
} else {
// Muestra una fila ordinaria
$this->filaTablaHorasAsignadas($horasAsignadas, $index);
}
}
imprimirTabulados(6);
echo $this->tabla->toHtml();
}
示例6: viewList
/**
* View list
*
* @author John.meng
* @since version1.0 - Dec 12, 2005
*/
function viewList()
{
global $__Lang__, $FlushPHPObj, $smarty;
include_once PEAR_DIR . "HTML/Table.php";
include_once PEAR_DIR . "HTML/QuickForm.php";
include_once APP_DIR . "UI.class.php";
$form =& new HTML_QuickForm();
$FilesDirsObj = $FlushPHPObj->loadUtility("FilesDirs");
$FilesDirsObj->FilesDirs(MODULE_DIR, 1, "CVS,General");
$Module_arr = $FilesDirsObj->listDirs();
asort($Module_arr);
reset($Module_arr);
$data = array();
$installImageObj = new UIImage(THEMES_DIR . "images/install.gif");
$unInstallImageObj = new UIImage(THEMES_DIR . "images/uninstall.gif");
if (sizeof($Module_arr)) {
foreach ($Module_arr as $key => $value) {
$temp_Module_arr = $FlushPHPObj->getModuleInfo($value);
if (file_exists(MODULE_DIR . "/" . $temp_Module_arr['name'] . "/" . $temp_Module_arr['logo']) && $temp_Module_arr['logo']) {
$ModuleImageLogo = new UIImage(MODULE_DIR . "/" . $temp_Module_arr['name'] . "/" . $temp_Module_arr['logo']);
$Module_logo = $ModuleImageLogo->toHTML() . "<br/>";
}
$data[$key] = array($Module_logo . $temp_Module_arr['name'] . " <b> " . $temp_Module_arr['version'] . " <b/> ", $temp_Module_arr['description'], $temp_Module_arr['author'], $unInstallImageObj->toHTML() . "<br/>" . $__Lang__['langGeneralUnInstall'], $installImageObj->toHTML() . "<br/>" . $__Lang__['langGeneralInstall']);
}
}
$tableAttrs = array("class" => "grid_table");
$table = new HTML_Table($tableAttrs);
$table->setAutoGrow(true);
$table->setAutoFill("n/a");
for ($nr = 0; $nr < count($data); $nr++) {
$table->setHeaderContents($nr + 1, 0, (string) $nr);
for ($i = 0; $i < 5; $i++) {
if ("" != $data[$nr][$i]) {
$table->setCellContents($nr + 1, $i + 1, $data[$nr][$i]);
}
}
}
$table->setColAttributes(3, array(" align" => "center"));
$table->setColAttributes(4, array(" align" => "center"));
$table->setColAttributes(5, array(" align" => "center"));
$altRow = array("class" => "grid_table_tr_alternate");
$table->altRowAttributes(1, null, $altRow);
$table->setHeaderContents(0, 0, "");
$table->setHeaderContents(0, 1, $__Lang__['langMenuModule']);
$table->setHeaderContents(0, 2, $__Lang__['langGeneralSummary']);
$table->setHeaderContents(0, 3, $__Lang__['langGeneralAuthor']);
$table->setHeaderContents(0, 4, $__Lang__['langGeneralStatus']);
$table->setHeaderContents(0, 5, $__Lang__['langGeneralOperation']);
$hrAttrs = array("class" => "grid_table_head");
$table->setRowAttributes(0, $hrAttrs, true);
$table->setColAttributes(0, $hrAttrs);
$smarty->assign("Main", $table->toHtml());
}
示例7: 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();
}
示例8: __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();
}
示例9: __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>';
}
示例10: __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();
}
示例11: __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);
}
}
示例12: array
if ($current_access_url_id == $url_info['access_url_id']) {
$add_user = false;
}
$access_info_to_string .= $url_info['url'] . '<br />';
}
}
if ($add_user) {
$row_table = array();
$row_table[] = api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ') ';
$row_table[] = $access_info_to_string;
$url = api_get_self() . '?action=add_user_to_my_url&user_id=' . $user['id'] . '&sec_token=' . $_SESSION['sec_token'];
$row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
foreach ($row_table as $cell) {
$table->setCellContents($row, $column, $cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
}
$extra_search_options .= $table->toHtml();
$table_result = '';
}
}
}
$tpl = new Template($tool_name);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $form . $table_result . $extra_search_options);
$tpl->display_one_col_template();
示例13: array
$table->setCellAttributes($row, $column, array('width' => '300px'));
$column++;
$table->setCellContents($row, $column, $userResult['sent_date']);
$column++;
$dateQualification = !empty($workExtraData['expires_on']) && $workExtraData['expires_on'] != '0000-00-00 00:00:00' ? api_get_local_time($workExtraData['expires_on']) : '-';
$table->setCellContents($row, $column, $dateQualification);
$column++;
$score = '-';
if (!empty($scoreWeight)) {
$score = strip_tags($userResult['qualification']) . "/" . $scoreWeight;
}
$table->setCellContents($row, $column, $score);
$column++;
// Actions
$links = null;
// is a text
$url = api_get_path(WEB_CODE_PATH) . 'work/view.php?' . api_get_cidreq() . '&id=' . $userResult['id'];
$links .= Display::url(Display::return_icon('default.png'), $url);
if (!empty($userResult['url'])) {
$url = api_get_path(WEB_CODE_PATH) . 'work/download.php?' . api_get_cidreq() . '&id=' . $userResult['id'];
$links .= Display::url(Display::return_icon('save.png', get_lang('Download')), $url);
}
$url = api_get_path(WEB_CODE_PATH) . 'work/edit.php?' . api_get_cidreq() . '&item_id=' . $userResult['id'] . '&id=' . $workId . '&parent_id=' . $workId;
$links .= Display::url(Display::return_icon('edit.png', get_lang('Comment')), $url);
$table->setCellContents($row, $column, $links);
$row++;
$column = 0;
}
}
echo $table->toHtml();
Display::display_footer();
示例14: get_stats_table_by_attempt
/**
* Returns a category summary report
* @params int exercise id
* @params array pre filled array with the category_id, score, and weight
* example: array(1 => array('score' => '10', 'total' => 20));
*/
public static function get_stats_table_by_attempt($exercise_id, $category_list = array())
{
if (empty($category_list)) {
return null;
}
$category_name_list = TestCategory::getListOfCategoriesNameForTest($exercise_id);
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('Categories'));
$table->setHeaderContents(0, 1, get_lang('AbsoluteScore'));
$table->setHeaderContents(0, 2, get_lang('RelativeScore'));
$row = 1;
$none_category = array();
if (isset($category_list['none'])) {
$none_category = $category_list['none'];
unset($category_list['none']);
}
$total = array();
if (isset($category_list['total'])) {
$total = $category_list['total'];
unset($category_list['total']);
}
if (count($category_list) > 1) {
foreach ($category_list as $category_id => $category_item) {
$table->setCellContents($row, 0, $category_name_list[$category_id]);
$table->setCellContents($row, 1, ExerciseLib::show_score($category_item['score'], $category_item['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($category_item['score'], $category_item['total'], true, false, true));
$row++;
}
if (!empty($none_category)) {
$table->setCellContents($row, 0, get_lang('None'));
$table->setCellContents($row, 1, ExerciseLib::show_score($none_category['score'], $none_category['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($none_category['score'], $none_category['total'], true, false, true));
$row++;
}
if (!empty($total)) {
$table->setCellContents($row, 0, get_lang('Total'));
$table->setCellContents($row, 1, ExerciseLib::show_score($total['score'], $total['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($total['score'], $total['total'], true, false, true));
}
return $table->toHtml();
}
return null;
}
示例15: imprimirFormularioNuevoUsuario
/**
* Muestra el formulario para dar de alta un nuevo usuario.
*/
private function imprimirFormularioNuevoUsuario()
{
imprimirTabulados(5);
echo '<div class="tablaTituloBotones">';
imprimirTabulados(6);
echo '<h1>Nuevo usuario</h1>';
imprimirTabulados(6);
echo '<form action="usuario.php" method="post">';
imprimirTabulados(6);
echo '<fieldset>';
imprimirTabulados(6);
$clase = array('class' => 'tablaCarga');
$tabla = new HTML_Table($clase);
$tabla->setAutoGrow(true);
$tabla->setHeaderContents(0, 0, 'Tipo de documento');
$tabla->setCellContents(0, 1, '<select class="cuadroSeleccion cuadroSeleccionAlineado" name="tipoDocumento"><option>DNI</option><option>LE</option><option>LC</option></select>');
$tabla->setHeaderContents(1, 0, 'Número de documento *');
$tabla->setCellContents(1, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="numeroDocumentoNuevo" value="" />');
$tabla->setHeaderContents(2, 0, 'Nombre *');
$tabla->setCellContents(2, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="nombre" value="" />');
$tabla->setHeaderContents(3, 0, 'Segundo nombre');
$tabla->setCellContents(3, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="segundoNombre" value="" />');
$tabla->setHeaderContents(4, 0, 'Apellido *');
$tabla->setCellContents(4, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="apellido" value="" />');
$tabla->setHeaderContents(5, 0, 'Fecha de nacimiento *');
$tabla->setCellContents(5, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="fechaNacimiento" value="DD-MM-AAAA" />');
$tabla->setHeaderContents(6, 0, 'Dirección *');
$tabla->setCellContents(6, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="direccion" value="" />');
$tabla->setHeaderContents(7, 0, 'Teléfono fijo');
$tabla->setCellContents(7, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="telefonoFijo" value="" />');
$tabla->setHeaderContents(8, 0, 'Teléfono celular');
$tabla->setCellContents(8, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="telefonoCelular" value="" />');
$tabla->setHeaderContents(9, 0, 'E-mail *');
$tabla->setCellContents(9, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="email" value="" />');
$tabla->setHeaderContents(10, 0, 'Legajo *');
$tabla->setCellContents(10, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="legajo" value="" />');
$tabla->setHeaderContents(11, 0, 'Área *');
$tabla->setCellContents(11, 1, $this->mostrarAreasMultipleSeleccion());
$tabla->setHeaderContents(12, 0, 'Tipo de usuario');
$tabla->setCellContents(12, 1, $this->mostrarNiveles());
$tabla->setHeaderContents(13, 0, 'Activo');
$tabla->setCellContents(13, 1, '<select class="cuadroSeleccionAlineado" name="activo"><option value="1">Si</option><option value="0">No</option></select>');
$tabla->setHeaderContents(14, 0, 'Notas');
$tabla->setCellContents(14, 1, '<textarea class="areaTexto" name="notas" rows="4" cols="20"></textarea>');
$tabla->setColAttributes(0, $clase);
$tabla->setColAttributes(1, $clase);
echo $tabla->toHtml();
imprimirTabulados(6);
echo '<br /><input type="submit" name="enviarNuevoUsuario" value="Enviar" >';
imprimirTabulados(6);
echo '</fieldset>';
imprimirTabulados(6);
echo '</form>';
imprimirTabulados(6);
echo '<div class="notas">';
imprimirTabulados(7);
echo '<p>(*) Campos obligatorios</p>';
imprimirTabulados(6);
echo '</div>';
imprimirTabulados(5);
echo '</div>';
}