6 use C4::Output; # contains gettemplate
12 my $op=$query->param("op");
13 if ($op eq "export") {
14 print $query->header('Content-Type: text/marc');
15 my $start_bib = $query->param("start_bib");
16 my $end_bib = $query->param("end_bib");
17 my $dbh=C4::Context->dbh;
19 if ($start_bib && $end_bib) {
20 $sth=$dbh->prepare("select bibid from marc_biblio where bibid >=? and bibid <=? order by bibid");
21 $sth->execute($start_bib,$end_bib);
23 $sth=$dbh->prepare("select bibid from marc_biblio order by bibid");
26 while (my ($bibid) = $sth->fetchrow) {
27 my $record = MARCgetbiblio($dbh,$bibid);
29 print $record->as_usmarc();
32 my ($template, $loggedinuser, $cookie)
33 = get_template_and_user({template_name => "export/marc.tmpl",
37 flagsrequired => {parameters => 1},
40 print $query->header(-cookie => $cookie), $template->output;