From cb6740fa6fa27b02563b10d51728fe937e19a574 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 17 Sep 2009 07:13:51 +0000 Subject: [PATCH] - Update the fair stats to use the new list - Don't have curl dump debug info --- admin/curl.inc.php | 4 ++-- admin/fair_stats.php | 50 +++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/admin/curl.inc.php b/admin/curl.inc.php index 4ce2662..403fdbf 100644 --- a/admin/curl.inc.php +++ b/admin/curl.inc.php @@ -52,7 +52,7 @@ break; } - echo "
Curl Send: $str
"; +// echo "
Curl Send: $str
"; $ch = curl_init(); /// initialize a cURL session curl_setopt ($ch, CURLOPT_URL, $url); @@ -80,7 +80,7 @@ $ret['message'] = $datastream; break; } - echo "
Server Returned: ";print_r($ret);echo "

"; +// echo "
Server Returned: ";print_r($ret);echo "

"; return $ret; } ?> diff --git a/admin/fair_stats.php b/admin/fair_stats.php index 6fa55e5..38d867b 100644 --- a/admin/fair_stats.php +++ b/admin/fair_stats.php @@ -66,15 +66,15 @@ /* SFIAB config options server side */ $server_config = array(); - $server_config['fair_stats_participation'] = 'no'; - $server_config['fair_stats_schools_ext'] = 'no'; - $server_config['fair_stats_minorities'] = 'no'; - $server_config['fair_stats_guests'] = 'no'; - $server_config['fair_stats_sffbc_misc'] = 'no'; - $server_config['fair_stats_info'] = 'no'; - $server_config['fair_stats_next_chair'] = 'no'; - $server_config['fair_stats_scholarships'] = 'no'; - $server_config['fair_stats_delegates'] = 'no'; + $server_config['participation'] = false; + $server_config['schools_ext'] = false; + $server_config['minorities'] = false; + $server_config['guests'] = false; + $server_config['sffbc_misc'] = false; + $server_config['info'] = false; + $server_config['next_chair'] = false; + $server_config['scholarships'] = false; + $server_config['delegates'] = false; if($_GET['year']) $year=intval($_GET['year']); else $year=$config['FAIRYEAR']; @@ -155,7 +155,7 @@ } if($fair['type'] == 'ysf') { - $data['statconfig'] = array('fair_stats_participation'); + $data['statconfig'] = array('participation'); } else { echo notice(i18n('Getting stats request and downloading existing stats from server %1', array($fair['url']))); /* Query the server to see what stats we need */ @@ -174,8 +174,8 @@ echo i18n('This server has requested the following stats for your %1 fair:', array($year)); echo '

'; - foreach($server_config as $k=>$v) { - $server_config[$k] = $data['statconfig'][$k]; + foreach($data['statconfig'] as $k) { + $server_config[$k] = true; } /* Gather all stats, then we'll decide what to send */ @@ -305,7 +305,7 @@ echo "
"; echo ""; - if($server_config['fair_stats_info'] == 'yes') { + if($server_config['info']) { echo '

'.i18n('%1 Fair information', array($year)).'

'; echo ''; echo ''; @@ -331,7 +331,7 @@ } - if($server_config['fair_stats_next_chair'] == 'yes') { + if($server_config['next_chair']) { echo '

'.i18n('%1 - %2 Chairperson (if known)', array($year, $year+1)).'

'; echo '
'.i18n('Fair Start Date').':
'; echo ''; @@ -350,7 +350,7 @@ echo '

'; } - if($server_config['fair_stats_delegates'] == 'yes') { + if($server_config['delegates']) { echo '

'.i18n('%1 CWSF Delegates and Alternatives', array($year)).'

'; echo '
'.i18n('Name').':
'; echo ''; @@ -371,14 +371,14 @@ echo '

'; } - if($server_config['fair_stats_scholarships'] == 'yes') { + if($server_config['scholarships']) { echo '

'.i18n('%1 Scholarships', array($year)).'

'; echo 'How many university/college scholarships are available at your fair? (use a format like:
6 - University of British Columbia - Entrance Scholarships
'; echo ''; echo '

'; } - if($server_config['fair_stats_participation'] == 'yes') { + if($server_config['participation']) { $rangemap = array(1=>'1-3', 4=>'4-6', 7=>'7-8', 9=>'9-10', 11=>'11-12'); echo '

'.i18n('%1 Fair participation', array($year)).'

'; echo '
'; @@ -411,7 +411,7 @@ echo '
'; } - if($server_config['fair_stats_schools_ext'] == 'yes') { + if($server_config['schools_ext']) { echo '

'.i18n('%1 Extended School/Participant data', array($year)).'

'; echo '
'; echo i18n('Public schools: %1 (%2 students).',array( @@ -429,20 +429,18 @@ echo '
'; echo '
'; } - if($server_config['fair_stats_minorities'] != '') { + if($server_config['minorities']) { echo '

'.i18n('%1 Data on minority groups', array($year)).'

'; echo '
'; echo '
'.i18n('Delegate Name(s)').''.i18n('Email').''.i18n('Jacket Size').'
'; - if(strstr('firstnations',$server_config['fair_stats_minorities']) != false) { - echo ''; - } + echo ''; echo '
'.i18n('Number of First Nations students'); - echo ": "; - echo '
'.i18n('Number of First Nations students'); + echo ": "; + echo '
'; echo '
'; echo '
'; } - if($server_config['fair_stats_guests'] == 'yes' ) { + if($server_config['guests'] ) { echo '

'.i18n('%1 Guests visiting the fair', array($year)).'

'; echo '
'; echo ''; @@ -457,7 +455,7 @@ echo '
'; } - if($server_config['fair_stats_sffbc_misc'] == 'yes') { + if($server_config['sffbc_misc']) { echo '

'.i18n('%1 Misc. SFFBC Questions', array($year)).'

'; echo '
'; echo '
';