sub logEvent() {

    my ($employer_id,$contact,$summary,$event) = @_;

    #### Make sure user is set, else set it...
    if ($contact eq "") { $contact = $ENV{'REMOTE_USER'}; }

    #### Make sure it's not a duplicate
    $sql = "SELECT * from employer_history where 
	employer_id=? and date_format(tstamp,'%Y-%m-%d')=curdate() 
	and contact=? and event_summary=?";
    $sth = $dbh->prepare($sql);
    $sth->execute($employer_id,$contact,$summary);
    if (@tmp = $sth->fetchrow_array()) { return(1); }

    #### If we made it this far, log the event...
    $sql = "INSERT INTO employer_history SET
	employer_id=?, contact=?, tstamp=now(), event_summary=?, event=?";
    $sth = $dbh->prepare($sql);
    $sth->execute($employer_id,$contact,$summary,$event);
    return(0);

}
####################################################################
sub printProposalOptions() {

    my ($dbh,$usage_type,$show_pricing,$defaults) = @_;

    #### Load up the proposal options depending on the type of proposal
    #### this is.

    if ($usage_type eq "partner") {
        $usage = "advertiser";
    } else { $usage = $usage_type; }

    $sql = "SELECT * FROM proposal_options WHERE usage_type like ?";
    $sth = $dbh->prepare($sql);
    $sth->execute($usage);

    print "<table cellspacing=0 width=100%>";
    $count=0;
    while ($hash = $sth->fetchrow_hashref()) {
        $description = "<font face=verdana size=1>$hash->{'description'}";
	if ($show_pricing) {
          $description .= "&nbsp;&nbsp;<b>Price: $hash->{'individual_pricing'}</b>";
	}
        $description =~ s/\n//g;
        $description =~ s/\cM//g;
        $description =~ s/\'/\\\'/g;
        $description =~ s/\"//g;
        if ($count == 0) {print "<tr>";}
        print "<td width=1><input type=checkbox name=option$hash->{'option_id'} value=true";
	if (grep{$hash->{option_id} == $_} @$defaults) {
	  print " checked";
	}
	print "></td>
        <td nowrap><a href=# onMouseover=\"ddrivetip('$description',250)\";
        onMouseout=\"hideddrivetip()\"><font size=1 face=tahoma><b>
        $hash->{'option_title'}</a></td>";
        $count++;
        if ($count == 4) {print "</tr>"; $count=0;}

    }
    print "</table>";
}

1;
