'); } else { oc_addHeader(''); } oc_addHeader(''); printHeader("Summary", 1); $colorAR = array('#5668E2', '#56AEE2', '#56E2CF', '#56E289', '#68E256', '#AEE256', '#E2CF56', '#E28956', '#E25668', '#E256AE', '#CF56E2', '#8A56E2'); $statusAR = array( 0 => '', 1 => '' ); // Get count of papers $r = ocsql_query("SELECT COUNT(`" . OCC_TABLE_PAPER . "`.`paperid`) AS `papertotal` FROM " . OCC_TABLE_PAPER) or err("Unable to query submission info"); $l = ocsql_fetch_assoc($r); $l1['papertotal'] = $l['papertotal']; // Get count of withdrawn submissions $r = ocsql_query("SELECT COUNT(*) AS `withdrawtotal` FROM `" . OCC_TABLE_WITHDRAWN . "`") or err("Unable to query withdrawn submission info"); $l = ocsql_fetch_assoc($r); $l1['withdrawtotal'] = $l['withdrawtotal']; // Get count of reviews $r = ocsql_query("SELECT COUNT(*) AS `reviewstotal` FROM `" . OCC_TABLE_PAPERREVIEWER . "`") or err("Unable to query reviews info"); $l = ocsql_fetch_assoc($r); $l1['reviewstotal'] = $l['reviewstotal']; // Get # of papers w/reviewers assigned $r = ocsql_query("SELECT COUNT(DISTINCT(`paperid`)) AS `revassigned` FROM `" . OCC_TABLE_PAPERREVIEWER . "`") or err("Unable to query assigned count"); $l = ocsql_fetch_assoc($r); $l1['revassigned'] = $l['revassigned']; // Get count of advocate assignments $r = ocsql_query("SELECT COUNT(*) AS `advocatingtotal` FROM `" . OCC_TABLE_PAPERADVOCATE . "`") or err("Unable to query advocate assignment info"); $l = ocsql_fetch_assoc($r); $l1['advocatingtotal'] = $l['advocatingtotal']; // Get # of uploads $r = ocsql_query("SELECT COUNT(*) AS `count` FROM `" . OCC_TABLE_PAPER . "` WHERE `format` IS NOT NULL") or err("Unable to query file uploads"); $l = ocsql_fetch_assoc($r); $uploadtotal = $l['count']; // Get count of signed up reviewers, advocates $r = ocsql_query("SELECT `" . OCC_TABLE_REVIEWER . "`.`onprogramcommittee`, COUNT(`" . OCC_TABLE_REVIEWER . "`.`reviewerid`) AS `count` FROM `" . OCC_TABLE_REVIEWER . "` GROUP BY `" . OCC_TABLE_REVIEWER . "`.`onprogramcommittee`") or err("Unable to query reviewer info"); $rcount = array(); $rcount['T'] = 0; $rcount['F'] = 0; while ($l = ocsql_fetch_assoc($r)) { $rcount[$l['onprogramcommittee']] = $l['count']; } // Get count of pc decision $r = ocsql_query("SELECT `" . OCC_TABLE_PAPER . "`.`accepted`, COUNT(`" . OCC_TABLE_PAPER . "`.`paperid`) AS `count` FROM `" . OCC_TABLE_PAPER . "` GROUP BY `" . OCC_TABLE_PAPER . "`.`accepted`") or err("Unable to query submission info"); $pcount = array(); $pcount['T'] = 0; $pcount['F'] = 0; while ($l = ocsql_fetch_assoc($r)) { $pcount[$l['accepted']] = $l['count']; } // Get count of completed reviews $r = ocsql_query("SELECT COUNT(`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`) FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`completed`='T'") or err("Unable to query reviews"); $l = ocsql_fetch_row($r); $reviewscompleted = $l[0]; // Get count of started reviews $r = ocsql_query("SELECT COUNT(`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`) FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `" . OCC_TABLE_PAPERREVIEWER . "`.`completed`='F' AND `" . OCC_TABLE_PAPERREVIEWER . "`.`updated` IS NOT NULL") or err("Unable to query started reviews"); $l = ocsql_fetch_row($r); $reviewsstarted = $l[0]; // Get count of advocate recommendations $r = ocsql_query("SELECT COUNT(`" . OCC_TABLE_PAPERADVOCATE . "`.`paperid`) FROM `" . OCC_TABLE_PAPERADVOCATE . "` WHERE `" . OCC_TABLE_PAPERADVOCATE . "`.`adv_recommendation` IS NOT NULL") or err("Unable to query recommendations"); $l = ocsql_fetch_row($r); $advocaterecommendations = $l[0]; // Get acceptance type $r = ocsql_query("SELECT `accepted`, COUNT(*) AS `count` FROM `" . OCC_TABLE_PAPER . "` GROUP BY `accepted` ORDER BY `accepted`") or err("Unable to get score count"); $accCountAR = array(); while ($l = ocsql_fetch_assoc($r)) { if (empty($l['accepted'])) { $accCountAR['Pending'] = $l['count']; } else { $accCountAR[$l['accepted']] = $l['count']; } } // Get submission types $r = ocsql_query("SELECT `type`, COUNT(*) AS `count` FROM `" . OCC_TABLE_PAPER . "` GROUP BY `type` ORDER BY `count` DESC, `type`") or err("Unable to get score count"); $typeCountAR = array(); $unknown = ''; while ($l = ocsql_fetch_assoc($r)) { if ($l['type'] == '') { $unknown = $l['count']; continue; } $typeCountAR[$l['type']] = $l['count']; } if ((count($typeCountAR) > 0) && !empty($unknown)) { $typeCountAR['unknown'] = $unknown; } $summaryAR = array(); $SummaryIndex = 0; //// Submissions $summaryAR[$SummaryIndex] = array( 'header' => 'Submissions', 'status' => array('( New ' . $statusAR[$OC_statusAR['OC_submissions_open']] . ' | Edit ' . $statusAR[$OC_statusAR['OC_edit_open']] . ' | Upload ' . $statusAR[$OC_statusAR['OC_upload_open']] . ' | View file ' . $statusAR[$OC_statusAR['OC_view_file_open']] . ' | Status ' . $statusAR[$OC_statusAR['OC_view_file_open']] . ' )'), 'charts' => array() ); // Submissions - Submissions $summaryAR[$SummaryIndex]['charts']['sub'] = array( 'title' => 'Total', 'link' => 'list_papers.php', 'linktitle' => 'view submissions', 'label' => $l1['papertotal'], 'sublabel' => 'active', 'values' => array( array( 'value' => $l1['papertotal'], 'color' => '#99ccff', 'label' => 'Active' ), array( 'value' => $l1['withdrawtotal'], 'color' => '#cccccc', 'label' => 'Withdrawn' ) ) ); // Submission - Files $summaryAR[$SummaryIndex]['charts']['files'] = array( 'title' => 'Author Files', 'link' => 'list_papers.php', 'linktitle' => 'view submissions and files', 'label' => $uploadtotal, 'sublabel' => 'uploaded', 'values' => array( array( 'value' => $uploadtotal, 'color' => '#99CCFF', 'label' => 'Uploaded' ), array( 'value' => ($l1['papertotal'] - $uploadtotal), 'color' => '#f0f0f0', 'label' => 'Pending' ) ) ); // Submissions - Type if (count($typeCountAR) > 0) { $summaryAR[$SummaryIndex]['charts']['type'] = array( 'title' => 'Type', 'link' => 'list_papers.php', 'linktitle' => 'view submissions', 'values' => array() ); $c = 0; foreach ($typeCountAR as $type => $count) { if ($type == 'unknown') { $color = '#f0f0f0'; } elseif ($c >= 12) { $color = $colorAR[($c%12+1)]; } else { $color = $colorAR[$c]; } $summaryAR[$SummaryIndex]['charts']['type']['values'][] = array( 'value' => $count, 'color' => $color, 'label' => $type ); $c++; } } // Submissions - Acceptance $summaryAR[$SummaryIndex]['charts']['acc'] = array( 'title' => 'Acceptance', 'link' => 'list_scores.php', 'linktitle' => 'view scores & accept/reject', 'label' => 0, 'sublabel' => 'accepted', 'values' => array() ); foreach ($OC_acceptanceValuesAR as $acc) { $summaryAR[$SummaryIndex]['charts']['acc']['values'][] = array( 'value' => (isset($accCountAR[$acc['value']]) ? $accCountAR[$acc['value']] : '0'), 'color' => '#' . $OC_acceptanceColorAR[$acc['value']], 'label' => $acc['value'] ); if (in_array($acc['value'], $OC_acceptedValuesAR)) { $summaryAR[$SummaryIndex]['charts']['acc']['label'] += (isset($accCountAR[$acc['value']]) ? $accCountAR[$acc['value']] : '0'); } } $summaryAR[$SummaryIndex]['charts']['acc']['values'][] = array( 'value' => (isset($accCountAR['Pending']) ? $accCountAR['Pending'] : '0'), 'color' => '#f0f0f0', 'label' => 'Pending' ); //// Committees & Assignments $SummaryIndex++; $summaryAR[$SummaryIndex] = array( 'header' => 'Committees & Assignments', 'status' => array('( Reviewer – Sign Up ' . $statusAR[$OC_statusAR['OC_rev_signup_open']] . ' | Sign In ' . $statusAR[$OC_statusAR['OC_rev_signin_open']] . ' | Reviewing ' . $statusAR[$OC_statusAR['OC_reviewing_open']] . ' )'), 'charts' => array() ); // Committee - Members $summaryAR[$SummaryIndex]['charts']['cmt'] = array( 'title' => 'Committee Members', 'link' => 'list_reviewers.php', 'linktitle' => 'view committee members', 'label' => $rcount['F'], 'sublabel' => 'total', 'values' => array( array( 'value' => $rcount['F'], 'color' => '#99ccff', 'label' => 'Review' ) ) ); // Committee - Review Assignments $summaryAR[$SummaryIndex]['charts']['rev'] = array( 'title' => 'Review Assignments', 'link' => 'list_reviews.php', 'linktitle' => 'view review assignments', 'label' => $l1['reviewstotal'], 'sublabel' => 'total', 'values' => array( array( 'value' => $reviewscompleted, 'color' => '#68E256', 'label' => 'Completed' ), array( 'value' => $reviewsstarted, 'color' => '#AEE256', 'label' => 'Started' ), array( 'value' => ($l1['reviewstotal'] - $reviewscompleted - $reviewsstarted), 'color' => '#F0F0F0', 'label' => 'Pending' ) ) ); // Advocates? if ($OC_configAR['OC_paperAdvocates']) { // Add advocates to Committee - Members $summaryAR[$SummaryIndex]['charts']['cmt']['label'] += $rcount['T']; $summaryAR[$SummaryIndex]['status'][] = '( Program – Sign Up ' . $statusAR[$OC_statusAR['OC_pc_signup_open']] . ' | Sign In ' . $statusAR[$OC_statusAR['OC_pc_signin_open']] . ' | Advocating ' . $statusAR[$OC_statusAR['OC_advocating_open']] . ' )'; $summaryAR[$SummaryIndex]['charts']['cmt']['values'][] = array( 'value' => $rcount['T'], 'color' => '#E28956', 'label' => 'Program' ); // Committee - Advocate Assignments $summaryAR[$SummaryIndex]['charts']['adv'] = array( 'title' => 'Advocate Assignments', 'link' => 'list_advocates.php', 'linktitle' => 'view advocate assignments', 'label' => $l1['advocatingtotal'], 'sublabel' => 'total', 'values' => array( array( 'value' => $advocaterecommendations, 'color' => '#68E256', 'label' => 'Completed' ), array( 'value' => ($l1['advocatingtotal'] - $advocaterecommendations), 'color' => '#F0F0F0', 'label' => 'Pending' ) ) ); } print ' '; if (oc_hookSet('chair-summary-pre')) { foreach ($OC_hooksAR['chair-summary-pre'] as $v) { include_once $v; } } $chartNames = array(); $chartJS = ''; $barChartNames = array(); $barChartJS = ''; foreach ($summaryAR as $sectionID => $section) { if ($sectionID > 0) { print '
'; } print '

' . safeHTMLstr($section['header']) . ' '; foreach ($section['status'] as $status) { print '' . $status . ' '; } print '

'; foreach ($section['charts'] as $chartIndex => $chart) { if (isset($chart['type']) && ($chart['type'] == 'bar')) { $labels = ''; $data = ''; $legend = ''; foreach ($chart['values'] as $value) { $labels .= '"' . $value['label'] . '",'; $data .= $value['value'] . ','; $legend .= safeHTMLstr($value['label'] . ': ' . $value['value']) . '
'; } $labels = rtrim($labels, ','); $data = rtrim($data, ','); $barChartJS .= ' "' . $chartIndex . '": { labels: [ ' . $labels . ' ], datasets: [ { fillColor: "rgba(153,204,244,0.5)", strokeColor: "rgba(153,204,244,0.8)", highlightFill: "rgba(153,187,204,0.75)", highlightStroke: "rgba(153,204,244,1)", data: [' . $data . '] } ] }, '; $barChartNames[] = $chartIndex; print '
'; print '' . $legend . ''; print '
'; } else { // default to donught $chartJS .= ' "' . $chartIndex . '": [ '; $chartNames[] = $chartIndex; print '

' . ( (isset($chart['link']) && !empty($chart['link']) ) ? '' . safeHTMLstr($chart['title']) . '' : safeHTMLstr($chart['title']) ) . '

'; if (isset($chart['label']) && ($chart['label'] !== '')) { print '
' . $chart['label']; if (isset($chart['sublabel']) && !empty($chart['sublabel'])) { print '
' . safeHTMLstr($chart['sublabel']) . ''; } print '
'; } print '

'; } } } print '
'; if (oc_hookSet('chair-summary')) { foreach ($OC_hooksAR['chair-summary'] as $v) { include_once $v; } } printFooter(); ?>