Пример #1
0
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";
    }
}
Пример #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");
}
Пример #3
0
      <p id="tags" class="tags">
        
      </p>
      <table id="demos">
        <thead>
          <tr>
            <th>Demo</th>
            <th>Support</th>
            <th>Technology</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($demos as $demo) :?>
          <tr>
            <td class="demo"><a href="<?=$demo->url?>"><?=$demo->desc?></a><?php if (isset($demo->note)) { echo ' <small>' . $demo->note . '</small>'; }?></td>
            <td class="support"><?=support($demo->support, $demo->url)?></td>
            <td class="tags"><?=spans($demo->tags)?></td>
          </tr>
          <?php endforeach ?>
        </tbody>
      </table>
      
	<p>All content, code, video and audio is <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Share Alike 2.0</a></p>
    </article>
    <a id="html5badge" href="http://www.w3.org/html/logo/">
    <img src="http://www.w3.org/html/logo/badge/html5-badge-h-connectivity-device-graphics-multimedia-performance-semantics-storage.png" width="325" height="64" alt="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage" title="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage">
    </a>
    <footer><a id="built" href="http://twitter.com/rem">@rem built this</a></footer> 
</section>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
Пример #4
0
/** Print HTML header
* @param string used in title, breadcrumb and heading, should be HTML escaped
* @param string
* @param mixed array("key" => "link", "key2" => array("link", "desc")), null for nothing, false for driver only, true for driver and server
* @param string used after colon in title and heading, should be HTML escaped
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "")
{
    global $LANG, $VERSION, $adminer, $drivers, $jush;
    page_headers();
    $title_all = $title . ($title2 != "" ? ": {$title2}" : "");
    $title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
    ?>
<!DOCTYPE html>
<html lang="<?php 
    echo $LANG;
    ?>
" dir="<?php 
    echo lang('ltr');
    ?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
<title><?php 
    echo $title_page;
    ?>
</title>
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<?php 
    if ($adminer->head()) {
        ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
<?php 
        if (file_exists("adminer.css")) {
            ?>
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php 
        }
    }
    ?>

<body class="<?php 
    echo lang('ltr');
    ?>
 nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);">
<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
</script>

<div id="help" class="jush-<?php 
    echo $jush;
    ?>
 jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div>

<div id="content">
<?php 
    if ($breadcrumb !== null) {
        $link = substr(preg_replace('~\\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
        echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
        $link = substr(preg_replace('~\\b(db|ns)=[^&]*&~', '', ME), 0, -1);
        $server = SERVER != "" ? h(SERVER) : lang('Server');
        if ($breadcrumb === false) {
            echo "{$server}\n";
        } else {
            echo "<a href='" . ($link ? h($link) : ".") . "' accesskey='1' title='Alt+Shift+1'>{$server}</a> &raquo; ";
            if ($_GET["ns"] != "" || DB != "" && is_array($breadcrumb)) {
                echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> &raquo; ';
            }
            if (is_array($breadcrumb)) {
                if ($_GET["ns"] != "") {
                    echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> &raquo; ';
                }
                foreach ($breadcrumb as $key => $val) {
                    $desc = is_array($val) ? $val[1] : h($val);
                    if ($desc != "") {
                        echo "<a href='" . h(ME . "{$key}=") . urlencode(is_array($val) ? $val[0] : $val) . "'>{$desc}</a> &raquo; ";
                    }
                }
            }
            echo "{$title}\n";
        }
    }
    echo "<h2>{$title_all}</h2>\n";
    restart_session();
    page_messages($error);
    $databases =& get_session("dbs");
    if (DB != "" && $databases && !in_array(DB, $databases, true)) {
        $databases = null;
    }
    stop_session();
    define("PAGE_HEADER", 1);
}
Пример #5
0
                $default = $regs[1];
            }
        }
        $value = $row !== null ? $row[$name] != "" && $jush == "sql" && preg_match("~enum|set~", $field["type"]) ? is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name] : $row[$name] : (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : $default));
        if (!$_POST["save"] && is_string($value)) {
            $value = $adminer->editVal($value, $field);
        }
        $function = $_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL')));
        if (preg_match("~time~", $field["type"]) && $value == "CURRENT_TIMESTAMP") {
            $value = "";
            $function = "now";
        }
        input($field, $value, $function);
        echo "\n";
    }
    if (!support("table")) {
        echo "<tr>" . "<th><input name='field_keys[]' value='" . h($_POST["field_keys"][0]) . "'>" . "<td class='function'>" . html_select("field_funs[]", $adminer->editFunctions(array()), $_POST["field_funs"][0]) . "<td><input name='field_vals[]' value='" . h($_POST["field_vals"][0]) . "'>" . "\n";
    }
    echo "</table>\n";
}
?>
<p>
<?php 
if ($fields) {
    echo "<input type='submit' value='" . lang('Save') . "'>\n";
    if (!isset($_GET["select"])) {
        echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') . "' onclick='return !ajaxForm(this.form, \"" . lang('Saving') . '...", this)' : lang('Save and insert next')) . "' title='Ctrl+Shift+Enter'>\n";
    }
}
echo $update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n" : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n");
if (isset($_GET["select"])) {
Пример #6
0
    ?>
          <tr>
            <td class="demo"><a href="<?php 
    echo $demo->url;
    ?>
"><?php 
    echo $demo->desc;
    ?>
</a><?php 
    if (isset($demo->note)) {
        echo ' <small>' . $demo->note . '</small>';
    }
    ?>
</td>
            <td class="support"><?php 
    echo support($demo->support);
    ?>
</td>
            <td class="tags"><?php 
    echo spans($demo->tags);
    ?>
</td>
          </tr>
          <?php 
}
?>
        </tbody>
      </table>
      
      <!-- <section>
        <a href="http://full-frontal.org" id="ffad" title="JavaScript Conference: Full Frontal, 20th November">
Пример #7
0
        echo "<h3 id='foreign-keys'>" . lang('Foreign keys') . "</h3>\n";
        $foreign_keys = foreign_keys($TABLE);
        if ($foreign_keys) {
            echo "<table cellspacing='0'>\n";
            echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td>&nbsp;</thead>\n";
            foreach ($foreign_keys as $name => $foreign_key) {
                echo "<tr title='" . h($name) . "'>";
                echo "<th><i>" . implode("</i>, <i>", array_map('h', $foreign_key["source"])) . "</i>";
                echo "<td><a href='" . h($foreign_key["db"] != "" ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), ME) : ($foreign_key["ns"] != "" ? preg_replace('~ns=[^&]*~', "ns=" . urlencode($foreign_key["ns"]), ME) : ME)) . "table=" . urlencode($foreign_key["table"]) . "'>" . ($foreign_key["db"] != "" ? "<b>" . h($foreign_key["db"]) . "</b>." : "") . ($foreign_key["ns"] != "" ? "<b>" . h($foreign_key["ns"]) . "</b>." : "") . h($foreign_key["table"]) . "</a>";
                echo "(<i>" . implode("</i>, <i>", array_map('h', $foreign_key["target"])) . "</i>)";
                echo "<td>" . nbsp($foreign_key["on_delete"]) . "\n";
                echo "<td>" . nbsp($foreign_key["on_update"]) . "\n";
                echo '<td><a href="' . h(ME . 'foreign=' . urlencode($TABLE) . '&name=' . urlencode($name)) . '">' . lang('Alter') . '</a>';
            }
            echo "</table>\n";
        }
        echo '<p class="links"><a href="' . h(ME) . 'foreign=' . urlencode($TABLE) . '">' . lang('Add foreign key') . "</a>\n";
    }
}
if (support(is_view($table_status) ? "view_trigger" : "trigger")) {
    echo "<h3 id='triggers'>" . lang('Triggers') . "</h3>\n";
    $triggers = triggers($TABLE);
    if ($triggers) {
        echo "<table cellspacing='0'>\n";
        foreach ($triggers as $key => $val) {
            echo "<tr valign='top'><td>" . h($val[0]) . "<td>" . h($val[1]) . "<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
        }
        echo "</table>\n";
    }
    echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
}
Пример #8
0
/** Print edit data form
* @param string
* @param array
* @param mixed
* @param bool
* @return null
*/
function edit_form($TABLE, $fields, $row, $update)
{
    global $adminer, $jush, $token, $error;
    $table_name = $adminer->tableName(table_status1($TABLE, true));
    page_header($update ? lang('Edit') : lang('Insert'), $error, array("select" => array($TABLE, $table_name)), $table_name);
    if ($row === false) {
        echo "<p class='error'>" . lang('No rows.') . "\n";
    }
    ?>
<form action="" method="post" enctype="multipart/form-data" id="form">
<?php 
    if (!$fields) {
        echo "<p class='error'>" . lang('You have no privileges to update this table.') . "\n";
    } else {
        echo "<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";
        foreach ($fields as $name => $field) {
            echo "<tr><th>" . $adminer->fieldName($field);
            $default = $_GET["set"][bracket_escape($name)];
            if ($default === null) {
                $default = $field["default"];
                if ($field["type"] == "bit" && preg_match("~^b'([01]*)'\$~", $default, $regs)) {
                    $default = $regs[1];
                }
            }
            $value = $row !== null ? $row[$name] != "" && $jush == "sql" && preg_match("~enum|set~", $field["type"]) ? is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name] : $row[$name] : (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : $default));
            if (!$_POST["save"] && is_string($value)) {
                $value = $adminer->editVal($value, $field);
            }
            $function = $_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL')));
            if (preg_match("~time~", $field["type"]) && $value == "CURRENT_TIMESTAMP") {
                $value = "";
                $function = "now";
            }
            input($field, $value, $function);
            echo "\n";
        }
        if (!support("table")) {
            echo "<tr>" . "<th><input name='field_keys[]' onkeyup='keyupChange.call(this);' onchange='fieldChange(this);' value=''>" . "<td class='function'>" . html_select("field_funs[]", $adminer->editFunctions(array("null" => isset($_GET["select"])))) . "<td><input name='field_vals[]'>" . "\n";
        }
        echo "</table>\n";
    }
    echo "<p>\n";
    if ($fields) {
        echo "<input type='submit' value='" . lang('Save') . "'>\n";
        if (!isset($_GET["select"])) {
            echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') . "' onclick='return !ajaxForm(this.form, \"" . lang('Saving') . '...", this)' : lang('Save and insert next')) . "' title='Ctrl+Shift+Enter'>\n";
        }
    }
    echo $update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n" : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n");
    if (isset($_GET["select"])) {
        hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
    }
    ?>
<input type="hidden" name="referer" value="<?php 
    echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]);
    ?>
">
<input type="hidden" name="save" value="1">
<input type="hidden" name="token" value="<?php 
    echo $token;
    ?>
">
</form>
<?php 
}
Пример #9
0
<?php 
}
?>

<?php 
if ($TABLE != "") {
    ?>
<input type="submit" name="drop" value="<?php 
    echo lang('Drop');
    ?>
"<?php 
    echo confirm();
    ?>
><?php 
}
if (support("partitioning")) {
    $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
    print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
    ?>
<p>
<?php 
    echo "<select name='partition_by' onchange='partitionByChange(this);'" . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . ">" . optionlist(array("" => "") + $partition_by, $row["partition_by"]) . "</select>";
    ?>
(<input name="partition" value="<?php 
    echo h($row["partition"]);
    ?>
">)
<?php 
    echo lang('Partitions');
    ?>
: <input type="number" name="partitions" class="size<?php 
Пример #10
0
    page_headers();
    ob_start();
} else {
    page_header(lang('Select') . ": {$table_name}", $error);
}
$set = null;
if (isset($rights["insert"]) || !support("table")) {
    $set = "";
    foreach ((array) $_GET["where"] as $val) {
        if (count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "=" || !$val["op"] && !preg_match('~[_%]~', $val["val"]))) {
            $set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
        }
    }
}
$adminer->selectLinks($table_status, $set);
if (!$columns && support("table")) {
    echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "." : ": " . error()) . "\n";
} else {
    echo "<form action='' id='form'>\n";
    echo "<div style='display: none;'>";
    hidden_fields_get();
    echo DB != "" ? '<input type="hidden" name="db" value="' . h(DB) . '">' . (isset($_GET["ns"]) ? '<input type="hidden" name="ns" value="' . h($_GET["ns"]) . '">' : "") : "";
    // not used in Editor
    echo '<input type="hidden" name="select" value="' . h($TABLE) . '">';
    echo "</div>\n";
    $adminer->selectColumnsPrint($select, $columns);
    $adminer->selectSearchPrint($where, $columns, $indexes);
    $adminer->selectOrderPrint($order, $columns, $indexes);
    $adminer->selectLimitPrint($limit);
    $adminer->selectLengthPrint($text_length);
    $adminer->selectActionPrint($indexes);
Пример #11
0
/** Print HTML header
* @param string used in title, breadcrumb and heading, should be HTML escaped
* @param string
* @param mixed array("key" => "link=desc", "key2" => array("link", "desc")), null for nothing, false for driver only, true for driver and server
* @param string used after colon in title and heading, will be HTML escaped
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "")
{
    global $LANG, $adminer, $connection, $drivers;
    header("Content-Type: text/html; charset=utf-8");
    if ($adminer->headers()) {
        header("X-XSS-Protection: 0");
        // prevents introducing XSS in IE8 by removing safe parts of the page
    }
    $title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
    $title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="<?php 
    echo $LANG;
    ?>
" dir="<?php 
    echo lang('ltr');
    ?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
<title><?php 
    echo $title_page;
    ?>
</title>
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<?php 
    if ($adminer->head()) {
        ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico" id="favicon">
<?php 
        if (file_exists("adminer.css")) {
            ?>
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php 
        }
    }
    ?>

<body class="<?php 
    echo lang('ltr');
    ?>
 nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);" onload="bodyLoad('<?php 
    echo is_object($connection) ? substr($connection->server_info, 0, 3) : "";
    ?>
');">
<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
</script>

<div id="content">
<?php 
    if ($breadcrumb !== null) {
        $link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
        echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
        $link = substr(preg_replace('~(db|ns)=[^&]*&~', '', ME), 0, -1);
        $server = SERVER != "" ? h(SERVER) : lang('Server');
        if ($breadcrumb === false) {
            echo "{$server}\n";
        } else {
            echo "<a href='" . ($link ? h($link) : ".") . "' accesskey='1' title='Alt+Shift+1'>{$server}</a> &raquo; ";
            if ($_GET["ns"] != "" || DB != "" && is_array($breadcrumb)) {
                echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> &raquo; ';
            }
            if (is_array($breadcrumb)) {
                if ($_GET["ns"] != "") {
                    echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> &raquo; ';
                }
                foreach ($breadcrumb as $key => $val) {
                    $desc = is_array($val) ? $val[1] : $val;
                    if ($desc != "") {
                        echo '<a href="' . h(ME . "{$key}=") . urlencode(is_array($val) ? $val[0] : $val) . '">' . h($desc) . '</a> &raquo; ';
                    }
                }
            }
            echo "{$title}\n";
        }
    }
    echo "<h2>{$title_all}</h2>\n";
    restart_session();
    $uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
    $messages = $_SESSION["messages"][$uri];
    if ($messages) {
        echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>\n";
        unset($_SESSION["messages"][$uri]);
    }
    $databases =& get_session("dbs");
    if (DB != "" && $databases && !in_array(DB, $databases, true)) {
        $databases = null;
    }
    stop_session();
    if ($error) {
        echo "<div class='error'>{$error}</div>\n";
    }
    define("PAGE_HEADER", 1);
}
Пример #12
0
	  </tr>

	</table>	
	</td>
  </tr>
  <tr>
    <td id="ma" align="left" valign="top" style="border-bottom:1px solid #6E2500; border-left:1px solid #6E2500; border-right:1px solid #6E2500; padding:1px;">
	
	<table width="100%" style="height:100%; background-color:#101010; border:1px solid #2E2E2E;   " border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top">
<div style="padding-left:5px; padding-right:10px; padding-top:5px; padding-bottom:10px" class="style2"><font class="content">
<font class="option1">

<?php 
support();
?>
ICQ 000-000
Tel.1234567

</font></font></div>		
		</td>

	  </tr>
	  <tr>
	    <td width="230"><img src="image/spacer.gif" alt="" width="145" height="1"></td>
	  </tr>
	</table>
	
	</td>
  </tr>  
Пример #13
0
function template($content_tile_name, $data)
{
    require_once dirname(__FILE__) . '/../tiles/' . $content_tile_name . '.php';
    before($content_tile_name);
    ?>
    <div id="header" class="right"><div class="right-inner">
        <?php 
    top();
    ?>
    
    </div></div>
    <div id="content" class="right"><div class="right-inner" style="float:_left">
        <?php 
    content($content_tile_name, $data);
    ?>
    </div></div>
    <div id="homelink" class="left"><div class="left-inner">
        <a href="./" title="на главную" id="home"></a>
    </div></div>
    <div id="timeleft" class="left"><div class="left-inner">
        <?php 
    timeleft($content_tile_name);
    ?>
    </div></div>
    <?php 
    if ('standing' != $content_tile_name && 'table' != $content_tile_name) {
        ?>
        <div id="control" class="left"><div class="left-inner">
            <?php 
        menu($content_tile_name);
        ?>
        </div></div>
    <?php 
    }
    ?>
    <div id="stuff" class="right"><div class="right-inner">
        <?php 
    stuff($content_tile_name);
    ?>
    </div></div>
    <div id="toolbar">
        <?php 
    toolbar($content_tile_name);
    ?>
    </div>
    <div id="support" class="left"><div class="left-inner">
        <?php 
    support();
    ?>
    </div></div>
    <div id="contacts" class="right"><div class="right-inner">
        <?php 
    contacts();
    ?>
    </div></div>
    <script type="text/javascript">
        (function($) {
            var
                    menuWidth   = $('#menu').width()
                ,   on          = false
                ;
            $(document.body).mousemove(function(e) {
                if ($(document.body).hasClass('noleft')) {
                    if (!on) {
                        defMargin(true);
                    }
                    if ($(e.target).closest('#control').size() && !on) {
                        on = true;
                        $('#control').animate(
                                { 'marginLeft': defMargin() + menuWidth + 'px' }
                            ,   200
                        );
                    } if (!$(e.target).closest('#control').size() && on) {
                        on = false;
                        $('#control').animate(
                                { 'marginLeft': defMargin() + 'px' }
                            ,   200
                        );
                    }
                } else {
                    defMargin(true);
                }
            });
        })(jQuery);
    </script>
<?php 
    after();
    die;
}
Пример #14
0
      <p id="tags" class="tags">
        
      </p>
      <table id="demos">
        <thead>
          <tr>
            <th>Demo</th>
            <th>Support</th>
            <th>Technology</th>            
          </tr>
        </thead>
        <tbody>
          <?php foreach ($demos as $demo) :?>
          <tr>
            <td class="demo"><a href="<?=$demo->url?>"><?=$demo->desc?></a><?php if (isset($demo->note)) { echo ' <small>' . $demo->note . '</small>'; }?></td>
            <td class="support"><?=support($demo->support)?></td>
            <td class="tags"><?=spans($demo->tags)?></td>
          </tr>
          <?php endforeach ?>
        </tbody>
      </table>
      
	<p>All content, code, video and audio is <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Share Alike 2.0</a></p>
    </article>
    <a id="html5badge" href="http://www.w3.org/html/logo/">
    <img src="http://www.w3.org/html/logo/badge/html5-badge-h-connectivity-device-graphics-multimedia-performance-semantics-storage.png" width="325" height="64" alt="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage" title="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage">
    </a>
    <footer><a id="built" href="http://twitter.com/rem">@rem built this</a></footer> 
</section>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
Пример #15
0
/** Print HTML header
* @param string used in title, breadcrumb and heading, should be HTML escaped
* @param string
* @param mixed array("key" => "link", "key2" => array("link", "desc")), null for nothing, false for driver only, true for driver and server
* @param string used after colon in title and heading, should be HTML escaped
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "")
{
    global $LANG, $VERSION, $adminer, $drivers, $jush;
    page_headers();
    if (is_ajax() && $error) {
        page_messages($error);
        exit;
    }
    $title_all = $title . ($title2 != "" ? ": {$title2}" : "");
    $title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
    ?>
<!DOCTYPE html>
<html lang="<?php 
    echo $LANG;
    ?>
" dir="<?php 
    echo lang('ltr');
    ?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
<meta name="referrer" content="origin-when-crossorigin">
<title><?php 
    echo $title_page;
    ?>
</title>

	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">

    <!-- Custom Fonts -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<?php 
    if ($adminer->head()) {
        ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
<?php 
        if (file_exists("adminer.css")) {
            ?>
<link rel="stylesheet" type="text/css" href="adminer.cssBORRAME">
<?php 
        }
    }
    ?>

<body class="<?php 
    echo lang('ltr');
    ?>
 nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php 
    echo isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('{$VERSION}');\"";
    ?>
>




<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
var offlineMessage = '<?php 
    echo js_escape(lang('You are offline.'));
    ?>
';
</script>

<div id="help" class="jush-<?php 
    echo $jush;
    ?>
 jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div>

<div id="content">
<?php 
    if ($breadcrumb !== null) {
        $link = substr(preg_replace('~\\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
        echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
        $link = substr(preg_replace('~\\b(db|ns)=[^&]*&~', '', ME), 0, -1);
        $server = SERVER != "" ? h(SERVER) : lang('Server');
        if ($breadcrumb === false) {
            echo "{$server}\n";
        } else {
            echo "<a href='" . ($link ? h($link) : ".") . "' accesskey='1' title='Alt+Shift+1'>{$server}</a> &raquo; ";
            if ($_GET["ns"] != "" || DB != "" && is_array($breadcrumb)) {
                echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> &raquo; ';
            }
            if (is_array($breadcrumb)) {
                if ($_GET["ns"] != "") {
                    echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> &raquo; ';
                }
                foreach ($breadcrumb as $key => $val) {
                    $desc = is_array($val) ? $val[1] : h($val);
                    if ($desc != "") {
                        echo "<a href='" . h(ME . "{$key}=") . urlencode(is_array($val) ? $val[0] : $val) . "'>{$desc}</a> &raquo; ";
                    }
                }
            }
            echo "{$title}\n";
        }
    }
    echo "\n\t\t<div class='well well-sm'>\n\t\t\t{$title_all}\n\t\t</div>\n";
    echo "<div id='ajaxstatus' class='jsonly hidden'></div>\n";
    restart_session();
    page_messages($error);
    $databases =& get_session("dbs");
    if (DB != "" && $databases && !in_array(DB, $databases, true)) {
        $databases = null;
    }
    stop_session();
    define("PAGE_HEADER", 1);
}
Пример #16
0
$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";
}
?>
<input type="hidden" name="token" value="<?php 
echo $token;
?>
">
</form>
Пример #17
0
    ?>
          <tr>
            <td class="demo"><a href="<?php 
    echo $demo->url;
    ?>
"><?php 
    echo $demo->desc;
    ?>
</a><?php 
    if (isset($demo->note)) {
        echo ' <small>' . $demo->note . '</small>';
    }
    ?>
</td>
            <td class="support"><?php 
    echo support($demo->support, $demo->url);
    ?>
</td>
            <td class="tags"><?php 
    echo spans($demo->tags);
    ?>
</td>
          </tr>
          <?php 
}
?>
        </tbody>
      </table>

	<p>All content, code, video and audio is <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Share Alike 2.0</a></p>
    </article>
Пример #18
0
/** Print table interior for fields editing
* @param array
* @param array
* @param string TABLE or PROCEDURE
* @param array returned by referencable_primary()
* @param bool display comments column
* @return null
*/
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array(), $comments = false)
{
    global $connection, $inout;
    $fields = array_values($fields);
    ?>
<thead><tr class="wrap">
<?php 
    if ($type == "PROCEDURE") {
        ?>
<td>&nbsp;<?php 
    }
    ?>
<th><?php 
    echo $type == "TABLE" ? lang('Column name') : lang('Parameter name');
    ?>
<td><?php 
    echo lang('Type');
    ?>
<textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea>
<td><?php 
    echo lang('Length');
    ?>
<td><?php 
    echo lang('Options');
    if ($type == "TABLE") {
        ?>
<td>NULL
<td><input type="radio" name="auto_increment_col" value=""><acronym title="<?php 
        echo lang('Auto Increment');
        ?>
">AI</acronym><?php 
        echo doc_link(array('sql' => "example-auto-increment.html", 'sqlite' => "autoinc.html", 'pgsql' => "datatype.html#DATATYPE-SERIAL", 'mssql' => "ms186775.aspx"));
        ?>
<td><?php 
        echo lang('Default value');
        echo support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : "";
    }
    ?>
<td><?php 
    echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>";
    ?>
<script type="text/javascript">row_count = <?php 
    echo count($fields);
    ?>
;</script>
</thead>
<tbody onkeydown="return editingKeydown(event);">
<?php 
    foreach ($fields as $i => $field) {
        $i++;
        $orig = $field[$_POST ? "orig" : "field"];
        $display = (isset($_POST["add"][$i - 1]) || isset($field["field"]) && !$_POST["drop_col"][$i]) && (support("drop_col") || $orig == "");
        ?>
<tr<?php 
        echo $display ? "" : " style='display: none;'";
        ?>
>
<?php 
        echo $type == "PROCEDURE" ? "<td>" . html_select("fields[{$i}][inout]", explode("|", $inout), $field["inout"]) : "";
        ?>
<th><?php 
        if ($display) {
            ?>
<input name="fields[<?php 
            echo $i;
            ?>
][field]" value="<?php 
            echo h($field["field"]);
            ?>
" onchange="editingNameChange(this);<?php 
            echo $field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);';
            ?>
" maxlength="64" autocapitalize="off"><?php 
        }
        ?>
<input type="hidden" name="fields[<?php 
        echo $i;
        ?>
][orig]" value="<?php 
        echo h($orig);
        ?>
">
<?php 
        edit_type("fields[{$i}]", $field, $collations, $foreign_keys);
        if ($type == "TABLE") {
            ?>
<td><?php 
            echo checkbox("fields[{$i}][null]", 1, $field["null"], "", "", "block");
            ?>
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php 
            echo $i;
            ?>
"<?php 
            if ($field["auto_increment"]) {
                ?>
 checked<?php 
            }
            ?>
 onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php 
            echo checkbox("fields[{$i}][has_default]", 1, $field["has_default"]);
            ?>
<input name="fields[<?php 
            echo $i;
            ?>
][default]" value="<?php 
            echo h($field["default"]);
            ?>
" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
<?php 
            echo support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[{$i}][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "'>" : "";
        }
        echo "<td>";
        echo support("move_col") ? "<input type='image' class='icon' name='add[{$i}]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow(this, 1);'>&nbsp;" . "<input type='image' class='icon' name='up[{$i}]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>&nbsp;" . "<input type='image' class='icon' name='down[{$i}]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>&nbsp;" : "";
        echo $orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[{$i}]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">" : "";
        echo "\n";
    }
}
Пример #19
0
                echo "<table cellspacing='0'>\n";
                echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . ($jush != "sqlite" ? "<td>&nbsp;" : "") . "</thead>\n";
                foreach ($foreign_keys as $name => $foreign_key) {
                    echo "<tr title='" . h($name) . "'>";
                    echo "<th><i>" . implode("</i>, <i>", array_map('h', $foreign_key["source"])) . "</i>";
                    echo "<td><a href='" . h($foreign_key["db"] != "" ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), ME) : ($foreign_key["ns"] != "" ? preg_replace('~ns=[^&]*~', "ns=" . urlencode($foreign_key["ns"]), ME) : ME)) . "table=" . urlencode($foreign_key["table"]) . "'>" . ($foreign_key["db"] != "" ? "<b>" . h($foreign_key["db"]) . "</b>." : "") . ($foreign_key["ns"] != "" ? "<b>" . h($foreign_key["ns"]) . "</b>." : "") . h($foreign_key["table"]) . "</a>";
                    echo "(<i>" . implode("</i>, <i>", array_map('h', $foreign_key["target"])) . "</i>)";
                    echo "<td>" . nbsp($foreign_key["on_delete"]) . "\n";
                    echo "<td>" . nbsp($foreign_key["on_update"]) . "\n";
                    echo $jush == "sqlite" ? "" : '<td><a href="' . h(ME . 'foreign=' . urlencode($TABLE) . '&name=' . urlencode($name)) . '">' . lang('Alter') . '</a>';
                }
                echo "</table>\n";
            }
            if ($jush != "sqlite") {
                echo '<p><a href="' . h(ME) . 'foreign=' . urlencode($TABLE) . '">' . lang('Add foreign key') . "</a>\n";
            }
        }
        if (support("trigger")) {
            echo "<h3>" . lang('Triggers') . "</h3>\n";
            $triggers = triggers($TABLE);
            if ($triggers) {
                echo "<table cellspacing='0'>\n";
                foreach ($triggers as $key => $val) {
                    echo "<tr valign='top'><td>{$val['0']}<td>{$val['1']}<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
                }
                echo "</table>\n";
            }
            echo '<p><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
        }
    }
}
Пример #20
0
<?php

$sp = support();
$row_sp = mysql_fetch_array($sp);
if (isset($_POST["btnsubmit"])) {
    $sp_title1 = $_POST["sp_title1"];
    $sp_phone1 = $_POST["sp_phone1"];
    $sp_title2 = $_POST["sp_title2"];
    $sp_phone2 = $_POST["sp_phone2"];
    $sp_title3 = $_POST["sp_title3"];
    $sp_phone3 = $_POST["sp_phone3"];
    $sp_yahoo = $_POST["sp_yahoo"];
    $sp_skype = $_POST["sp_skype"];
    $qr = "UPDATE support SET  \n\t\t sp_title1='{$sp_title1}',\n\t\t sp_phone1='{$sp_phone1}',\n\t\t sp_title2='{$sp_title2}',\n\t\t sp_phone2='{$sp_phone2}',\n\t\t sp_title3='{$sp_title3}',\n\t\t sp_phone3='{$sp_phone3}',\n\t\t sp_yahoo='{$sp_yahoo}',\n\t\t sp_skype='{$sp_skype}'\n\t\t WHERE id='1'\n\t\t\n\t\t";
    mysql_query($qr);
    header("location:main-page.php?p=support");
}
?>
<div class="title_style">HỖ TRỢ TRỰC TUYẾN</div>
<div class="title_style2">HỖ TRỢ 1</div>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
                 <div class="row_form_input">
                 <label>Tiêu đề</label>
                 <input type="text" name="sp_title1" id="sp_title1" value="<?php 
echo $row_sp[sp_title1];
?>
" />
                 </div>
                 <div class="row_form_input">
                 <label>Liên hệ</label>
                 <input type="text" name="sp_phone1" id="sp_phone1" value="<?php 
Пример #21
0
        $select = array("*");
    }
    if ($select) {
        $result = $driver->adminer_select($TABLE, $select, array($where), $select, array(), isset($_GET["select"]) ? 2 : 1);
        $row = $result->fetch_assoc();
        if (!$row) {
            // MySQLi returns null
            $row = false;
        }
        if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) {
            // $result->num_rows != 1 isn't available in all drivers
            $row = null;
        }
    }
}
if (!support("table") && !$fields) {
    if (!$where) {
        // insert
        $result = $driver->adminer_select($TABLE, array("*"), $where, array("*"));
        $row = $result ? $result->fetch_assoc() : false;
        if (!$row) {
            $row = array($driver->primary => "");
        }
    }
    if ($row) {
        foreach ($row as $key => $val) {
            if (!$where) {
                $row[$key] = null;
            }
            $fields[$key] = array("field" => $key, "null" => $key != $driver->primary, "auto_increment" => $key == $driver->primary);
        }
Пример #22
0
 /** Prints table list in menu
  * @param array result of table_status('', true)
  * @return null
  */
 function tablesPrint($tables)
 {
     echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
     foreach ($tables as $table => $status) {
         echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
         $name = $this->tableName($status);
         echo (support("table") || support("indexes") ? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), is_view($status) ? "view" : "", "structure") . " title='" . lang('Show structure') . "'>{$name}</a>" : "<span>{$name}</span>") . "<br>\n";
     }
 }
Пример #23
0
 }
 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']}");
             echo "<td>{$row['Ends']}";
             echo '<td><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . lang('Alter') . '</a>';
         }
         echo "</table>\n";
         $event_scheduler = $connection->result("SELECT @@event_scheduler");
         if ($event_scheduler && $event_scheduler != "ON") {
Пример #24
0
}
parse_str($_COOKIE["adminer_export"], $row);
if (!$row) {
    $row = array("output" => "text", "format" => "sql", "db_style" => DB != "" ? "" : "CREATE", "table_style" => "DROP+CREATE", "data_style" => "INSERT");
}
if (!isset($row["events"])) {
    // backwards compatibility
    $row["routines"] = $row["events"] = $_GET["dump"] == "";
    $row["triggers"] = $row["table_style"];
}
echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n";
// 0 - radio
echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n";
// 0 - radio
echo $jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"]) . (support("routine") ? adminer_checkbox("routines", 1, $row["routines"], lang('Routines')) : "") . (support("event") ? adminer_checkbox("events", 1, $row["events"], lang('Events')) : "");
echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"]) . adminer_checkbox("auto_increment", 1, $row["auto_increment"], lang('Auto Increment')) . (support("trigger") ? adminer_checkbox("triggers", 1, $row["triggers"], lang('Triggers')) : "");
echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]);
?>
</table>
<p><input type="submit" value="<?php 
echo lang('Export');
?>
">
<input type="hidden" name="token" value="<?php 
echo $token;
?>
">

<table cellspacing="0">
<?php 
$prefixes = array();
Пример #25
0
    /** Prints navigation after Adminer title
     * @param string can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema
     * @return null
     */
    function navigation($missing)
    {
        global $VERSION, $connection, $token, $jush, $drivers;
        ?>
<h1>
<?php 
        echo $this->name();
        ?>
 <span class="version"><?php 
        echo $VERSION;
        ?>
</span>
<a href="http://www.adminer.org/#download" id="version"><?php 
        echo version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : "";
        ?>
</a>
</h1>
<?php 
        if ($missing == "auth") {
            $first = true;
            foreach ((array) $_SESSION["pwds"] as $driver => $servers) {
                foreach ($servers as $server => $usernames) {
                    foreach ($usernames as $username => $password) {
                        if (isset($password)) {
                            if ($first) {
                                echo "<p onclick='eventStop(event);'>\n";
                                $first = false;
                            }
                            echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>({$drivers[$driver]}) " . h($username . ($server != "" ? "@{$server}" : "")) . "</a><br>\n";
                        }
                    }
                }
            }
        } else {
            $databases = get_databases();
            ?>
<form action="" method="post">
<p class="logout">
<?php 
            if (DB == "" || !$missing) {
                echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "</a>\n";
                if (support("dump")) {
                    echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
                }
            }
            ?>
<input type="submit" name="logout" value="<?php 
            echo lang('Logout');
            ?>
" onclick="eventStop(event);">
<input type="hidden" name="token" value="<?php 
            echo $token;
            ?>
">
</p>
</form>
<form action="">
<p>
<?php 
            hidden_fields_get();
            echo $databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">';
            ?>
<input type="submit" value="<?php 
            echo lang('Use');
            ?>
"<?php 
            echo $databases ? " class='hidden'" : "";
            ?>
 onclick="eventStop(event);">
<?php 
            if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
                if (support("scheme")) {
                    echo "<br>" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();");
                    if ($_GET["ns"] != "") {
                        set_schema($_GET["ns"]);
                    }
                }
                if ($_GET["ns"] !== "" && !$missing) {
                    echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
                    $tables = tables_list();
                    if (!$tables) {
                        echo "<p class='message'>" . lang('No tables.') . "\n";
                    } else {
                        $this->tablesPrint($tables);
                        $links = array();
                        foreach ($tables as $table => $type) {
                            $links[] = preg_quote($table, '/');
                        }
                        echo "<script type='text/javascript'>\n";
                        echo "var jushLinks = { {$jush}: [ '" . js_adminer_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
                        foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
                            echo "jushLinks.{$val} = jushLinks.{$jush};\n";
                        }
                        echo "</script>\n";
                    }
                }
            }
            echo isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">' : (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">' : (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">' : ""));
            echo "</p></form>\n";
        }
    }