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

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

revision 1.3 by dpavlin, Wed May 10 08:55:28 2000 UTC revision 1.4 by dpavlin, Wed May 31 14:32:39 2000 UTC
# Line 31  $dbh->do("set datestyle = 'german'") || Line 31  $dbh->do("set datestyle = 'german'") ||
31    
32  my $sth;  my $sth;
33    
34    open(WHO,"who am i |") || die "who am i? $!";
35    my $db_user=<WHO>;
36    chomp $db_user;
37    $db_user=~s/\s.+$//g;
38    close(WHO);
39    
40    open(HOSTNAME,"hostname |") || die "hostname: $!";
41    my $hostname=<HOSTNAME>;
42    chomp $hostname;
43    close(HOSTNAME);
44    
45    my $sth = $dbh->prepare("select ko_id from unix2ko where login='$db_user' and host='$hostname'") || die $dbh->errstr();
46    $sth->execute() || die $sth->errstr();
47    my ($ko_id)=$sth->fetchrow_array;
48    
49  #$sth = $dbh->prepare("select id from kontakt_osobe where e_mail like '%hana%'") || die $dbh->errstr();  #$sth = $dbh->prepare("select id from kontakt_osobe where e_mail like '%hana%'") || die $dbh->errstr();
50  #$sth->execute() || die $sth->errstr();  #$sth->execute() || die $sth->errstr();
51  #($kontakt_osoba_id) = $sth->fetchrow_array();  #($kontakt_osoba_id) = $sth->fetchrow_array();
# Line 91  $sth->execute() || die $sth->errstr(); Line 106  $sth->execute() || die $sth->errstr();
106  while (my @arr = $sth->fetchrow_array() ) {  while (my @arr = $sth->fetchrow_array() ) {
107          print join("|",@arr),"\n";          print join("|",@arr),"\n";
108    
109          $dbh->do("insert into status (osoba_id,kontakt_osoba_id,datum,status_tip_id) values ($arr[0],3,'now'::datetime,5)") if (!$debug);          $dbh->do("insert into status (osoba_id,kontakt_osoba_id,datum,status_tip_id) values ($arr[0],$ko_id,'now'::datetime,5)") if (!$debug);
110    
111          seek(IN,$begin_pos,0);          seek(IN,$begin_pos,0);
112          while(<IN>) {          while(<IN>) {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26