#!/usr/local/bin/perl use Postgres; $cutoff_date = $ARGV[0]; $amount = $ARGV[1]; $user = $ARGV[2]; if ($user eq "") { print "usage: warn \n"; exit; } if ($amount eq "") { print "usage: warn \n"; exit; } if ($cutoff_date eq "") { print "usage: warn \n"; exit; } $dbh = db_connect("pimpy", undef); if (!$dbh) { print "Insert into history failed: $Postgres::error\n"; exit 1; } $statement = "insert into _history values (" . "'$user'" . "," . "'$amount'" . "," . "'$cutoff_date'" . ")"; #print "$statement\n"; $result = $dbh->execute("$statement"); if (!$result) { print "Insert into _history failed:$Postgres::error\n"; exit 1; } system("echo \"Our records indicate that you have an upaid balance of \$ $amount. Have \nwe made a mistake? Please take a few minutes to check your records \nand contact Shari (shari\@infocom.com or 935-6294) who will be glad \nto help sort this out. \n\nWe would like to hear from you by $cutoff_date, this will prevent an\ninterruption in your Internet access.\n\nThank You, \nThe Accounts Receivable Department\"|mail -s '* Accounts Receivable Warning - $user' -c charliep,shari $user")/256 == 0 || die "could not mail warning to $user: $!";