Please go back and select at least one submission and one advocate
'; } else { // Get conflicts? if ($OC_configAR['OC_allowConflictOverride'] && isset($_POST['conflict_override']) && ($_POST['conflict_override'] == 1)) { $conflictAR = array(); } else { $conflictAR = getConflicts(); } // Assign advocates (and reviewers?) // NOTE: Although a foreach is used below for future expansion, there should only be 1 advocate $advocateAssignmentAR = array(); // keep track of advocates w/successful assignments foreach ($_POST['advocates'] as $i) { if (!is_numeric($i)) { err('Invalid advocate ID: ' . safeHTMLstr($i)); } $count = 0; // keep track of # of successful assignments foreach ($_POST['papers'] as $j) { if (!is_numeric($j)) { err('Invalid submission ID: ' . safeHTMLstr($j)); } // Check for conflict if (in_array("$j-$i",$conflictAR)) { print "
! Submission $j is in conflict with advocate $i.
\n"; continue; } // Delete current assignment? if (isset($_POST['assignment_override']) && ($_POST['assignment_override'] == 1)) { issueSQL("DELETE FROM " . OCC_TABLE_PAPERADVOCATE . " WHERE paperid=" . $j); } // Make assignment $q = "INSERT INTO " . OCC_TABLE_PAPERADVOCATE . " (paperid,advocateid) VALUES ($j,$i)"; ocsql_query($q); if (($merr = ocsql_errno()) != 0) { if ($merr == 1062) { // Duplicate entry print "! Submission $j already has an advocate assigned. Please delete the existing advocate first before assigning a new one, or select Override Current Assingment.\n"; } else { print "!! Error assigning submission $j to advocate $i (" . safeHTMLstr(ocsql_error()) . ")\n"; } } else { print "Submission $j assigned to advocate $i.\n"; $count++; // Also assign a reviewer? if (isset($_POST['asrev']) && ($_POST['asrev'] == "yes")) { $q = "INSERT INTO " . OCC_TABLE_PAPERREVIEWER . " (paperid,reviewerid) VALUES ($j,$i)"; ocsql_query($q); if (($merr = ocsql_errno()) != 0) { if ($merr == 1062) { // Duplicate entry print "
Notification sent to ' . $l['name'] . ' (' . $l['reviewerid'] . ')
'; } else { print '!! Unable to email notification to ' . $l['name'] . ' (' . $l['reviewerid'] . ')
'; } } } } print ''; } else { $pq = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPER . "`.`title`, `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_PAPERADVOCATE . "` ON `" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_PAPERADVOCATE . "`.`paperid` ORDER BY `" . OCC_TABLE_PAPER . "`.`paperid`"; $pr = ocsql_query($pq) or err("Unable to get submissions"); // Get pad size for paper id's - yes, we really need the max id, but this should do:) $psize = oc_strlen((string) ocsql_num_rows($pr)); if (ocsql_num_rows($pr) == 0) { print 'No submissions have been made yet'; } else { if (!isset($_GET['s']) || ($_GET['s'] == "id")) { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# Submission'; $legend = "[ Advocate ID - $nsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"; } elseif ($_GET['s'] == "reviews") { $rsortstr = '# Reviews'; $idsortstr = 'ID'; $nsortstr = 'Name'; $legend = "[ # Submissions - Advocate $nsortstr - $idsortstr ]"; $sortby = "`acount`, `" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } else { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# Submissions'; $legend = "[ Advocate Name - $idsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } $rq = "SELECT `" . OCC_TABLE_REVIEWER . "`.`reviewerid`, CONCAT_WS(' ', `" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name`, count(`" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`) AS `acount` FROM `" . OCC_TABLE_REVIEWER . "` LEFT JOIN `" . OCC_TABLE_PAPERADVOCATE . "` ON `" . OCC_TABLE_REVIEWER . "`.`reviewerid`=`" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid` WHERE `" . OCC_TABLE_REVIEWER . "`.`onprogramcommittee`='T' GROUP BY `" . OCC_TABLE_REVIEWER . "`.`reviewerid` ORDER BY $sortby"; $rr = ocsql_query($rq) or err("Unable to get program committee members"); // Get pad size for advocate id's - yes, we really need the max id, but this should do:) $rsize = oc_strlen((string) ocsql_num_rows($rr)); if (ocsql_num_rows($rr) == 0) { print 'No program committee members have signed up yet
'; } else { print '
'; } } } printFooter(); ?>