/[sql-web-session]/index.cgi
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 /index.cgi

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

revision 23 by dpavlin, Sat Apr 18 23:14:41 2009 UTC revision 24 by dpavlin, Sat Apr 18 23:21:40 2009 UTC
# Line 153  $t = time() - $t; Line 153  $t = time() - $t;
153    
154  print $sth->rows, qq| rows in $t s</code>|;  print $sth->rows, qq| rows in $t s</code>|;
155    
 #my @types = map { scalar $dbh->type_info($_)->{TYPE_NAME} } @{ $sth->{TYPE} };  
 my $types = dump( $sth->{TYPE} );  
 print qq{  
 <script type="text/javascript">  
 var column_type = $types ;  
 </script>  
 };  
   
156  @columns = @{ $sth->{NAME} } if $#columns == 0 && $columns[0] eq '*';  @columns = @{ $sth->{NAME} } if $#columns == 0 && $columns[0] eq '*';
157    
 print qq|<table id="results">|;  
   
 my $counter = 0;  
 sub table_row {  
         my $cell = shift;  
         my $class = $counter++ % 2 == 0 ? ' class=o' : '';  
         return  
                   qq|<tr $class><$cell>|  
                 . join( qq|</$cell><$cell>|, @_ )  
                 . qq|</$cell></tr>|  
                 ;  
   
 }  
   
 print table_row( 'th', @columns );  
   
 while ( my @row = $sth->fetchrow_array ) {  
         print table_row( 'td', @row );  
 }  
   
158  print  print
159          qq|</table>|            start_form( -id => 'sql', -class => 'fixed' )
         , start_form( -id => 'sql', -class => 'fixed' )  
160    
161          , qq|<input type=button value="[=]" onclick="\$('form#sql').toggleClass('fixed'); return false;" title="toggle fixed position" class="right">|          , qq|<input type=button value="[=]" onclick="\$('form#sql').toggleClass('fixed'); return false;" title="toggle fixed position" class="right">|
162          , qq|<input type=button value="[x]" onclick="\$('form#sql').toggleClass('visible'); return false;" title="hide sql editor" class="right">|          , qq|<input type=button value="[x]" onclick="\$('form#sql').toggleClass('visible'); return false;" title="hide sql editor" class="right">|
# Line 206  print Line 177  print
177                  <input type=button name=lookup_col title="lookup column details">                  <input type=button name=lookup_col title="lookup column details">
178                  <input type=button name=close_group_by value="[x]" disabled=1>                  <input type=button name=close_group_by value="[x]" disabled=1>
179                  <div id="lookup"></div>                  <div id="lookup"></div>
180                  <span>                  </span>
181          |          |
182    
183          , qq|<label for=group_by>group by</label>|          , qq|<label for=group_by>group by</label>|
# Line 224  print Line 195  print
195          , submit( -name => 'execute', -value => 'execute' )          , submit( -name => 'execute', -value => 'execute' )
196    
197          , end_form          , end_form
198            ;
199    
200    #my @types = map { scalar $dbh->type_info($_)->{TYPE_NAME} } @{ $sth->{TYPE} };
201    my $types = dump( $sth->{TYPE} );
202    print qq{
203    <script type="text/javascript">
204    var column_type = $types ;
205    </script>
206    };
207    
208    print qq|<table id="results">|;
209    
210    my $counter = 0;
211    sub table_row {
212            my $cell = shift;
213            my $class = $counter++ % 2 == 0 ? ' class=o' : '';
214            return
215                      qq|<tr $class><$cell>|
216                    . join( qq|</$cell><$cell>|, @_ )
217                    . qq|</$cell></tr>|
218                    ;
219    
220    }
221    
222    print table_row( 'th', @columns );
223    
224    while ( my @row = $sth->fetchrow_array ) {
225            print table_row( 'td', @row );
226    }
227    
228    print qq|</table>|
229          , qq|</body></html>|          , qq|</body></html>|
230          ;          ;

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

  ViewVC Help
Powered by ViewVC 1.1.26