Changed search interface to allow searches on Illustrator. This is
[koha_fer] / marc / koha2marc
1 #!/usr/bin/perl
2
3
4
5 #  CAREFUL!!!!
6 # This next line deletes _ALL_ of the existing MARC data from the
7 # MySQL tables!!!  It is only in here during development!!!!
8
9 system("mysql Koha -pkohapass < deletemarc");
10
11 use C4::Database;
12 use C4::Catalogue;
13 use CGI;
14 use DBI;
15 #use strict;
16 use C4::Acquisitions;
17 use C4::Output;
18 my $dbh=C4Connect;
19 my $userid=$ENV{'REMOTE_USER'};
20
21
22 my $dbh=C4Connect;
23
24
25 my $sth=$dbh->prepare("select * from biblio,biblioitems where biblio.biblionumber=biblioitems.biblionumber");
26 $sth->execute;
27 my $env;
28 $env->{'marconly'}=1;
29
30 while (my $biblioitem=$sth->fetchrow_hashref) {
31     print "Processing $biblioitem->{'title'}\n";
32     my $Record_ID;
33     ($env, $Record_ID) = newBiblioItem($env,$biblioitem);
34     my $sti=$dbh->prepare("select * from items,biblioitems where items.biblioitemnumber=biblioitems.biblioitemnumber and biblioitems.biblioitemnumber=$biblioitem->{'biblioitemnumber'}");
35     $sti->execute;
36     while (my $item=$sti->fetchrow_hashref) {
37         newItem($env, $Record_ID, $item);
38     }
39 }