Index: ossp-pkg/quos/quos.cgi RCS File: /v/ossp/cvs/ossp-pkg/quos/quos.cgi,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/quos/quos.cgi,v' 2>/dev/null --- quos.cgi 2004/10/26 16:56:28 1.4 +++ quos.cgi 2004/10/27 16:23:46 1.5 @@ -1,4 +1,4 @@ -#!/usr/opkg/bin/perl +#!/usr/opkg/bin/perl ## ## OSSP quos - Query On Steroids ## Copyright (c) 2004 Ralf S. Engelschall @@ -33,7 +33,10 @@ # create objects my $cgi = new CGI; my $html = new String::Divert; +my $nr_lops = 4; +my $nr_rows = 7; $html->overload(1); +#&printparams($cgi); # generate outer canvas $html .= "
\n"; @@ -75,71 +78,104 @@ # sample $html >> "query"; -$html .= "this is the query part
"; -$html .= $cgi->popup_menu(-name=>'opr1c1', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c2', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c3', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'fieldr1', - -values=>['name','description','foo'], - -default=>'name'); -$html .= $cgi->popup_menu(-name=>'opr1c4', - -values=>['=','begins with','ends with'], - -default=>'='); -$html .= $cgi->textfield(-name=>'valuer1'); -$html .= '
'; -$html .= $cgi->popup_menu(-name=>'opr1c1', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c2', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c3', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'fieldr1', - -values=>['name','description','foo'], - -default=>'name'); -$html .= $cgi->popup_menu(-name=>'opr1c4', - -values=>['=','begins with','ends with'], - -default=>'='); -$html .= $cgi->textfield(-name=>'valuer1'); -$html .= '
'; -$html .= $cgi->popup_menu(-name=>'opr1c1', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c2', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'opr1c3', - -values=>['(',')','!','&','|'], - -default=>'&'); -$html .= $cgi->popup_menu(-name=>'fieldr1', - -values=>['name','description','foo'], - -default=>'name'); -$html .= $cgi->popup_menu(-name=>'opr1c4', - -values=>['=','begins with','ends with'], - -default=>'='); -$html .= $cgi->textfield(-name=>'valuer1'); -$html .= '
'; -$html .= $cgi->submit('Action','submit'); +$html .= "parametrize your query
"; +$html .= $cgi->start_html("query on steroids"); +$html .= $cgi->start_form; +$html .= ""; +$html .= '
'; +for ($i = 0; $i < $cgi->param('nr_rows'); $i++) { + $html .= ""; + for ($j = $cgi->param('nr_lops') -1; $j >= 0; $j--) { + $html .= ""; + } + $html .= "'; + $html .= ''; + $html .= ''; + $html .= '
'; + $html .= ''; +} +$html .= "
"; + $html .= $cgi->popup_menu(-name=>"logop$j-$i", + -values=>[' ','(',')','!','&','|'], + -default=>' '); + $html .= ""; + $html .= $cgi->popup_menu(-name=>"f_name-$i", + -values=>['name','description','foo'], + -default=>'name'); + $html .= ''; + $html .= $cgi->popup_menu(-name=>"f_operator-$i", + -values=>['=','begins with','ends with'], + -default=>'='); + $html .= ''; + $html .= $cgi->textfield(-name=>"f_value-$i"); + $html .= '
"; +$html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; +$html .= '
'; + $html .= $cgi->popup_menu(-name=>"nr_lops", + -values=>[1..9], + -default=>'3'); + $html .= ''; + $html .= $cgi->popup_menu(-name=>'nr_rows', + -values=>[1..9], + -default=>'4'); + $html .= ''; + $html .= $cgi->submit('act_matrix_upd','update'); + $html .= ''; + $html .= $cgi->submit('act_matrix_clear','clear'); + $html .= ''; + $html .= $cgi->submit('act_matrix_submit','submit'); + $html .= '
'; + +$html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; +$html .= '
'; + $html .= 'name of query'; + $html .= ''; + $html .= $cgi->submit('act_matrix_clear','load'); + $html .= ''; + $html .= $cgi->submit('act_matrix_submit','delete'); + $html .= '
'; + $html .= $cgi->textfield(-name=>'name_persquery'); + $html .= ''; + $html .= $cgi->submit('act_matrix_clear','save'); + $html .= ''; + $html .= 'hyperlink'; + $html .= '
'; + +$html .= ''; +$html .= $cgi->end_form; sub printparams { my($cgi) = @_; my(@values,$key); foreach $key ($cgi->param) { - print "$key -> "; - @values = $query->param($key); - print join(", ",@values),"
\n"; + $html .= "$key -> "; + @values = $cgi->param($key); + $html .= join(", ",@values)."
\n"; } } +# my($cgi) = @=; + + + $html << 1; # read HTML skeleton @@ -159,7 +195,6 @@ ); $http .= $html; print STDOUT $http; -&printparams($cgi); __END__