'Reviewer ID', 'name' => 'Full Name', ); if ($OC_configAR['OC_paperAdvocates']) { $fieldAR['onprogramcommittee'] = 'PC/Advocate'; } foreach ($OC_reviewerFieldSetAR as $fsKey => $fsAR) { foreach ($fsAR['fields'] AS $fieldID) { if (preg_match("/^password/i", $fieldID) || ($fieldID == 'topics') || empty($OC_reviewerFieldAR[$fieldID]['name'])) { continue; } $fieldAR[$fieldID] = $OC_reviewerFieldAR[$fieldID]['name']; } } $fieldAR['_topics'] = 'Topics'; $fieldAR['skip' . $skip++] = ''; // Default list of checked fields $checkedFieldAR = array_keys($fieldAR); // Include extra fields if (oc_hookSet('chair-export_reviewers-fields')) { foreach ($OC_hooksAR['chair-export_reviewers-fields'] as $v) { require_once $v; } } if (isset($_POST['submit']) && ($_POST['submit'] == "Generate File") && isset($_POST['fields']) && !empty($_POST['fields'])) { // Check for valid submission if (!validToken('chair')) { warn('Invalid submission'); } // Verify Fields $fieldARkeys = array_keys($fieldAR); foreach ($_POST['fields'] as $f) { if (!in_array($f, $fieldARkeys)) { err('Invalid field name selection'); } } // Init extra field AR $extraAR = array(); // List of fields to export $exportFieldsAR = $_POST['fields']; // Topics if (in_array('_topics', $exportFieldsAR)) { $q = "SELECT `" . OCC_TABLE_REVIEWER . "`.`reviewerid`, `" . OCC_TABLE_TOPIC . "`.`topicname`, `" . OCC_TABLE_TOPIC . "`.`short` FROM `" . OCC_TABLE_REVIEWER . "`, `" . OCC_TABLE_TOPIC . "`, `" . OCC_TABLE_REVIEWERTOPIC . "` WHERE `" . OCC_TABLE_REVIEWER . "`.`reviewerid`=`" . OCC_TABLE_REVIEWERTOPIC . "`.`reviewerid` AND `" . OCC_TABLE_REVIEWERTOPIC . "`.`topicid`=`" . OCC_TABLE_TOPIC . "`.`topicid`"; $r = mysql_query($q) or exporterr("Unable to retrieve data for export (t)"); while ($l = mysql_fetch_assoc($r)) { if (isset($extraAR[$l['reviewerid']]['_topics'])) { $extraAR[$l['reviewerid']]['_topics'] .= ',' . useTopic($l['short'], $l['topicname']); } else { $extraAR[$l['reviewerid']]['_topics'] = useTopic($l['short'], $l['topicname']); } } } // Get extra fields data if (oc_hookSet('chair-export_reviewers-data')) { foreach ($OC_hooksAR['chair-export_reviewers-data'] as $v) { require_once $v; } } // Get sub. data & iterate through each $q = "SELECT *,`reviewerid` AS `id`, CONCAT_WS(' ', `name_first`, `name_last`) AS `name` FROM `" . OCC_TABLE_REVIEWER . "` ORDER BY `reviewerid`"; $r = ocsql_query($q) or err("Unable to retrieve data for export"); if (mysql_num_rows($r) == 0) { warn("There are no committee members to export", 'Export Committee Members', 1); exit; } else { // Export file require_once 'export.inc'; oc_export($scope, $exportFieldsAR, $fieldAR, $r, $extraAR, $OC_reviewerFieldAR); exit; } } // Display form printHeader('Export Committee Members', 1); print '

Export will generate one row/entry per committee member.

Select Fields to Export:

'; foreach ($fieldAR as $fieldID => $fieldName) { if (preg_match("/^skip\d+$/", $fieldID)) { print '

'; continue; } print '
\n"; } print '

    Format:

Note: When opening up a CSV or Tab-delimited file in a spreadsheet, you may need to specify the character encoding: UTF-8.

'; printFooter(); ?>