File: db.inc.php

package info (click to toggle)
adminer 5.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,828 kB
  • sloc: php: 28,768; javascript: 1,188; xml: 107; makefile: 48; sh: 3
file content (36 lines) | stat: -rw-r--r-- 1,413 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Adminer;

page_header(lang('Server'), "", false);

if (adminer()->homepage()) {
	echo "<form action='' method='post'>\n";
	echo "<p>" . lang('Search data in tables') . ": <input type='search' name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
	if ($_POST["query"] != "") {
		search_tables();
	}
	echo "<div class='scrollable'>\n";
	echo "<table class='nowrap checkable odds'>\n";
	echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
	echo '<thead><tr class="wrap">';
	echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^tables\[/);", "");
	echo '<th>' . lang('Table');
	echo '<td>' . lang('Rows');
	echo "</thead>\n";

	foreach (table_status() as $table => $row) {
		$name = adminer()->tableName($row);
		if ($name != "") {
			echo '<tr><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true));
			echo "<th><a href='" . h(ME) . 'select=' . urlencode($table) . "'>$name</a>";
			$val = format_number($row["Rows"]);
			echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
		}
	}

	echo "</table>\n";
	echo "</div>\n";
	echo "</form>\n";
	echo script("tableCheck();");
	adminer()->pluginsLinks();
}