/[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 3 by dpavlin, Mon Apr 13 20:23:55 2009 UTC revision 6 by dpavlin, Tue Apr 14 12:43:07 2009 UTC
# Line 90  my $group_by = param('add_group_by'); Line 90  my $group_by = param('add_group_by');
90  if ( $group_by ) {  if ( $group_by ) {
91          @columns = ( "count($group_by)", $group_by );          @columns = ( "count($group_by)", $group_by );
92          my $g;          my $g;
93          foreach my $c ( @where_parts, param('order_by'), $group_by ) {          foreach my $c ( @where_parts, $group_by ) {
94                  $c =~ s/\s.+$//;                  $c =~ s/\s.+$//;
95                  $g->{$c}++ if length($c) > 0;                  $g->{$c}++ if length($c) > 0;
96          }          }
# Line 99  if ( $group_by ) { Line 99  if ( $group_by ) {
99          param('where_value','');          param('where_value','');
100          param('group_by', $group_by);          param('group_by', $group_by);
101          param('columns', [ @columns ], [ @columns ]);          param('columns', [ @columns ], [ @columns ]);
102            param('order_by', $columns[0] . ' desc');
103  } else {  } else {
104          $group_by = param('group_by');          $group_by = param('group_by');
105  }  }
# Line 177  print Line 178  print
178          qq|</table>|          qq|</table>|
179          , start_form( -id => 'sql' )          , start_form( -id => 'sql' )
180    
181            , qq|<a href="#" onclick="\$('form#sql').toggleClass('visible'); return false;" class=close>close</a>|
182    
183          , qq|<label for=columns>select</label>|          , qq|<label for=columns>select</label>|
184          , checkbox_group( -name => 'columns', -values => [ @columns ], -defaults => [ @columns ] )          , checkbox_group( -name => 'columns', -values => [ @columns ], -defaults => [ @columns ] )
185    

Legend:
Removed from v.3  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26