- Add remaining stats gathering info for SFFBC, try to make them generic so

anyone could use them.
This commit is contained in:
dave 2009-05-04 06:13:15 +00:00
parent 0f450e4426
commit 66fe2ed34f
2 changed files with 107 additions and 32 deletions

View File

@ -84,6 +84,10 @@
$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';
function curl_query($fair, $xml)
{
@ -141,7 +145,6 @@
}
$stats['year'] = $year;
$xml = stats_to_xml($fair, $stats);
if(function_exists('curl_init')) {
$r = curl_query($fair, $xml);
@ -211,7 +214,7 @@
echo notice(i18n('Server said: Success'));
echo '<hr />';
echo i18n('This server has requested the following stats:');
echo i18n('This server has requested the following stats for your %1 fair:', array($year));
echo '<br /><br />';
foreach($server_config as $k=>$v) {
@ -345,10 +348,82 @@
echo "<form method=\"POST\" action=\"$PHPSELF\">";
echo "<input type=\"hidden\" name=\"action\" value=\"sendstats\" />";
$manual_stats = array();
if($server_config['fair_stats_info'] == 'yes') {
echo '<h3>'.i18n('%1 Fair information', array($year)).'</h3>';
echo '<table>';
echo '<tr><td>'.i18n('Fair Start Date').':</td>';
echo "<td><input type=\"text\" size=\"12\" name=\"start_date\" value=\"{$stats['start_date']}\">(YYYY-MM-DD)</td></tr>";
echo '<tr><td>'.i18n('Fair End Date').':</td>';
echo "<td><input type=\"text\" size=\"12\" name=\"end_date\" value=\"{$stats['end_date']}\">(YYYY-MM-DD)</td></tr>";
echo '<tr><td>'.i18n('Fair Location/Address').':</td>';
echo '<td><textarea name="address" rows="4" cols="60">'.htmlspecialchars($stats['address']).'</textarea></td>';
echo '<tr><td>'.i18n('Fair Budget').':</td>';
echo "<td>$<input type=text name=\"budget\" value=\"{$stats['budget']}\"></td></tr>";
echo '<tr><td>'.i18n('YSF Affiliation Complete').'?</td>';
echo '<td><select name="ysf_affiliation_complete">';
$sel = $stats['ysf_affiliation_complete'] == 'N' ? 'selected="selected"' : '';
echo " <option value=\"N\" $sel >No</option>";
$sel = $stats['ysf_affiliation_complete'] == 'Y' ? 'selected="selected"' : '';
echo " <option value=\"Y\" $sel >Yes</option>";
echo '</select></td></tr>';
echo '<tr><td>'.i18n('Charity Number or Information').'?</td>';
echo "<td><input type=text size=\"40\" name=\"charity\" value=\"{$stats['charity']}\"></td></tr>";
echo '</table>';
echo '<br />';
echo '<br />';
}
if($server_config['fair_stats_next_chair'] == 'yes') {
echo '<h3>'.i18n('%1 - %2 Chairperson (if known)', array($year, $year+1)).'</h3>';
echo '<table>';
echo '<tr><td>'.i18n('Name').': </td>';
echo "<td><input type=text name=\"chair_name\" value=\"{$stats['name']}\"></td>";
echo '<td>'.i18n('Email').': </td>';
echo "<td><input type=text name=\"chair_email\" value=\"{$stats['email']}\"></td></tr>";
echo '<tr><td>'.i18n('Tel. Bus').': </td>';
echo "<td><input type=text name=\"chair_bphone\" value=\"{$stats['bphone']}\"></td>";
echo '<td>'.i18n('Tel. Home').': </td>';
echo "<td><input type=text name=\"chair_hphone\" value=\"{$stats['hphone']}\"></td></tr>";
echo '<tr><td>'.i18n('Fax').': </td>';
echo "<td><input type=text name=\"chair_fax\" value=\"{$stats['fax']}\"></td>";
echo '</tr>';
echo '</table>';
echo '<br /><br />';
}
if($server_config['fair_stats_delegates'] == 'yes') {
echo '<h3>'.i18n('%1 CWSF Delegates and Alternatives', array($year)).'</h3>';
echo '<table>';
echo '<tr><td>'.i18n('Delegate Name(s)').'</td><td>'.i18n('Email').'</td><td>'.i18n('Jacket Size').'<td></tr>';
for($x=1;$x<=3;$x++) {
$sizes = array('small'=>'Small', 'medium'=>'Medium', 'large'=>'Large', 'xlarge'=>'X-Large');
echo "<td><input type=text size=\"25\" name=\"delegate$x\" value=\"{$stats["delegate$x"]}\"></td>";
echo "<td><input type=text size=\"25\" name=\"delegate{$x}_email\" value=\"{$stats["delegate{$x}_email"]}\"></td>";
echo "<td><select name=\"delegate{$x}_size\">";
$sz = $stats["delegate{$x}_size"];
foreach($sizes as $s=>$t) {
$sel = ($sz == $s) ? 'selected="selected"' : '';
echo " <option value=\"$s\" $sel >".i18n($t).'</option>';
}
echo '</select></td></tr>';
}
echo '</table>';
echo i18n('Remember, the jackets fit smaller than normal sizes.');
echo '<br /><br />';
}
if($server_config['fair_stats_scholarships'] == 'yes') {
echo '<h3>'.i18n('%1 Scholarships', array($year)).'</h3>';
echo 'How many university/college scholarships are available at your fair? (use a format like: <br /><b>6 - University of British Columbia - Entrance Scholarships</b><br />';
echo '<textarea name="scholarships" rows="4\" cols="80">'.htmlspecialchars($stats['scholarships']).'</textarea>';
echo '<br /><br />';
}
if($server_config['fair_stats_participation'] == 'yes') {
$rangemap = array(1=>'1-3', 4=>'4-6', 7=>'7-8', 9=>'9-10', 11=>'11-12');
echo '<b>'.i18n('Fair participation').'</b><br />';
echo '<h3>'.i18n('%1 Fair participation', array($year)).'</h3>';
echo '<br />';
echo i18n("Number of students").": <b>{$stats['students_total']}</b>";
echo '<table><tr><td></td><td></td><td></td><td align=\"center\">'.i18n('Grade').'</td><td></td><td></td></tr>';
@ -380,7 +455,7 @@
}
if($server_config['fair_stats_schools_ext'] == 'yes') {
echo '<b>'.i18n('Extended School/Participant data').'</b><br />';
echo '<h3>'.i18n('%1 Extended School/Participant data', array($year)).'</h3>';
echo '<br />';
echo i18n('Public schools: <b>%1</b> (<b>%2</b> students).',array(
$stats['schools_public'], $stats['students_public']));
@ -398,7 +473,7 @@
echo '<br />';
}
if($server_config['fair_stats_minorities'] != '') {
echo '<b>'.i18n('Data on minority groups').'</b><br />';
echo '<h3>'.i18n('%1 Data on minority groups', array($year)).'</h3>';
echo '<br />';
echo '<table>';
if(strstr('firstnations',$server_config['fair_stats_minorities']) != false) {
@ -411,7 +486,7 @@
echo '<br />';
}
if($server_config['fair_stats_guests'] == 'yes' ) {
echo '<b>'.i18n('Guests visiting the fair').'</b><br />';
echo '<h3>'.i18n('%1 Guests visiting the fair', array($year)).'</h3>';
echo '<br />';
echo '<table>';
echo '<tr><td>'.i18n('Number of Students that visited the fair (tours, etc.)');
@ -426,7 +501,7 @@
}
if($server_config['fair_stats_sffbc_misc'] == 'yes') {
echo '<b>'.i18n('Misc. SFFBC Questions').'</b><br />';
echo '<h3>'.i18n('%1 Misc. SFFBC Questions', array($year)).'</h3>';
echo '<br />';
echo '<table>';
echo '<tr><td>'.i18n('Number of Teachers supporting student projects');

View File

@ -1,12 +1,12 @@
<?
$stats_data = array(
'start_date' => array(),
'end_date' => array(),
'address' => array(),
'budget' => array(),
'ysf_affiliation_complete' => array(),
'charity' => array(),
'start_date' => array('manual' => true),
'end_date' => array('manual' => true),
'address' => array('manual' => true),
'budget' => array('manual' => true),
'ysf_affiliation_complete' => array('manual' => true),
'charity' => array('manual' => true),
'male_1' => array(),
'male_4' => array(),
'male_7' => array(),
@ -40,23 +40,23 @@ $stats_data = array(
'consideringcareer' => array('manual' => true),
'committee_members' => array(),
'judges' => array(),
'next_chair_name' => array(),
'next_chairemail' => array(),
'next_chair_hphone' => array(),
'next_chair_bphone' => array(),
'next_chair_fax' => array(),
'scholarships' => array(),
'delegate1' => array(),
'delegate2' => array(),
'delegate3' => array(),
'delegate4' => array(),
'delegate1_email' => array(),
'delegate2_email' => array(),
'delegate3_email' => array(),
'delegate4_email' => array(),
'delegate1_size' => array(),
'delegate2_size' => array(),
'delegate3_size' => array(),
'delegate4_size' => array(),
'next_chair_name' => array('manual' => true),
'next_chairemail' => array('manual' => true),
'next_chair_hphone' => array('manual' => true),
'next_chair_bphone' => array('manual' => true),
'next_chair_fax' => array('manual' => true),
'scholarships' => array('manual' => true),
'delegate1' => array('manual' => true),
'delegate2' => array('manual' => true),
'delegate3' => array('manual' => true),
'delegate4' => array('manual' => true),
'delegate1_email' => array('manual' => true),
'delegate2_email' => array('manual' => true),
'delegate3_email' => array('manual' => true),
'delegate4_email' => array('manual' => true),
'delegate1_size' => array('manual' => true),
'delegate2_size' => array('manual' => true),
'delegate3_size' => array('manual' => true),
'delegate4_size' => array('manual' => true),
);
?>