'; } function print_footer() { echo '
'; } register_shutdown_function('print_footer'); print_header(); $registrations = dbquery("SELECT * FROM teams"); foreach ($registrations as $nr => $reg) { foreach ($reg as $k => $v) { $reg[$k] = DBToForm($v); } $registrations[$nr] = $reg; } $cunt = array( // eliglibility 'nordic' => array('yes' => 0, 'no' => 0), 'bycountry' => array(), 'bysite' => array(), ); foreach ($COUNTRIES as $ckey => $cval) { $cunt['bycountry'][$ckey] = array('yes' => 0, 'no' => 0); } $sitereg = array(); foreach ($SCHOOLS_ALL as $sid) { $cunt['bysite'][$sid] = array('yes' => 0, 'no' => 0); $sitereg[$sid] = array(); } foreach($registrations as $r) { if ($r['Eliglible'] == 'yes') $sid = $r['AffiliationID']; else $sid = $r['SiteID']; $cunt['nordic'][$r['Eliglible']]++; $cunt['bycountry'][$SCHOOLINFO[$sid]['country']][$r['Eliglible']]++; $cunt['bysite'][$sid][$r['Eliglible']]++; $sitereg[$sid][] = $r; } function num_all($arr) { return $arr['yes'] + $arr['no']; } function print_stats($arr, $where) { echo ' '.$where.' '.num_all($arr).' '.$arr['yes'].' '; } echo '

Nordic Programming Championship

Go back to NCPC 2008 page.

ICPC eliglible teams are listed under their affiliated site, while other teams are listed at the site they compete at.

'; print_stats($cunt['nordic'], 'All countries'); foreach ($COUNTRIES as $ckey => $cval) { if (num_all($cunt['bycountry'][$ckey])) { print_stats($cunt['bycountry'][$ckey], $cval); foreach ($SCHOOLS_BY_COUNTRY[$ckey] as $sid) { if (num_all($cunt['bysite'][$sid])) { if ($sid == 'chal') $short = 'Chalmers'; else $short = strtoupper($sid); print_stats($cunt['bysite'][$sid], '    '.$short); } } } } echo '
Total ICPC
'; foreach ($COUNTRIES as $ckey => $cval) { if (num_all($cunt['bycountry'][$ckey])) { //echo ' //
//flag'; //echo ' //

'. $cval .'

'; //print_stats2($cunt['bycountry'][$ckey]); foreach ($SCHOOLS_BY_COUNTRY[$ckey] as $sid) { if (num_all($cunt['bysite'][$sid])) { echo "

{$SCHOOLINFO[$sid]['name']}

"; //print_stats2($cunt['bysite'][$sid]); echo ' '; $cnt = 1; foreach ($sitereg[$sid] as $n => $r) { $tn = escapeHTML($r['TeamName']); if ($tn == 'WE LOVE UNICODE') { $tn = 'WE ☐ UNICODE'; } echo ' '; foreach (array(1,2,3) as $C) { $nam = trim(escapeHTML($r['FirstMiddle'.$C]) . " " . escapeHTML($r['LastName'.$C])); if ($nam != '') { echo ""; } } echo " "; } echo "
ICPC Team name Member 1 Member 2 Member 3
'.$cnt++.' '.($r['Eliglible']=='yes'?'x':'').' '.$tn.'$nam
"; } } } } ?>