2007-07-02 05:51:26 +00:00
< ? php
2009-08-29 13:57:50 +00:00
$TABLE = $_GET [ " select " ];
$table_status = table_status ( $TABLE );
$indexes = indexes ( $TABLE );
$fields = fields ( $TABLE );
2009-06-21 23:20:32 +00:00
$rights = array (); // privilege => 0
$columns = array (); // selectable columns
2007-08-24 16:00:10 +00:00
unset ( $text_length );
2007-07-06 13:03:13 +00:00
foreach ( $fields as $key => $field ) {
2009-07-27 11:25:37 +00:00
$name = $adminer -> fieldName ( $field );
2009-07-21 13:59:02 +00:00
if ( isset ( $field [ " privileges " ][ " select " ]) && strlen ( $name )) {
2009-07-23 14:42:38 +00:00
$columns [ $key ] = html_entity_decode ( strip_tags ( $name ));
2009-07-13 16:03:51 +00:00
if ( ereg ( 'text|blob' , $field [ " type " ])) {
2009-07-27 14:40:55 +00:00
$text_length = $adminer -> selectLengthProcess ();
2009-07-13 23:28:26 +00:00
}
2007-07-06 13:03:13 +00:00
}
2007-07-09 06:12:22 +00:00
$rights += $field [ " privileges " ];
}
2009-07-27 14:40:55 +00:00
list ( $select , $group ) = $adminer -> selectColumnsProcess ( $columns , $indexes );
2009-07-28 14:21:05 +00:00
$where = $adminer -> selectSearchProcess ( $fields , $indexes );
$order = $adminer -> selectOrderProcess ( $fields , $indexes );
2009-07-27 14:40:55 +00:00
$limit = $adminer -> selectLimitProcess ();
2009-08-29 13:57:50 +00:00
$from = ( $select ? implode ( " , " , $select ) : " * " ) . " FROM " . idf_escape ( $TABLE ) . ( $where ? " WHERE " . implode ( " AND " , $where ) : " " );
2009-06-22 00:13:11 +00:00
$group_by = ( $group && count ( $group ) < count ( $select ) ? " GROUP BY " . implode ( " , " , $group ) : " " ) . ( $order ? " ORDER BY " . implode ( " , " , $order ) : " " );
2008-01-08 14:02:55 +00:00
if ( $_POST && ! $error ) {
2009-07-16 14:07:14 +00:00
$where_check = " ( " . implode ( " ) OR ( " , array_map ( 'where_check' , ( array ) $_POST [ " check " ])) . " ) " ;
2009-07-28 11:04:49 +00:00
$primary = ( $indexes [ " PRIMARY " ] ? ( $select ? array_flip ( $indexes [ " PRIMARY " ][ " columns " ]) : array ()) : null ); // empty array means that all primary fields are selected
2009-07-27 14:40:55 +00:00
foreach ( $select as $key => $val ) {
$val = $_GET [ " columns " ][ $key ];
if ( ! $val [ " fun " ]) {
unset ( $primary [ $val [ " col " ]]);
}
}
2008-10-01 11:39:13 +00:00
if ( $_POST [ " export " ]) {
2009-08-29 13:57:50 +00:00
dump_headers ( $TABLE );
dump_table ( $TABLE , " " );
2009-08-25 14:11:15 +00:00
if ( $_POST [ " format " ] != " sql " ) { // Editor doesn't send format
dump_csv ( $select ? $select : array_keys ( $fields ));
}
2009-07-13 23:28:26 +00:00
if ( ! is_array ( $_POST [ " check " ]) || $primary === array ()) {
2009-08-29 13:57:50 +00:00
dump_data ( $TABLE , " INSERT " , " SELECT $from " . ( is_array ( $_POST [ " check " ]) ? ( $where ? " AND " : " WHERE " ) . " ( $where_check ) " : " " ) . $group_by );
2009-07-13 23:28:26 +00:00
} else {
2009-06-15 10:01:55 +00:00
$union = array ();
2009-04-01 10:57:34 +00:00
foreach ( $_POST [ " check " ] as $val ) {
2009-07-13 23:28:26 +00:00
// where is not unique so OR can't be used
2009-07-11 19:45:57 +00:00
$union [] = " (SELECT $from " . ( $where ? " AND " : " WHERE " ) . where_check ( $val ) . $group_by . " LIMIT 1) " ;
2008-01-08 14:02:55 +00:00
}
2009-08-29 13:57:50 +00:00
dump_data ( $TABLE , " INSERT " , implode ( " UNION ALL " , $union ));
2008-01-08 14:02:55 +00:00
}
2009-08-28 14:44:43 +00:00
dump ();
2008-10-01 11:39:13 +00:00
exit ;
}
2009-07-28 11:18:08 +00:00
if ( ! $adminer -> selectEmailProcess ( $where )) {
2009-07-24 10:52:24 +00:00
if ( ! $_POST [ " import " ]) { // edit
$result = true ;
$affected = 0 ;
2009-08-29 13:57:50 +00:00
$command = ( $_POST [ " delete " ] ? ( $_POST [ " all " ] && ! $where ? " TRUNCATE " : " DELETE FROM " ) : ( $_POST [ " clone " ] ? " INSERT INTO " : " UPDATE " )) . idf_escape ( $TABLE );
2009-07-30 15:53:10 +00:00
$set = array ();
2009-07-24 10:52:24 +00:00
if ( ! $_POST [ " delete " ]) {
foreach ( $columns as $name => $val ) { //! should check also for edit or insert privileges
2009-07-27 16:32:56 +00:00
$val = process_input ( $fields [ $name ]);
2009-07-24 10:52:24 +00:00
if ( $_POST [ " clone " ]) {
$set [] = ( $val !== false ? $val : idf_escape ( $name ));
} elseif ( $val !== false ) {
$set [] = idf_escape ( $name ) . " = $val " ;
}
2008-12-30 15:19:35 +00:00
}
2009-08-29 13:57:50 +00:00
$command .= ( $_POST [ " clone " ] ? " \n SELECT " . implode ( " , " , $set ) . " \n FROM " . idf_escape ( $TABLE ) : " SET \n " . implode ( " , \n " , $set ));
2008-12-30 15:19:35 +00:00
}
2009-07-24 10:52:24 +00:00
if ( $_POST [ " delete " ] || $set ) {
if ( $_POST [ " all " ] || ( $primary === array () && $_POST [ " check " ])) {
$result = queries ( $command . ( $_POST [ " all " ] ? ( $where ? " \n WHERE " . implode ( " AND " , $where ) : " " ) : " \n WHERE $where_check " ));
$affected = $dbh -> affected_rows ;
} else {
foreach (( array ) $_POST [ " check " ] as $val ) {
// where is not unique so OR can't be used
2009-07-28 12:56:38 +00:00
$result = queries ( $command . " \n WHERE " . where_check ( $val ) . ( count ( $group ) < count ( $select ) ? " " : " \n LIMIT 1 " ));
2009-07-24 10:52:24 +00:00
if ( ! $result ) {
break ;
}
$affected += $dbh -> affected_rows ;
2009-06-30 16:30:28 +00:00
}
2008-12-30 15:19:35 +00:00
}
2008-10-01 11:39:13 +00:00
}
2009-07-24 10:52:24 +00:00
query_redirect ( queries (), remove_from_uri ( " page " ), lang ( '%d item(s) have been affected.' , $affected ), $result , false , ! $result );
//! display edit page in case of an error
2009-08-28 11:49:57 +00:00
} elseif ( is_string ( $file = get_file ( " csv_file " , true ))) {
2009-07-24 10:52:24 +00:00
$file = preg_replace ( " ~^ \xEF \xBB \xBF ~ " , '' , $file ); //! character set
2009-08-20 15:05:35 +00:00
$affected = 0 ;
$length = 0 ;
$result = true ;
2009-08-29 13:55:09 +00:00
$dbh -> query ( " SET foreign_key_checks = 0 " );
2009-08-29 13:57:50 +00:00
$query = " REPLACE " . idf_escape ( $TABLE ); // ON DUPLICATE KEY UPDATE would require one query per record
2009-08-20 15:05:35 +00:00
$packet_size = $dbh -> result ( $dbh -> query ( " SELECT @@max_allowed_packet " ));
$rows = array ();
preg_match_all ( '~("[^"]*"|[^"\\n])+~' , $file , $matches );
2009-07-24 10:52:24 +00:00
foreach ( $matches [ 0 ] as $key => $val ) {
$row = array ();
2009-08-20 15:05:35 +00:00
preg_match_all ( '~(("[^"]*")+|[^,]*),~' , " $val , " , $matches2 );
2009-07-24 10:52:24 +00:00
if ( ! $key && ! array_diff ( $matches2 [ 1 ], array_keys ( $fields ))) { //! doesn't work with column names containing ",\n
// first row corresponds to column names - use it for table structure
2009-08-20 15:05:35 +00:00
$query .= " ( " . implode ( " , " , array_map ( 'idf_escape' , $matches2 [ 1 ])) . " ) " ;
2009-07-24 10:52:24 +00:00
} else {
foreach ( $matches2 [ 1 ] as $col ) {
$row [] = ( ! strlen ( $col ) ? " NULL " : $dbh -> quote ( str_replace ( '""' , '"' , preg_replace ( '~^"|"$~' , '' , $col ))));
}
2009-08-20 15:05:35 +00:00
$s = " \n ( " . implode ( " , " , $row ) . " ) " ;
$length += 1 + strlen ( $s ); // 1 - separator length
if ( $rows && $length > $packet_size ) {
$result = queries ( $query . implode ( " , " , $rows ));
if ( ! $result ) {
break ;
}
2009-08-29 13:55:09 +00:00
$affected += count ( $rows );
2009-08-20 15:05:35 +00:00
$length = strlen ( $query );
$rows = array ();
}
$rows [] = $s ;
2009-04-16 13:18:22 +00:00
}
2009-08-20 15:05:35 +00:00
if ( ! $key ) {
$query .= " VALUES " ;
$length += strlen ( $query );
}
}
if ( $result ) {
$result = queries ( $query . implode ( " , " , $rows ));
2009-08-29 13:55:09 +00:00
$affected += count ( $rows );
2009-04-16 13:18:22 +00:00
}
2009-08-20 15:05:35 +00:00
query_redirect ( queries (), remove_from_uri ( " page " ), lang ( '%d row(s) have been imported.' , $affected ), $result , false , ! $result );
2009-07-24 10:52:24 +00:00
} else {
$error = upload_error ( $file );
2009-04-16 13:18:22 +00:00
}
2008-08-16 21:15:46 +00:00
}
2008-01-08 14:02:55 +00:00
}
2009-07-11 19:45:57 +00:00
2009-07-27 11:25:37 +00:00
page_header ( lang ( 'Select' ) . " : " . $adminer -> tableName ( $table_status ), $error );
2008-01-08 14:02:55 +00:00
2009-08-29 13:57:50 +00:00
$foreign_keys = column_foreign_keys ( $TABLE );
2009-01-23 15:50:42 +00:00
echo " <p> " ;
2007-07-09 06:12:22 +00:00
if ( isset ( $rights [ " insert " ])) {
2009-07-30 08:12:54 +00:00
$set = " " ;
foreach (( array ) $_GET [ " where " ] as $val ) {
if ( count ( $foreign_keys [ $val [ " col " ]]) == 1 && ( $val [ " op " ] == " = "
|| ( $val [ " op " ] == " " && ! ereg ( '[_%]' , $val [ " val " ])) // LIKE in Editor
)) {
$set .= " &set " . urlencode ( " [ " . bracket_escape ( $val [ " col " ]) . " ] " ) . " = " . urlencode ( $val [ " val " ]);
}
}
2009-08-29 13:57:50 +00:00
echo '<a href="' . h ( ME . 'edit=' . urlencode ( $TABLE ) . $set ) . '">' . lang ( 'New item' ) . '</a> ' ;
2007-07-02 05:51:26 +00:00
}
2009-07-27 11:25:37 +00:00
echo $adminer -> selectLinks ( $table_status );
2007-07-02 05:51:26 +00:00
2007-07-06 13:03:13 +00:00
if ( ! $columns ) {
2009-07-28 16:20:50 +00:00
echo " <p class='error'> " . lang ( 'Unable to select the table' ) . ( $fields ? " " : " : " . h ( $dbh -> error )) . " . \n " ;
2007-07-06 13:03:13 +00:00
} else {
2008-08-07 10:57:28 +00:00
echo " <form action='' id='form'> \n " ;
2009-07-27 14:40:55 +00:00
echo " <div style='display: none;'> " ;
2009-07-28 16:20:50 +00:00
echo ( strlen ( $_GET [ " server " ]) ? '<input type="hidden" name="server" value="' . h ( $_GET [ " server " ]) . '">' : " " );
2009-08-29 13:54:25 +00:00
echo ( strlen ( DB ) ? '<input type="hidden" name="db" value="' . h ( DB ) . '">' : " " ); // not used in Editor
2009-08-29 13:57:50 +00:00
echo '<input type="hidden" name="select" value="' . h ( $TABLE ) . '">' ;
2009-07-27 14:40:55 +00:00
echo " </div> \n " ;
$adminer -> selectColumnsPrint ( $select , $columns );
$adminer -> selectSearchPrint ( $where , $columns , $indexes );
$adminer -> selectOrderPrint ( $order , $columns , $indexes );
$adminer -> selectLimitPrint ( $limit );
$adminer -> selectLengthPrint ( $text_length );
$adminer -> selectActionPrint ( $text_length );
2007-07-06 13:03:13 +00:00
echo " </form> \n " ;
2009-07-28 14:21:05 +00:00
$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 " ]) : " " ) : " " );
2009-07-27 11:25:37 +00:00
echo $adminer -> selectQuery ( $query );
2008-09-01 12:22:26 +00:00
2009-05-08 05:23:03 +00:00
$result = $dbh -> query ( $query );
2007-09-03 11:12:38 +00:00
if ( ! $result ) {
2009-07-28 16:20:50 +00:00
echo " <p class='error'> " . h ( $dbh -> error ) . " \n " ;
2007-07-06 13:03:13 +00:00
} else {
2009-07-11 22:44:22 +00:00
$email_fields = array ();
2008-12-30 15:19:35 +00:00
echo " <form action='' method='post' enctype='multipart/form-data'> \n " ;
2007-09-03 11:12:38 +00:00
if ( ! $result -> num_rows ) {
2009-07-11 20:30:40 +00:00
echo " <p class='message'> " . lang ( 'No rows.' ) . " \n " ;
2007-09-03 11:12:38 +00:00
} else {
2009-07-14 10:06:35 +00:00
$rows = array ();
while ( $row = $result -> fetch_assoc ()) {
$rows [] = $row ;
}
2009-07-16 14:20:05 +00:00
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
2009-07-28 14:21:05 +00:00
$found_rows = ( intval ( $limit ) && $group && count ( $group ) < count ( $select )
2009-07-16 14:20:05 +00:00
? $dbh -> result ( $dbh -> query ( " SELECT FOUND_ROWS() " )) // space to allow mysql.trace_mode
: count ( $rows )
);
2009-07-14 10:06:35 +00:00
2009-07-27 11:25:37 +00:00
$descriptions = $adminer -> rowDescriptions ( $rows , $foreign_keys );
2007-09-03 11:12:38 +00:00
2009-08-29 13:57:50 +00:00
$backward_keys = $adminer -> backwardKeys ( $TABLE );
2009-08-20 15:29:32 +00:00
$table_names = array ();
if ( $backward_keys ) {
foreach ( $backward_keys as $key => $val ) {
$val = $adminer -> tableName ( table_status ( $key ));
if ( strlen ( $val )) {
$table_names [ $key ] = $val ;
}
}
2009-07-21 21:10:19 +00:00
}
2009-07-15 14:56:27 +00:00
2009-08-25 10:25:56 +00:00
echo " <table cellspacing='0' class='nowrap' onclick='table_click(event);'> \n " ;
2009-07-14 10:06:35 +00:00
echo " <thead><tr><td><input type='checkbox' id='all-page' onclick='form_check(this, /check/);'> " ;
2009-07-23 15:49:59 +00:00
$names = array ();
reset ( $select );
2009-07-31 09:43:53 +00:00
$order = 1 ;
2009-07-14 10:06:35 +00:00
foreach ( $rows [ 0 ] as $key => $val ) {
2009-07-23 15:49:59 +00:00
$val = $_GET [ " columns " ][ key ( $select )];
2009-07-24 06:33:30 +00:00
$field = $fields [ $select ? $val [ " col " ] : $key ];
2009-07-27 16:51:40 +00:00
$name = ( $field ? $adminer -> fieldName ( $field , $order ) : " * " );
2009-07-21 13:59:02 +00:00
if ( strlen ( $name )) {
2009-07-27 16:51:40 +00:00
$order ++ ;
2009-07-23 15:49:59 +00:00
$names [ $key ] = $name ;
2009-07-28 16:20:50 +00:00
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
2009-07-21 13:59:02 +00:00
}
2009-07-23 15:49:59 +00:00
next ( $select );
2009-07-14 10:06:35 +00:00
}
2009-07-28 15:28:29 +00:00
echo ( $table_names ? " <th> " . lang ( 'Relations' ) : " " ) . " </thead> \n " ;
2009-07-20 15:34:05 +00:00
foreach ( $descriptions as $n => $row ) {
2009-07-28 12:56:38 +00:00
$unique_idf = implode ( '&' , unique_idf ( $rows [ $n ], $indexes ));
2009-08-29 13:57:50 +00:00
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 ( DB ) ? '' : " <a href=' " . h ( ME ) . " edit= " . urlencode ( $TABLE ) . " & $unique_idf '> " . lang ( 'edit' ) . " </a> " );
2007-09-03 11:12:38 +00:00
foreach ( $row as $key => $val ) {
2009-07-24 09:52:18 +00:00
if ( isset ( $names [ $key ])) {
2009-07-22 13:58:54 +00:00
if ( strlen ( $val ) && ( ! isset ( $email_fields [ $key ]) || strlen ( $email_fields [ $key ]))) {
2009-07-23 15:49:59 +00:00
$email_fields [ $key ] = ( is_email ( $val ) ? $names [ $key ] : " " ); //! filled e-mails may be contained on other pages
2009-07-21 13:59:02 +00:00
}
2009-07-21 16:22:42 +00:00
$link = " " ;
2009-07-27 16:32:56 +00:00
$val = $adminer -> editVal ( $val , $fields [ $key ]);
2009-07-21 13:59:02 +00:00
if ( ! isset ( $val )) {
$val = " <i>NULL</i> " ;
2007-09-03 11:12:38 +00:00
} else {
2009-07-24 10:14:36 +00:00
if ( ereg ( 'blob|binary' , $fields [ $key ][ " type " ]) && strlen ( $val )) {
2009-08-29 13:57:50 +00:00
$link = h ( ME . 'download=' . urlencode ( $TABLE ) . '&field=' . urlencode ( $key ) . '&' ) . $unique_idf ;
2009-07-24 10:14:36 +00:00
}
2009-07-21 13:59:02 +00:00
if ( ! strlen ( trim ( $val , " \t " ))) {
$val = " " ;
2009-07-24 10:14:36 +00:00
} elseif ( strlen ( $text_length ) && ereg ( 'blob|text' , $fields [ $key ][ " type " ]) && is_utf8 ( $val )) {
2009-07-23 17:28:29 +00:00
$val = nl2br ( shorten_utf8 ( $val , max ( 0 , intval ( $text_length )))); // usage of LEFT() would reduce traffic but complicate query
2009-07-21 13:59:02 +00:00
} else {
2009-07-28 16:20:50 +00:00
$val = nl2br ( h ( $val ));
2007-09-03 11:12:38 +00:00
}
2009-07-21 13:59:02 +00:00
2009-08-03 13:37:29 +00:00
if ( ! $link ) { // link related items
foreach (( array ) $foreign_keys [ $key ] as $foreign_key ) {
if ( count ( $foreign_keys [ $key ]) == 1 || count ( $foreign_key [ " source " ]) == 1 ) {
foreach ( $foreign_key [ " source " ] as $i => $source ) {
$link .= where_link ( $i , $foreign_key [ " target " ][ $i ], $rows [ $n ][ $source ]);
}
$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
break ;
2009-07-21 13:59:02 +00:00
}
2007-09-03 11:12:38 +00:00
}
2007-07-06 13:03:13 +00:00
}
2007-07-02 15:52:15 +00:00
}
2009-07-22 13:58:54 +00:00
if ( ! $link && is_email ( $val )) {
$link = " mailto: $val " ;
}
2009-07-27 11:25:37 +00:00
$val = $adminer -> selectVal ( $val , $link , $fields [ $key ]);
2009-07-21 13:59:02 +00:00
echo " <td> $val " ;
2007-07-02 05:51:26 +00:00
}
}
2009-07-28 15:28:29 +00:00
if ( $table_names ) {
2009-07-15 14:56:27 +00:00
echo " <td> " ;
2009-07-28 15:28:29 +00:00
foreach ( $table_names as $table => $name ) {
foreach ( $backward_keys [ $table ] as $columns ) {
2009-08-03 13:37:29 +00:00
$link = ME . 'select=' . urlencode ( $table );
2009-07-15 14:56:27 +00:00
$i = 0 ;
foreach ( $columns as $column => $val ) {
2009-08-03 13:37:29 +00:00
$link .= where_link ( $i ++ , $column , $rows [ $n ][ $val ]);
2009-07-15 14:56:27 +00:00
}
2009-08-03 13:37:29 +00:00
echo " <a href=' " . h ( $link ) . " '> $name </a> " ;
2009-07-15 14:56:27 +00:00
}
}
}
2009-07-14 10:06:35 +00:00
echo " \n " ;
2007-07-25 16:31:47 +00:00
}
2007-09-03 11:12:38 +00:00
echo " </table> \n " ;
2008-09-01 10:25:29 +00:00
2009-07-16 14:20:05 +00:00
if ( intval ( $limit ) && count ( $group ) >= count ( $select )) {
// slow with big tables
ob_flush ();
flush ();
2009-08-29 13:57:50 +00:00
$found_rows = $dbh -> result ( $dbh -> query ( " SELECT COUNT(*) FROM " . idf_escape ( $TABLE ) . ( $where ? " WHERE " . implode ( " AND " , $where ) : " " )));
2009-07-16 14:20:05 +00:00
}
2008-09-01 10:25:29 +00:00
echo " <p> " ;
if ( intval ( $limit ) && $found_rows > $limit ) {
2009-06-21 23:20:32 +00:00
// display first, previous 3, next 3 and last page
2007-09-03 11:12:38 +00:00
$max_page = floor (( $found_rows - 1 ) / $limit );
2009-07-15 11:31:17 +00:00
echo lang ( 'Page' ) . " : " . pagination ( 0 ) . ( $_GET [ " page " ] > 3 ? " ... " : " " );
2007-09-03 11:12:38 +00:00
for ( $i = max ( 1 , $_GET [ " page " ] - 2 ); $i < min ( $max_page , $_GET [ " page " ] + 3 ); $i ++ ) {
2009-07-15 11:31:17 +00:00
echo pagination ( $i );
2007-09-03 11:12:38 +00:00
}
2009-07-15 11:31:17 +00:00
echo ( $_GET [ " page " ] + 3 < $max_page ? " ... " : " " ) . pagination ( $max_page );
2007-07-25 16:31:47 +00:00
}
2009-07-11 20:30:40 +00:00
echo " ( " . lang ( '%d row(s)' , $found_rows ) . ') <label><input type="checkbox" name="all" value="1">' . lang ( 'whole result' ) . " </label> \n " ;
2008-09-01 12:22:26 +00:00
2009-08-29 13:54:25 +00:00
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' ) . " ' $confirm ></div></fieldset> \n " );
2009-08-28 11:49:57 +00:00
echo " <fieldset><legend> " . lang ( 'Export' ) . " </legend><div> $dump_output $dump_format $dump_compress <input type='submit' name='export' value=' " . lang ( 'Export' ) . " '></div></fieldset> \n " ;
2007-07-02 05:51:26 +00:00
}
2009-07-11 20:30:40 +00:00
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 " ;
2009-07-11 19:45:57 +00:00
2009-07-28 11:18:08 +00:00
$adminer -> selectEmailPrint ( array_filter ( $email_fields , 'strlen' ));
2009-07-11 19:45:57 +00:00
2008-12-30 15:19:35 +00:00
echo " </form> \n " ;
2007-07-02 05:51:26 +00:00
}
}