/[SQLSession]/trunk/share/web/templates/sql.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/share/web/templates/sql.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9 - (show annotations)
Sat Dec 2 23:53:00 2006 UTC (17 years, 5 months ago) by dpavlin
File MIME type: text/html
File size: 775 byte(s)
added template which produce SQL results in table from entered SQL query
1 <%args>
2 $page => 1
3 $sth => undef
4 </%args>
5 <%init>
6
7 my $action = Jifty->web->new_action(
8 class => 'DoSQL',
9 moniker => 'execute_sql',
10 );
11
12 my $result = Jifty->web->response->result('execute_sql');
13 $sth = $result->content('sth') if $result and !defined $sth;
14
15 </%init>
16
17 <&| /_elements/wrapper, title => "Try out SQL query" &>
18 <% Jifty->web->form->start() %>
19 <% $action->form_field('sql_query') %>
20 <% $action->form_field('database') %>
21 <% Jifty->web->form->submit( label => 'Try it!' ) %>
22 <% Jifty->web->form->end() %>
23 </&>
24
25 <table cellpadding="3" cellspacing="0" border="1">
26
27 <tr>
28 % foreach my $col ( @{ $sth->{'NAME'} } ) {
29 <th><% $col %></th>
30 % }
31 </tr>
32
33 % while ( my @row = $sth->fetchrow_array() ) {
34 <tr>
35 % foreach my $v ( @row ) {
36 <td><% $v %></td>
37 % }
38 </tr>
39 % }
40
41 </table>

  ViewVC Help
Powered by ViewVC 1.1.26