/[nn.old]/trunk/search/nn-swish.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 /trunk/search/nn-swish.cgi

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

revision 76 by dpavlin, Wed Jun 26 08:55:39 2002 UTC revision 77 by dpavlin, Wed Jun 26 09:42:48 2002 UTC
# Line 11  require Unicode::Map8; Line 11  require Unicode::Map8;
11  my $dir='/home/dpavlin/nn/swish';  my $dir='/home/dpavlin/nn/swish';
12    
13  my $hits=0;  my $hits=0;
14    my $max_hits=100;
15    
16    my %labels = (100=>' 100', 200=>' 200', 500=>' 500', 0=>'neograničeno');
17    
18  print header(-charset=>'iso-8859-2'),start_html(-title=>'NN pretrazivanje',-lang=>'hr'),start_form;  print header(-charset=>'iso-8859-2'),start_html(-title=>'NN pretrazivanje',-lang=>'hr'),start_form;
19  print "Potraži zakone sa riječima: ",textfield('search');  print "Potraži ",popup_menu(-name=>'max_hits',-values=>[ sort keys %labels ],-labels=>\%labels,-default=>$max_hits)," zakona sa riječima: ",textfield('search');
20  print submit(-value=>'prikaži');  print submit(-value=>'prikaži');
21  print end_form,hr;  print end_form,hr;
22    
# Line 51  if (param('search')) { Line 54  if (param('search')) {
54  #                       my @fields = $hit->field_names;  #                       my @fields = $hit->field_names;
55  #                       print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields;  #                       print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields;
56                  },                  },
57                    maxhits => param('max_hits'),
58          );          );
59    
60          die $SWISH::errstr unless $sh;          die $SWISH::errstr unless $sh;
# Line 58  if (param('search')) { Line 62  if (param('search')) {
62          $hits = $sh->query("naslov_czs=($s)");          $hits = $sh->query("naslov_czs=($s)");
63    
64          if ($hits > 0) {          if ($hits > 0) {
65                  print p,hr,"Nađeno je $hits zakona... <small>($s)</small>";                  print p,hr,"Prikazujem $hits zakona (maks. ",param('max_hits'),")... <small>($s)</small>";
66          } else {          } else {
67                  print p,"Nije nađen niti jedan zakon... <small>($s, ",$sh->errstr,")</small>";                  print p,"Nije nađen niti jedan zakon... <small>($s, ",$sh->errstr,")</small>";
68          }          }

Legend:
Removed from v.76  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.26