本文整理汇总了PHP中checkbox函数的典型用法代码示例。如果您正苦于以下问题:PHP checkbox函数的具体用法?PHP checkbox怎么用?PHP checkbox使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginForm
function loginForm()
{
?>
<table cellspacing="0">
<tr><th><?php
echo lang('Server');
?>
<td><input type="hidden" name="driver" value="<?php
echo $this->driver;
?>
"><select name="server"><?php
echo optionlist($this->servers, SERVER);
?>
</select>
<tr><th><?php
echo lang('Username');
?>
<td><input id="username" name="username" value="<?php
echo h($_GET["username"]);
?>
">
<tr><th><?php
echo lang('Password');
?>
<td><input type="password" name="password">
</table>
<p><input type="submit" value="<?php
echo lang('Login');
?>
">
<?php
echo checkbox("permanent", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
return true;
}
示例2: doLoginForm
/**
* Renders and outputs a login form.
*
* This function outputs a full HTML document,
* including <head> and footer.
*
* @param string|array $message The activity message
*/
function doLoginForm($message)
{
global $textarray_script, $event, $step;
include txpath . '/lib/txplib_head.php';
$event = 'login';
if (gps('logout')) {
$step = 'logout';
} elseif (gps('reset')) {
$step = 'reset';
}
pagetop(gTxt('login'), $message);
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
$name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
$out = array();
if ($reset) {
$out[] = hed(gTxt('password_reset'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), ' class="login-name"') . graf(fInput('submit', '', gTxt('password_reset_button'), 'publish') . n) . graf(href(gTxt('back_to_login'), 'index.php'), array('class' => 'login-return')) . hInput('p_reset', 1);
} else {
$out[] = hed(gTxt('login_to_textpattern'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), array('class' => 'login-name')) . graf(n . span(tag(gTxt('password'), 'label', array('for' => 'login_password')), array('class' => 'txp-label')) . n . span(fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password'), array('class' => 'txp-value')), array('class' => 'login-password')) . graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . tag(gTxt('stay_logged_in'), 'label', array('for' => 'login_stay')) . popHelp('remember_login') . n, array('class' => 'login-stay')) . graf(fInput('submit', '', gTxt('log_in_button'), 'publish') . n) . graf(href(gTxt('password_forgotten'), '?reset=1'), array('class' => 'login-forgot'));
if (gps('event')) {
$out[] = eInput(gps('event'));
}
}
echo form(tag(join('', $out), 'section', array('role' => 'region', 'class' => 'txp-login', 'aria-labelledby' => 'txp-login-heading')), '', '', 'post', '', '', 'login_form') . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</main><!-- /txp-body -->' . n . '</body>' . n . '</html>';
exit(0);
}
示例3: doLoginForm
function doLoginForm($message)
{
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'), $message);
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
$name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
echo n . '<div id="login_container" class="txp-container">';
echo form('<div class="txp-login">' . n . hed(gTxt($reset ? 'password_reset' : 'login_to_textpattern'), 2) . n . graf('<span class="login-label"><label for="login_name">' . gTxt('name') . '</label></span>' . n . '<span class="login-value">' . fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name') . '</span>', ' class="login-name"') . ($reset ? '' : n . graf('<span class="login-label"><label for="login_password">' . gTxt('password') . '</label></span>' . n . '<span class="login-value">' . fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password') . '</span>', ' class="login-password"')) . ($reset ? '' : graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . '<label for="login_stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'), ' class="login-stay"')) . ($reset ? n . hInput('p_reset', 1) : '') . n . graf(fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish')) . n . ($reset ? graf('<a href="index.php">' . gTxt('back_to_login') . '</a>', ' class="login-return"') : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>', ' class="login-forgot"')) . (gps('event') ? eInput(gps('event')) : '') . '</div>', '', '', 'post', '', '', 'login_form') . '</div>' . n . script_js(<<<EOSCR
// Focus on either username or password when empty
\$(document).ready(
\tfunction() {
\t\tvar has_name = \$("#login_name").val().length;
\t\tvar password_box = \$("#login_password").val();
\t\tvar has_password = (password_box) ? password_box.length : 0;
\t\tif (!has_name) {
\t\t\t\$("#login_name").focus();
\t\t} else if (!has_password) {
\t\t \t\$("#login_password").focus();
\t\t}
\t}
);
EOSCR
) . n . '</div><!-- /txp-body -->' . n . '</body>' . n . '</html>';
exit(0);
}
示例4: GetAllComplaints
function GetAllComplaints($var, $gm)
{
global $tbl_list_complaint;
if ($var["serverindex"] == null || $var["serverindex"] == "") {
echo "<script src='/js/page.js'></script>\n";
echo "<script src='/js/checkbox.js'></script>\n";
form($var, $gm);
checkbox(true, true);
ReturnAndBack();
echo "</form>\n";
return eachServerFrame($var, $gm);
} else {
$serv_id = intval($var["serverindex"]);
}
global $page_main, $tbl_sys_msg;
$query_string = "select ua.ua_nMsgType, us.us_sName, c.c_sName, ua.ua_sErrorMsg, ua.ua_dtTime, ua.ua_uErrorCode from tbl_user_advice ua, tbl_char c, tbl_char_static cs, tbl_user_static us where ua.cs_uId = c.cs_uId and c.cs_uId = cs.cs_uId and cs.us_uId = us.us_uId order by ua_dtTime desc";
page($var, $query_string, 58, "Game", $serv_id, $result, $page, $desc);
echo "<table class='list_table'>\n";
echo "<tr><th class='type' style='width:60px;'>" . $page_main["category"] . "</th><th style='width:80px;'>" . $page_main["user_name"] . "</th><th style='width:80px;'>" . $page_main["role_name"] . "</th><th>" . $page_main["content"] . "</th><th style='width:40px;'>" . $tbl_sys_msg["status"] . "</th><th style='width:120px;'>" . $tbl_sys_msg["time"] . "</th></tr>\n";
while ($row = mysql_fetch_row($result)) {
printf("<tr><td>%s</td><td><input type='checkbox' flag='user' value='%s' onclick='Checkbox(this)' />%s</td><td><input type='checkbox' flag='role' value='%s' onclick='Checkbox(this)' />%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $tbl_list_complaint[$row[0]], $row[1], $row[1], $row[2], $row[2], $row[3], "-", $row[4]);
}
echo "</table>\n";
echo $page;
return true;
}
示例5: RoleToUser
function RoleToUser($var, $gm)
{
global $page_main;
if ($var["serverindex"] == null || $var["serverindex"] == "") {
echo "<script src='/js/checkbox.js' type='text/javascript'></script>\n";
form($var, $gm);
checkbox(true, false);
echo "</form>\n";
ReturnAndBack();
$ret = eachServerFrame($var, $gm);
ReturnAndBack();
return $ret;
}
$serverid = $var["serverindex"];
$role_names = $var["role_name"];
$role_names = implode("','", explode(",", $role_names));
$qs = "select distinct us.us_uId, us.us_sName from tbl_char_static cs, tbl_char c, tbl_user_static us where cs.cs_uId = c.cs_uId and cs.us_uId = us.us_uId and c.c_sName in ('" . $role_names . "');";
$result = MySQLQuery($qs, "Game", $serverid);
echo "<table class='list_table'>\n";
echo "<tr><th>" . $page_main["user_id"] . "</th><th>" . $page_main["user_name"] . "</th></tr>\n";
while ($row = mysql_fetch_row($result)) {
printf("<tr" . ($i++ % 2 == 0 ? "" : " class='even'") . "><td>%s</td><td><input type='checkbox' flag='user' onclick='Checkbox(this);' value='%s'/>%s</td></tr>\n", $row[0], $row[1], $row[1]);
}
echo "</table>\n";
return true;
}
示例6: GetCmpstByGM
function GetCmpstByGM($var, $gm)
{
global $tbl_sys_msg, $page_main, $tbl_list_compensate;
if ($var["serverindex"] == null || $var["serverindex"] == "") {
$js_src = <<<_js_src
<script type='text/javascript' src='/js/checkbox.js'></script>
<script type='text/javascript' src='/js/page.js'></script>
<script type='text/javascript'>
function cancel(id)
{
\tdocument.form1.target = "_block"
\tdocument.form1.action_name.value='124';
\tdocument.form1.id.value=id;
\tdocument.form1.submit();
}
</script>
_js_src;
echo $js_src . "\n";
echo "<script type='text/javascript' src='/js/log_info.js'></script>\n";
form($var, $gm);
echo "<input type='hidden' name='flag' />\n";
echo "<input type='hidden' name='role_name' />\n";
echo "<input type='hidden' name='str' />\n";
echo "<input type='hidden' name='urs' />\n";
echo "<input type='hidden' name='id' />";
checkbox(false, true);
ReturnAndBack();
$ret = eachServerFrame($var, $gm);
ReturnAndBack();
echo "</form>\n";
return $ret;
}
$serv_id = intval($var["serverindex"]);
$gm_name = mysql_escape_string($gm);
$filter = "";
if ($var["flag"] != "" || $var["role_name"] != "") {
$filter = " and";
if ($var["flag"] != "") {
$filter .= " reason like '%#[" . $var["flag"] . "[%'";
}
if ($var["flag"] != "" && $var["role_name"] != "") {
$filter .= " and";
}
if ($var["role_name"] != "") {
$k = $var["role_name"];
$filter .= " (reason like '%[" . $k . ",%' or reason like '%," . $k . "]%' or reason like '%," . $k . ",%' or reason like '%[" . $k . "]%')";
}
}
$query = "select gca_uId, gm, action_id, reason, action_state from tbl_gm_compensate_action where server_id = '{$serv_id}' and gm = '{$gm_name}'" . $filter . " order by gca_uId desc";
page($var, $query, 123, "GMS", 0, $result, $page, $desc);
echo "<table class='list_table'>\n";
echo "<tr><th style='width:60px;'>" . $page_main["user_name"] . "</th><th style='width:160px;'>" . $page_main["event_type"] . "</th><th>" . $tbl_sys_msg["desc"] . "</th><th style='width:60px;'>" . $tbl_sys_msg["act"] . "</th><th style='width:80px;'>" . $tbl_sys_msg["status"] . "</th></tr>\n";
while ($row = mysql_fetch_row($result)) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='server' title='" . $serv_id . "'>%s</td></tr>", $row[1], GetGMCommandLogAction($row[2]), LogInfo($row[3]), hasAuth(124, $gm) && $row[4] == 1 ? "<input type=button value='" . $tbl_sys_msg["cancel"] . "' onclick='cancel(" . $row[0] . ")'/>" : "", $tbl_list_compensate[$row[4]]);
}
echo "</table>\n";
echo $page;
return true;
}
示例7: rec_checkbox
function rec_checkbox($row)
{
$name = "rec_" . $row['id'];
$hidden = 'last[' . $row['id'] . ']';
$value = $row['reconciled'] != '';
// save also in hidden field for testing during 'Reconcile'
return checkbox(null, $name, $value, true, _('Reconcile this transaction')) . hidden($hidden, $value, false);
}
示例8: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include $txpcfg['txpath'] . '/lib/txplib_head.php';
pagetop('log in');
echo form(startTable('edit') . tr(td() . td(graf($message))) . tr(fLabelCell('name') . fInputCell('p_userid')) . tr(fLabelCell('password') . td(fInput('password', 'p_password', '', 'edit'))) . tr(td() . td(graf(checkbox('stay', 1, 1) . gTxt('stay_logged_in') . popHelp('remember_login')))) . tr(fLabelCell('') . td(fInput('submit', '', gTxt('log_in_button'), 'publish'))) . endTable());
exit("</div></body></html>");
}
示例9: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'));
$stay = !(cs('txp_nostay') == 1);
echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', '', 1, '', '', 'name')) . n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password'))) . n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login')))) . n . n . tr(n . td() . td(fInput('submit', '', gTxt('log_in_button'), 'publish', '', '', '', 4))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</div>' . n . n . '</body>' . n . '</html>';
exit(0);
}
示例10: getHtmlTag
function getHtmlTag($class = "")
{
$html = "\n\t\t\t\t\t<ul class=\"checkboxes_group {$class}\" style=\"width: " . (count($this->list_code) * 51 + 10 + 14) . "px;\">\n\t\t\t\t\t\t<li class=\"select_all_none\">\n\t\t\t\t\t\t\t<img style=\"width: 10px;\" src=\"img/all.png\" alt=\"" . __("Select all buttons") . "\" title=\"" . __("Select all buttons") . "\"/>\n\t\t\t\t\t\t\t<img style=\"width: 10px;\" src=\"img/none.png\" alt=\"" . __("Deselect all buttons") . "\" title=\"" . __("Deselect all buttons") . "\"/>\n\t\t\t\t\t\t</li>";
foreach ($this->list_code as $code) {
$html .= "\n\t\t\t\t\t\t\t<li class='li_checkbox'>" . checkbox("img", $this->id, $this->checked, $code, __($code), __($code)) . "</li>";
}
$html .= "\n\t\t\t\t\t</ul>";
return $html;
}
示例11: plug_deploy
function plug_deploy($deploy)
{
$qb = $_SESSION['qb'];
$USE = $_SESSION['USE'];
$raed = suj_of_id($deploy);
$nl = $_GET['nl'] ? $_GET['nl'] : "nl";
if ($deploy && $USE) {
//prep
list($qauth, $subj) = sql('name,suj', 'qda', 'r', 'id="' . $deploy . '"');
$msg = sql('msg', 'qdm', 'v', 'id="' . $deploy . '"');
if ($USE == $qauth or auth(5)) {
$http = host();
if (!$_POST['dpl']) {
reqp('mail');
$qmail = mail_list_tosend();
$ret .= form("/?read={$deploy}&deploy={$deploy}&nl=nlb", txarea('dpl" maxlength="1000', $qmail, 40, 10) . br() . checkbox("dpf", "ok", "html", 1) . checkbox("multiple", "ok", "each_one", 1) . input2('submit', "send", nms(50), 'popbt'));
} else {
$htacc = urlread($deploy);
$_SESSION['nl'] = $nl;
//deploy
if ($_POST['dpf'] == "ok") {
$mail_format = "html";
$txt = format_txt($msg, $nl, $deploy);
$txt = html_entity_decode($txt);
$txt = str_replace('href="/', 'href="' . $http . '/', $txt);
$msg = lkc("", $http . $htacc, bal("h2", $subj));
$msg .= divc("panel justy", $txt);
} else {
$mail_format = "txt";
$msg = clean_internaltag($msg);
$msg = html_entity_decode($msg);
}
$_SESSION['nl'] = "";
//send
$sender = sql('mail', 'qdu', 'v', 'name="' . $USE . '"');
$lstm = str_replace("\n", ",", $_POST['dpl']);
$lstm = str_replace("\r", ",", $lstm);
$listmail = explode(",", trim($lstm));
if ($_POST['multiple'] == "ok" && is_array($listmail)) {
$sentto = send_mail_r($listmail, $mail_format, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
} else {
$sentto = $_POST['dpl'];
$vm = str_replace(array(",", ";", "\n", " "), ",", $sentto);
send_mail($mail_format, $vm, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
}
$ret .= lkc("popbt", '/?read=' . $deploy, 'article ' . $deploy . ' sent to: ' . $sentto);
}
} else {
$ret .= btn("popdel", "forbidden");
}
}
//if($_POST['dpl'])return $ret;
return $ret;
}
示例12: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'));
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
list($name) = split(',', cs('txp_login'));
echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', $name, 1, '', '', 'name')) . ($reset ? '' : n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password')))) . ($reset ? '' : n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'))))) . n . n . tr(n . td() . td(($reset ? hInput('p_reset', 1) : '') . fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish', '', '', '', 4) . ($reset ? '' : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>')))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</body>' . n . '</html>';
exit(0);
}
示例13: plug_ummdico
function plug_ummdico($p, $o)
{
//umm_sav();
ses('qu', 'umm_dico');
$ret = bal('h3', 'Recherche sur le dictionnaire des vocables');
$ret .= input(1, 'search', '', '') . ' ';
$ret .= checkbox('chk', '1', 'phonétique', 0);
$ret .= lj('txtbox', 'ucbk_plug___ummdico_ud*search_1_2_search|chk', 'chercher') . br() . br();
$ret .= divd('ucbk', '') . br();
//callback
return $ret;
}
示例14: connect_error
function connect_error()
{
global $connection, $token, $error, $drivers;
$databases = array();
if (DB != "") {
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else {
if ($_POST["db"] && !$error) {
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
}
page_header(lang('Select database'), $error, false);
echo "<p><a href='" . h(ME) . "database='>" . lang('Create new database') . "</a>\n";
foreach (array('privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
if (support($key)) {
echo "<a href='" . h(ME) . "{$key}='>{$val}</a>\n";
}
}
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>{$connection->server_info}</b>", "<b>{$connection->extension}</b>") . "\n";
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
if ($_GET["refresh"]) {
set_session("dbs", null);
}
$databases = get_databases();
if ($databases) {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n";
echo "<thead><tr><td> <th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
foreach ($databases as $db) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
echo "<th><a href='{$root}'>" . h($db) . "</a>";
echo "<td><a href='{$root}" . ($scheme ? "&ns=" : "") . "&database=' title='" . lang('Alter database') . "'>" . nbsp(db_collation($db, $collations)) . "</a>";
echo "<td align='right'><a href='{$root}&schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>";
echo "\n";
}
echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)", 1) . ">\n";
// 1 - eventStop
echo "<input type='hidden' name='token' value='{$token}'>\n";
echo "<a href='" . h(ME) . "refresh=1' onclick='eventStop(event);'>" . lang('Refresh') . "</a>\n";
echo "</form>\n";
}
}
page_footer("db");
if ($databases) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_adminer_escape(ME) . "script=connect');</script>\n";
}
}
示例15: connect_error
function connect_error()
{
global $adminer, $connection, $token, $error, $drivers;
if (DB != "") {
header("HTTP/1.1 404 Not Found");
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else {
if ($_POST["db"] && !$error) {
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
}
//Encabezado y botones de la parte superior en la seleccion de bases de datos
page_header(lang('Select database'), $error, false);
echo "<p>\n";
foreach (array('database' => lang('Create new database'), 'privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
if (support($key)) {
echo "<a class='btn btn-xs btn-primary' href='" . h(ME) . "{$key}='>{$val}</a>\n";
}
}
//Presenta informacion de la conexion
echo "<p><i class='fa fa-exchange fa-fw'></i> " . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>" . h($connection->server_info) . "</b>", "<b>{$connection->extension}</b>") . "\n";
echo "<p><i class='fa fa-user fa-fw'></i> " . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
//Presenta la lista de bases de datos existentes y los encabezados
$databases = $adminer->databases();
if ($databases) {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable table table-condensed table-responsive table-hover' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<thead><tr>" . (support("database") ? "<th> " : "") . "<th>" . lang('Database') . " - <a class='btn btn-default btn-xs' href='" . h(ME) . "refresh=1'><i class='fa fa-refresh fa-fw'></i> " . lang('Refresh') . "</a>" . "<th>" . lang('Collation') . "<th>" . lang('Tables') . "<th>" . lang('Size') . " - <a class='btn btn-default btn-xs' href='" . h(ME) . "dbsize=1' onclick=\"return !ajaxSetHtml('" . js_escape(ME) . "script=connect');\">" . lang('Compute') . "</a>" . "</thead>\n";
//Presenta la lista de bases de datos
$databases = $_GET["dbsize"] ? count_tables($databases) : array_flip($databases);
foreach ($databases as $db => $tables) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . ">" . (support("database") ? "\n\t\t\t\t\t<td align=center>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])) : "");
echo "<th><a href='{$root}'>" . h($db) . "</a>";
$collation = nbsp(db_collation($db, $collations));
echo "<td>" . (support("database") ? "<a href='{$root}" . ($scheme ? "&ns=" : "") . "&database=' title='" . lang('Alter database') . "'>{$collation}</a>" : $collation);
echo "<td align='right'><a href='{$root}&schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
echo "<td align='right' id='size-" . h($db) . "'>" . ($_GET["dbsize"] ? db_size($db) : "?");
echo "\n";
}
echo "</table>\n";
//Agrega boton de eliminar
echo support("database") ? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n" . "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n" . "<input class='btn btn-xs btn-danger' type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n" . "</div></fieldset>\n" : "";
echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "<input type='hidden' name='token' value='{$token}'>\n";
echo "</form>\n";
}
}
page_footer("db");
}