include_once "/var/www/html/includes/services_includes.php"; ?>
$title = "In Process/On Order Book Request"; ?>
addElement('header', null, 'In Process Request');
$form->addElement('hidden','subject','',array('style'=>'display:none'));
$locations = build_pickups(2);
$s =& $form->createElement('select','pickup','Where do you want to pick up the material?');
$s->loadArray($locations,1);
$form->addElement($s);
$form->addElement('static','s1','','Items requested will ordinarily be available within two working days. Please go to the library you selected above to pick up the materials.');
$form->addElement('text', 'name', 'Enter your fullname:', array('size' => 40, 'maxlength' => 255));
$form->addElement('text', 'barcode', 'Enter your barcode ID:', array('size' => 40, 'maxlength' => 255));
$phone[] = &HTML_QuickForm::createElement('text','areacode',null,'size="3"');
$phone[] = &HTML_QuickForm::createElement('text','exchange',null,'size="3"');
$phone[] = &HTML_QuickForm::createElement('text','last4',null,'size="4"');
$form->addGroup($phone,'phone_number','Phone: ','-');
$form->addElement('text', 'email', 'Enter your complete e-mail address:', array('size' => 40, 'maxlength' => 255));
$form->addGroup($annx,'location','Book Information: ','
');
$form->addElement('text', 'author', 'Author/Editor', array('size' => 40, 'maxlength' => 255));
$form->addElement('text', 'pubtitle', 'Title:', array('size' => 40, 'maxlength' => 255));
$form->addElement('text', 'edition', 'Edition Date:', array('size' => 40, 'maxlength' => 255));
$form->addElement('static','s3','','Note: You may paste the record from the Main Catalog in the field below. You may also use this space for comments and suggestions.');
$form->addElement('textarea','record','',array('rows'=>5,'cols'=>30));
$form->addElement('submit', null, 'Send');
// Define filters and validation rules
$form->applyFilter('name', 'trim');
$form->addRule('name', 'Please enter your name.', 'required', null, 'server');
$form->addRule('pickup', 'Please select a pickup location.', 'required', null, 'server');
$form->registerRule('checkblank','function','isblank');
$form->addRule('pickup', 'Please select a pickup location.', 'checkblank');
#$form->addRule('barcode', 'Please enter your barcode.', 'required');
$form->addRule('phone', 'Please enter your phone number.', 'required');
$form->addRule('email', 'Please enter your complete valid e-mail address.', 'required');
$form->addRule('email', 'Please enter your complete valid e-mail address.', 'email');
$form->addRule('pubtitle', 'Please enter the title.', 'required');
if ($form->validate()) {
$email = htmlspecialchars($form->exportValue('email'));
$name = htmlspecialchars($form->exportValue('name'));
$barcode = htmlspecialchars($form->exportValue('barcode'));
$phone_num = $form->exportValue('phone_number');
$ph = htmlspecialchars($phone_num['areacode']).' - '.htmlspecialchars($phone_num['exchange']).' - '.htmlspecialchars($phone_num['last4']);
$pickupid = $form->exportValue('pickup');
$pickup = htmlspecialchars(return_pickup($pickupid));
$recip = "fstcirc@Princeton.EDU";
#$pickup = htmlspecialchars(return_pickup($form->exportValue('pickup')));
$pubtitle = htmlspecialchars($form->exportValue('pubtitle'));
$edition = htmlspecialchars($form->exportValue('edition'));
$author = htmlspecialchars($form->exportValue('author'));
$record = nl2br(htmlspecialchars($form->exportValue('record')));
$headers = "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 3\n";
$headers .= "From: $email\n";
$headers .= "Reply-to: $email\n";
$omsg .= "Requestor: $name - $email\n";
$omsg .= "\nBarcode: $barcode\n";
$omsg .= "Phone number: $ph\n";
$omsg .= "Pickup location: $pickup\n";
$omsg .= "Title: $pubtitle\n";
$omsg .= "Edition: $edition\n";
$omsg .= "Author: $author\n";
$spamfield = $form->exportValue('subject');
# Send Email if Captcha Successful
form_logging($recip, 'In Process Request:'. $sub, $omsg, $email, $headers);
if (strlen($spamfield)==0) {
if ($email=="abarrera@princeton.edu") {
$recip="abarrera@princeton.edu";
}
send_mail($recip,$email,'In Process Request: '.$sub, $omsg);
echo "
Request submitted.
Your In Process / On Order request has been successfully transmitted. Thank you for using this service of the Princeton University Library.
";
echo "
";
echo "
".nl2br($omsg)."
";
$conmsg = "This is a copy for your records of the In Process / On Order Request you submitted. Please remember that items requested will ordinarily be available within two working days. Please go to $pickup to pick up the materials.
";
$omsg = $conmsg.$omsg;
} else {
echo "
Request submitted.
Your In Process request has been successfully transmitted. Thank you for using this service of the Princeton University Library.
";
spam_attempts($recip, 'In Process Request Spam:'. $sub, $omsg."\n$_POST[subject]", $email, $headers);
$fp = fopen("logging/comments.log", "a");
fwrite($fp, "========\n");
fwrite($fp,date("m/d/Y H:m")."\n");
fwrite($fp,"$_SERVER[HTTP_REFERER]==$_SERVER[REQUEST_URI]\n");
fwrite($fp,"Subject: $sub\n");
fwrite($fp,"Message: $omsg\n");
fwrite($fp,"Headers: $headers\n");
fwrite($fp,"IP: ".$_SERVER["REMOTE_ADDR"]."\n");
$sql = "SELECT DISTINCT
Count(`captured_spam`.`ip_address`) AS `countofattempts`,
`captured_spam`.`ip_address` FROM `captured_spam` where ip_address='$_SERVER[REMOTE_ADDR]' GROUP BY
`captured_spam`.`ip_address` order by `countofattempts` DESC";
$res = db_query($sql);
$infoip = db_returnrow($res);
if ($infoip[0] >= 20) {
fwrite($fp,"BLOCKED\n");
} else {
#mail($recip,"Annex Web Form: ".$sub, $omsg, $headers);
send_mail("abarrera@princeton.edu",$email,'In Process Request Spam: '.$sub, $omsg);
}
fclose($fp);
}
} else {
?>
In Process Firestone books may be picked up at Circulation in 1-2 business
days. On Order books have not yet been received. You will be notified when they
have been received and are available for you.
Required fields are marked with an asterisk (*).
$renderer =& new HTML_QuickForm_Renderer_Default(true);
$head_tpl = "\n\t
\n\t\t{header} | \n\t
";
$form_tpl = "\n
";
$renderer->setFormTemplate($form_tpl);
$renderer->setHeaderTemplate($head_tpl);
$renderer->setElementTemplate("\n\t
\n\t\t\n\t\t{element}
| \n\t
", "s1");
$renderer->setElementTemplate("\n\t
\n\t\t\n\t\t{element}
| \n\t
", "s2");
$renderer->setElementTemplate("\n\t
\n\t\t\n\t\t{element}
| \n\t
", "s3");
$form->accept($renderer);
echo $renderer->toHtml();
#$form->display();
}
?>
page_footer($is_hp=false)
?>