当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_Table::setCaption方法代码示例

本文整理汇总了PHP中HTML_Table::setCaption方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::setCaption方法的具体用法?PHP HTML_Table::setCaption怎么用?PHP HTML_Table::setCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML_Table的用法示例。


在下文中一共展示了HTML_Table::setCaption方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: make_link

    echo "<br /><br />";
    $table = new HTML_Table('style="width: 100%"');
    $table->setCaption("Grant karma to " . htmlspecialchars($handle), 'style="background-color: #CCCCCC;"');
    $form = new HTML_QuickForm2('karma_grant', 'post', array('action' => 'karma.php?action=grant'));
    $form->removeAttribute('name');
    $form->addElement('text', 'level')->setLabel('Level:&nbsp;');
    $form->addElement('hidden', 'handle')->setValue(htmlspecialchars($handle));
    $form->addElement('submit', 'submit')->setLabel('Submit Changes');
    $csrf_token_value = create_csrf_token($csrf_token_name);
    $form->addElement('hidden', $csrf_token_name)->setValue($csrf_token_value);
    $table->addRow(array((string) $form));
    echo $table->toHTML();
}
echo "<p>&nbsp;</p><hr />";
$table = new HTML_Table('style="width: 90%"');
$table->setCaption("Karma Statistics", 'style="background-color: #CCCCCC;"');
if (!empty($_GET['a']) && $_GET['a'] == "details" && !empty($_GET['level'])) {
    $table->addRow(array('Handle', 'Granted'), null, 'th');
    foreach ($karma->getUsers($_GET['level']) as $user) {
        $detail = sprintf("Granted by <a href=\"/user/%s\">%s</a> on %s", htmlspecialchars($user['granted_by']), htmlspecialchars($user['granted_by']), htmlspecialchars($user['granted_at']));
        $table->addRow(array(make_link("/user/" . htmlspecialchars($user['user']), htmlspecialchars($user['user'])), $detail));
    }
} else {
    $table->addRow(array('Level', '# of users'));
    foreach ($karma->getLevels() as $level) {
        $table->addRow(array(make_link("karma.php?a=details&amp;level=" . htmlspecialchars($level['level']), htmlspecialchars($level['level'])), htmlspecialchars($level['sum'])));
    }
}
echo $table->toHTML();
echo '<br /><br />';
echo make_link('/admin/karma.php', 'Back');
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:karma.php

示例2: strtolower

// | that is bundled with this package in the file LICENSE, and is        |
// | available at through the world-wide-web at                           |
// | http://www.php.net/license/3_0.txt.                                  |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Author: Klaus Guenther <klaus@capitalfocus.org>                      |
// +----------------------------------------------------------------------+
//
// $Id$
require_once 'HTML/Page2.php';
require_once 'HTML/Table.php';
// This is an example from HTML_Table
$table = new HTML_Table('width=100%');
$table->setCaption('256 colors table');
$i = $j = 0;
for ($R = 0; $R <= 255; $R += 51) {
    for ($G = 0; $G <= 255; $G += 51) {
        for ($B = 0; $B <= 255; $B += 51) {
            $table->setCellAttributes($i, $j, 'style="background-color:#' . strtolower(sprintf('%02X%02X%02X', $R, $G, $B)) . ';"');
            $j++;
        }
    }
    $i++;
    $j = 0;
}
// end of HTML_Table example
// The initializing code can also be in in the form of an HTML
// attr="value" string.
// Possible attributes are:
开发者ID:jonez734,项目名称:HTML_Page2,代码行数:31,代码来源:Page2_Complex.php

示例3: make_link

            $mailtext = wordwrap($mailtext, 72);
            $query = 'SELECT u.email FROM users u, maintains m WHERE m.package = ? AND u.handle = m.handle';
            $rows = $dbh->getAll($query, array($id), DB_FETCHMODE_ASSOC);
            foreach ($rows as $u_row) {
                mail($u_row['email'], SITE_BIG . ' Package ' . $action, $mailtext, 'From: "' . SITE_BIG . ' Package Approval System" <' . PEAR_GROUP_EMAIL . '>', '-f ' . PEAR_BOUNCE_EMAIL);
            }
        }
        echo "Successfully <b>" . $action . " package</b>.<br /><br />";
    } else {
        echo "There have been problems: Either an error occured while " . "updating the database or the package has already been " . $action . " by someone else.<br /><br />";
    }
}
$query = 'SELECT id, name FROM packages WHERE approved = 0 AND package_type = ?';
$rows = $dbh->getAll($query, array(SITE), DB_FETCHMODE_ASSOC);
$self = htmlspecialchars($_SERVER['PHP_SELF']);
if (count($rows) == 0) {
    echo "<b>Currently there are no unapproved packages.</b>\n";
} else {
    require_once 'HTML/Table.php';
    $table = new HTML_Table('style="width: 90%"');
    $table->setCaption('Unapproved packages', 'style="background-color: #CCCCCC;"');
    $csrf_link = '&amp;' . urlencode($csrf_token_name) . '=' . urlencode(create_csrf_token($csrf_token_name));
    foreach ($rows as $row) {
        $tmp = array($row['name'], make_link("{$self}?approve=" . $row['id'] . $csrf_link, "Approve") . ' / ' . make_link("{$self}?reject=" . $row['id'] . $csrf_link, "Reject"));
        $table->addRow($tmp);
    }
    echo $table->toHTML();
}
echo "<br /><br />";
echo make_link('/admin/', 'Back');
response_footer();
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:package-approval.php

示例4: array

						}
						break;
				}

				return false;
			}
        //-->
        </script>
		<form action="<?php 
        echo $self;
        ?>
" name="mass_reject_form" method="post">
		<input type="hidden" value="" name="cmd"/>
		<?php 
        $table = new HTML_Table('style="width: 100%" cellspacing="2"');
        $table->setCaption('Account Requests', 'style="background-color: #CCCCCC;"');
        $requests = $dbh->getAssoc("SELECT u.handle,u.name,n.note,u.userinfo FROM users u " . "LEFT JOIN notes n ON n.uid = u.handle " . "WHERE u.registered = 0");
        if (is_array($requests) && sizeof($requests) > 0) {
            $head = array("<a href=\"#\" onclick=\"toggleSelectAll(this)\">&#x2713;</a>", "Name", "Handle", "Account Purpose", "Status", "&nbsp;");
            $table->addRow($head, null, 'th');
            foreach ($requests as $handle => $data) {
                list($name, $note, $userinfo) = $data;
                // Grab userinfo/request purpose
                if (@unserialize($userinfo)) {
                    $userinfo = @unserialize($userinfo);
                    $account_purpose = $userinfo[0];
                } else {
                    $account_purpose = $userinfo;
                }
                $rejected = preg_match("/^Account rejected:/", $note);
                if ($rejected) {
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:index.php


注:本文中的HTML_Table::setCaption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。