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">| |
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>| |
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 |
; |
; |