Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 276 lines (260 sloc) 12.903 kb
667bfec4 »
2007-07-02 Decomposition
1 <?php
79d19028 »
2009-08-29 Substitute table name to $TABLE
2 $TABLE = $_GET["select"];
3 $table_status = table_status($TABLE);
4 $indexes = indexes($TABLE);
5 $fields = fields($TABLE);
dea345cb »
2009-09-09 Substitute foreign keys in e-mail fields
6 $foreign_keys = column_foreign_keys($TABLE);
7
64ba9242 »
2009-06-21 Comments
8 $rights = array(); // privilege => 0
9 $columns = array(); // selectable columns
02a851c7 »
2007-08-24 Shorten texts in PHP
10 unset($text_length);
ffcea8b5 »
2007-07-06 Rights
11 foreach ($fields as $key => $field) {
c64c4fd1 »
2009-07-27 Adminer class
12 $name = $adminer->fieldName($field);
116c8736 »
2009-07-21 Ignore tables and fields with empty name
13 if (isset($field["privileges"]["select"]) && strlen($name)) {
1e4d11e9 »
2009-07-23 Select from foreign keys in Editor
14 $columns[$key] = html_entity_decode(strip_tags($name));
5abd943c »
2009-07-13 Change simple preg_match to ereg
15 if (ereg('text|blob', $field["type"])) {
d24ad780 »
2009-07-27 Select boxes customization
16 $text_length = $adminer->selectLengthProcess();
16c4ddb4 »
2009-07-13 Single faster POST query with primary key
17 }
ffcea8b5 »
2007-07-06 Rights
18 }
430034c3 »
2007-07-09 Cottage homework
19 $rights += $field["privileges"];
20 }
21
d24ad780 »
2009-07-27 Select boxes customization
22 list($select, $group) = $adminer->selectColumnsProcess($columns, $indexes);
07e1ae10 »
2009-07-28 FOUND_ROWS only with GROUP BY
23 $where = $adminer->selectSearchProcess($fields, $indexes);
24 $order = $adminer->selectOrderProcess($fields, $indexes);
d24ad780 »
2009-07-27 Select boxes customization
25 $limit = $adminer->selectLimitProcess();
79d19028 »
2009-08-29 Substitute table name to $TABLE
26 $from = ($select ? implode(", ", $select) : "*") . " FROM " . idf_escape($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : "");
4c736a0a »
2009-06-22 Use group by in export
27 $group_by = ($group && count($group) < count($select) ? " GROUP BY " . implode(", ", $group) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "");
116faf2e »
2008-01-08 Mass delete
28
29 if ($_POST && !$error) {
56948c93 »
2009-07-16 $_POST[check] may be empty
30 $where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
a3d2266a »
2009-07-28 Order by first index in Editor by default
31 $primary = ($indexes["PRIMARY"] ? ($select ? array_flip($indexes["PRIMARY"]["columns"]) : array()) : null); // empty array means that all primary fields are selected
d24ad780 »
2009-07-27 Select boxes customization
32 foreach ($select as $key => $val) {
33 $val = $_GET["columns"][$key];
34 if (!$val["fun"]) {
35 unset($primary[$val["col"]]);
36 }
37 }
78639a98 »
2008-10-01 Function results in edit
38 if ($_POST["export"]) {
79d19028 »
2009-08-29 Substitute table name to $TABLE
39 dump_headers($TABLE);
40 dump_table($TABLE, "");
e4f5d17e »
2009-08-25 Dump column names in CSV select export
41 if ($_POST["format"] != "sql") { // Editor doesn't send format
42 dump_csv($select ? $select : array_keys($fields));
43 }
16c4ddb4 »
2009-07-13 Single faster POST query with primary key
44 if (!is_array($_POST["check"]) || $primary === array()) {
79d19028 »
2009-08-29 Substitute table name to $TABLE
45 dump_data($TABLE, "INSERT", "SELECT $from" . (is_array($_POST["check"]) ? ($where ? " AND " : " WHERE ") . "($where_check)" : "") . $group_by);
16c4ddb4 »
2009-07-13 Single faster POST query with primary key
46 } else {
fa5c952a »
2009-06-15 Use extended INSERT in select export
47 $union = array();
f7452add »
2009-04-01 Import and export
48 foreach ($_POST["check"] as $val) {
16c4ddb4 »
2009-07-13 Single faster POST query with primary key
49 // where is not unique so OR can't be used
c16c57b1 »
2009-07-11 E-mail sending
50 $union[] = "(SELECT $from " . ($where ? "AND " : "WHERE ") . where_check($val) . $group_by . " LIMIT 1)";
116faf2e »
2008-01-08 Mass delete
51 }
79d19028 »
2009-08-29 Substitute table name to $TABLE
52 dump_data($TABLE, "INSERT", implode(" UNION ALL ", $union));
116faf2e »
2008-01-08 Mass delete
53 }
702e949d »
2009-08-28 Bzip2 compression
54 dump();
78639a98 »
2008-10-01 Function results in edit
55 exit;
56 }
dea345cb »
2009-09-09 Substitute foreign keys in e-mail fields
57 if (!$adminer->selectEmailProcess($where, $foreign_keys)) {
00d9b361 »
2009-07-24 E-mail sending only in Editor
58 if (!$_POST["import"]) { // edit
59 $result = true;
60 $affected = 0;
79d19028 »
2009-08-29 Substitute table name to $TABLE
61 $command = ($_POST["delete"] ? ($_POST["all"] && !$where ? "TRUNCATE " : "DELETE FROM ") : ($_POST["clone"] ? "INSERT INTO " : "UPDATE ")) . idf_escape($TABLE);
28b2b8db »
2009-07-30 Readable variable initialization
62 $set = array();
00d9b361 »
2009-07-24 E-mail sending only in Editor
63 if (!$_POST["delete"]) {
64 foreach ($columns as $name => $val) { //! should check also for edit or insert privileges
a0def479 »
2009-07-27 Date localization
65 $val = process_input($fields[$name]);
00d9b361 »
2009-07-24 E-mail sending only in Editor
66 if ($_POST["clone"]) {
45e0de7b »
2009-09-08 Include columns list in clone
67 $set[idf_escape($name)] = ($val !== false ? $val : idf_escape($name));
00d9b361 »
2009-07-24 E-mail sending only in Editor
68 } elseif ($val !== false) {
69 $set[] = idf_escape($name) . " = $val";
70 }
e7eb28d3 »
2008-12-30 CSV import
71 }
45e0de7b »
2009-09-08 Include columns list in clone
72 $command .= ($_POST["clone"] ? " (" . implode(", ", array_keys($set)) . ")\nSELECT " . implode(", ", $set) . "\nFROM " . idf_escape($TABLE) : " SET\n" . implode(",\n", $set));
e7eb28d3 »
2008-12-30 CSV import
73 }
00d9b361 »
2009-07-24 E-mail sending only in Editor
74 if ($_POST["delete"] || $set) {
75 if ($_POST["all"] || ($primary === array() && $_POST["check"])) {
76 $result = queries($command . ($_POST["all"] ? ($where ? "\nWHERE " . implode(" AND ", $where) : "") : "\nWHERE $where_check"));
64d616c0 »
2009-09-22 Rename get_dbh to connection
77 $affected = $connection->affected_rows;
00d9b361 »
2009-07-24 E-mail sending only in Editor
78 } else {
79 foreach ((array) $_POST["check"] as $val) {
80 // where is not unique so OR can't be used
988a29fc »
2009-07-28 Don't use aggregation functions in unique_idf
81 $result = queries($command . "\nWHERE " . where_check($val) . (count($group) < count($select) ? "" : "\nLIMIT 1"));
00d9b361 »
2009-07-24 E-mail sending only in Editor
82 if (!$result) {
83 break;
84 }
64d616c0 »
2009-09-22 Rename get_dbh to connection
85 $affected += $connection->affected_rows;
38059b61 »
2009-06-30 Remove empty if
86 }
e7eb28d3 »
2008-12-30 CSV import
87 }
78639a98 »
2008-10-01 Function results in edit
88 }
00d9b361 »
2009-07-24 E-mail sending only in Editor
89 query_redirect(queries(), remove_from_uri("page"), lang('%d item(s) have been affected.', $affected), $result, false, !$result);
90 //! display edit page in case of an error
25f01d35 »
2009-08-28 Compress export and import
91 } elseif (is_string($file = get_file("csv_file", true))) {
00d9b361 »
2009-07-24 E-mail sending only in Editor
92 $file = preg_replace("~^\xEF\xBB\xBF~", '', $file); //! character set
cb370a8a »
2009-08-20 Respect max_allowed_packet in CSV import
93 $result = true;
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
94 $cols = array_keys($fields);
17a3c5bd »
2009-09-02 NULL and \r in CSV import
95 preg_match_all('~("[^"]*"|[^"\\r\\n])+~', $file, $matches);
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
96 $affected = count($matches[0]);
00d9b361 »
2009-07-24 E-mail sending only in Editor
97 foreach ($matches[0] as $key => $val) {
cb370a8a »
2009-08-20 Respect max_allowed_packet in CSV import
98 preg_match_all('~(("[^"]*")+|[^,]*),~', "$val,", $matches2);
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
99 if (!$key && !array_diff($matches2[1], $cols)) { //! doesn't work with column names containing ",\n
00d9b361 »
2009-07-24 E-mail sending only in Editor
100 // first row corresponds to column names - use it for table structure
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
101 $cols = $matches2[1];
102 $affected--;
00d9b361 »
2009-07-24 E-mail sending only in Editor
103 } else {
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
104 $set = "";
105 foreach ($matches2[1] as $i => $col) {
64d616c0 »
2009-09-22 Rename get_dbh to connection
106 $set .= ", " . idf_escape($cols[$i]) . " = " . (!strlen($col) && $fields[$cols[$i]]["null"] ? "NULL" : $connection->quote(str_replace('""', '"', preg_replace('~^"|"$~', '', $col))));
00d9b361 »
2009-07-24 E-mail sending only in Editor
107 }
2c765783 »
2009-09-09 Reduce size
108 $set = substr($set, 1);
109 $result = queries("INSERT INTO " . idf_escape($_GET["select"]) . " SET$set ON DUPLICATE KEY UPDATE$set");
e8953684 »
2009-08-30 Use ON DUPLICATE KEY UPDATE for CSV import
110 if (!$result) {
111 break;
cb370a8a »
2009-08-20 Respect max_allowed_packet in CSV import
112 }
113 }
114 }
115 query_redirect(queries(), remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result, false, !$result);
00d9b361 »
2009-07-24 E-mail sending only in Editor
116 } else {
117 $error = upload_error($file);
d83b6548 »
2009-04-16 Detect import errors
118 }
ec23248c »
2008-08-16 Exportable select
119 }
116faf2e »
2008-01-08 Mass delete
120 }
c16c57b1 »
2009-07-11 E-mail sending
121
b9ffd64d »
2009-09-08 Remove common prefix in backward key
122 $table_name = $adminer->tableName($table_status);
123 page_header(lang('Select') . ": $table_name", $error);
116faf2e »
2008-01-08 Mass delete
124
f2ed2379 »
2009-09-20 Display table links above table structure
125 $set = null;
430034c3 »
2007-07-09 Cottage homework
126 if (isset($rights["insert"])) {
98507da3 »
2009-07-30 Function verify_version doesn't use version parameter
127 $set = "";
128 foreach ((array) $_GET["where"] as $val) {
129 if (count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "="
130 || ($val["op"] == "" && !ereg('[_%]', $val["val"])) // LIKE in Editor
131 )) {
132 $set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
133 }
134 }
667bfec4 »
2007-07-02 Decomposition
135 }
f2ed2379 »
2009-09-20 Display table links above table structure
136 $adminer->selectLinks($table_status, $set);
667bfec4 »
2007-07-02 Decomposition
137
ffcea8b5 »
2007-07-06 Rights
138 if (!$columns) {
64d616c0 »
2009-09-22 Rename get_dbh to connection
139 echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "" : ": " . h($connection->error)) . ".\n";
ffcea8b5 »
2007-07-06 Rights
140 } else {
5ee29cb0 »
2008-08-07 Select columns, aggregation
141 echo "<form action='' id='form'>\n";
d24ad780 »
2009-07-27 Select boxes customization
142 echo "<div style='display: none;'>";
689699aa »
2009-07-28 Shortcut for htmlspecialchars
143 echo (strlen($_GET["server"]) ? '<input type="hidden" name="server" value="' . h($_GET["server"]) . '">' : "");
3022dcb8 »
2009-08-29 Define DB
144 echo (strlen(DB) ? '<input type="hidden" name="db" value="' . h(DB) . '">' : ""); // not used in Editor
79d19028 »
2009-08-29 Substitute table name to $TABLE
145 echo '<input type="hidden" name="select" value="' . h($TABLE) . '">';
d24ad780 »
2009-07-27 Select boxes customization
146 echo "</div>\n";
147 $adminer->selectColumnsPrint($select, $columns);
148 $adminer->selectSearchPrint($where, $columns, $indexes);
149 $adminer->selectOrderPrint($order, $columns, $indexes);
150 $adminer->selectLimitPrint($limit);
151 $adminer->selectLengthPrint($text_length);
152 $adminer->selectActionPrint($text_length);
ffcea8b5 »
2007-07-06 Rights
153 echo "</form>\n";
154
07e1ae10 »
2009-07-28 FOUND_ROWS only with GROUP BY
155 $query = "SELECT " . (intval($limit) && $group && count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
c64c4fd1 »
2009-07-27 Adminer class
156 echo $adminer->selectQuery($query);
8b745113 »
2008-09-01 Print SQL query (fixes #2082448)
157
64d616c0 »
2009-09-22 Rename get_dbh to connection
158 $result = $connection->query($query);
21ea4aea »
2007-09-03 Check errors
159 if (!$result) {
64d616c0 »
2009-09-22 Rename get_dbh to connection
160 echo "<p class='error'>" . h($connection->error) . "\n";
ffcea8b5 »
2007-07-06 Rights
161 } else {
f2365d08 »
2009-07-11 Typo
162 $email_fields = array();
e7eb28d3 »
2008-12-30 CSV import
163 echo "<form action='' method='post' enctype='multipart/form-data'>\n";
21ea4aea »
2007-09-03 Check errors
164 if (!$result->num_rows) {
ace55ed1 »
2009-07-11 HTML instead of XHTML
165 echo "<p class='message'>" . lang('No rows.') . "\n";
21ea4aea »
2007-09-03 Check errors
166 } else {
ba90d60b »
2009-07-14 Introduce adminer_select_val
167 $rows = array();
168 while ($row = $result->fetch_assoc()) {
169 $rows[] = $row;
170 }
4cdc4598 »
2009-07-16 FOUND_ROWS works with last SELECT
171 // use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
07e1ae10 »
2009-07-28 FOUND_ROWS only with GROUP BY
172 $found_rows = (intval($limit) && $group && count($group) < count($select)
64d616c0 »
2009-09-22 Rename get_dbh to connection
173 ? $connection->result($connection->query(" SELECT FOUND_ROWS()")) // space to allow mysql.trace_mode
4cdc4598 »
2009-07-16 FOUND_ROWS works with last SELECT
174 : count($rows)
175 );
ba90d60b »
2009-07-14 Introduce adminer_select_val
176
09e93ded »
2009-09-23 Move backward keys to Editor
177 $backward_keys = $adminer->backwardKeys($TABLE, $table_name);
c42c46a2 »
2009-07-15 Table relations
178
bcff0255 »
2009-08-25 Click on row selects it (fixes #2844098)
179 echo "<table cellspacing='0' class='nowrap' onclick='table_click(event);'>\n";
ba90d60b »
2009-07-14 Introduce adminer_select_val
180 echo "<thead><tr><td><input type='checkbox' id='all-page' onclick='form_check(this, /check/);'>";
50341236 »
2009-07-23 Apply field name with functions
181 $names = array();
182 reset($select);
23df820f »
2009-07-31 Distinguish no column order in fieldName
183 $order = 1;
ba90d60b »
2009-07-14 Introduce adminer_select_val
184 foreach ($rows[0] as $key => $val) {
50341236 »
2009-07-23 Apply field name with functions
185 $val = $_GET["columns"][key($select)];
ba9c9a52 »
2009-07-24 Display SQL function with braces in select heading
186 $field = $fields[$select ? $val["col"] : $key];
6c97b806 »
2009-07-27 Display only first five columns in Editor example
187 $name = ($field ? $adminer->fieldName($field, $order) : "*");
116c8736 »
2009-07-21 Ignore tables and fields with empty name
188 if (strlen($name)) {
6c97b806 »
2009-07-27 Display only first five columns in Editor example
189 $order++;
50341236 »
2009-07-23 Apply field name with functions
190 $names[$key] = $name;
689699aa »
2009-07-28 Shortcut for htmlspecialchars
191 echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions
116c8736 »
2009-07-21 Ignore tables and fields with empty name
192 }
50341236 »
2009-07-23 Apply field name with functions
193 next($select);
ba90d60b »
2009-07-14 Introduce adminer_select_val
194 }
09e93ded »
2009-09-23 Move backward keys to Editor
195 echo ($backward_keys ? "<th>" . lang('Relations') : "") . "</thead>\n";
dea345cb »
2009-09-09 Substitute foreign keys in e-mail fields
196 foreach ($adminer->rowDescriptions($rows, $foreign_keys) as $n => $row) {
988a29fc »
2009-07-28 Don't use aggregation functions in unique_idf
197 $unique_idf = implode('&amp;', unique_idf($rows[$n], $indexes));
81f91c00 »
2009-09-19 Check previously checked rows
198 echo "<tr" . odd() . "><td><input type='checkbox' name='check[]' value='$unique_idf'" . (in_array(str_replace("&amp;", "&", $unique_idf), (array) $_POST["check"]) ? " checked" : "") . " onclick=\"this.form['all'].checked = false; form_uncheck('all-page');\">" . (count($select) != count($group) || information_schema(DB) ? '' : " <a href='" . h(ME) . "edit=" . urlencode($TABLE) . "&amp;$unique_idf'>" . lang('edit') . "</a>");
21ea4aea »
2007-09-03 Check errors
199 foreach ($row as $key => $val) {
78e49f01 »
2009-07-24 Pass $field to select_val
200 if (isset($names[$key])) {
d6e3fc71 »
2009-07-22 Link e-mails
201 if (strlen($val) && (!isset($email_fields[$key]) || strlen($email_fields[$key]))) {
50341236 »
2009-07-23 Apply field name with functions
202 $email_fields[$key] = (is_email($val) ? $names[$key] : ""); //! filled e-mails may be contained on other pages
116c8736 »
2009-07-21 Ignore tables and fields with empty name
203 }
5911cf17 »
2009-07-21 Always call select_val
204 $link = "";
a0def479 »
2009-07-27 Date localization
205 $val = $adminer->editVal($val, $fields[$key]);
116c8736 »
2009-07-21 Ignore tables and fields with empty name
206 if (!isset($val)) {
207 $val = "<i>NULL</i>";
21ea4aea »
2007-09-03 Check errors
208 } else {
97b8c7b6 »
2009-07-24 Display images in Editor
209 if (ereg('blob|binary', $fields[$key]["type"]) && strlen($val)) {
79d19028 »
2009-08-29 Substitute table name to $TABLE
210 $link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . '&') . $unique_idf;
97b8c7b6 »
2009-07-24 Display images in Editor
211 }
24801a0c »
2009-09-14 Display whitespace in texts (bug #2858042)
212 if (!strlen($val)) {
116c8736 »
2009-07-21 Ignore tables and fields with empty name
213 $val = "&nbsp;";
97b8c7b6 »
2009-07-24 Display images in Editor
214 } elseif (strlen($text_length) && ereg('blob|text', $fields[$key]["type"]) && is_utf8($val)) {
24801a0c »
2009-09-14 Display whitespace in texts (bug #2858042)
215 $val = whitespace(shorten_utf8($val, max(0, intval($text_length)))); // usage of LEFT() would reduce traffic but complicate query
116c8736 »
2009-07-21 Ignore tables and fields with empty name
216 } else {
24801a0c »
2009-09-14 Display whitespace in texts (bug #2858042)
217 $val = whitespace(h($val));
21ea4aea »
2007-09-03 Check errors
218 }
116c8736 »
2009-07-21 Ignore tables and fields with empty name
219
db46fc24 »
2009-08-03 Maintain insert prefill value
220 if (!$link) { // link related items
221 foreach ((array) $foreign_keys[$key] as $foreign_key) {
222 if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
223 foreach ($foreign_key["source"] as $i => $source) {
224 $link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
225 }
226 $link = h((strlen($foreign_key["db"]) ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link); // InnoDB supports non-UNIQUE keys
227 break;
116c8736 »
2009-07-21 Ignore tables and fields with empty name
228 }
21ea4aea »
2007-09-03 Check errors
229 }
ffcea8b5 »
2007-07-06 Rights
230 }
fa3dd557 »
2007-07-02 Parent
231 }
d6e3fc71 »
2009-07-22 Link e-mails
232 if (!$link && is_email($val)) {
233 $link = "mailto:$val";
234 }
c64c4fd1 »
2009-07-27 Adminer class
235 $val = $adminer->selectVal($val, $link, $fields[$key]);
116c8736 »
2009-07-21 Ignore tables and fields with empty name
236 echo "<td>$val";
667bfec4 »
2007-07-02 Decomposition
237 }
238 }
09e93ded »
2009-09-23 Move backward keys to Editor
239 $adminer->backwardKeysPrint($backward_keys, $rows[$n]);
ba90d60b »
2009-07-14 Introduce adminer_select_val
240 echo "\n";
5ab708a1 »
2007-07-25 Compact pages
241 }
21ea4aea »
2007-09-03 Check errors
242 echo "</table>\n";
e4b188cd »
2008-09-01 Display found rows
243
4cdc4598 »
2009-07-16 FOUND_ROWS works with last SELECT
244 if (intval($limit) && count($group) >= count($select)) {
245 // slow with big tables
246 ob_flush();
247 flush();
64d616c0 »
2009-09-22 Rename get_dbh to connection
248 $found_rows = $connection->result($connection->query("SELECT COUNT(*) FROM " . idf_escape($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : "")));
4cdc4598 »
2009-07-16 FOUND_ROWS works with last SELECT
249 }
e4b188cd »
2008-09-01 Display found rows
250 echo "<p>";
251 if (intval($limit) && $found_rows > $limit) {
64ba9242 »
2009-06-21 Comments
252 // display first, previous 3, next 3 and last page
21ea4aea »
2007-09-03 Check errors
253 $max_page = floor(($found_rows - 1) / $limit);
c565c545 »
2009-07-15 Let pagination function return
254 echo lang('Page') . ":" . pagination(0) . ($_GET["page"] > 3 ? " ..." : "");
21ea4aea »
2007-09-03 Check errors
255 for ($i = max(1, $_GET["page"] - 2); $i < min($max_page, $_GET["page"] + 3); $i++) {
c565c545 »
2009-07-15 Let pagination function return
256 echo pagination($i);
21ea4aea »
2007-09-03 Check errors
257 }
c565c545 »
2009-07-15 Let pagination function return
258 echo ($_GET["page"] + 3 < $max_page ? " ..." : "") . pagination($max_page);
5ab708a1 »
2007-07-25 Compact pages
259 }
ace55ed1 »
2009-07-11 HTML instead of XHTML
260 echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1">' . lang('whole result') . "</label>\n";
8b745113 »
2008-09-01 Print SQL query (fixes #2082448)
261
06ce6828 »
2009-09-23 Display number of manipulated rows in JS confirm
262 echo (information_schema(DB) ? "" : "<fieldset><legend>" . lang('Edit') . "</legend><div><input type='submit' name='edit' value='" . lang('Edit') . "'> <input type='submit' name='clone' value='" . lang('Clone') . "'> <input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + (this.form['all'].checked ? $found_rows : form_checked(this, /check/)) + ')');\"></div></fieldset>\n");
dc667ea1 »
2009-09-11 Hide select export and import
263 print_fieldset("export", lang('Export'));
264 echo "$dump_output $dump_format $dump_compress <input type='submit' name='export' value='" . lang('Export') . "'>\n";
265 echo "</div></fieldset>\n";
667bfec4 »
2007-07-02 Decomposition
266 }
dc667ea1 »
2009-09-11 Hide select export and import
267 print_fieldset("import", lang('CSV Import'), !$result->num_rows);
268 echo "<input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'>\n";
269 echo "</div></fieldset>\n";
c16c57b1 »
2009-07-11 E-mail sending
270
1e55d475 »
2009-09-09 User interface for e-mail {$name}
271 $adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);
c16c57b1 »
2009-07-11 E-mail sending
272
e7eb28d3 »
2008-12-30 CSV import
273 echo "</form>\n";
667bfec4 »
2007-07-02 Decomposition
274 }
275 }
Something went wrong with that request. Please try again.