forked from science-ation/science-ation
- More data, more stats
This commit is contained in:
parent
b5745656c1
commit
cfdcfb7c9d
@ -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 '<br /><br />';
|
||||
|
||||
/* 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 '<b>'.i18n('Data on minority groups').'</b><br />';
|
||||
echo '<br />';
|
||||
echo '<table>';
|
||||
if(strstr('firstnations',$server_config['fair_stats_minorities']) != false) {
|
||||
echo '<tr><td>'.i18n('Number of First Nations students');
|
||||
echo ": </td><td><input type=\"text\" name=\"firstnations\" value=\"{$stats['firstnations']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
if($server_config['fair_stats_guests'] == 'yes' ) {
|
||||
echo '<b>'.i18n('Guests visiting the fair').'</b><br />';
|
||||
echo '<br />';
|
||||
echo '<table>';
|
||||
echo '<tr><td>'.i18n('Number of Students that visited the fair (tours, etc.)');
|
||||
echo ": </td><td><input type=\"text\" name=\"studentsvisiting\" value=\"{$stats['studentsvisiting']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Number of Public Guests that visited the fair');
|
||||
echo ": </td><td><input type=\"text\" name=\"publicvisiting\" value=\"{$stats['publicvisiting']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
echo '</table>';
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
if($server_config['fair_stats_sffbc_misc'] == 'yes') {
|
||||
echo '<b>'.i18n('Misc. SFFBC Questions').'</b><br />';
|
||||
echo '<br />';
|
||||
echo '<table>';
|
||||
echo '<tr><td>'.i18n('Number of Teachers supporting student projects: ');
|
||||
echo ": </td><td><input type=\"text\" name=\"teacherssupporting\" value=\"{$stats['teacherssupporting']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Number of Students indicating increased interest in science & technology: ');
|
||||
echo ": </td><td><input type=\"text\" name=\"increasedinterest\" value=\"{$stats['increasedinterest']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Number of Students considering careers in science & technology: ');
|
||||
echo ": </td><td><input type=\"text\" name=\"consideringcareer\" value=\"{$stats['consideringcareer']}\" size=\"5\" />";
|
||||
echo '</td></tr>';
|
||||
echo '</table>';
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
/*Number of Teachers supporting student projects:
|
||||
Number of Students indicating increased interest in science & technology:
|
||||
Number of Students considering careers in science & technology:
|
||||
*/
|
||||
}
|
||||
echo "<br />";
|
||||
|
||||
echo "<br />";
|
||||
@ -356,6 +400,7 @@
|
||||
xmlCreateRecurse($xmldata);
|
||||
$xml=$output;
|
||||
|
||||
echo '<hr />';
|
||||
echo "<h3>".i18n("The following data will be sent to")." {$fair['name']}</h3>";
|
||||
echo "<form method=\"post\" action=\"$PHPSELF\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"sendstats\">";
|
||||
|
@ -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.<ul>\r\n<li>Number of at-risk schools and students<li>Number of public schools and students<li>Number of private/independent schools and students</ul>', -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<ul> <li>Supporting teachers <li>Students with increased interest in sci and tech <li>Students considering a career in science</ul>', '-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 ,
|
||||
|
@ -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];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user