'deleted', 'Withdraw' => 'withdrawn', 'Restore' => 'restored' ); if (isset($_POST['action']) && preg_match("/^(Delete|Withdraw|Restore) Submissions$/", $_POST['action'], $matches) && !empty($_POST['papers'])) { $action = $matches[1]; // Check for valid submission if (!validToken('chair')) { warn('Invalid submission'); } foreach ($_POST['papers'] as $paperid) { if (preg_match("/^\d+$/",$paperid)) { // restore paper? if ($action == 'Restore') { print "restoring id $paperid ...
\n"; restorePaper($paperid); } else { // withdraw paper? if ($action == 'Withdraw') { print "withdrawing id $paperid ...\n"; if (! withdrawPaper($paperid, 'Chair')) { print " SUBMISSION NOT FOUND\n"; } } else { print "deleting id $paperid ...\n"; } // delete paper deletePaper($paperid); } } else { print "Unable to process submission id " . safeHTMLstr($paperid) . ".
\n"; } } print ' Submission(s) have been ' . $verbAR[$action] . '.
';
printFooter();
exit;
}
if (!isset($_GET['s']) || ($_GET['s'] == "id")) {
$sortby = "paperid";
$rsortstr = 'ID
' . $OC_sortImg;
$tsortstr = 'Title';
$nsortstr = 'Contact Author';
$ssortstr = 'Stud.';
} elseif ($_GET['s'] == "title") {
$sortby = "title";
$tsortstr = 'Title
' . $OC_sortImg;
$rsortstr = 'ID';
$nsortstr = 'Contact Author';
$ssortstr = 'Stud.';
} elseif ($_GET['s'] == "student") {
$sortby = "student, paperid";
$ssortstr = 'Stud.
' . $OC_sortImg;
$tsortstr = 'Title';
$rsortstr = 'ID';
$nsortstr = 'Contact Author';
} else { // name sort
$sortby = "name_last, name_first";
$nsortstr = 'Contact Author
' . $OC_sortImg;
$rsortstr = 'ID';
$tsortstr = 'Title';
$ssortstr = 'Stud.';
}
$q = "SELECT " . OCC_TABLE_PAPER . ".paperid, CONCAT_WS(' ',name_first,name_last) AS name, title, format, student FROM " . OCC_TABLE_PAPER . " LEFT JOIN " . OCC_TABLE_AUTHOR . " ON " . OCC_TABLE_AUTHOR . ".paperid=" . OCC_TABLE_PAPER . ".paperid AND " . OCC_TABLE_AUTHOR . ".position=" . OCC_TABLE_PAPER . ".contactid ORDER BY $sortby";
$r = ocsql_query($q) or err("Unable to get submissions");
if (mysql_num_rows($r) == 0) {
print 'No submissions have been made yet.
'; } else { print "Count: ".mysql_num_rows($r)."
\n"; print ' Note: When deleting a submission, all records associated with the submission is permanently removed. When withdrawing a submission, all reviews and assignments, uploaded files, etc, are permanently removed; the submission (paper) and author table data however may be restored.
'; } $q = "SELECT `paperid`, `title`, `contact_author`, `contact_email`, `withdraw_date`, `withdrawn_by` FROM `" . OCC_TABLE_WITHDRAWN . "` ORDER BY `paperid`"; $r = ocsql_query($q) or err('Unable to check for withdrawn submissions'); if (mysql_num_rows($r) > 0) { print '
Withdrawn Submissions
Note: Restoring a withdrawn submission will not restore all the submission data, only the information stored in the submission (paper) and authors table.
'; } printFooter(); ?>