Example #1
0
function even($x)
{
    if ($x == 0) {
        return true;
    } else {
        return odd($x - 1);
    }
}
Example #2
0
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>&nbsp;" : "") . "<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 ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>{$collation}</a>" : $collation);
                echo "<td align='right'><a href='{$root}&amp;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");
}
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>&nbsp;<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 ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>" . nbsp(db_collation($db, $collations)) . "</a>";
                echo "<td align='right'><a href='{$root}&amp;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";
    }
}
function rem_array_filter($array)
{
    $array2 = array();
    $array2_counter = 0;
    for ($j = 0; $j < count($array); $j++) {
        $row = each($array);
        if (odd($row["key"])) {
            $array2[$array2_counter] = $row["value"];
            $array2_counter++;
        }
        // if
    }
    // for
    return $array2;
}
Example #5
0
     }
 }
 echo ($backward_keys ? "<th>" . lang('Relations') : "") . "</thead>\n";
 if (is_ajax()) {
     if ($limit % 2 == 1 && $page % 2 == 1) {
         odd();
     }
     ob_end_clean();
 }
 foreach ($adminer->rowDescriptions($rows, $foreign_keys) as $n => $row) {
     $unique_array = unique_array($rows[$n], $indexes);
     $unique_idf = "";
     foreach ($unique_array as $key => $val) {
         $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
     }
     echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));
     foreach ($row as $key => $val) {
         if (isset($names[$key])) {
             $field = $fields[$key];
             if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
                 $email_fields[$key] = is_mail($val) ? $names[$key] : "";
                 //! filled e-mails can be contained on other pages
             }
             $link = "";
             $val = $adminer->editVal($val, $field);
             if ($val !== null) {
                 if (ereg('blob|bytea|raw|file', $field["type"]) && $val != "") {
                     $link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf);
                 }
                 if ($val === "") {
                     // === - may be int
Example #6
0
$fields = fields($TABLE);
if (!$fields) {
    $error = error();
}
$table_status = table_status1($TABLE, true);
page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
$adminer->selectLinks($table_status);
$comment = $table_status["Comment"];
if ($comment != "") {
    echo "<p>" . lang('Comment') . ": " . h($comment) . "\n";
}
if ($fields) {
    echo "<table cellspacing='0'>\n";
    echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . (support("comment") ? "<td>" . lang('Comment') : "") . "</thead>\n";
    foreach ($fields as $field) {
        echo "<tr" . odd() . "><th>" . h($field["field"]);
        echo "<td title='" . h($field["collation"]) . "'>" . h($field["full_type"]) . ($field["null"] ? " <i>NULL</i>" : "") . ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
        echo isset($field["default"]) ? " [<b>" . h($field["default"]) . "</b>]" : "";
        echo support("comment") ? "<td>" . nbsp($field["comment"]) : "";
        echo "\n";
    }
    echo "</table>\n";
}
if (!is_view($table_status)) {
    if (support("indexes")) {
        echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n";
        $indexes = indexes($TABLE);
        if ($indexes) {
            echo "<table cellspacing='0'>\n";
            foreach ($indexes as $name => $index) {
                ksort($index["columns"]);
Example #7
0
/** Print select result
* @param Min_Result
* @param Min_DB connection to examine indexes
* @param array
* @param int
* @return array $orgtables
*/
function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
{
    global $jush;
    $links = array();
    // colno => orgtable - create links from these columns
    $indexes = array();
    // orgtable => array(column => colno) - primary keys
    $columns = array();
    // orgtable => array(column => ) - not selected columns in primary key
    $blobs = array();
    // colno => bool - display bytes for blobs
    $types = array();
    // colno => type - display char in <code>
    $return = array();
    // table => orgtable - mapping to use in EXPLAIN
    odd('');
    // reset odd for each result
    for ($i = 0; (!$limit || $i < $limit) && ($row = $result->fetch_row()); $i++) {
        if (!$i) {
            echo "<table cellspacing='0' class='nowrap'>\n";
            echo "<thead><tr>";
            for ($j = 0; $j < count($row); $j++) {
                $field = $result->fetch_field();
                $name = $field->name;
                $orgtable = $field->orgtable;
                $orgname = $field->orgname;
                $return[$field->table] = $orgtable;
                if ($orgtables && $jush == "sql") {
                    // MySQL EXPLAIN
                    $links[$j] = $name == "table" ? "table=" : ($name == "possible_keys" ? "indexes=" : null);
                } elseif ($orgtable != "") {
                    if (!isset($indexes[$orgtable])) {
                        // find primary key in each table
                        $indexes[$orgtable] = array();
                        foreach (indexes($orgtable, $connection2) as $index) {
                            if ($index["type"] == "PRIMARY") {
                                $indexes[$orgtable] = array_flip($index["columns"]);
                                break;
                            }
                        }
                        $columns[$orgtable] = $indexes[$orgtable];
                    }
                    if (isset($columns[$orgtable][$orgname])) {
                        unset($columns[$orgtable][$orgname]);
                        $indexes[$orgtable][$orgname] = $j;
                        $links[$j] = $orgtable;
                    }
                }
                if ($field->charsetnr == 63) {
                    // 63 - binary
                    $blobs[$j] = true;
                }
                $types[$j] = $field->type;
                echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "{$orgtable}." : "") . $orgname) . "'" : "") . ">" . h($name) . ($orgtables ? doc_link(array('sql' => "explain-output.html#explain_" . strtolower($name))) : "");
            }
            echo "</thead>\n";
        }
        echo "<tr" . odd() . ">";
        foreach ($row as $key => $val) {
            if ($val === null) {
                $val = "<i>NULL</i>";
            } elseif ($blobs[$key] && !is_utf8($val)) {
                $val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>";
                //! link to download
            } elseif (!strlen($val)) {
                // strlen - SQLite can return int
                $val = "&nbsp;";
                // some content to print a border
            } else {
                $val = h($val);
                if ($types[$key] == 254) {
                    // 254 - char
                    $val = "<code>{$val}</code>";
                }
            }
            if (isset($links[$key]) && !$columns[$links[$key]]) {
                if ($orgtables && $jush == "sql") {
                    // MySQL EXPLAIN
                    $table = $row[array_search("table=", $links)];
                    $link = $links[$key] . urlencode($orgtables[$table] != "" ? $orgtables[$table] : $table);
                } else {
                    $link = "edit=" . urlencode($links[$key]);
                    foreach ($indexes[$links[$key]] as $col => $j) {
                        $link .= "&where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
                    }
                }
                $val = "<a href='" . h(ME . $link) . "'>{$val}</a>";
            }
            echo "<td>{$val}";
        }
    }
    echo ($i ? "</table>" : "<p class='message'>" . lang('No rows.')) . "\n";
    return $return;
}
Example #8
0
<?php

page_header(lang('Privileges'));
$result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q(DB) . " LIKE Db") . " ORDER BY Host, User");
$grant = $result;
if (!$result) {
    // list logged user, information_schema.USER_PRIVILEGES lists just the current user too
    $result = $connection->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
}
echo "<form action=''><p>\n";
hidden_fields_get();
echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
echo $grant ? "" : "<input type='hidden' name='grant' value=''>\n";
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th>&nbsp;</thead>\n";
while ($row = $result->fetch_assoc()) {
    echo '<tr' . odd() . '><td>' . h($row["User"]) . "<td>" . h($row["Host"]) . '<td><a href="' . h(ME . 'user='******'&host=' . urlencode($row["Host"])) . '">' . lang('Edit') . "</a>\n";
}
if (!$grant || DB != "") {
    echo "<tr" . odd() . "><td><input name='user'><td><input name='host' value='localhost'><td><input type='submit' value='" . lang('Edit') . "'>\n";
}
echo "</table>\n";
echo "</form>\n";
echo '<p><a href="' . h(ME) . 'user="******"</a>";
Example #9
0
?>

<form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
<?php 
// HTML valid because there is always at least one process
$i = -1;
foreach (process_list() as $i => $row) {
    if (!$i) {
        echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "");
        foreach ($row as $key => $val) {
            echo "<th>{$key}" . doc_link(array('sql' => "show-processlist.html#processlist_" . strtolower($key), 'pgsql' => "monitoring-stats.html#PG-STAT-ACTIVITY-VIEW", 'oracle' => "../b14237/dynviews_2088.htm"));
        }
        echo "</thead>\n";
    }
    echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row[$jush == "sql" ? "Id" : "pid"], 0) : "");
    foreach ($row as $key => $val) {
        echo "<td>" . ($jush == "sql" && $key == "Info" && preg_match("~Query|Killed~", $row["Command"]) && $val != "" || $jush == "pgsql" && $key == "current_query" && $val != "<IDLE>" || $jush == "oracle" && $key == "sql_text" && $val != "" ? "<code class='jush-{$jush}'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>' : nbsp($val));
    }
    echo "\n";
}
?>
</table>
<script type='text/javascript'>tableCheck();</script>
<p>
<?php 
if (support("kill")) {
    echo $i + 1 . "/" . lang('%d in total', max_connections());
    echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
}
?>
</table>

<?php 
//! MAX_* limits, REQUIRE
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th colspan='2'>" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level"));
$i = 0;
foreach ($grants as $object => $grant) {
    echo '<th>' . ($object != "*.*" ? "<input name='objects[{$i}]' value='" . h($object) . "' size='10' autocapitalize='off'>" : "<input type='hidden' name='objects[{$i}]' value='*.*' size='10'>*.*");
    //! separate db, table, columns, PROCEDURE|FUNCTION, routine
    $i++;
}
echo "</thead>\n";
foreach (array("" => "", "Server Admin" => lang('Server'), "Databases" => lang('Database'), "Tables" => lang('Table'), "Columns" => lang('Column'), "Procedures" => lang('Routine')) as $context => $desc) {
    foreach ((array) $privileges[$context] as $privilege => $comment) {
        echo "<tr" . odd() . "><td" . ($desc ? ">{$desc}<td" : " colspan='2'") . ' lang="en" title="' . h($comment) . '">' . h($privilege);
        $i = 0;
        foreach ($grants as $object => $grant) {
            $name = "'grants[{$i}][" . h(strtoupper($privilege)) . "]'";
            $value = $grant[strtoupper($privilege)];
            if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : ".*")) {
                echo "<td>&nbsp;";
            } elseif (isset($_GET["grant"])) {
                echo "<td><select name={$name}><option><option value='1'" . ($value ? " selected" : "") . ">" . lang('Grant') . "<option value='0'" . ($value == "0" ? " selected" : "") . ">" . lang('Revoke') . "</select>";
            } else {
                echo "<td align='center'><label class='block'><input type='adminer_checkbox' name={$name} value='1'" . ($value ? " checked" : "") . ($privilege == "All privileges" ? " id='grants-{$i}-all'" : ($privilege == "Grant option" ? "" : " onclick=\"if (this.checked) formUncheck('grants-{$i}-all');\"")) . "></label>";
                //! uncheck all except grant if all is checked
            }
            $i++;
        }
    }
Example #11
0
         foreach ($sequences as $val) {
             echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
         }
         echo "</table>\n";
     }
     echo "<p class='links'><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
 }
 if (support("type")) {
     echo "<h3 id='user-types'>" . lang('User types') . "</h3>\n";
     $user_types = types();
     if ($user_types) {
         echo "<table cellspacing='0'>\n";
         echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
         odd('');
         foreach ($user_types as $val) {
             echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
         }
         echo "</table>\n";
     }
     echo "<p class='links'><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n";
 }
 if (support("event")) {
     echo "<h3 id='events'>" . lang('Events') . "</h3>\n";
     $rows = get_rows("SHOW EVENTS");
     if ($rows) {
         echo "<table cellspacing='0'>\n";
         echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "<td></thead>\n";
         foreach ($rows as $row) {
             echo "<tr>";
             echo "<th>" . h($row["Name"]);
             echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>{$row['Starts']}");
Example #12
0
<?php

page_header(lang('Server'), "", false);
if ($adminer->homepage()) {
    echo "<form action='' method='post'>\n";
    echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
    if ($_POST["query"] != "") {
        search_tables();
    }
    echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);'>\n";
    echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
    foreach (table_status() as $table => $row) {
        $name = $adminer->tableName($row);
        if (isset($row["Engine"]) && $name != "") {
            echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
            echo "<th><a href='" . h(ME) . 'select=' . urlencode($table) . "'>{$name}</a>";
            $val = format_number($row["Rows"]);
            echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ {$val}" : $val) . "</a>";
        }
    }
    echo "</table>\n";
    echo "<script type='text/javascript'>tableCheck();</script>\n";
    echo "</form>\n";
}
Example #13
0
    }
    queries_redirect(ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"]);
}
page_header(lang('Process list'), $error);
?>

<form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" class="nowrap checkable">
<?php 
// HTML valid because there is always at least one process
$i = -1;
foreach (process_list() as $i => $row) {
    if (!$i) {
        echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "") . "<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
    }
    echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
    foreach ($row as $key => $val) {
        echo "<td>" . ($jush == "sql" && $key == "Info" && ereg("Query|Killed", $row["Command"]) && $val != "" || $jush == "pgsql" && $key == "current_query" && $val != "<IDLE>" || $jush == "oracle" && $key == "sql_text" && $val != "" ? "<code class='jush-{$jush}'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>' : nbsp($val));
    }
    echo "\n";
}
?>
</table>
<script type='text/javascript'>tableCheck();</script>
<p>
<?php 
if (support("kill")) {
    echo $i + 1 . "/" . lang('%d in total', $connection->result("SELECT @@max_connections"));
    echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
}
?>
Example #14
0
             //! columns looking like functions
             $unique_array[$key] = $val;
         }
     }
 }
 $unique_idf = "";
 foreach ($unique_array as $key => $val) {
     if (($jush == "sql" || $jush == "pgsql") && strlen($val) > 64) {
         $key = strpos($key, '(') ? $key : idf_escape($key);
         //! columns looking like functions
         $key = "MD5(" . ($jush == 'sql' && preg_match("~^utf8_~", $fields[$key]["collation"]) ? $key : "CONVERT({$key} USING " . charset($connection) . ")") . ")";
         $val = md5($val);
     }
     $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
 }
 echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a data-toggle='tooltip' data-placement='top' title='" . lang('edit') . "' class='btn btn-xs btn-default' href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'><i class='fa fa-pencil fa-fw'></i></a>"));
 foreach ($row as $key => $val) {
     if (isset($names[$key])) {
         $field = $fields[$key];
         if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
             $email_fields[$key] = is_mail($val) ? $names[$key] : "";
             //! filled e-mails can be contained on other pages
         }
         $link = "";
         if (preg_match('~blob|bytea|raw|file~', $field["type"]) && $val != "") {
             $link = ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf;
         }
         if (!$link && $val !== null) {
             // link related items
             foreach ((array) $foreign_keys[$key] as $foreign_key) {
                 if (count($foreign_keys[$key]) == 1 || end($foreign_key["source"]) == $key) {