\n";
}
}
print "
Advocate(s) have been unassigned.
\n";
if (isset($_POST['s'])) {
print 'Return to Advocate Listings
';
}
printFooter();
exit;
}
if (!isset($_GET['s']) || ($_GET['s'] == "pid")) {
$sortby = "`paperid`";
$pidsort="S-ID
" . $OC_sortImg;
$psort='Submission';
$nsort='Advocate';
$aidsort='A-ID';
$_GET['s'] = 'pid';
} elseif ($_GET['s'] == "paper") {
$sortby = "`title`";
$pidsort='S-ID';
$psort="Submission
" . $OC_sortImg;
$nsort='Advocate';
$aidsort='A-ID';
} elseif ($_GET['s'] == "name") {
$sortby = "`name_last`, `name_first`";
$pidsort='S-ID';
$psort='Submission';
$nsort="Advocate
" . $OC_sortImg;
$aidsort='A-ID';
} elseif ($_GET['s'] == "aid") {
$sortby = "`advocateid`";
$pidsort='S-ID';
$psort='Submission';
$nsort='Advocate';
$aidsort="A-ID
" . $OC_sortImg;
} else {
err("Unknown sort source");
}
// Display Filter
$aAR = array_keys($OC_acceptanceColorAR);
$aAR[] = 'Pending';
print '
';
$q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`, `adv_recommendation`, CONCAT_WS(' ',`" . OCC_TABLE_REVIEWER . "`.`name_first`,`" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name`, `title` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_PAPERADVOCATE . "` ON `" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_PAPERADVOCATE . "`.`paperid` LEFT JOIN `" . OCC_TABLE_REVIEWER . "` ON `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`";
switch($atype) {
case '':
break;
case 'Pending':
$q .= " WHERE (`" . OCC_TABLE_PAPER . "`.`accepted`='' OR `" . OCC_TABLE_PAPER . "`.`accepted` IS NULL) ";
break;
default:
$q .= " WHERE `" . OCC_TABLE_PAPER . "`.`accepted`='" . safeSQLstr($atype) . "' ";
break;
}
switch($stype) {
case '':
break;
default:
$q .= (preg_match("/ WHERE /", $q) ? ' AND ' : ' WHERE ') . "`" . OCC_TABLE_PAPER . "`.`type`='" . safeSQLstr($stype) . "' ";
break;
}
$q .= " ORDER BY " . $sortby;
$r = ocsql_query($q) or err("Unable to get information");
if (ocsql_num_rows($r) == 0) {
print 'No advocates found.';
} else {
print '
- Links:
- Recom. – Show recommendation
- Submission – Show Submission info
- Advocate – Show Advocate info
';
}
printFooter();
?>