include("../include/irm.inc");
AuthCheck("5");
if("$entry"=="add") {
$new_date = date("Y-m-d H:i:s");
$comments = addslashes($comments);
$query = "INSERT INTO agreements VALUES (NULL, '$name', '$description', '$comments', '$notes', '$contact_a', '$contact_t', '$new_date')";
$count = $adb->dbh_do($query);
$query = "SELECT ID FROM agreements WHERE (date_mod = '$new_date')";
$sth = $adb->prepare($query);
if($sth)
{
$res = $sth->execute();
$result = $sth->fetchrow_hash();
$ID = $result["ID"];
logevent($ID, "agreements", 4, "database", "$IRMName added record");
} else
{
PRINT "Could not prepare query: ".$sth->errstr."
\n";
}
header("Location: http://$SERVER_NAME/$USERPREFIX/agreements/?field=name&phrasetype=contains&contains=&sort=name");
}?>
commonHeader("IRM Agreements - Add Form");
PRINT "Fill out this form to add a new agreement.";
?>