7 use C4::Interface::CGI::Output;
13 my $op = $query->param('op');
14 my $search = $query->param('titleorissn');
15 my $startfrom=$query->param('startfrom');
21 my $dbh = C4::Context->dbh;
22 my @marclist = $query->param('marclist');
23 my @and_or = $query->param('and_or');
24 my @excluding = $query->param('excluding');
25 my @operator = $query->param('operator');
26 my @value = $query->param('value');
28 my $resultsperpage= $query->param('resultsperpage');
29 $resultsperpage = 19 if(!defined $resultsperpage);
33 my $sth = $dbh->prepare("select subscriptionid, biblionumber from subscription");
36 while (my $first_step = $sth->fetchrow_hashref)
38 my $sth2 = $dbh->prepare("select b3.title from biblioitems b2, biblio b3 where b3.biblionumber = ? and b2.biblionumber = b3.biblionumber and (b2.issn = ? or b3.title like ?)");
39 $sth2->execute($first_step->{'biblionumber'},$search, "%$search%");
41 @answear = $sth2->fetchrow_array;
42 $total = scalar @answear;
45 $first_step->{'serial'} = $answear[0];
46 push @finalsolution ,$first_step;
49 my ($template, $loggedinuser, $cookie)
50 = get_template_and_user({template_name => "bull/receipt-search-result.tmpl",
54 flagsrequired => {catalogue => 1},
57 $template->param(subtable => \@finalsolution, total => $total
61 my $displayprev=$startfrom;
62 if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
69 for(my $i = 0 ; $i <= $#marclist ; $i++)
71 push @field_data, { term => "marclist", val=>$marclist[$i] };
72 push @field_data, { term => "and_or", val=>$and_or[$i] };
73 push @field_data, { term => "excluding", val=>$excluding[$i] };
74 push @field_data, { term => "operator", val=>$operator[$i] };
75 push @field_data, { term => "value", val=>$value[$i] };
80 if ($total>$resultsperpage)
82 for (my $i=1; $i<$total/$resultsperpage+1; $i++)
87 ($startfrom==($i-1)) && ($highlight=1);
88 push @numbers, { number => $i,
89 highlight => $highlight ,
90 searchdata=> \@field_data,
96 my $from = $startfrom*$resultsperpage+1;
99 if($total < (($startfrom+1)*$resultsperpage))
103 $to = (($startfrom+1)*$resultsperpage);
105 $results = \@finalsolution;
106 $template->param(result => $results) if $results;
108 startfrom=> $startfrom,
109 displaynext=> $displaynext,
110 displayprev=> $displayprev,
111 resultsperpage => $resultsperpage,
112 startfromnext => $startfrom+1,
113 startfromprev => $startfrom-1,
114 searchdata=>\@field_data,
120 output_html_with_http_headers $query, $cookie, $template->output;
124 my ($template, $loggedinuser, $cookie)
125 = get_template_and_user({template_name => "bull/receipt.tmpl",
128 authnotrequired => 0,
129 flagsrequired => {catalogue => 1},
132 output_html_with_http_headers $query, $cookie, $template->output;