Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HTML instead of XHTML

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@803 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit ace55ed14293d6cd84ba44d9e30c483ae7f0de8f 1 parent f203092
jakubvrana authored
Showing with 297 additions and 338 deletions.
  1. +6 −7 adminer/call.inc.php
  2. +4 −4 adminer/coverage.inc.php
  3. +17 −22 adminer/create.inc.php
  4. +6 −7 adminer/createv.inc.php
  5. +6 −7 adminer/database.inc.php
  6. +22 −25 adminer/db.inc.php
  7. +14 −14 adminer/dump.inc.php
  8. +8 −9 adminer/edit.inc.php
  9. +11 −12 adminer/event.inc.php
  10. +12 −16 adminer/foreign.inc.php
  11. +13 −16 adminer/include/adminer.inc.php
  12. +6 −6 adminer/include/auth.inc.php
  13. +3 −3 adminer/include/connect.inc.php
  14. +9 −14 adminer/include/design.inc.php
  15. +25 −25 adminer/include/editing.inc.php
  16. +2 −2 adminer/include/export.inc.php
  17. +14 −15 adminer/include/functions.inc.php
  18. +2 −2 adminer/include/lang.inc.php
  19. +8 −9 adminer/indexes.inc.php
  20. +9 −9 adminer/privileges.inc.php
  21. +7 −8 adminer/procedure.inc.php
  22. +4 −5 adminer/processlist.inc.php
  23. +2 −2 adminer/schema.inc.php
  24. +38 −40 adminer/select.inc.php
  25. +12 −14 adminer/sql.inc.php
  26. +9 −11 adminer/table.inc.php
  27. +8 −9 adminer/trigger.inc.php
  28. +13 −15 adminer/user.inc.php
  29. +2 −3 adminer/variables.inc.php
  30. +1 −1  adminer/view.inc.php
  31. +4 −6 editor/include/adminer.inc.php
View
13 adminer/call.inc.php
@@ -29,14 +29,14 @@
}
$result = $dbh->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($_GET["call"]) . "(" . implode(", ", $call) . ")");
if (!$result) {
- echo "<p class='error'>" . htmlspecialchars($dbh->error) . "</p>\n";
+ echo "<p class='error'>" . htmlspecialchars($dbh->error) . "\n";
} else {
do {
$result = $dbh->store_result();
if (is_object($result)) {
select($result);
} else {
- echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $dbh->affected_rows) . "</p>\n";
+ echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $dbh->affected_rows) . "\n";
}
} while ($dbh->next_result());
if ($out) {
@@ -52,19 +52,18 @@
echo "<table cellspacing='0'>\n";
foreach ($in as $key) {
$field = $routine["fields"][$key];
- echo "<tr><th>" . htmlspecialchars($field["field"]) . "</th>";
+ echo "<tr><th>" . htmlspecialchars($field["field"]);
$value = $_POST["fields"][$key];
if (strlen($value) && ($field["type"] == "enum" || $field["type"] == "set")) {
$value = intval($value);
}
input($key, $field, $value); // param name can be empty
- echo "</td></tr>\n";
+ echo "\n";
}
echo "</table>\n";
}
?>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Call'); ?>" />
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Call'); ?>">
</form>
View
8 adminer/coverage.inc.php
@@ -19,7 +19,7 @@ function xhtml_open_tags($s) {
unset($_SESSION["coverage"]); // disable coverage if it is not available
if (extension_loaded("xdebug")) {
$_SESSION["coverage"] = array();
- echo "<p class='message'>Coverage started.</p>\n";
+ echo "<p class='message'>Coverage started.\n";
}
} elseif (preg_match('~^(include/)?[-_.a-z0-9]+$~i', $_GET["coverage"])) {
// highlight single file
@@ -49,7 +49,7 @@ function xhtml_open_tags($s) {
$s = ($open_tags ? "<" . implode("><", $open_tags) . ">" : "");
$prev_color = $color;
}
- $s .= "$line<br />\n";
+ $s .= "$line<br>\n";
}
} else {
// display list of files
@@ -61,10 +61,10 @@ function xhtml_open_tags($s) {
$values = array_count_values($cov);
$ratio = round(100 - 100 * $values[-1] / count($cov));
}
- echo "<tr><td align='right' style='background-color: " . ($ratio < 50 ? "Red" : ($ratio < 75 ? "#FFEA20" : "#A7FC9D")) . ";'>$ratio%</td><th><a href=\"" . htmlspecialchars($SELF) . "coverage=$filename\">$filename</a></th></tr>\n";
+ echo "<tr><td align='right' style='background-color: " . ($ratio < 50 ? "Red" : ($ratio < 75 ? "#FFEA20" : "#A7FC9D")) . ";'>$ratio%<th><a href=\"" . htmlspecialchars($SELF) . "coverage=$filename\">$filename</a>\n";
}
echo "</table>\n";
- echo '<p><a href="' . htmlspecialchars($SELF) . 'coverage=0">Start new coverage</a></p>' . "\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'coverage=0">Start new coverage</a>' . "\n";
}
page_footer("auth");
exit;
View
39 adminer/create.inc.php
@@ -127,50 +127,45 @@
$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 8 : 0);
if ($suhosin && count($row["fields"]) > $suhosin) {
- echo "<p class='error'>" . htmlspecialchars(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "</p>\n";
+ echo "<p class='error'>" . htmlspecialchars(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n";
}
?>
<form action="" method="post" id="form">
<p>
-<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo htmlspecialchars($row["name"]); ?>" />
-<select name="Engine"><option value="">(<?php echo lang('engine'); ?>)</option><?php echo optionlist($engines, $row["Engine"]); ?></select>
-<select name="Collation"><option value="">(<?php echo lang('collation'); ?>)</option><?php echo optionlist($collations, $row["Collation"]); ?></select>
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-</p>
+<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo htmlspecialchars($row["name"]); ?>">
+<select name="Engine"><option value="">(<?php echo lang('engine'); ?>)<?php echo optionlist($engines, $row["Engine"]); ?></select>
+<select name="Collation"><option value="">(<?php echo lang('collation'); ?>)<?php echo optionlist($collations, $row["Collation"]); ?></select>
+<input type="submit" value="<?php echo lang('Save'); ?>">
<table cellspacing="0" id="edit-fields">
<?php $column_comments = edit_fields($row["fields"], $collations, "TABLE", $suhosin, $foreign_keys); ?>
</table>
<p>
-<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="4" value="<?php echo intval($row["Auto_increment"]); ?>" />
-<?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo htmlspecialchars($row["Comment"]); ?>" maxlength="60" />
+<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="4" value="<?php echo intval($row["Auto_increment"]); ?>">
+<?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo htmlspecialchars($row["Comment"]); ?>" maxlength="60">
<script type="text/javascript">// <![CDATA[
-document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked="checked"<?php } ?> onclick="column_comments_click(this.checked);" /><?php echo lang('Show column comments'); ?></label>');
+document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked="checked"<?php } ?> onclick="column_comments_click(this.checked);"><?php echo lang('Show column comments'); ?></label>');
// ]]></script>
-</p>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-<?php if (strlen($_GET["create"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php if (strlen($_GET["create"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php
if ($dbh->server_info >= 5.1) {
$partition_table = ereg('RANGE|LIST', $row["partition_by"]);
?>
<fieldset><legend><?php echo lang('Partition by'); ?></legend>
<p>
-<select name="partition_by" onchange="partition_by_change(this);"><option></option><?php echo optionlist($partition_by, $row["partition_by"]); ?></select>
-(<input name="partition" value="<?php echo htmlspecialchars($row["partition"]); ?>" />)
-<?php echo lang('Partitions'); ?>: <input name="partitions" size="2" value="<?php echo htmlspecialchars($row["partitions"]); ?>"<?php echo ($partition_table || !$row["partition_by"] ? " class='hidden'" : ""); ?> />
-</p>
+<select name="partition_by" onchange="partition_by_change(this);"><option><?php echo optionlist($partition_by, $row["partition_by"]); ?></select>
+(<input name="partition" value="<?php echo htmlspecialchars($row["partition"]); ?>">)
+<?php echo lang('Partitions'); ?>: <input name="partitions" size="2" value="<?php echo htmlspecialchars($row["partitions"]); ?>"<?php echo ($partition_table || !$row["partition_by"] ? " class='hidden'" : ""); ?>>
<table cellspacing="0" id="partition-table"<?php echo ($partition_table ? "" : " class='hidden'"); ?>>
-<thead><tr><th><?php echo lang('Partition name'); ?></th><th><?php echo lang('Values'); ?></th></tr></thead>
+<thead><tr><th><?php echo lang('Partition name'); ?><th><?php echo lang('Values'); ?></thead>
<?php
foreach ($row["partition_names"] as $key => $val) {
echo '<tr>';
- echo '<td><input name="partition_names[]" value="' . htmlspecialchars($val) . '"' . ($key == count($row["partition_names"]) - 1 ? ' onchange="partition_name_change(this);"' : '') . ' /></td>';
- echo '<td><input name="partition_values[]" value="' . htmlspecialchars($row["partition_values"][$key]) . '" /></td>';
- echo "</tr>\n";
+ echo '<td><input name="partition_names[]" value="' . htmlspecialchars($val) . '"' . ($key == count($row["partition_names"]) - 1 ? ' onchange="partition_name_change(this);"' : '') . '>';
+ echo '<td><input name="partition_values[]" value="' . htmlspecialchars($row["partition_values"][$key]) . '">';
}
?>
</table>
View
13 adminer/createv.inc.php
@@ -21,12 +21,11 @@
?>
<form action="" method="post">
-<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["select"]); ?></textarea></p>
+<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["select"]); ?></textarea>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1" /><?php } ?>
-<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-<?php if (strlen($_GET["createv"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
+<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php if (strlen($_GET["createv"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>
View
13 adminer/database.inc.php
@@ -69,16 +69,15 @@
<form action="" method="post">
<p>
-<?php echo ($_POST["add_x"] ? '<textarea name="name" rows="10" cols="40">' . htmlspecialchars($name) . '</textarea><br />' : '<input name="name" value="' . htmlspecialchars($name) . '" maxlength="64" />') . "\n"; ?>
-<select name="collation"><option value="">(<?php echo lang('collation'); ?>)</option><?php echo optionlist($collations, $collate); ?></select>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
+<?php echo ($_POST["add_x"] ? '<textarea name="name" rows="10" cols="40">' . htmlspecialchars($name) . '</textarea><br>' : '<input name="name" value="' . htmlspecialchars($name) . '" maxlength="64">') . "\n"; ?>
+<select name="collation"><option value="">(<?php echo lang('collation'); ?>)<?php echo optionlist($collations, $collate); ?></select>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if (strlen($_GET["db"])) {
- echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm />\n";
+ echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
} elseif (!$_POST["add_x"]) {
- echo "<input type='image' name='add' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' />\n";
+ echo "<input type='image' name='add' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
}
?>
-</p>
</form>
View
47 adminer/db.inc.php
@@ -31,7 +31,7 @@
$message = lang('Tables have been dropped.');
} else {
while ($row = $result->fetch_assoc()) {
- $message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "<br />";
+ $message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "<br>";
}
}
}
@@ -39,76 +39,73 @@
}
page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), $error, false);
-echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
-echo '<p><a href="' . htmlspecialchars($SELF) . 'schema=">' . lang('Database schema') . "</a></p>\n";
+echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a>\n";
+echo '<p><a href="' . htmlspecialchars($SELF) . 'schema=">' . lang('Database schema') . "</a>\n";
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$table_status = table_status();
if (!$table_status) {
- echo "<p class='message'>" . lang('No tables.') . "</p>\n";
+ echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='nowrap'>\n";
- echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="form_check(this, /^(tables|views)\[/);" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . '</td><td>' . lang('Comment') . "</td></tr></thead>\n";
+ echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="form_check(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . '<td>' . lang('Comment') . "</thead>\n";
foreach ($table_status as $row) {
$name = $row["Name"];
table_comment($row);
- echo '<tr' . odd() . '><td><input type="checkbox" name="' . (isset($row["Rows"]) ? 'tables' : 'views') . '[]" value="' . htmlspecialchars($name) . '"' . (in_array($name, $tables_views, true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');" /></td>';
+ echo '<tr' . odd() . '><td><input type="checkbox" name="' . (isset($row["Rows"]) ? 'tables' : 'views') . '[]" value="' . htmlspecialchars($name) . '"' . (in_array($name, $tables_views, true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');">';
if (isset($row["Rows"])) {
- echo '<th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '">' . htmlspecialchars($name) . "</a></th><td>$row[Engine]</td><td>$row[Collation]</td>";
+ echo '<th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '">' . htmlspecialchars($name) . "</a><td>$row[Engine]<td>$row[Collation]";
foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) {
$val = number_format($row[$key], 0, '.', lang(','));
- echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($name) . '">' . str_replace(" ", "&nbsp;", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '</a>' : '&nbsp;') . '</td>';
+ echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($name) . '">' . str_replace(" ", "&nbsp;", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '</a>' : '&nbsp;');
}
- echo "<td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : "&nbsp;") . "</td>";
+ echo "<td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : "&nbsp;");
} else {
- echo '<th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($name) . '">' . htmlspecialchars($name) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($name) . '">' . lang('View') . '</a></td>';
+ echo '<th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($name) . '">' . htmlspecialchars($name) . '</a><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($name) . '">' . lang('View') . '</a>';
}
- echo "</tr>\n";
}
echo "</table>\n";
- echo "<p><input type='hidden' name='token' value='$token' /><input type='submit' value='" . lang('Analyze') . "' /> <input type='submit' name='optimize' value='" . lang('Optimize') . "' /> <input type='submit' name='check' value='" . lang('Check') . "' /> <input type='submit' name='repair' value='" . lang('Repair') . "' /> <input type='submit' name='truncate' value='" . lang('Truncate') . "'$confirm /> <input type='submit' name='drop' value='" . lang('Drop') . "'$confirm /></p>\n";
+ echo "<p><input type='hidden' name='token' value='$token'><input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> <input type='submit' name='truncate' value='" . lang('Truncate') . "'$confirm> <input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
$dbs = get_databases();
if (count($dbs) != 1) {
$db = (isset($_POST["target"]) ? $_POST["target"] : $_GET["db"]);
- echo "<p>" . lang('Move to other database') . ($dbs ? ": <select name='target'>" . optionlist($dbs, $db) . "</select>" : ': <input name="target" value="' . htmlspecialchars($db) . '" />') . " <input type='submit' name='move' value='" . lang('Move') . "' /></p>\n";
+ echo "<p>" . lang('Move to other database') . ($dbs ? ": <select name='target'>" . optionlist($dbs, $db) . "</select>" : ': <input name="target" value="' . htmlspecialchars($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
}
echo "</form>\n";
}
if ($dbh->server_info >= 5) {
- echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=">' . lang('Create view') . "</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=">' . lang('Create view') . "</a>\n";
echo "<h3>" . lang('Routines') . "</h3>\n";
$result = $dbh->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $dbh->quote($_GET["db"]));
if ($result->num_rows) {
echo "<table cellspacing='0'>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
- echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
- echo '<th><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></th>';
- echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a></td>";
- echo "</tr>\n";
+ echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]);
+ echo '<th><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a>';
+ echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
}
echo "</table>\n";
}
$result->free();
- echo '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . htmlspecialchars($SELF) . 'function=">' . lang('Create function') . "</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . htmlspecialchars($SELF) . 'function=">' . lang('Create function') . "</a>\n";
}
if ($dbh->server_info >= 5.1 && ($result = $dbh->query("SHOW EVENTS"))) {
echo "<h3>" . lang('Events') . "</h3>\n";
if ($result->num_rows) {
echo "<table cellspacing='0'>\n";
- echo "<thead><tr><th>" . lang('Name') . "</th><td>" . lang('Schedule') . "</td><td>" . lang('Start') . "</td><td>" . lang('End') . "</td></tr></thead>\n";
+ echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
- echo '<th><a href="' . htmlspecialchars($SELF) . 'event=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th>";
- echo "<td>" . ($row["Execute at"] ? lang('At given time') . "</td><td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "</td><td>$row[Starts]") . "</td>";
- echo "<td>$row[Ends]</td>";
- echo "</tr>\n";
+ echo '<th><a href="' . htmlspecialchars($SELF) . 'event=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a>";
+ 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 "</table>\n";
}
$result->free();
- echo '<p><a href="' . htmlspecialchars($SELF) . 'event=">' . lang('Create event') . "</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'event=">' . lang('Create event') . "</a>\n";
}
View
28 adminer/dump.inc.php
@@ -162,39 +162,39 @@ function dump_triggers($table, $style) {
$db_style[] = 'CREATE+ALTER';
$table_style[] = 'CREATE+ALTER';
}
-echo "<tr><th>" . lang('Output') . "</th><td>$dump_output</td></tr>\n";
-echo "<tr><th>" . lang('Format') . "</th><td>$dump_format</td></tr>\n";
-echo "<tr><th>" . lang('Database') . "</th><td><select name='db_style'><option></option>" . optionlist($db_style, (strlen($_GET["db"]) ? '' : 'CREATE')) . "</select></td></tr>\n";
-echo "<tr><th>" . lang('Tables') . "</th><td><select name='table_style'><option></option>" . optionlist($table_style, 'DROP+CREATE') . "</select></td></tr>\n";
-echo "<tr><th>" . lang('Data') . "</th><td><select name='data_style'><option></option>" . optionlist($data_style, 'INSERT') . "</select></td></tr>\n";
+echo "<tr><th>" . lang('Output') . "<td>$dump_output\n";
+echo "<tr><th>" . lang('Format') . "<td>$dump_format\n";
+echo "<tr><th>" . lang('Database') . "<td><select name='db_style'><option>" . optionlist($db_style, (strlen($_GET["db"]) ? '' : 'CREATE')) . "</select>\n";
+echo "<tr><th>" . lang('Tables') . "<td><select name='table_style'><option>" . optionlist($table_style, 'DROP+CREATE') . "</select>\n";
+echo "<tr><th>" . lang('Data') . "<td><select name='data_style'><option>" . optionlist($data_style, 'INSERT') . "</select>\n";
?>
</table>
-<p><input type="submit" value="<?php echo lang('Export'); ?>" /></p>
+<p><input type="submit" value="<?php echo lang('Export'); ?>">
<table cellspacing="0">
<?php
if (strlen($_GET["db"])) {
$checked = (strlen($_GET["dump"]) ? "" : " checked='checked'");
echo "<thead><tr>";
- echo "<th align='left'><label><input type='checkbox' id='check-tables'$checked onclick='form_check(this, /^tables\\[/);' />" . lang('Tables') . "</label></th>";
- echo "<th align='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='form_check(this, /^data\\[/);' /></label></th>";
- echo "</tr></thead>\n";
+ echo "<th align='left'><label><input type='checkbox' id='check-tables'$checked onclick='form_check(this, /^tables\\[/);'>" . lang('Tables') . "</label>";
+ echo "<th align='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='form_check(this, /^data\\[/);'></label>";
+ echo "</thead>\n";
$views = "";
foreach (table_status() as $row) {
$checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'");
- $print = '<tr><td><label><input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-tables');\" />" . htmlspecialchars($row["Name"]) . "</label></td>";
+ $print = '<tr><td><label><input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-tables');\">" . htmlspecialchars($row["Name"]) . "</label>";
if (!$row["Engine"]) {
- $views .= "$print</tr>\n";
+ $views .= "$print\n";
} else {
- echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? lang('~ %s', $row["Rows"]) : $row["Rows"]) . '<input type="checkbox" name="data[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-data');\" /></label></td></tr>\n";
+ echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? lang('~ %s', $row["Rows"]) : $row["Rows"]) . '<input type="checkbox" name="data[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-data');\"></label>\n";
}
}
echo $views;
} else {
- echo "<thead><tr><th align='left'><label><input type='checkbox' id='check-databases' checked='checked' onclick='form_check(this, /^databases\\[/);' />" . lang('Database') . "</label></th></tr></thead>\n";
+ echo "<thead><tr><th align='left'><label><input type='checkbox' id='check-databases' checked='checked' onclick='form_check(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n";
foreach (get_databases() as $db) {
if (!information_schema($db)) {
- echo '<tr><td><label><input type="checkbox" name="databases[]" value="' . htmlspecialchars($db) . '" checked="checked" onclick="form_uncheck(\'check-databases\');" />' . htmlspecialchars($db) . "</label></td></tr>\n";
+ echo '<tr><td><label><input type="checkbox" name="databases[]" value="' . htmlspecialchars($db) . '" checked="checked" onclick="form_uncheck(\'check-databases\');">' . htmlspecialchars($db) . "</label>\n";
}
}
}
View
17 adminer/edit.inc.php
@@ -73,7 +73,7 @@
unset($create);
echo "<table cellspacing='0'>\n";
foreach ($fields as $name => $field) {
- echo "<tr><th>" . adminer_field_name($fields, $name) . "</th>";
+ echo "<tr><th>" . adminer_field_name($fields, $name);
$value = (isset($row)
? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
: ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : false))
@@ -85,29 +85,28 @@
$create = $dbh->result($dbh->query("SHOW CREATE TABLE " . idf_escape($_GET["edit"])), 1);
}
$checked = ($_POST ? $_POST["on_update"][bracket_escape($name)] : preg_match("~\n\\s*" . preg_quote(idf_escape($name), '~') . " timestamp.* on update CURRENT_TIMESTAMP~i", $create));
- echo '<label><input type="checkbox" name="on_update[' . htmlspecialchars(bracket_escape($name)) . ']" value="1"' . ($checked ? ' checked="checked"' : '') . ' />' . lang('ON UPDATE CURRENT_TIMESTAMP') . '</label>';
+ echo '<label><input type="checkbox" name="on_update[' . htmlspecialchars(bracket_escape($name)) . ']" value="1"' . ($checked ? ' checked="checked"' : '') . '>' . lang('ON UPDATE CURRENT_TIMESTAMP') . '</label>';
}
- echo "</td></tr>\n";
+ echo "\n";
}
echo "</table>\n";
}
?>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="hidden" name="save" value="1" />
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="hidden" name="save" value="1">
<?php
if (isset($_GET["select"])) {
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
}
if ($fields) {
- echo "<input type='submit' value='" . lang('Save') . "' />\n";
+ echo "<input type='submit' value='" . lang('Save') . "'>\n";
if (!isset($_GET["default"]) && !isset($_GET["select"])) {
- echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "' />\n";
+ echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n";
}
}
if ($update) {
- echo "<input type='submit' name='delete' value='" . lang('Delete') . "'$confirm />\n";
+ echo "<input type='submit' name='delete' value='" . lang('Delete') . "'$confirm>\n";
}
?>
-</p>
</form>
View
23 adminer/event.inc.php
@@ -36,18 +36,17 @@
<form action="" method="post">
<table cellspacing="0">
-<tr><th><?php echo lang('Name'); ?></th><td><input name="EVENT_NAME" value="<?php echo htmlspecialchars($row["EVENT_NAME"]); ?>" maxlength="64" /></td></tr>
-<tr><th><?php echo lang('Start'); ?></th><td><input name="STARTS" value="<?php echo htmlspecialchars("$row[EXECUTE_AT]$row[STARTS]"); ?>" /></td></tr>
-<tr><th><?php echo lang('End'); ?></th><td><input name="ENDS" value="<?php echo htmlspecialchars($row["ENDS"]); ?>" /></td></tr>
-<tr><th><?php echo lang('Every'); ?></th><td><input name="INTERVAL_VALUE" value="<?php echo htmlspecialchars($row["INTERVAL_VALUE"]); ?>" size="6" /> <select name="INTERVAL_FIELD"><?php echo optionlist($intervals, $row["INTERVAL_FIELD"]); ?></select></td></tr>
-<tr><th><?php echo lang('Status'); ?></th><td><select name="STATUS"><?php echo optionlist($statuses, $row["STATUS"]); ?></select></td></tr>
-<tr><th><?php echo lang('Comment'); ?></th><td><input name="EVENT_COMMENT" value="<?php echo htmlspecialchars($row["EVENT_COMMENT"]); ?>" maxlength="64" /></td></tr>
-<tr><th>&nbsp;</th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
+<tr><th><?php echo lang('Name'); ?><td><input name="EVENT_NAME" value="<?php echo htmlspecialchars($row["EVENT_NAME"]); ?>" maxlength="64">
+<tr><th><?php echo lang('Start'); ?><td><input name="STARTS" value="<?php echo htmlspecialchars("$row[EXECUTE_AT]$row[STARTS]"); ?>">
+<tr><th><?php echo lang('End'); ?><td><input name="ENDS" value="<?php echo htmlspecialchars($row["ENDS"]); ?>">
+<tr><th><?php echo lang('Every'); ?><td><input name="INTERVAL_VALUE" value="<?php echo htmlspecialchars($row["INTERVAL_VALUE"]); ?>" size="6"> <select name="INTERVAL_FIELD"><?php echo optionlist($intervals, $row["INTERVAL_FIELD"]); ?></select>
+<tr><th><?php echo lang('Status'); ?><td><select name="STATUS"><?php echo optionlist($statuses, $row["STATUS"]); ?></select>
+<tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo htmlspecialchars($row["EVENT_COMMENT"]); ?>" maxlength="64">
+<tr><th>&nbsp;<td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?>><?php echo lang('On completion preserve'); ?></label>
</table>
-<p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["EVENT_DEFINITION"]); ?></textarea></p>
+<p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["EVENT_DEFINITION"]); ?></textarea>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-<?php if (strlen($_GET["event"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php if (strlen($_GET["event"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>
View
28 adminer/foreign.inc.php
@@ -15,7 +15,7 @@
. (in_array($_POST["on_delete"], $on_actions) ? " ON DELETE $_POST[on_delete]" : "")
. (in_array($_POST["on_update"], $on_actions) ? " ON UPDATE $_POST[on_update]" : "")
, $SELF . "table=" . urlencode($_GET["foreign"]), (strlen($_GET["name"]) ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
- $error = lang('Source and target columns must have the same data type and there must be an index on the target columns.') . "<br />$error";
+ $error = lang('Source and target columns must have the same data type and there must be an index on the target columns.') . "<br>$error";
}
}
page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]);
@@ -44,30 +44,26 @@
<p>
<?php echo lang('Target table'); ?>:
<select name="table" onchange="this.form['change-js'].value = '1'; this.form.submit();"><?php echo optionlist(array_keys(table_status_referencable()), $row["table"]); ?></select>
-<input type="hidden" name="change-js" value="" />
-</p>
-<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>" /></p></noscript>
+<input type="hidden" name="change-js" value="">
+<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
<table cellspacing="0">
-<thead><tr><th><?php echo lang('Source'); ?></th><th><?php echo lang('Target'); ?></th></tr></thead>
+<thead><tr><th><?php echo lang('Source'); ?><th><?php echo lang('Target'); ?></thead>
<?php
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
- echo "<td><select name='source[" . intval($key) . "]'" . ($j == count($row["source"]) - 1 ? " onchange='foreign_add_row(this);'" : "") . "><option></option>" . optionlist($source, $val) . "</select></td>";
- echo "<td><select name='target[" . intval($key) . "]'>" . optionlist($target, $row["target"][$key]) . "</select></td>";
- echo "</tr>\n";
+ echo "<td><select name='source[" . intval($key) . "]'" . ($j == count($row["source"]) - 1 ? " onchange='foreign_add_row(this);'" : "") . "><option>" . optionlist($source, $val) . "</select>";
+ echo "<td><select name='target[" . intval($key) . "]'>" . optionlist($target, $row["target"][$key]) . "</select>";
$j++;
}
?>
</table>
<p>
-<?php echo lang('ON DELETE'); ?>: <select name="on_delete"><option></option><?php echo optionlist($on_actions, $row["on_delete"]); ?></select>
-<?php echo lang('ON UPDATE'); ?>: <select name="on_update"><option></option><?php echo optionlist($on_actions, $row["on_update"]); ?></select>
-</p>
+<?php echo lang('ON DELETE'); ?>: <select name="on_delete"><option><?php echo optionlist($on_actions, $row["on_delete"]); ?></select>
+<?php echo lang('ON UPDATE'); ?>: <select name="on_update"><option><?php echo optionlist($on_actions, $row["on_update"]); ?></select>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-<?php if (strlen($_GET["name"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
-</p>
-<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>" /></p></noscript>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php if (strlen($_GET["name"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
+<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
</form>
View
29 adminer/include/adminer.inc.php
@@ -54,7 +54,7 @@ function adminer_select_links($table_status) {
function adminer_select_query($query) {
global $SELF;
// it would be nice if $query can be passed by reference and printed value would be returned but call_user() doesn't allow reference parameters
- return call_adminer('select_query', "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a></p>\n", $query);
+ return call_adminer('select_query', "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n", $query);
}
/** Query printed after execution in the message
@@ -80,37 +80,34 @@ function adminer_navigation($missing) {
<p>
<a href="<?php echo htmlspecialchars($SELF); ?>sql="><?php echo lang('SQL command'); ?></a>
<a href="<?php echo htmlspecialchars($SELF); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo lang('Dump'); ?></a>
-<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]; ?>" />
-<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" />
-</p>
+<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]; ?>">
+<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</form>
<form action="">
-<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
+<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>"><?php } ?>
<?php if ($databases) { ?>
-<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option><?php echo optionlist($databases, $_GET["db"]); ?></select>
+<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)<?php echo optionlist($databases, $_GET["db"]); ?></select>
<?php } else { ?>
-<input name="db" value="<?php echo htmlspecialchars($_GET["db"]); ?>" />
+<input name="db" value="<?php echo htmlspecialchars($_GET["db"]); ?>">
<?php } ?>
-<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?>
-<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value="" /><?php } ?>
-<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value="" /><?php } ?>
-<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?> />
-</p>
+<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value=""><?php } ?>
+<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value=""><?php } ?>
+<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value=""><?php } ?>
+<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
</form>
<?php
if ($missing != "db" && strlen($_GET["db"])) {
$table_status = table_status();
if (!$table_status) {
- echo "<p class='message'>" . lang('No tables.') . "</p>\n";
+ echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<p>\n";
foreach ($table_status as $row) {
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '">' . lang('select') . '</a> ';
- echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Rows"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '">' . adminer_table_name($row) . "</a><br />\n";
+ echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Rows"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '">' . adminer_table_name($row) . "</a><br>\n";
}
- echo "</p>\n";
}
- echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a>\n";
}
}
}
View
12 adminer/include/auth.inc.php
@@ -44,19 +44,19 @@ function auth_error($exception = null) {
?>
<form action="" method="post">
<table cellspacing="0">
- <tr><th><?php echo lang('Server'); ?></th><td><input name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /></td></tr>
- <tr><th><?php echo lang('Username'); ?></th><td><input name="username" value="<?php echo htmlspecialchars($username); ?>" /></td></tr>
- <tr><th><?php echo lang('Password'); ?></th><td><input type="password" name="password" /></td></tr>
+ <tr><th><?php echo lang('Server'); ?><td><input name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>">
+ <tr><th><?php echo lang('Username'); ?><td><input name="username" value="<?php echo htmlspecialchars($username); ?>">
+ <tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
<p>
<?php
hidden_fields($_POST, $ignore); // expired session
foreach ($_FILES as $key => $val) {
- echo '<input type="hidden" name="files[' . htmlspecialchars($key) . ']" value="' . ($val["error"] ? $val["error"] : base64_encode(file_get_contents($val["tmp_name"]))) . '" />';
+ echo '<input type="hidden" name="files[' . htmlspecialchars($key) . ']" value="' . ($val["error"] ? $val["error"] : base64_encode(file_get_contents($val["tmp_name"]))) . '">';
}
?>
- <input type="submit" value="<?php echo lang('Login'); ?>" />
- </p>
+ <input type="submit" value="<?php echo lang('Login'); ?>">
+
</form>
<?php
page_footer("auth");
View
6 adminer/include/connect.inc.php
@@ -11,10 +11,10 @@ function connect_error() {
'processlist' => lang('Process list'),
'variables' => lang('Variables'),
) as $key => $val) {
- echo '<p><a href="' . htmlspecialchars($SELF) . "$key=\">$val</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . "$key=\">$val</a>\n";
}
- echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "</p>\n";
- echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "</p>\n";
+ echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "\n";
+ echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "\n";
}
page_footer("db");
}
View
23 adminer/include/design.inc.php
@@ -3,19 +3,17 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $SELF, $LANG, $VERSION;
header("Content-Type: text/html; charset=utf-8");
?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $LANG; ?>">
-<head>
-<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" />
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="<?php echo $LANG; ?>">
+<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 . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . (strlen($_GET["server"]) && $_GET["server"] != "localhost" ? htmlspecialchars("- $_GET[server]") : "") . " - " . adminer_name(); ?></title>
-<link rel="shortcut icon" type="image/x-icon" href="../adminer/favicon.ico" />
-<link rel="stylesheet" type="text/css" href="../adminer/default.css<?php // Ondrej Valka, http://valka.info ?>" />
+<link rel="shortcut icon" type="image/x-icon" href="../adminer/favicon.ico">
+<link rel="stylesheet" type="text/css" href="../adminer/default.css<?php // Ondrej Valka, http://valka.info ?>">
<?php if (file_exists("adminer.css")) { ?>
-<link rel="stylesheet" type="text/css" href="adminer.css" />
+<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
-</head>
<body onload="body_load();<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verify_version('$VERSION');"); ?>">
<script type="text/javascript" src="../adminer/functions.js"></script>
@@ -37,7 +35,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
}
}
}
- echo "$title</p>\n";
+ echo "$title\n";
}
echo "<h2>$title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . "</h2>\n";
if ($_SESSION["messages"]) {
@@ -69,8 +67,5 @@ function page_footer($missing = false) {
</h1>
<?php adminer_navigation($missing); ?>
</div>
-
-</body>
-</html>
<?php
}
View
50 adminer/include/editing.inc.php
@@ -20,12 +20,12 @@ function referencable_primary($self) {
function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $types, $unsigned, $inout;
?>
-<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_keys($types) + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select></td>
-<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3" /></td>
+<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_keys($types) + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
+<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3">
<td><?php
-echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')</option>' . optionlist($collations, $field["collation"]) . '</select>';
-echo ($unsigned ? " <select name=\"$key" . '[unsigned]"' . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option></option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
-?></td>
+echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
+echo ($unsigned ? " <select name=\"$key" . '[unsigned]"' . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
+?>
<?php
}
@@ -48,38 +48,38 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
}
?>
<thead><tr>
-<?php if ($type == "PROCEDURE") { ?><td><?php echo lang('IN-OUT'); ?></td><?php } ?>
-<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?></th>
-<td><?php echo lang('Type'); ?></td>
-<td><?php echo lang('Length'); ?></td>
-<td><?php echo lang('Options'); ?></td>
+<?php if ($type == "PROCEDURE") { ?><td><?php echo lang('IN-OUT'); ?><?php } ?>
+<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
+<td><?php echo lang('Type'); ?>
+<td><?php echo lang('Length'); ?>
+<td><?php echo lang('Options'); ?>
<?php if ($type == "TABLE") { ?>
-<td><?php echo lang('NULL'); ?></td>
-<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
-<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
+<td><?php echo lang('NULL'); ?>
+<td><input type="radio" name="auto_increment_col" value=""><?php echo lang('Auto Increment'); ?>
+<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?>
<?php } ?>
-<td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' />"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
-</tr></thead>
+<td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
+</thead>
<?php
foreach ($fields as $i => $field) {
$i++;
$display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i]));
?>
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
-<?php if ($type == "PROCEDURE") { ?><td><select name="fields[<?php echo $i; ?>][inout]"><?php echo optionlist($inout, $field["inout"]); ?></select></td><?php } ?>
-<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo htmlspecialchars($field["field"]); ?>" onchange="<?php echo (strlen($field["field"]) || count($fields) > 1 ? "" : "editing_add_row(this, $allowed); "); ?>editing_name_change(this);" maxlength="64" /><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>" /></th>
+<?php if ($type == "PROCEDURE") { ?><td><select name="fields[<?php echo $i; ?>][inout]"><?php echo optionlist($inout, $field["inout"]); ?></select><?php } ?>
+<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo htmlspecialchars($field["field"]); ?>" onchange="<?php echo (strlen($field["field"]) || count($fields) > 1 ? "" : "editing_add_row(this, $allowed); "); ?>editing_name_change(this);" maxlength="64"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>">
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
<?php if ($type == "TABLE") { ?>
-<td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked="checked"<?php } ?> /></td>
-<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked="checked"<?php } ?> /></td>
-<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo htmlspecialchars($field["comment"]); ?>" maxlength="255" /></td>
+<td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked="checked"<?php } ?>>
+<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked="checked"<?php } ?>>
+<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo htmlspecialchars($field["comment"]); ?>" maxlength="255">
<?php } ?>
<?php
- echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;' />";
- echo "&nbsp;<input type='image' name='drop_col[$i]' src='../adminer/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);' />";
- echo "&nbsp;<input type='image' name='up[$i]' src='../adminer/up.gif' alt='^' title='" . lang('Move up') . "' />";
- echo "&nbsp;<input type='image' name='down[$i]' src='../adminer/down.gif' alt='v' title='" . lang('Move down') . "' />";
- echo "</td>\n</tr>\n";
+ echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;'>";
+ echo "&nbsp;<input type='image' name='drop_col[$i]' src='../adminer/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);'>";
+ echo "&nbsp;<input type='image' name='up[$i]' src='../adminer/up.gif' alt='^' title='" . lang('Move up') . "'>";
+ echo "&nbsp;<input type='image' name='down[$i]' src='../adminer/down.gif' alt='v' title='" . lang('Move down') . "'>";
+ echo "\n\n";
}
return $column_comments;
}
View
4 adminer/include/export.inc.php
@@ -155,6 +155,6 @@ function dump_headers($identifier, $multi_table = false) {
return $ext;
}
-$dump_output = "<select name='output'><option value='text'>" . lang('open') . "</option><option value='file'>" . lang('save') . "</option></select>";
-$dump_format = "<select name='format'><option value='sql'>" . lang('SQL') . "</option><option value='csv'>" . lang('CSV') . "</option></select>";
+$dump_output = "<select name='output'><option value='text'>" . lang('open') . "<option value='file'>" . lang('save') . "</select>";
+$dump_format = "<select name='format'><option value='sql'>" . lang('SQL') . "<option value='csv'>" . lang('CSV') . "</select>";
$max_packet = 1048576; // default, minimum is 1024
View
29 adminer/include/functions.inc.php
@@ -20,7 +20,7 @@ function optionlist($options, $selected = null) {
$return .= '<optgroup label="' . htmlspecialchars($k) . '">';
}
foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) {
- $return .= '<option' . (is_string($key) ? ' value="' . htmlspecialchars($key) . '"' : '') . ((is_string($key) ? $key : $val) === $selected ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
+ $return .= '<option' . (is_string($key) ? ' value="' . htmlspecialchars($key) . '"' : '') . ((is_string($key) ? $key : $val) === $selected ? ' selected="selected"' : '') . '>' . htmlspecialchars($val);
}
if (is_array($v)) {
$return .= '</optgroup>';
@@ -159,7 +159,7 @@ function odd($s = ' class="odd"') {
function select($result, $dbh2 = null) {
global $SELF;
if (!$result->num_rows) {
- echo "<p class='message'>" . lang('No rows.') . "</p>\n";
+ echo "<p class='message'>" . lang('No rows.') . "\n";
} else {
echo "<table cellspacing='0' class='nowrap'>\n";
$links = array(); // colno => orgtable - create links from these columns
@@ -195,9 +195,9 @@ function select($result, $dbh2 = null) {
$blobs[$j] = true;
}
$types[$j] = $field->type;
- echo "<th>" . htmlspecialchars($field->name) . "</th>";
+ echo "<th>" . htmlspecialchars($field->name);
}
- echo "</tr></thead>\n";
+ echo "</thead>\n";
}
echo "<tr" . odd() . ">";
foreach ($row as $key => $val) {
@@ -222,9 +222,8 @@ function select($result, $dbh2 = null) {
$val = '<a href="' . htmlspecialchars($SELF) . $link . '">' . $val . '</a>';
}
}
- echo "<td>$val</td>";
+ echo "<td>$val";
}
- echo "</tr>\n";
}
echo "</table>\n";
}
@@ -253,7 +252,7 @@ function hidden_fields($process, $ignore = array()) {
$process[$key . "[$k]"] = $v;
}
} elseif (!in_array($key, $ignore)) {
- echo '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
+ echo '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '">';
}
}
}
@@ -263,18 +262,18 @@ function input($name, $field, $value) {
$name = htmlspecialchars(bracket_escape($name));
echo "<td class='function'>";
if ($field["type"] == "enum") {
- echo "&nbsp;</td><td>" . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
+ echo "&nbsp;<td>" . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked"><em>' . lang('original') . '</em></label>' : "");
if ($field["null"] || isset($_GET["default"])) {
- echo ' <label><input type="radio" name="fields[' . $name . ']" value=""' . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked="checked"') . ' />' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
+ echo ' <label><input type="radio" name="fields[' . $name . ']" value=""' . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked="checked"') . '>' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
}
if (!isset($_GET["default"])) {
- echo '<input type="radio" name="fields[' . $name . ']" value="0"' . ($value === 0 ? ' checked="checked"' : '') . ' />';
+ echo '<input type="radio" name="fields[' . $name . ']" value="0"' . ($value === 0 ? ' checked="checked"' : '') . '>';
}
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : $value === $val);
- echo ' <label><input type="radio" name="fields[' . $name . ']" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . ' />' . htmlspecialchars($val) . '</label>';
+ echo ' <label><input type="radio" name="fields[' . $name . ']" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . '>' . htmlspecialchars($val) . '</label>';
}
} else {
$first = ($field["null"] || isset($_GET["default"])) + isset($_GET["select"]);
@@ -302,22 +301,22 @@ function input($name, $field, $value) {
if ($field["null"] || isset($_GET["default"])) {
array_unshift($options, "NULL");
}
- echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, ($value === false ? null : (isset($value) ? (string) $_POST["function"][$name] : 'NULL'))) . '</select>' : "&nbsp;") . '</td><td>';
+ echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') : '') . optionlist($options, ($value === false ? null : (isset($value) ? (string) $_POST["function"][$name] : 'NULL'))) . '</select>' : "&nbsp;") . '<td>';
if ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
- echo ' <label><input type="checkbox" name="fields[' . $name . '][' . $i . ']" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : 1 << $i) . '"' . ($checked ? ' checked="checked"' : '') . $onchange . ' />' . htmlspecialchars($val) . '</label>';
+ echo ' <label><input type="checkbox" name="fields[' . $name . '][' . $i . ']" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : 1 << $i) . '"' . ($checked ? ' checked="checked"' : '') . $onchange . '>' . htmlspecialchars($val) . '</label>';
}
} elseif (strpos($field["type"], "text") !== false) {
echo '<textarea name="fields[' . $name . ']" cols="50" rows="12"' . $onchange . '>' . htmlspecialchars($value) . '</textarea>';
} elseif (preg_match('~binary|blob~', $field["type"])) {
- echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . ' />' : lang('File uploads are disabled.') . ' ');
+ echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . '>' : lang('File uploads are disabled.') . ' ');
} else {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
- echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . ($maxlength ? " maxlength='$maxlength'" : "") . $onchange . ' />';
+ echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . ($maxlength ? " maxlength='$maxlength'" : "") . $onchange . '>';
}
}
}
View
4 adminer/include/lang.inc.php
@@ -33,9 +33,9 @@ function switch_lang() {
hidden_fields($_GET, array('lang'));
echo lang('Language') . ": <select name='lang' onchange='this.form.submit();'>";
foreach ($langs as $lang => $val) {
- echo "<option value='$lang'" . ($LANG == $lang ? " selected='selected'" : "") . ">$val</option>";
+ echo "<option value='$lang'" . ($LANG == $lang ? " selected='selected'" : "") . ">$val";
}
- echo "</select>\n<noscript><div style='display: inline;'><input type='submit' value='" . lang('Use') . "' /></div></noscript>\n</div>\n</form>\n";
+ echo "</select>\n<noscript><div style='display: inline;'><input type='submit' value='" . lang('Use') . "'></div></noscript>\n</div>\n</form>\n";
}
if (isset($_GET["lang"])) {
View
17 adminer/indexes.inc.php
@@ -65,24 +65,23 @@
<form action="" method="post">
<table cellspacing="0">
-<thead><tr><th><?php echo lang('Index Type'); ?></th><th><?php echo lang('Column (length)'); ?></th></tr></thead>
+<thead><tr><th><?php echo lang('Index Type'); ?><th><?php echo lang('Column (length)'); ?></thead>
<?php
$j = 0;
foreach ($row["indexes"] as $index) {
- echo "<tr><td><select name='indexes[$j][type]'" . ($j == count($row["indexes"]) - 1 ? " onchange='indexes_add_row(this);'" : "") . "><option></option>" . optionlist($index_types, $index["type"]) . "</select></td><td>\n";
+ echo "<tr><td><select name='indexes[$j][type]'" . ($j == count($row["indexes"]) - 1 ? " onchange='indexes_add_row(this);'" : "") . "><option>" . optionlist($index_types, $index["type"]) . "</select><td>\n";
ksort($index["columns"]);
foreach ($index["columns"] as $i => $column) {
- echo "<span><select name='indexes[$j][columns][$i]'" . ($i == count($index["columns"]) ? " onchange='indexes_add_column(this);'" : "") . "><option></option>" . optionlist($fields, $column) . "</select>";
- echo "<input name='indexes[$j][lengths][$i]' size='2' value=\"" . htmlspecialchars($index["lengths"][$i]) . "\" /> </span>\n";
+ echo "<span><select name='indexes[$j][columns][$i]'" . ($i == count($index["columns"]) ? " onchange='indexes_add_column(this);'" : "") . "><option>" . optionlist($fields, $column) . "</select>";
+ echo "<input name='indexes[$j][lengths][$i]' size='2' value=\"" . htmlspecialchars($index["lengths"][$i]) . "\"> </span>\n";
}
- echo "</td></tr>\n";
+ echo "\n";
$j++;
}
?>
</table>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-</p>
-<noscript><p><input type="submit" name="add" value="<?php echo lang('Add next'); ?>" /></p></noscript>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<noscript><p><input type="submit" name="add" value="<?php echo lang('Add next'); ?>"></noscript>
</form>
View
18 adminer/privileges.inc.php
@@ -1,24 +1,24 @@
<?php
page_header(lang('Privileges'));
-echo '<p><a href="' . htmlspecialchars($SELF) . 'user=">' . lang('Create user') . "</a></p>";
+echo '<p><a href="' . htmlspecialchars($SELF) . 'user=">' . lang('Create user') . "</a>";
$result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
if (!$result) {
?>
<form action=""><p>
- <?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
- <?php echo lang('Username'); ?>: <input name="user" />
- <?php echo lang('Server'); ?>: <input name="host" value="localhost" />
- <input type="hidden" name="grant" value="" />
- <input type="submit" value="<?php echo lang('Edit'); ?>" />
- </p></form>
+ <?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>"><?php } ?>
+ <?php echo lang('Username'); ?>: <input name="user">
+ <?php echo lang('Server'); ?>: <input name="host" value="localhost">
+ <input type="hidden" name="grant" value="">
+ <input type="submit" value="<?php echo lang('Edit'); ?>">
+ </form>
<?php
// list logged user, information_schema.USER_PRIVILEGES lists just the current user too
$result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
}
echo "<table cellspacing='0'>\n";
-echo "<thead><tr><th>&nbsp;</th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
+echo "<thead><tr><th>&nbsp;<th>" . lang('Username') . "<th>" . lang('Server') . "</thead>\n";
while ($row = $result->fetch_assoc()) {
- echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
+ echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('edit') . '</a><td>' . htmlspecialchars($row["User"]) . "<td>" . htmlspecialchars($row["Host"]) . "\n";
}
echo "</table>\n";
$result->free();
View
15 adminer/procedure.inc.php
@@ -40,14 +40,13 @@
<form action="" method="post" id="form">
<table cellspacing="0">
<?php edit_fields($row["fields"], $collations, $routine); ?>
-<?php if (isset($_GET["function"])) { ?><tr><td><?php echo lang('Return type'); ?></td><?php echo edit_type("returns", $row["returns"], $collations); ?></tr><?php } ?>
+<?php if (isset($_GET["function"])) { ?><tr><td><?php echo lang('Return type'); ?><?php echo edit_type("returns", $row["returns"], $collations); ?><?php } ?>
</table>
-<p><textarea name="definition" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["definition"]); ?></textarea></p>
+<p><textarea name="definition" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["definition"]); ?></textarea>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1" /><?php } ?>
-<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64" />
-<input type="submit" value="<?php echo lang('Save'); ?>" />
-<?php if (strlen($_GET["procedure"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
+<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php if (strlen($_GET["procedure"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>
View
9 adminer/processlist.inc.php
@@ -17,15 +17,14 @@
$result = $dbh->query("SHOW PROCESSLIST");
for ($i=0; $row = $result->fetch_assoc(); $i++) {
if (!$i) {
- echo "<thead><tr lang='en'><th>&nbsp;</th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
+ echo "<thead><tr lang='en'><th>&nbsp;<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
}
- echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
+ echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]'><td>" . implode("<td>", $row) . "\n";
}
$result->free();
?>
</table>
<p>
-<input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Kill'); ?>" />
-</p>
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Kill'); ?>">
</form>
View
4 adminer/schema.inc.php
@@ -60,7 +60,7 @@
<?php
foreach ($schema as $name => $table) {
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event);'>";
- echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br />\n";
+ echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br>\n";
foreach ($table["fields"] as $field) {
$val = htmlspecialchars($field["field"]);
$title = ' title="' . htmlspecialchars($field["full_type"] . ($field["null"] ? " " . lang('NULL') : '')) . '"';
@@ -75,7 +75,7 @@
} else {
$val = "<span$title>$val</span>";
}
- echo ($field["primary"] ? "<em>$val</em>" : $val) . "<br />\n";
+ echo ($field["primary"] ? "<em>$val</em>" : $val) . "<br>\n";
}
foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) {
View
78 adminer/select.inc.php
@@ -162,79 +162,78 @@
echo '<a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '">' . lang('New item') . '</a> ';
}
echo adminer_select_links($table_status);
-echo "</p>\n";
if (!$columns) {
- echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".</p>\n";
+ echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".\n";
} else {
echo "<form action='' id='form'>\n";
echo '<fieldset><legend><a href="#fieldset-select" onclick="return !toggle(\'fieldset-select\');">' . lang('Select') . "</a></legend><div id='fieldset-select'" . ($select ? "" : " class='hidden'") . ">\n";
if (strlen($_GET["server"])) {
- echo '<input type="hidden" name="server" value="' . htmlspecialchars($_GET["server"]) . '" />';
+ echo '<input type="hidden" name="server" value="' . htmlspecialchars($_GET["server"]) . '">';
}
- echo '<input type="hidden" name="db" value="' . htmlspecialchars($_GET["db"]) . '" />';
- echo '<input type="hidden" name="select" value="' . htmlspecialchars($_GET["select"]) . '" />';
+ echo '<input type="hidden" name="db" value="' . htmlspecialchars($_GET["db"]) . '">';
+ echo '<input type="hidden" name="select" value="' . htmlspecialchars($_GET["select"]) . '">';
echo "\n";
$i = 0;
$fun_group = array(lang('Functions') => $functions, lang('Aggregation') => $grouping);
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
- echo "<div><select name='columns[$i][fun]'><option></option>" . optionlist($fun_group, $val["fun"]) . "</select>";
- echo "<select name='columns[$i][col]'><option></option>" . optionlist($columns, $val["col"]) . "</select></div>\n";
+ echo "<div><select name='columns[$i][fun]'><option>" . optionlist($fun_group, $val["fun"]) . "</select>";
+ echo "<select name='columns[$i][col]'><option>" . optionlist($columns, $val["col"]) . "</select></div>\n";
$i++;
}
- echo "<div><select name='columns[$i][fun]' onchange='this.nextSibling.onchange();'><option></option>" . optionlist($fun_group) . "</select>";
- echo "<select name='columns[$i][col]' onchange='select_add_row(this);'><option></option>" . optionlist($columns) . "</select></div>\n";
+ echo "<div><select name='columns[$i][fun]' onchange='this.nextSibling.onchange();'><option>" . optionlist($fun_group) . "</select>";
+ echo "<select name='columns[$i][col]' onchange='select_add_row(this);'><option>" . optionlist($columns) . "</select></div>\n";
echo "</div></fieldset>\n";
echo '<fieldset><legend><a href="#fieldset-search" onclick="return !toggle(\'fieldset-search\');">' . lang('Search') . "</a></legend><div id='fieldset-search'" . ($where ? "" : " class='hidden'") . ">\n";
foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT") {
echo "(<i>" . implode("</i>, <i>", array_map('htmlspecialchars', $index["columns"])) . "</i>) AGAINST";
- echo ' <input name="fulltext[' . $i . ']" value="' . htmlspecialchars($_GET["fulltext"][$i]) . '" />';
- echo "<label><input type='checkbox' name='boolean[$i]' value='1'" . (isset($_GET["boolean"][$i]) ? " checked='checked'" : "") . " />" . lang('BOOL') . "</label>";
- echo "<br />\n";
+ echo ' <input name="fulltext[' . $i . ']" value="' . htmlspecialchars($_GET["fulltext"][$i]) . '">';
+ echo "<label><input type='checkbox' name='boolean[$i]' value='1'" . (isset($_GET["boolean"][$i]) ? " checked='checked'" : "") . ">" . lang('BOOL') . "</label>";
+ echo "<br>\n";
}
}
$i = 0;
foreach ((array) $_GET["where"] as $val) {
if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
- echo "<div><select name='where[$i][col]'><option value=''>" . lang('(anywhere)') . "</option>" . optionlist($columns, $val["col"]) . "</select>";
+ echo "<div><select name='where[$i][col]'><option value=''>" . lang('(anywhere)') . optionlist($columns, $val["col"]) . "</select>";
echo "<select name='where[$i][op]'>" . optionlist($operators, $val["op"]) . "</select>";
- echo "<input name='where[$i][val]' value=\"" . htmlspecialchars($val["val"]) . "\" /></div>\n";
+ echo "<input name='where[$i][val]' value=\"" . htmlspecialchars($val["val"]) . "\"></div>\n";
$i++;
}
}
- echo "<div><select name='where[$i][col]' onchange='select_add_row(this);'><option value=''>" . lang('(anywhere)') . "</option>" . optionlist($columns) . "</select>";
+ echo "<div><select name='where[$i][col]' onchange='select_add_row(this);'><option value=''>" . lang('(anywhere)') . optionlist($columns) . "</select>";
echo "<select name='where[$i][op]'>" . optionlist($operators) . "</select>";
- echo "<input name='where[$i][val]' /></div>\n";
+ echo "<input name='where[$i][val]'></div>\n";
echo "</div></fieldset>\n";
echo '<fieldset><legend><a href="#fieldset-sort" onclick="return !toggle(\'fieldset-sort\');">' . lang('Sort') . "</a></legend><div id='fieldset-sort'" . (count($order) > 1 ? "" : " class='hidden'") . ">\n";
$i = 0;
foreach ((array) $_GET["order"] as $key => $val) {
if (isset($columns[$val])) {
- echo "<div><select name='order[$i]'><option></option>" . optionlist($columns, $val) . "</select>";
- echo "<label><input type='checkbox' name='desc[$i]' value='1'" . (isset($_GET["desc"][$key]) ? " checked='checked'" : "") . " />" . lang('descending') . "</label></div>\n";
+ echo "<div><select name='order[$i]'><option>" . optionlist($columns, $val) . "</select>";
+ echo "<label><input type='checkbox' name='desc[$i]' value='1'" . (isset($_GET["desc"][$key]) ? " checked='checked'" : "") . ">" . lang('descending') . "</label></div>\n";
$i++;
}
}
- echo "<div><select name='order[$i]' onchange='select_add_row(this);'><option></option>" . optionlist($columns) . "</select>";
- echo "<label><input type='checkbox' name='desc[$i]' value='1' />" . lang('descending') . "</label></div>\n";
+ echo "<div><select name='order[$i]' onchange='select_add_row(this);'><option>" . optionlist($columns) . "</select>";
+ echo "<label><input type='checkbox' name='desc[$i]' value='1'>" . lang('descending') . "</label></div>\n";
echo "</div></fieldset>\n";
echo "<fieldset><legend>" . lang('Limit') . "</legend><div>"; // <div> for easy styling
- echo "<input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\" />";
+ echo "<input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\">";
echo "</div></fieldset>\n";
if (isset($text_length)) {
echo "<fieldset><legend>" . lang('Text length') . "</legend><div>";
- echo "<input name='text_length' size='3' value=\"" . htmlspecialchars($text_length) . "\" />";
+ echo "<input name='text_length' size='3' value=\"" . htmlspecialchars($text_length) . "\">";
echo "</div></fieldset>\n";
}
echo "<fieldset><legend>" . lang('Action') . "</legend><div>";
- echo "<input type='submit' value='" . lang('Select') . "' />";
+ echo "<input type='submit' value='" . lang('Select') . "'>";
echo "</div></fieldset>\n";
echo "</form>\n";
@@ -243,11 +242,11 @@
$result = $dbh->query($query);
if (!$result) {
- echo "<p class='error'>" . htmlspecialchars($dbh->error) . "</p>\n";
+ echo "<p class='error'>" . htmlspecialchars($dbh->error) . "\n";
} else {
echo "<form action='' method='post' enctype='multipart/form-data'>\n";
if (!$result->num_rows) {
- echo "<p class='message'>" . lang('No rows.') . "</p>\n";
+ echo "<p class='message'>" . lang('No rows.') . "\n";
} else {
$foreign_keys = array();
foreach (foreign_keys($_GET["select"]) as $foreign_key) {
@@ -261,14 +260,14 @@
echo "<table cellspacing='0' class='nowrap'>\n";
for ($j=0; $row = $result->fetch_assoc(); $j++) {
if (!$j) {
- echo '<thead><tr><td><input type="checkbox" id="all-page" onclick="form_check(this, /check/);" /></td>';
+ echo '<thead><tr><td><input type="checkbox" id="all-page" onclick="form_check(this, /check/);">';
foreach ($row as $key => $val) {
- echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . adminer_field_name($fields, $key) . '</a></th>';
+ echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . adminer_field_name($fields, $key) . '</a>';
}
- echo "</tr></thead>\n";
+ echo "</thead>\n";
}
$unique_idf = implode('&amp;', unique_idf($row, $indexes)); //! don't use aggregation functions
- echo '<tr' . odd() . '><td><input type="checkbox" name="check[]" value="' . $unique_idf . '" onclick="this.form[\'all\'].checked = false; form_uncheck(\'all-page\');" />' . (count($select) != count($group) || information_schema($_GET["db"]) ? '' : ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . '</a>') . '</td>';
+ echo '<tr' . odd() . '><td><input type="checkbox" name="check[]" value="' . $unique_idf . '" onclick="this.form[\'all\'].checked = false; form_uncheck(\'all-page\');">' . (count($select) != count($group) || information_schema($_GET["db"]) ? '' : ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . '</a>');
foreach ($row as $key => $val) {
if (strlen($val) && (!isset($email_fields[$key]) || $email_fields[$key])) {
$email_fields[$key] = is_email($val); //! filled e-mails may be contained on other pages
@@ -300,9 +299,8 @@
}
}
}
- echo "<td>$val</td>";
+ echo "<td>$val";
}
- echo "</tr>\n";
}
echo "</table>\n";
@@ -328,23 +326,23 @@
}
print_pagination($max_page);
}
- echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1" />' . lang('whole result') . "</label></p>\n";
+ echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1">' . lang('whole result') . "</label>\n";
- echo (information_schema($_GET["db"]) ? "" : "<fieldset><legend>" . lang('Edit') . "</legend><div><input type='submit' value='" . lang('Edit') . "' /> <input type='submit' name='clone' value='" . lang('Clone') . "' /> <input type='submit' name='delete' value='" . lang('Delete') . "'$confirm /></div></fieldset>\n");
- echo "<fieldset><legend>" . lang('Export') . "</legend><div>$dump_output $dump_format <input type='submit' name='export' value='" . lang('Export') . "' /></div></fieldset>\n";
+ echo (information_schema($_GET["db"]) ? "" : "<fieldset><legend>" . lang('Edit') . "</legend><div><input type='submit' value='" . lang('Edit') . "'> <input type='submit' name='clone' value='" . lang('Clone') . "'> <input type='submit' name='delete' value='" . lang('Delete') . "'$confirm></div></fieldset>\n");
+ echo "<fieldset><legend>" . lang('Export') . "</legend><div>$dump_output $dump_format <input type='submit' name='export' value='" . lang('Export') . "'></div></fieldset>\n";
}
$result->free();
- echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token' /><input type='file' name='csv_file' /> <input type='submit' name='import' value='" . lang('Import') . "' /></div></fieldset>\n";
+ echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'></div></fieldset>\n";
//! Editor only
$email_fields = array_filter($email_fields);
if ($email_fields) {
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email' class='hidden'>\n";
- echo "<p>" . lang('From') . ": <input name='email_from' />\n";
- echo lang('Subject') . ": <input name='email_subject' /></p>\n";
- echo "<p><textarea name='email_message' rows='15' cols='60'></textarea></p>\n";
- echo (count($email_fields) == 1 ? '<input type="hidden" name="email_field" value="' . htmlspecialchars(key($email_fields)) . '" />' : '<select name="email_field">' . optionlist(array_keys($email_fields)) . '</select>');
- echo "<input type='submit' name='email' value='" . lang('Send') . "'$confirm />\n";
+ echo "<p>" . lang('From') . ": <input name='email_from'>\n";
+ echo lang('Subject') . ": <input name='email_subject'>\n";
+ echo "<p><textarea name='email_message' rows='15' cols='60'></textarea>\n";
+ echo (count($email_fields) == 1 ? '<input type="hidden" name="email_field" value="' . htmlspecialchars(key($email_fields)) . '">' : '<select name="email_field">' . optionlist(array_keys($email_fields)) . '</select>');
+ echo "<input type='submit' name='email' value='" . lang('Send') . "'$confirm>\n";
echo "</div></fieldset>\n";
}