/[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 20 by dpavlin, Sat Apr 18 14:05:13 2009 UTC revision 22 by dpavlin, Sat Apr 18 14:18:48 2009 UTC
# Line 9  use DBI; Line 9  use DBI;
9  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
10  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
11    
12    print qq{Content-type: text/html\r\n\r\n};
13    
14  our $dsn    = 'DBI:Pg:dbname=syslog';  our $dsn    = 'DBI:Pg:dbname=syslog';
15  our $user   = 'dpavlin';  our $user   = 'dpavlin';
16  our $table  = 'log';  our $table  = 'log';
# Line 63  if ( my $group_by = param('lookup_col') Line 65  if ( my $group_by = param('lookup_col')
65          my $sth = $dbh->prepare( $sql );          my $sth = $dbh->prepare( $sql );
66          $sth->execute;          $sth->execute;
67          $t = time() - $t;          $t = time() - $t;
68          print header, qq|$t<table><tr><th>|, join(qq|</th><th>|, @cols), qq|</th></tr>|;          print qq|$t<table><tr><th>|, join(qq|</th><th>|, @cols), qq|</th></tr>|;
69          while ( my @row = $sth->fetchrow_array ) {          while ( my @row = $sth->fetchrow_array ) {
70                  my $n = shift @row;                  my $n = shift @row;
71                  $n = 'NULL' unless defined $n;                  $n = 'NULL' unless defined $n;
# Line 74  if ( my $group_by = param('lookup_col') Line 76  if ( my $group_by = param('lookup_col')
76          exit;          exit;
77  }  }
78    
79  print header, q|  print q|
80    
81  <html>  <html>
82  <head>  <head>
# Line 169  while ( my @row = $sth->fetchrow_array ) Line 171  while ( my @row = $sth->fetchrow_array )
171    
172  print  print
173          qq|</table>|          qq|</table>|
174          , start_form( -id => 'sql' )          , start_form( -id => 'sql', -class => 'fixed' )
175    
176          , qq|<input type=button value="[x]" onclick="\$('form#sql').toggleClass('visible'); return false;" title="hide sql editor" class="close">|          , qq|<input type=button value="[=]" onclick="\$('form#sql').toggleClass('fixed'); return false;" title="toggle fixed position" class="right">|
177            , qq|<input type=button value="[x]" onclick="\$('form#sql').toggleClass('visible'); return false;" title="hide sql editor" class="right">|
178    
179          , qq|<label for=columns>select</label>|          , qq|<label for=columns>select</label>|
180          , checkbox_group( -name => 'columns', -values => [ @columns ], -defaults => [ @columns ] )          , checkbox_group( -name => 'columns', -values => [ @columns ], -defaults => [ @columns ] )

Legend:
Removed from v.20  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26