Beispiel #1
0
<?php

//charge et initiale les bibliotheques globales
include 'setting.inc.php';
$command = get_command();
$routes = get_routes($command);
if ($routes[0] == '') {
    // lire le code de langue
    $the_lang = get_lang();
    redirect($the_lang . '/home');
} elseif ($routes[0] == 'fr') {
    switch_lang('fr');
    display_text();
    site_routing($routes);
} elseif ($routes[0] == 'en') {
    switch_lang('en');
    display_text();
    site_routing($routes);
} elseif ($routes[0] == 'es') {
    switch_lang('es');
    display_text();
    site_routing($routes);
} else {
    header('Status: 404 Not Found');
    error404_action();
}
}
?>
    </div>
    <div class="links">

        <span class="copyright"><?php 
echo $this->settings_model->system['_system_copyright_'];
?>
</span>

        <?php 
foreach (get_languages() as $lang) {
    ?>

            <a href="<?php 
    echo switch_lang($lang['code']);
    ?>
"
               class="language<?php 
    echo $lang['code'] == current_language() ? ' active' : '';
    ?>
">
                <span class="flag flag-<?php 
    echo $lang['code'];
    ?>
"></span>
            </a>
        <?php 
}
?>
Beispiel #3
0
function page_footer($missing = false)
{
    global $SELF, $mysql;
    ?>
</div>

<?php 
    switch_lang();
    ?>
<div id="menu">
<h1><a href="http://phpminadmin.sourceforge.net"><?php 
    echo lang('phpMinAdmin');
    ?>
</a></h1>
<?php 
    if ($missing != "auth") {
        ?>
<form action="" method="post">
<p>
<a href="<?php 
        echo htmlspecialchars($SELF);
        ?>
sql="><?php 
        echo lang('SQL command');
        ?>
</a>
<a href="<?php 
        echo htmlspecialchars($SELF);
        ?>
dump=<?php 
        echo urlencode($_GET["table"]);
        ?>
"><?php 
        echo lang('Dump');
        ?>
</a>
<input type="hidden" name="token" value="<?php 
        echo $_SESSION["tokens"][$_GET["server"]]["?logout"];
        ?>
" />
<input type="submit" name="logout" value="<?php 
        echo lang('Logout');
        ?>
" />
</p>
</form>
<form action="">
<p><?php 
        if (strlen($_GET["server"])) {
            ?>
<input type="hidden" name="server" value="<?php 
            echo htmlspecialchars($_GET["server"]);
            ?>
" /><?php 
        }
        ?>
<select name="db" onchange="this.form.submit();"><option value="">(<?php 
        echo lang('database');
        ?>
)</option>
<?php 
        if (!isset($_SESSION["databases"][$_GET["server"]])) {
            flush();
            $_SESSION["databases"][$_GET["server"]] = get_vals("SHOW DATABASES");
        }
        echo optionlist($_SESSION["databases"][$_GET["server"]], $_GET["db"]);
        ?>
</select>
<?php 
        if (isset($_GET["sql"])) {
            ?>
<input type="hidden" name="sql" value="" /><?php 
        }
        if (isset($_GET["schema"])) {
            ?>
<input type="hidden" name="schema" value="" /><?php 
        }
        ?>
</p>
<noscript><p><input type="submit" value="<?php 
        echo lang('Use');
        ?>
" /></p></noscript>
</form>
<?php 
        if ($missing != "db" && strlen($_GET["db"])) {
            $result = $mysql->query("SHOW TABLE STATUS");
            if (!$result->num_rows) {
                echo "<p class='message'>" . lang('No tables.') . "</p>\n";
            } else {
                echo "<p>\n";
                while ($row = $result->fetch_assoc()) {
                    echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '" title="' . ($row["Engine"] == "MyISAM" ? lang('%d row(s)', $row["Rows"]) : lang('around %d row(s)', $row["Rows"])) . '">' . lang('select') . '</a> ';
                    echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Engine"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '" title="' . (isset($row["Engine"]) ? htmlspecialchars($row["Engine"]) : lang('View')) . '">' . htmlspecialchars($row["Name"]) . "</a><br />\n";
                }
                echo "</p>\n";
            }
            echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a></p>\n";
            $result->free();
        }
    }
    ?>
</div>

</body>
</html>
<?php 
}
Beispiel #4
0
/** Print HTML footer
* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "")
{
    global $adminer, $token;
    ?>
</div>

<?php 
    switch_lang();
    if ($missing != "auth") {
        ?>
<form action="" method="post">
<p class="logout">
<input type="submit" name="logout" value="<?php 
        echo lang('Logout');
        ?>
" id="logout">
<input type="hidden" name="token" value="<?php 
        echo $token;
        ?>
">
</p>
</form>
<?php 
    }
    ?>
<div id="menu">
<?php 
    $adminer->navigation($missing);
    ?>
</div>
<script type="text/javascript">setupSubmitHighlight(document);</script>
<?php 
}
Beispiel #5
0
/** Print HTML footer
* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "")
{
    global $adminer;
    ?>
</div>

<?php 
    switch_lang();
    ?>
<div id="menu">
<?php 
    $adminer->navigation($missing);
    ?>
</div>
<?php 
}
Beispiel #6
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, $jush, $drivers, $connection;
        ?>
			<!-- ACERCA DE -->
			<div class='well well-sm well-info' align=center>
				<?php 
        echo $this->name();
        ?>
 <span class="version"><?php 
        echo $VERSION;
        ?>
</span>
				<?php 
        switch_lang();
        ?>
			</div>

<?php 
        if ($missing == "auth") {
            $first = true;
            foreach ((array) $_SESSION["pwds"] as $vendor => $servers) {
                foreach ($servers as $server => $usernames) {
                    foreach ($usernames as $username => $password) {
                        if ($password !== null) {
                            if ($first) {
                                echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
                                $first = false;
                            }
                            $dbs = $_SESSION["db"][$vendor][$server][$username];
                            foreach ($dbs ? array_keys($dbs) : array("") as $db) {
                                echo "<a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>({$drivers[$vendor]}) " . h($username . ($server != "" ? "@{$server}" : "") . ($db != "" ? " - {$db}" : "")) . "</a><br>\n";
                            }
                        }
                    }
                }
            }
        } else {
            if ($_GET["ns"] !== "" && !$missing && DB != "") {
                $connection->select_db(DB);
                $tables = table_status('', true);
            }
            if (support("sql")) {
                ?>
								<script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
								<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
								<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
								<script type="text/javascript" src="../externals/jush/modules/jush-<?php 
                echo $jush;
                ?>
.js"></script>
								<script type="text/javascript">
								<?php 
                if ($tables) {
                    $links = array();
                    foreach ($tables as $table => $type) {
                        $links[] = preg_quote($table, '/');
                    }
                    echo "var jushLinks = { {$jush}: [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
                    foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
                        echo "jushLinks.{$val} = jushLinks.{$jush};\n";
                    }
                }
                ?>
							bodyLoad('<?php 
                echo is_object($connection) ? substr($connection->server_info, 0, 3) : "";
                ?>
');
							</script>
						<?php 
            }
            echo "<div align=center>";
            $this->databasesPrint($missing);
            echo "<br>";
            if (DB == "" || !$missing) {
                echo (support("sql") ? "\n\t\t\t\t\t\t\t<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . " class='btn btn-info btn-xs'><i class='fa fa-terminal fa-fw'></i>  " . lang('SQL command') . "</a>\n\n\t\t\t\t\t\t\t<a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . " class='btn btn-warning btn-xs'><i class='fa fa-download fa-fw'></i> " . lang('Import') . "</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"])) . " class='btn btn-danger btn-xs'><i class='fa fa-floppy-o fa-fw'></i> " . lang('Export') . "</a>\n";
                }
            }
            if ($_GET["ns"] !== "" && !$missing && DB != "") {
                echo '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . " class='btn btn-success btn-xs'><i class='fa fa-plus fa-fw'></i> " . lang('Create table') . "</a>\n";
                if (!$tables) {
                    //Imprime mensaje indicando que no hay tablas
                    echo "<br><br><div class='alert alert-warning' role='alert'>" . lang('No tables.') . "</div>\n";
                } else {
                    //Imprime la lista de tablas cuando hay al menos una en la BD
                    echo "<div align=left>";
                    $this->tablesPrint($tables);
                    echo "</div>";
                }
            }
            echo "</div>";
        }
    }