--- print/print.pl 2000/05/10 08:55:28 1.3 +++ print/print.pl 2000/05/31 14:32:39 1.4 @@ -31,6 +31,21 @@ my $sth; +open(WHO,"who am i |") || die "who am i? $!"; +my $db_user=; +chomp $db_user; +$db_user=~s/\s.+$//g; +close(WHO); + +open(HOSTNAME,"hostname |") || die "hostname: $!"; +my $hostname=; +chomp $hostname; +close(HOSTNAME); + +my $sth = $dbh->prepare("select ko_id from unix2ko where login='$db_user' and host='$hostname'") || die $dbh->errstr(); +$sth->execute() || die $sth->errstr(); +my ($ko_id)=$sth->fetchrow_array; + #$sth = $dbh->prepare("select id from kontakt_osobe where e_mail like '%hana%'") || die $dbh->errstr(); #$sth->execute() || die $sth->errstr(); #($kontakt_osoba_id) = $sth->fetchrow_array(); @@ -91,7 +106,7 @@ while (my @arr = $sth->fetchrow_array() ) { print join("|",@arr),"\n"; - $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); seek(IN,$begin_pos,0); while() {