/[informatika.old]/print/izvjestaj.pl
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 /print/izvjestaj.pl

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

revision 1.9 by dpavlin, Thu Jul 13 08:01:31 2000 UTC revision 1.10 by dpavlin, Fri Jan 25 14:47:50 2002 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  my $ic_mail='biljana.gombar@pliva.hr';  my $ic_mail='biljana.gombar@pliva.hr,antonio.gulam@pliva.hr';
6  my $mreze_mail='davorin.koprivnjak@pliva.hr';  my $mreze_mail='davorin.koprivnjak@pliva.hr';
7    
8  my $debug=0;  my $debug=0;
# Line 10  my $debug=0; Line 10  my $debug=0;
10  use DBI;  use DBI;
11  use POSIX qw(strftime);  use POSIX qw(strftime);
12    
13  $debug++ if ($ARGV[0] eq "-d");  $debug++ if (defined $ARGV[0] && $ARGV[0] eq "-d");
14    
15  print STDERR "Debug mod: output je u /tmp/debug*\n" if ($debug);  print STDERR "Debug mod: output je u /tmp/debug*\n" if ($debug);
16    
# Line 55  if (! defined($db_user)) { Line 55  if (! defined($db_user)) {
55          $db_user="user=$db_user;";          $db_user="user=$db_user;";
56  }  }
57    
58    my $dbh = DBI->connect("DBI:Pg:dbname=informatika;${host}${db_user}","","") || die "can't connect";
59  my $dbh = DBI->connect("DBI:Pg:dbname=informatika;${host}${db_user}","","") || die $DBI::errstr;  # die $DBI::errstr;
60  $dbh->do("set datestyle = 'german'") || die $dbh->errstr();  $dbh->do("set datestyle = 'german'") || die $dbh->errstr();
61    
62  my $sth = $dbh->prepare("select id from last_print order by id desc limit 1,1");  my $sth = $dbh->prepare("select id from last_print order by id desc limit 1,1");
# Line 88  sa potpunim podacima o umrežavanju, loka Line 88  sa potpunim podacima o umrežavanju, loka
88  print HTML "  print HTML "
89  <br>Datum i vrijeme generiranja izvještaja: $currdate<p>";  <br>Datum i vrijeme generiranja izvještaja: $currdate<p>";
90    
91  $sth = $dbh->prepare("  my $sql="
92          select osobe.id,ime,prezime,tel,lokacije.naziv,          select osobe.id,ime,prezime,tel,lokacije.naziv,
93                  org_jed.naziv,org_pod_jed.pod_naziv,                  org_jed.naziv,org_pod_jed.pod_naziv,
94                  lok_racunala,objekt,kat,soba,z_rac,umrezavanje,                  lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
# Line 100  $sth = $dbh->prepare(" Line 100  $sth = $dbh->prepare("
100                  and podesavanje=true                  and podesavanje=true
101                  and kontakt_osobe.id=kontakt_osoba_id                  and kontakt_osobe.id=kontakt_osoba_id
102          order by lokacije.naziv,org_jed.naziv          order by lokacije.naziv,org_jed.naziv
103          ") || die $dbh->errstr();          ";
104    
105    die "nema osoba za izvještaj" if (! @osoba_id_za_print);
106    
107    $sth = $dbh->prepare($sql) || die $dbh->errstr();
108  $sth->execute() || die $sth->errstr();  $sth->execute() || die $sth->errstr();
109    
110  my $rbr=1;  my $rbr=1;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26