Please see the release notes and apply update scripts if necessary.");
//by default, require first name, last name, birth year (because month and day are pulldowns), and gender
//otherwise, if $_GET['required_entries'] was passed in, use this list
$required_info = (isset($_GET['required_entries']))? $_GET['required_entries'] : "name_first,name_last,dob_year,gender";
$required_info_list = explode(",",$required_info);
// check provided data
$valid_sid = FALSE;
if ((isset($_POST["response_submit"])) && ($_POST["response_submit"] == "subject_id")) {
$name_last = trim($_POST['name_last']);
$name_first = trim($_POST['name_first']);
$name_middle = trim($_POST['name_middle']);
$dob = $_POST['dob_yr']."-".$_POST['dob_mo']."-".$_POST['dob_day'];
//Assume submitted subject Info is valid unless one of the following tests fails
$valid_sid = TRUE;
if(in_array("name_first",$required_info_list)) {
// was a first name provided?
if($error_fn = check_post($name_first, "First Name", "non-numeric", FALSE)) {
printf("
%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_FIRST_NAME);
$valid_sid = FALSE;
}
}
if(in_array("name_last",$required_info_list)) {
// was a last name provided?
if($error_ln = check_post($name_last, "Last Name", "non-numeric", FALSE)) {
printf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_LAST_NAME);
$valid_sid = FALSE;
}
}
if(in_array("dob_year",$required_info_list)) {
// was a date of birth provided?
if($error_dob = check_post($_POST['dob_yr'], "Birth Year", "int16", FALSE,(intval(date("Y"))-125),intval(date("Y")))) {
printf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_DOB);
$valid_sid = FALSE;
}
}
if(in_array("gender",$required_info_list)) {
if($error_gender = ($_POST['gender'] == 'unselected')) {
printf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_GENDER);
$valid_sid = FALSE;
}
}
if(in_array("county",$required_info_list)) {
if($error_county = check_post($_POST['county'],"County","non-numeric",FALSE)) {
printf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_COUNTY);
$valid_sid = FALSE;
}
}
if(in_array("state",$required_info_list)) {
if($error_county = check_post($_POST['state'],"State","non-numeric",FALSE)) {
printf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_STATE);
$valid_sid = FALSE;
}
}
}
?>