' . oc_('Submissions are closed.') . '
'; printFooter(); exit; } // File upload settings $uploadDir = $OC_configAR['OC_paperDir']; $extAR = $OC_configAR['OC_extar']; $fileNotice = $OC_configAR['OC_paperFldNote']; $formatDBFldName = 'format'; $fileFldName = 'File'; if (oc_hookSet('author-submit-preprocess')) { foreach ($GLOBALS['OC_hooksAR']['author-submit-preprocess'] as $hook) { require_once $hook; } } require_once OCC_FORM_INC_FILE; require_once OCC_SUBMISSION_INC_FILE; // Check whether this is a submission if (isset($_POST['submit'])) { $err = ''; $errInc = ''; $qfields = array(); // fields to insert into submission table $afields = array(); // fields to insert into authors table $tfields = array(); // fields to insert into topics table $fileUploaded = false; require_once 'submission-validate.inc'; // errors? if (!empty($err)) { print '' . oc_('Please check the following:') . '' . $err . $errInc . '
' . oc_('This submission appears to already have been made; please check your email for a confirmation. '); if ($OC_statusAR['OC_edit_open']) { print sprintf(oc_('You may review or edit the submission here.'), 'edit.php') . ' '; } print oc_('Please contact the Chair with any questions.') . '
'; printFooter(); exit; } $backupMsg = ''; // add paper $q = "INSERT INTO `" . OCC_TABLE_PAPER . "` SET `submissiondate`='" . safeSQLstr(date("Y-m-d")) . "', `lastupdate`='" . safeSQLstr(date("Y-m-d")) . "'"; foreach ($qfields as $qid => $qval) { $q .= ", `" . $qid . "`=" . $qval; } $r = ocsql_query($q) or err(oc_('unable to process submission')); $backupMsg .= "$q\n\n"; // get paper ID $pid = mysql_insert_id() or err(oc_('unable to get submission ID')); // add authors foreach ($afields as $qid => $qar) { $q = "INSERT INTO `" . OCC_TABLE_AUTHOR . "` SET `paperid`=" . $pid . ", `position`=" . $qid; foreach ($qar as $qqid => $qqval) { $q .= ", `" . $qqid . "`=" . $qqval; } $r = ocsql_query($q) or err(oc_('unable to add one or more authors, but submission added. Please edit submission.')); $backupMsg .= "$q\n\n"; } // add topic(s) if (!empty($tfields)) { $q = "INSERT INTO `" . OCC_TABLE_PAPERTOPIC . "` (`paperid`,`topicid`) VALUES"; foreach ($tfields as $t) { $q .= " ($pid,$t),"; } $r = ocsql_query(rtrim($q, ',')) or err(oc_('unable to add submission topic, but submission and authors added')); $backupMsg .= "$q\n\n"; } if (!empty($OC_configAR['OC_subBackupEmail'])) { sendEmail($OC_configAR['OC_subBackupEmail'], "Submission ID $pid SQL", $backupMsg); } $formFields = oc_('Submission ID') . ": " . $pid . "\n\n" . oc_genFieldMessage($OC_submissionFieldSetAR, $OC_submissionFieldAR, $_POST); // confirm it $confirmmsg = '' . sprintf(' ' . oc_('Thank you for your submission. Your submission ID number is %s. Please write this number down and include it in any communications with us.') . ' ' . oc_('Below is the information submitted. We have also emailed a copy to the contact author. If you notice any problems or do not receive the email within 24 hours, please contact the Chair.') . ' ' . sprintf(oc_('Your file failed to load properly. Please try uploading just the file or contact the Chair.'), 'upload.php') . ' >>> ' . oc_('Proceed to upload file') . '
' . safeHTMLstr($formFields) . ''; sendEmail($contactemail, sprintf(oc_('Submission ID %s'), $pid), $mailbody, $OC_configAR['OC_notifyAuthorSubmit']); printFooter(); exit; } // else no errors } print '