prepare( 'INSERT INTO uploaded_files (original_filename, new_filename, uploaded_by, user_id) VALUES (?, ?, ?, ?)' ); $stmt->execute([$original_filename, $new_filename, $_SESSION['user_email'], $_SESSION['user_id']]); $message = 'Success! Your file "' . htmlspecialchars($original_filename) . '" has been uploaded and is pending validation.'; $message_type = 'success'; } catch (PDOException $e) { // If DB insert fails, it's critical to let the user know. $message = 'File uploaded, but failed to record the submission. Please contact support.'; $message_type = 'danger'; // Optionally, log the detailed error: error_log($e->getMessage()); } } else { $message = 'An error occurred while saving the file. Please try again.'; $message_type = 'danger'; } } } } ?>
Please select the IEPR XML report file you wish to submit. The file will be validated against the required schema before being processed.