I could not connect to the database. Please try again later.
\n"; exit(); } $last_modify_date = OracleNow(); $date_submitted = $last_modify_date; $status = 'pending'; $abstract = ereg_replace("'", "''", $abstract); $url = ereg_replace("'", "''", $url); $practice_title = ereg_replace("'", "''", $practice_title); $submitter_name = ereg_replace("'", "''", $submitter_name); $practice_title = ereg_replace("'", "''", $practice_title); $practice_lock_file = '/afs/umbc.edu/public/www/grantsites/diversity/db/lock_submit'; $fp = fopen($practice_lock_file, 'w'); flock($fp, 2); $sql = 'SELECT max(practice_id) FROM practice'; $parsed_sql = OCIParse($connection, $sql); OCIExecute($parsed_sql); $practice_id = OCIFetch($parsed_sql) ? OCIResult($parsed_sql, 1) + 1 : 1; OCIFreeStatement($parsed_sql); $sql = "INSERT INTO Practice (practice_id, practice_title, abstract, " . "url, status, last_modifier_id, last_modify_date, submitter_name, " . "submitter_email, date_submitted) VALUES('$practice_id', " . "'$practice_title', '$abstract', '$url', '$status', '', " . "TO_DATE('$last_modify_date', '$oracle_now_format'), " . "'$submitter_name', '$submitter_email', " . "TO_DATE('$date_submitted', '$oracle_now_format') )"; $parsed_sql = OCIParse($connection, $sql); $result = OCIExecute($parsed_sql); OCIFreeStatement($parsed_sql); flock($fp, 3); fclose($fp); $practice_incomplete = 1; if($result) { $url = ''; $abstract = ''; $practice_title = ''; $practice_warning_message = 'Your practice was successfully submitted.'; } else { $practice_warning_message = 'There was a problem with submitting the practice. ' . 'Please try again.'; } include($diversity_include_path . 'create_practice.inc'); if(! $result) { $error = OCIError(); $error_email = "There was an error in submitting a new practice.\n\n" . $error['message'] . "\n\n"; $error_email .= "Practice Title : " . $practice_title . "\n\nSubmitter Email : " . $submitter_email . "\n\n"; mail($maintainer, 'Error with USM Diversity Site', $error_email); exit(); } $admin_message = "A new practice has been submitted for approval.\n" . "Please click " . "" . "here to log in and review it.\n\n"; $sql = 'SELECT email_address FROM users'; $parsed_sql = OCIParse($connection, $sql); OCIExecute($parsed_sql); while( OCIFetch($parsed_sql) ) { $admin_email = OCIResult($parsed_sql, 1); mail($admin_email, 'New USM Diversity Practice submitted', $admin_message); } $submitter_message = "Your new practice has been submitted, and is currently " . "awaiting approval.\n\n"; mail($submitter_email, 'New USM Diversity Practice received', $submitter_message); OCILogoff($connection); exit(); ?>