include_once "data_valid_fns.php"; include_once "data.php"; $submitted = false; $missing = false; // email addresses for each library $deptemail = array("Architecture Library"=>"trace@princeton.edu", "East Asian Library"=>"trace@princeton.edu", "Engineering Library"=>"trace@princeton.edu", "Fine Hall Library"=>"trace@princeton.edu", "Firestone Library"=>"trace@princeton.edu", "Lewis Library"=>"trace@princeton.edu", "Marquand Libary"=>"trace@princeton.edu", "Mendel Music Library"=>"trace@princeton.edu", "Plasma Physics Library"=>"trace@princeton.edu", "Stokes Library"=>"trace@princeton.edu"); // if form submitted, process it if (count($HTTP_POST_VARS) > 0) { // form submitted; clean up fields $submitted = true; foreach ($HTTP_POST_VARS as $key=>$value) { $$key = stripslashes(trim($value)); } // see if any required fields are missing if (!$fullname || !$email || !$callnum) { // yep $missing = true; } else if (!valid_email($email)) { $missing = true; $email_err = true; } else { // form's ok; format and send e-mail $recip = $deptemail[$pickup]; //$recip = "gpmenos@princeton.edu"; if (!$recip) { $recip = "trace@princeton.edu"; } $from = "\"$fullname\" <$email>"; $subject = "Trace Request"; $msg .= "Name: $fullname\n"; $msg .= "Barcode: $barcode\n"; if ($phone) { $msg .= "Phone: $phone\n"; } $msg .= "E-mail address: $email\n"; $msg .= "Pick up at: $pickup\n\n"; if ($location) { $msg .= "Location of item: $location\n\n"; } $msg .= "Call Number: $callnum\n\n"; $msg .= "Title of item: $pubtitle\n\n"; if ($volnum) { $msg .= "Volume/Year(s): $volnum\n\n"; } if ($author) { $msg .= "Author: $author\n\n"; } if ($articletitle) { $msg .= "Article title: $articletitle\n\n"; } if ($pagenums) { $msg .= "Page number(s): $pagenums\n\n"; } $msg .= "Record/Comments: $comments\n"; $headers = "From: $from\r\n"; $headers .= "Reply-To: $from\r\n"; mail($recip, $subject, $msg, $headers); } } $title = "Trace Request"; ?>
include_once "/var/www/html/includes/services_includes.php"; ?> $title = "Library Services "; ?>If a book or journal you have searched for is not on the shelf and not checked out or marked missing in the Main Catalog, please complete this form so that circulation staff can follow up on the problem. You will be notified of the results of the trace in approximately one week.
Fields marked with an asterisk (*) are required.
}
if ($submitted && $missing)
{
// form submitted, but fields missing
?>
Please check required fields.
if ($email_err) { ?> Please enter complete email address!
} ?>
Please fill in all required fields, marked with an asterisk (*).
}
if ($submitted && !$missing)
{
// form submitted successfully
?>
Request submitted.
Your trace request has been successfully
transmitted. Thank you for using this service of the Princeton
University Library.
} else { ?>