コード例 #1
0
ファイル: karma.php プロジェクト: stof/pearweb
    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');
コード例 #2
0
ファイル: Page2_Complex.php プロジェクト: jonez734/HTML_Page2
// | 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 <*****@*****.**>                      |
// +----------------------------------------------------------------------+
//
// $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:
コード例 #3
0
ファイル: package-approval.php プロジェクト: stof/pearweb
            $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();
コード例 #4
0
ファイル: index.php プロジェクト: stof/pearweb
						}
						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) {