diff --git a/admin/fair_stats.php b/admin/fair_stats.php index 7bb2b034..acc88ce3 100644 --- a/admin/fair_stats.php +++ b/admin/fair_stats.php @@ -40,6 +40,7 @@ $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'; function curl_query($fair, $xml) { @@ -137,6 +138,9 @@ exit; } + echo i18n('This server has requested the following stats:'); + echo '

'; + /* Query the server to see what stats we need */ $xmldata=array("sfiab"=>array( "username"=>$fair['username'], @@ -189,14 +193,18 @@ $stats['students_public'] = 0; $stats['students_private'] = 0; $stats['schools_atrisk'] = 0; + $districts = array(); while($si=mysql_fetch_assoc($q)) { - if($si['designate'] == 'public') + if($si['designate'] == 'public') $stats['students_public']++; - if($si['designate'] == 'independent') + if($si['designate'] == 'independent') $stats['students_private']++; - if($si['atrisk'] == 'yes') + if($si['atrisk'] == 'yes') $stats['schools_atrisk']++; + $bd = $si['board'].'~'.$si['district']; + if(!in_array($db, $districts)) $districts[] =$bd; } + $stats['schools_districts'] = count($districts); //numbers of students: $q=mysql_query("SELECT students.*,schools.* @@ -327,16 +335,52 @@ if($server_config['fair_stats_minorities'] != '') { echo ''.i18n('Data on minority groups').'
'; echo '
'; + echo ''; + if(strstr('firstnations',$server_config['fair_stats_minorities']) != false) { + echo ''; + } + echo '
'.i18n('Number of First Nations students'); + echo ": "; + echo '
'; echo '
'; echo '
'; } if($server_config['fair_stats_guests'] == 'yes' ) { echo ''.i18n('Guests visiting the fair').'
'; echo '
'; + echo ''; + echo ''; + echo ''; + echo '
'.i18n('Number of Students that visited the fair (tours, etc.)'); + echo ": "; + echo '
'.i18n('Number of Public Guests that visited the fair'); + echo ": "; + echo '
'; echo '
'; echo '
'; } + if($server_config['fair_stats_sffbc_misc'] == 'yes') { + echo ''.i18n('Misc. SFFBC Questions').'
'; + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'.i18n('Number of Teachers supporting student projects: '); + echo ": "; + echo '
'.i18n('Number of Students indicating increased interest in science & technology: '); + echo ": "; + echo '
'.i18n('Number of Students considering careers in science & technology: '); + echo ": "; + echo '
'; + echo '
'; + echo '
'; +/*Number of Teachers supporting student projects: +Number of Students indicating increased interest in science & technology: +Number of Students considering careers in science & technology: +*/ + } echo "
"; echo "
"; @@ -356,6 +400,7 @@ xmlCreateRecurse($xmldata); $xml=$output; + echo '
'; echo "

".i18n("The following data will be sent to")." {$fair['name']}

"; echo "
"; echo ""; diff --git a/db/db.update.127.sql b/db/db.update.127.sql index 15ee01cf..dcd02801 100644 --- a/db/db.update.127.sql +++ b/db/db.update.127.sql @@ -2,7 +2,8 @@ INSERT INTO `config` (`var`, `val`, `category`, `type`, `type_values`, `ord`, `d ('fair_stats_participation', 'yes', 'Science Fairs', 'yesno', '', 100, 'Gather Stats: Student and School Participation (students, gender, and projects) by age group.', -1), ('fair_stats_schools_ext', 'yes', 'Science Fairs', 'yesno', '', 200, 'Gather Stats: Extended school participation data.', -1), ('fair_stats_minorities', 'firstnations', 'Science Fairs', 'multisel', 'firstnations=Number of First Nation students|disabled=Number of Disabled students', 300, 'Gather Stats: Participant minority demographics (must be filled in manually by the fair)', -1), -('fair_stats_guests', 'yes', 'Science Fairs', 'yesno', '', 400, 'Gather Stats: Number of student and public guests (must be filled in manually by the fair)', -1); +('fair_stats_guests', 'yes', 'Science Fairs', 'yesno', '', 400, 'Gather Stats: Number of student and public guests (must be filled in manually by the fair)', -1), +('fair_stats_sffbc_misc', 'yes', 'Science Fairs', 'yesno', '', '500', 'Gather Stats: Misc. SFFBC Data', '-1'); ALTER TABLE `fairs_stats` CHANGE `publicschools` `schools_public` INT( 11 ) NOT NULL DEFAULT '0', CHANGE `privateschools` `schools_private` INT( 11 ) NOT NULL DEFAULT '0'; @@ -14,9 +15,9 @@ ALTER TABLE `fairs_stats` ADD `students_total` INT NOT NULL AFTER `projects_11` ALTER TABLE `fairs_stats` CHANGE `innercity` `students_atrisk` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `fairs_stats` ADD `schools_atrisk` INT NOT NULL AFTER `students_atrisk` ; ALTER TABLE `fairs_stats` ADD `schools_active` INT NOT NULL AFTER `schools_total` ; - ALTER TABLE `fairs_stats` ADD `committee_members` INT NOT NULL AFTER `consideringcareer` , ADD `judges` INT NOT NULL AFTER `committee_members` ; +ALTER TABLE `fairs_stats` CHANGE `schooldistricts` `schools_districts` INT( 11 ) NOT NULL DEFAULT '0'; CREATE TABLE `fairs` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , diff --git a/xmltransport.php b/xmltransport.php index be8a2a05..41f91f13 100644 --- a/xmltransport.php +++ b/xmltransport.php @@ -56,7 +56,8 @@ if(array_key_exists('getstats', $data)) { $year = $data['getstats'][0]['year'][0]; $vars = array('fair_stats_participation', 'fair_stats_schools_ext', - 'fair_stats_minorities', 'fair_stats_guests'); + 'fair_stats_minorities', 'fair_stats_guests', + 'fair_stats_sffbc_misc'); foreach($vars as $v) { $response['statconfig'][$v] = $config[$v]; }