[set page_title][L]Individual Table Export[/L][/set] [set table_perm]=x[/set] [set ui_class]Admin[/set] [set help_name]export.main[/set] [set icon_name]icon_config.gif[/set] @_UI_STD_HEAD_@ [page __UI_BASE__/dbdownload][L]Multiple table export[/L]
[seti user_tables][loop list="[list-databases]"][if-mm function=export table="[loop-code]"][loop-code] [/if-mm][/loop][/seti] [seti tables][scratch user_tables] __UI_ACCESS_TABLE__ __UI_META_TABLE__[/seti] [perl table="[scratch tables]"] my @tables = grep /\S/, split /\s+/, $Scratch->{tables}; my $out; for(@tables) { #Log("table $_"); unless (ref $Db{$_}) { Log("bad table %s", $_); next; } $tables{$_} = [ $Db{$_}->columns() ]; } $out = "
EOF [/perl] [if cgi ui_export_database] [update values] [seti result][export-database table="[value mv_data_table]" file="[value mv_data_file]" type="[value mv_data_export_type]" sort="[if value ui_sort_field][value ui_sort_field]:[value ui_sort_option][/if]" ][/seti] [if scratch result] Export of table [cgi mv_data_table] successful

[quick-table] Table name: [value mv_data_table] File name: [default mv_data_file] File type: [default mv_data_export_type][if value ui_sort_field] Sorting: [value ui_sort_field]:[value ui_sort_option][/if] [/quick-table] [else]

> Database export error: [data session last_error]

[/else] [/if] [/if]
[if cgi mv_data_table] [value name=mv_data_table set="[cgi mv_data_table]" hide=1] [/if] [form-session-id]

[L]Export complete table to file[/L]
[L]Table to export[/L] |
[L]Export as[/L] |
[L]Export to file[/L] ([L]leave empty for default file[/L]) |
[L]Sort by column[/L] |
[L]Sort options[/L] |
[set [L]Export[/L]] ui_export_database=1 [/set]

[set joincol] [calc] my $cols = $CGI->{cols}; $cols =~ s/[\s,\0]+/,/g; $cols =~ s/^,+//; $cols =~ s/,+$//; $CGI->{sql} = "select $cols from $CGI->{mv_data_table}"; return; [/calc] [/set] [form-session-id]

Download table slice
[L]Fields from[/L] [cgi mv_data_table] [L]to download[/L] Check all Uncheck all | [display name=cols type=checkbox_left_4 passed="[db-columns table='[cgi mv_data_table]' joiner=',']"]
[L]Output File[/L] |
[L]Export to file[/L] ([L]leave empty for default file[/L]) |

@_UI_STD_FOOTER_@