Order rows by clicking on table heading

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@418 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-05-27 14:31:39 +00:00
parent 2d6eed778f
commit e4089afd4c
2 changed files with 6 additions and 3 deletions

View file

@ -195,7 +195,11 @@ function add_row(field) {
echo "<table border='1' cellspacing='0' cellpadding='2'>\n"; echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
for ($j=0; $row = $result->fetch_assoc(); $j++) { for ($j=0; $row = $result->fetch_assoc(); $j++) {
if (!$j) { if (!$j) {
echo '<thead><tr><td><label><input type="checkbox" name="delete_selected" value="1" onclick="var elems = this.form.elements; for (var i=0; i < elems.length; i++) if (elems[i].name == \'delete[]\') elems[i].checked = this.checked;" />' . lang('all') . '</label></td><th>' . implode("</th><th>", array_map('htmlspecialchars', array_keys($row))) . "</th></tr></thead>\n"; echo '<thead><tr><td><label><input type="checkbox" name="delete_selected" value="1" onclick="var elems = this.form.elements; for (var i=0; i < elems.length; i++) if (elems[i].name == \'delete[]\') elems[i].checked = this.checked;" />' . lang('all') . '</label></td>';
foreach ($row as $key => $val) {
echo '<th><a href="' . remove_from_uri('(order|desc)[^=]*') . '&amp;order%5B0%5D=' . htmlspecialchars($key) . ($_GET["order"][0] === $key && !$_GET["desc"][0] ? '&amp;desc%5B0%5D=1' : '') . '">' . htmlspecialchars($key) . "</a></th>";
}
echo "</tr></thead>\n";
} }
$unique_idf = implode('&amp;', unique_idf($row, $indexes)); $unique_idf = implode('&amp;', unique_idf($row, $indexes));
echo '<tr><td><input type="checkbox" name="delete[]" value="' . $unique_idf . '" /> <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . "</a></td>"; echo '<tr><td><input type="checkbox" name="delete[]" value="' . $unique_idf . '" /> <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . "</a></td>";

View file

@ -1,4 +1,4 @@
Edit of fields with foreign key as <select> (optional) Add whisperer to fields with foreign key
Highlight found fields Highlight found fields
MySQL 5 BIT data type MySQL 5 BIT data type
Check MySQL server version Check MySQL server version
@ -7,7 +7,6 @@ Clone row
Execution time in sql.inc.php Execution time in sql.inc.php
Input function results in edit Input function results in edit
Choose tables and data to export Choose tables and data to export
Order rows by clicking on table heading
? CSV export ? CSV export
? Query print ? Query print
? Access without login - accept $_GET ? Access without login - accept $_GET