1 |
<%args> |
<%args> |
|
$page => 1 |
|
2 |
$sth => undef |
$sth => undef |
3 |
</%args> |
</%args> |
4 |
<%init> |
<%init> |
18 |
<% $action->form_field('sql_query') %> |
<% $action->form_field('sql_query') %> |
19 |
<% $action->form_field('database') %> |
<% $action->form_field('database') %> |
20 |
<% Jifty->web->form->submit( label => 'Try it!' ) %> |
<% Jifty->web->form->submit( label => 'Try it!' ) %> |
|
<% Jifty->web->form->end() %> |
|
|
</&> |
|
21 |
|
|
22 |
% if ( defined($sth) ) { |
% if ( defined($sth) ) { |
23 |
|
|
32 |
% while ( my @row = $sth->fetchrow_array() ) { |
% while ( my @row = $sth->fetchrow_array() ) { |
33 |
<tr> |
<tr> |
34 |
% foreach my $v ( @row ) { |
% foreach my $v ( @row ) { |
35 |
<td><% $v %></td> |
<td><% defined($v) ? $v : 'NULL' %></td> |
36 |
% } |
% } |
37 |
</tr> |
</tr> |
38 |
% } |
% } |
39 |
|
|
40 |
</table> |
</table> |
41 |
|
|
42 |
|
<%perl> |
43 |
|
my $save = Jifty->web->new_action( |
44 |
|
class => 'CreateQuery', |
45 |
|
arguments => { |
46 |
|
sql_query => $action->form_field('sql_query'), |
47 |
|
on_database => $action->form_field('database'), |
48 |
|
} |
49 |
|
); |
50 |
|
|
51 |
|
</%perl> |
52 |
|
|
53 |
|
<% $save->form_field('name') %> |
54 |
|
<% $save->button( label => 'Save' ) %> |
55 |
|
|
56 |
% } |
% } |
57 |
|
|
58 |
|
<% Jifty->web->form->end() %> |
59 |
|
</&> |
60 |
|
|