本文整理汇总了PHP中admin_page_head函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_page_head函数的具体用法?PHP admin_page_head怎么用?PHP admin_page_head使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_page_head函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_assigns
function show_assigns()
{
admin_page_head("Assignments");
$asgns = BoincAssignment::enum();
if (count($asgns)) {
start_table();
table_header("Assignment ID/time", "target", "workunit", "result");
foreach ($asgns as $asgn) {
show_assign($asgn);
}
end_table();
} else {
echo "No assignments";
}
admin_page_tail();
}
示例2: db_init
<?php
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
// show summary of results that have been received or timed out recently
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Result summary");
show_result_summary();
admin_page_tail();
$cvs_version_tracker[] = "\$Id: result_summary.php 15758 2008-08-05 22:43:14Z davea \$";
//Generated automatically - do not edit
示例3: if
// (3) script is safe to run multiple times and on databases with no errors
// As supplied in cvs it is 'read only' and will only report problems
// the user database. It won't correct them, until it is edited by hand
// to enable it to write changes to the database.
// (4) Just to be safe, back up your user database before running this script.
require_once "../inc/util_ops.inc";
require_once "../inc/db_ops.inc";
// activate/deactivate script
if (1) {
echo "\r\nThis script needs to be activated before it can be run.\r\nOnce you understand what the script does you can change the\r\nif (1) to if (0) at the top of the file to activate it.\r\nBe sure to deactivate the script after using it to make sure\r\nit is not accidentally run.\r\n";
exit;
}
db_init();
$confirm = $_GET['confirm'];
$update_needed = false;
admin_page_head("Repair emails and CPID=0");
echo "<br>\r\n\tScript for repairing user database if some email addresses in lower case and/or some CPID=0<br>\r\n\t<b>Attention this runs an expensive query on the database</b><br><br>\n";
$query = "select count(*) from user";
if (!($result = mysql_query($query))) {
echo "No rows found in USER database table";
exit;
}
$users_array = mysql_fetch_array($result);
mysql_free_result($result);
$number_of_users = $users_array[0];
echo "Found {$number_of_users} users<br/>";
$query = "select id, email_addr,cross_project_id from user";
$result = mysql_query($query);
// loop over all users
while ($user = mysql_fetch_object($result)) {
$id = $user->id;
示例4: db_init
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Failures grouped by app version and host");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$main_query = "\nSELECT\n app_version_id,\n app_version_num,\n hostid AS Host_ID,\n case\n when INSTR(host.os_name, 'Darwin') then 'Darwin'\n when INSTR(host.os_name, 'Linux') then 'Linux'\n when INSTR(host.os_name, 'Windows') then 'Windows'\n when INSTR(host.os_name, 'SunOS') then 'SunOS'\n when INSTR(host.os_name, 'Solaris') then 'Solaris'\n when INSTR(host.os_name, 'Mac') then 'Mac'\n else 'Unknown'\n end AS OS_Name,\n case\n when INSTR(host.os_name, 'Linux') then \n case\n when INSTR(LEFT(host.os_version, 6), '-') then LEFT(host.os_version, (INSTR(LEFT(host.os_version, 6), '-') - 1))\n else LEFT(host.os_version, 6)\n end\n else host.os_version\n end AS OS_Version,\n host.nresults_today AS Results_Today, \n COUNT(*) AS error_count\nFROM result\n left join host on result.hostid = host.id \nWHERE\n appid = '{$query_appid}' and\n server_state = '5' and\n outcome = '3' and \n received_time > '{$query_received_time}'\nGROUP BY\n app_version_id,\n hostid\norder by error_count desc\n";
$result = _mysql_query($main_query);
start_table();
table_header("App version", "Host ID", "OS Version", "Results today", "Error count");
while ($res = _mysql_fetch_object($result)) {
table_row(app_version_desc($res->app_version_id), "<a href=" . URL_BASE . "show_host_detail.php?hostid={$res->Host_ID}>{$res->Host_ID}</a>", $res->OS_Version, $res->Results_Today, "<a href=db_action.php?table=result&detail=low&hostid={$res->Host_ID}&app_version_id={$res->app_version_id}&server_state=5&outcome=3>{$res->error_count}</a>");
}
_mysql_free_result($result);
end_table();
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例5: get_config
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
require_once "../inc/db_ops.inc";
require_once "../inc/util_ops.inc";
require_once "../inc/uotd.inc";
require_once "../project/project.inc";
$config = get_config();
$cgi_url = parse_config($config, "<cgi_url>");
$stripchart_cgi_url = parse_config($config, "<stripchart_cgi_url>");
db_init();
$title = "Project Management";
admin_page_head($title);
// Notification area
echo "<ul>\n";
echo "<li>";
if (file_exists("../../local.revision")) {
$local_rev = file_get_contents("../../local.revision");
}
if ($local_rev) {
echo "Currently used SVN revision: " . $local_rev . "; ";
}
if (file_exists("../cache/remote.revision") && time() < filemtime("../cache/remote.revision") + 24 * 60 * 60) {
$remote_rev = file_get_contents("../cache/remote.revision");
} else {
// Get latest revision
if (isset($project_http_proxy)) {
$context = stream_context_create(array('http' => array('request_fulluri' => true, 'proxy' => $project_http_proxy)));
示例6: db_init
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// cancel a WU:
// - mark unsent results as OVER, outcome DIDNT_NEED
// - set CANCELLED bit in WU error mask
//
require_once "../inc/db.inc";
require_once "../inc/util_ops.inc";
db_init();
$wuid1 = get_int('wuid1');
$wuid2 = get_int('wuid2');
$unsent_only = get_str('unsent_only', true);
if ($wuid1 < 1 || $wuid2 < $wuid1) {
error_page("<h2>Workunit IDs fail to satisfy the conditions:<p> 0 < ID1 <= ID2");
}
if ($unsent_only) {
cancel_wus_if_unsent($wuid1, $wuid2);
} else {
cancel_wus($wuid1, $wuid2);
}
admin_page_head("Cancel jobs");
echo " canceled jobs with {$wuid1} <= workunit ID <= {$wuid2}</h2>";
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例7: db_init
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Failure summary by (app version, error)");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$q = new SqlQueryString();
$q->process_form_items();
$main_query = "\nSELECT\n app_version_id,\n app_version.plan_class,\n case\n when INSTR(host.os_name, 'Darwin') then 'Darwin'\n when INSTR(host.os_name, 'Linux') then 'Linux'\n when INSTR(host.os_name, 'Windows') then 'Windows'\n when INSTR(host.os_name, 'SunOS') then 'SunOS'\n when INSTR(host.os_name, 'Solaris') then 'Solaris'\n when INSTR(host.os_name, 'Mac') then 'Mac'\n else 'Unknown'\n end AS OS_Name,\n exit_status,\n COUNT(*) AS error_count\nFROM result\n left join host on result.hostid = host.id\n left join app_version on result.app_version_id = app_version.id\nWHERE\n result.appid = '{$query_appid}' and\n server_state = '5' and\n outcome = '3' and\n received_time > '{$query_received_time}'\nGROUP BY\n app_version_id,\n exit_status\norder by error_count desc\n";
$urlquery = $q->urlquery;
$result = _mysql_query($main_query);
start_table();
table_header("App version", "Exit Status", "Error Count");
while ($res = _mysql_fetch_object($result)) {
$exit_status_condition = "exit_status={$res->exit_status}";
table_row(app_version_desc($res->app_version_id), link_results(exit_status_string($res->exit_status), $urlquery, "{$exit_status_condition}", ""), $res->error_count);
}
_mysql_free_result($result);
end_table();
示例8: db_init
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once '../inc/forum.inc';
require_once '../inc/util_ops.inc';
db_init();
admin_page_head('Manage special users');
start_table("align=\"center\"");
row1("Current special users", '9');
echo "<tr><td>User</td>";
for ($i = 0; $i <= 6; $i++) {
echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n";
}
echo "</tr>";
$result = mysql_query("SELECT prefs.userid, prefs.special_user, user.id, user.name \n FROM forum_preferences as prefs, user \n WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id");
for ($i = 1; $i <= mysql_num_rows($result); $i++) {
$foo = mysql_fetch_object($result);
echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n";
echo "<input type=\"hidden\" name=\"userid\" value=\"{$foo->userid}\"\n <tr><td>{$foo->name} ({$foo->id})</td>\n ";
for ($j = 0; $j <= 6; $j++) {
$bit = substr($foo->special_user, $j, 1);
echo "<td><input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\"";
示例9: db_init
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/db_ops.inc";
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Manage special users action");
$bitset = '';
for ($i = 0; $i < S_NFLAGS; $i++) {
if (post_int("role" . $i, TRUE) == '1') {
$bitset = str_pad($bitset, $i + 1, '1');
} else {
$bitset = str_pad($bitset, $i + 1, '0');
}
}
if ($bitset == "0000000") {
$bitset = '';
}
$userid = post_int("userid");
$query = "UPDATE forum_preferences SET special_user='{$bitset}' WHERE userid='{$userid}'";
_mysql_query($query);
if (_mysql_affected_rows() == 1) {
示例10: db_init
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Result summary per app version");
// modified by Bernd Machenschalk 2007
//
// 1. distinguish between Darwin x86 and Darwin PPC
// 2. lists the "fail rates" for individual client states to allow for
// distinguishing between download errors, computing errors and aborts
// 3. optionally list individual "unknown" OS by name
// 4. optionally list "unofficial" application versions
//
// 3. and 4. are probably rather confusing on open-source projects like SETI,
// but I found them helpful e.g. on Einstein
$query_appid = get_int('appid');
$query_nsecs = get_int('nsecs');
$query_received_time = time() - $query_nsecs;
$query_all_versions = get_str('allversions', true);
$query_all_platforms = get_str('allplatforms', true);
示例11: exit_error
function exit_error($message)
{
echo "Error: {$message} <br>";
exit;
}
// These are set to large values because otherwise the script has
// a tendency to just stop after some time.
//
ini_set("memory_limit", "20M");
set_time_limit(3600);
$receiver = 0;
$receiver = post_int('receiver', true);
$subject = post_str('subject', true);
$body = post_str('body', true);
$body = stripslashes($body);
admin_page_head("Send mass email");
if ($receiver > 0) {
db_init();
switch ($receiver) {
case 1:
// all users
$query = "select * from user where send_email > 0";
break;
case 2:
// unsuccessful users
$week_ago = time(0) - 7 * 86400;
$query = "select user.id,user.name,user.email_addr from user left join result on user.id=result.userid where send_email>0 and total_credit=0 and user.create_time<{$week_ago} and isnull(result.id)";
break;
case 3:
// successful users
$query = "select * from user where send_email>0 and total_credit>0";
示例12: delete_user
}
}
}
}
}
// Process a delete request. Empty user will trigger search form.
//
if (isset($_POST['delete_user']) && !empty($user)) {
delete_user($user);
}
// Now update from whatever might have been set above
if (!empty($user)) {
BoincForumPrefs::lookup($user);
}
// Output:
admin_page_head("User Management: {$user->name}");
echo "<h2>User Management</h2>\n";
if (!defined("POST_REPORT_EMAILS")) {
echo "<p><font color='RED'>\n There is no addministrative e-mail address defined for reporting problems\nor abuse in the forums. Please define POST_REPORT_EMAILS in project.inc\n </font></p>\n";
}
echo "<form name='manage_user' action=manage_user.php method='POST'>\n <input type='hidden' name='userid' value='" . $user->id . "'>\n";
start_table();
if (empty($user->id)) {
if (!empty($search_name)) {
echo "No match found. ";
if (!empty($matches)) {
echo " Partial matches are: <blockquote> {$matches} </blockquote>\n";
}
}
echo " Enter user name:\n <blockquote>\n <input type='text' name='search_text' >\n <input type='submit' name='search_submit' value='Search'>\n </form>\n ";
admin_page_tail();
示例13: show_form
function show_form()
{
admin_page_head("Revalidate jobs");
echo "\n This form lets you re-validate jobs.\n Use this if you changed your validator to a more permissive policy,\n and you want to rerun it on some jobs\n (e.g. to grant credit to instances previously marked as invalid).\n <p>\n <form method=get action=revalidate.php>\n <p>\n Enter a SQL 'where' clause indicating which workunits\n you want to revalidate\n (e.g., <b>id >= 1000 and id < 2000</b>).\n <p>\n where <input name=clause size=60>\n <p>\n <input type=submit value=OK>\n </form>\n ";
admin_page_tail();
}
示例14: get_int
$appid_filter = "";
$appid_title = "";
$appid = get_int("appid", true);
if ($appid) {
$appid_filter = " appid = {$appid} AND ";
$app = BoincApp::lookup_id($appid);
$appid_title = " for " . $app->name;
}
// the following variables are using the cache that is created by the variables above
// hide already canceled WUs
$hide_canceled = get_str("hide_canceled", true);
// hide WU that have only download errors
$hide_dlerr = get_str("hide_dlerr", true);
// refresh cache from DB
$refresh_cache = get_int("refresh_cache", true);
admin_page_head("All-error Workunits" . $appid_title);
function print_wu($row)
{
echo "<tr>\n";
echo "<td align=\"left\" valign=\"top\">";
if (!in_rops()) {
echo "<input type=\"checkbox\" name=\"WU[]\" value=\"" . $row->id . "\">\n";
}
echo "<a href=db_action.php?table=workunit&detail=high&id=";
echo $row->id;
echo ">";
echo $row->id;
echo "</a></td>\n";
echo "<td align=\"left\" valign=\"top\">" . $row->name . "</td>\n";
echo "<td align=\"left\" valign=\"top\">" . $row->appid . "</td>\n";
echo "<td align=\"left\" valign=\"top\">" . $row->min_quorum . "</td>\n";
示例15: db_init
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Pass percentage by platform");
/*
modified by Bernd Machenschalk 2007
1. distinguish between Darwin x86 and Darwin PPC
2. lists the "fail rates" for individual client states to allow for
distinguishing between download errors, computing errors and aborts
3. optionally list individual "unknown" OS by name
4. optionally list "unofficial" application versions
3. and 4. are probably rather confusing on open-source projects like SETI,
but I found them helpful e.g. on Einstein
*/
$query_appid = $_GET['appid'];
$query_nsecs = $_GET['nsecs'];
$query_received_time = time() - $query_nsecs;
$query_all_versions = $_GET['allversions'];
$query_all_platforms = $_GET['allplatforms'];