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

Diff of /trunk/share/web/templates/sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/share/web/templates/sql.html revision 9 by dpavlin, Sat Dec 2 23:53:00 2006 UTC trunk/share/web/templates/sql revision 23 by dpavlin, Mon Dec 4 15:15:54 2006 UTC
# Line 1  Line 1 
1  <%args>  <%args>
 $page => 1  
2  $sth => undef  $sth => undef
3    
4    $sql_query => undef
5    $name => undef
6    $database => undef
7    
8  </%args>  </%args>
9  <%init>  <%init>
10    
# Line 16  $sth = $result->content('sth') if $resul Line 20  $sth = $result->content('sth') if $resul
20    
21  <&| /_elements/wrapper, title => "Try out SQL query" &>  <&| /_elements/wrapper, title => "Try out SQL query" &>
22  <% Jifty->web->form->start() %>  <% Jifty->web->form->start() %>
23  <% $action->form_field('sql_query') %>  <% $action->form_field('sql_query',
24  <% $action->form_field('database') %>          default_value => $sql_query,
25  <% Jifty->web->form->submit( label => 'Try it!' ) %>  ) %>
26    <% $action->form_field('database',
27            default_value => $database,
28    ) %>
29    <div class="submit_button">
30    <% $action->button( label => 'Try it!' ) %>
31    
32    
33    % if ( defined($sth) ) {
34    
35    <% Jifty->web->link(
36            label => 'Save',
37            onclick => {
38                    region => 'save_query',
39                    replace_with => '/save',
40                    args => {
41                            sql_query => $action->argument_value('sql_query'),
42                            database => $action->argument_value('database'),
43                    },
44                    refresh_self => 1,
45                    toggle => 1,
46            },
47            as_button => 1,
48    ) %>
49    
50    </div>
51  <% Jifty->web->form->end() %>  <% Jifty->web->form->end() %>
52  </&>  
53    <% Jifty->web->region(
54            name => 'save_query',
55    ) %>
56    
57    </div>
58    
59  <table cellpadding="3" cellspacing="0" border="1">  <table cellpadding="3" cellspacing="0" border="1">
60    
# Line 33  $sth = $result->content('sth') if $resul Line 67  $sth = $result->content('sth') if $resul
67  % while ( my @row = $sth->fetchrow_array() ) {  % while ( my @row = $sth->fetchrow_array() ) {
68  <tr>  <tr>
69  %       foreach my $v ( @row ) {  %       foreach my $v ( @row ) {
70  <td><% $v %></td>  <td><% defined($v) ? $v : 'NULL' %></td>
71  %       }  %       }
72  </tr>  </tr>
73  % }  % }
74    
75  </table>  </table>
76    
77    % } else {
78    
79    </div><!-- submit_button -->
80    <% Jifty->web->form->end() %>
81    
82    % }
83    
84    <% Jifty->web->return( label => "Go back" ) %>
85    
86    </&>
87    

Legend:
Removed from v.9  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26