forked from science-ation/science-ation
- Update the designate field, make it editable by everyone
- Add an "at risk" field, to flag schools. This is purely for stats gathering. - Add a fairs_stats page to gather stats from sub-fairs. This will be used when linking SFIABs together so the feeder fairs can upload statistics to, say, a provincial body (both runnign SFIAB).
This commit is contained in:
parent
6bd52d6ff2
commit
255adde40a
@ -37,10 +37,12 @@
|
|||||||
else
|
else
|
||||||
$id=$_POST['id'];
|
$id=$_POST['id'];
|
||||||
|
|
||||||
|
$atrisk = $_POST['atrisk'] == 'yes' ? 'yes' : 'no';
|
||||||
|
|
||||||
$exec="UPDATE schools SET ".
|
$exec="UPDATE schools SET ".
|
||||||
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
|
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
|
||||||
"schoollang='".mysql_escape_string(stripslashes($_POST['schoollang']))."', ".
|
"schoollang='".mysql_escape_string(stripslashes($_POST['schoollang']))."', ".
|
||||||
|
"designate='".mysql_escape_string(stripslashes($_POST['schooldesignate']))."', ".
|
||||||
"schoollevel='".mysql_escape_string(stripslashes($_POST['schoollevel']))."', ".
|
"schoollevel='".mysql_escape_string(stripslashes($_POST['schoollevel']))."', ".
|
||||||
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
|
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
|
||||||
"board='".mysql_escape_string(stripslashes($_POST['board']))."', ".
|
"board='".mysql_escape_string(stripslashes($_POST['board']))."', ".
|
||||||
@ -59,7 +61,8 @@
|
|||||||
"registration_password='".mysql_escape_string(stripslashes($_POST['registration_password']))."', ".
|
"registration_password='".mysql_escape_string(stripslashes($_POST['registration_password']))."', ".
|
||||||
"projectlimit='".mysql_escape_string(stripslashes($_POST['projectlimit']))."', ".
|
"projectlimit='".mysql_escape_string(stripslashes($_POST['projectlimit']))."', ".
|
||||||
"projectlimitper='".mysql_escape_string(stripslashes($_POST['projectlimitper']))."', ".
|
"projectlimitper='".mysql_escape_string(stripslashes($_POST['projectlimitper']))."', ".
|
||||||
"accesscode='".mysql_escape_string(stripslashes($_POST['accesscode']))."' ".
|
"accesscode='".mysql_escape_string(stripslashes($_POST['accesscode']))."', ".
|
||||||
|
"atrisk='$atrisk' ".
|
||||||
"WHERE id='$id'";
|
"WHERE id='$id'";
|
||||||
mysql_query($exec);
|
mysql_query($exec);
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
@ -134,6 +137,16 @@
|
|||||||
echo "</select>";
|
echo "</select>";
|
||||||
|
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
|
echo "<tr><td>".i18n("School Designation")."</td><td>";
|
||||||
|
$des = array('' => 'Choose', 'public' => 'Public',
|
||||||
|
'independent' => 'Independent/Private',
|
||||||
|
'home' => 'Home School');
|
||||||
|
echo "<select name=\"schooldesignate\">";
|
||||||
|
foreach($des as $k=>$v) {
|
||||||
|
$sel=($r->designate == $k) ?'selected="selected"' : '';
|
||||||
|
echo "<option $sel value=\"$k\">".i18n($v)."</option>\n";
|
||||||
|
}
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
echo "<tr><td>".i18n("School Level")."</td><td><input type=\"text\" name=\"schoollevel\" value=\"".htmlspecialchars($r->schoollevel)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
|
echo "<tr><td>".i18n("School Level")."</td><td><input type=\"text\" name=\"schoollevel\" value=\"".htmlspecialchars($r->schoollevel)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
|
||||||
echo "<tr><td>".i18n("School Board")."</td><td><input type=\"text\" name=\"board\" value=\"".htmlspecialchars($r->board)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
|
echo "<tr><td>".i18n("School Board")."</td><td><input type=\"text\" name=\"board\" value=\"".htmlspecialchars($r->board)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
|
||||||
echo "<tr><td>".i18n("School District")."</td><td><input type=\"text\" name=\"district\" value=\"".htmlspecialchars($r->district)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
|
echo "<tr><td>".i18n("School District")."</td><td><input type=\"text\" name=\"district\" value=\"".htmlspecialchars($r->district)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
|
||||||
@ -181,6 +194,10 @@
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
echo "<tr><td colspan=2><br /><b>".i18n("Demographic Information")."</b></td></tr>";
|
||||||
|
|
||||||
|
$ch = ($r->atrisk) == 'yes' ? 'checked="checked"' : '';
|
||||||
|
echo "<tr><td align=\"right\"><input type=\"checkbox\" name=\"atrisk\" value=\"yes\" $ch /></td><td>".i18n("Inner City or At-Risk school")."</td></tr>\n";
|
||||||
echo "<tr><td colspan=\"2\"> </td></tr>";
|
echo "<tr><td colspan=\"2\"> </td></tr>";
|
||||||
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"$buttontext\" /></td></tr>\n";
|
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"$buttontext\" /></td></tr>\n";
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
125
|
126
|
||||||
|
71
db/db.update.126.sql
Normal file
71
db/db.update.126.sql
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
CREATE TABLE `fairs_stats` (
|
||||||
|
`id` int(11) NOT NULL auto_increment,
|
||||||
|
`users_uid` int(11) NOT NULL default '0',
|
||||||
|
`year` int(11) NOT NULL default '0',
|
||||||
|
`start_date` date NOT NULL default '0000-00-00',
|
||||||
|
`end_date` date NOT NULL default '0000-00-00',
|
||||||
|
`address` text NOT NULL,
|
||||||
|
`budget` float NOT NULL default '0',
|
||||||
|
`ysf_affiliation_complete` enum('Y','N') NOT NULL default 'Y',
|
||||||
|
`charity` tinytext NOT NULL,
|
||||||
|
`male_1` int(11) NOT NULL default '0',
|
||||||
|
`male_4` int(11) NOT NULL default '0',
|
||||||
|
`male_7` int(11) NOT NULL default '0',
|
||||||
|
`male_9` int(11) NOT NULL default '0',
|
||||||
|
`male_11` int(11) NOT NULL default '0',
|
||||||
|
`female_1` int(11) NOT NULL default '0',
|
||||||
|
`female_4` int(11) NOT NULL default '0',
|
||||||
|
`female_7` int(11) NOT NULL default '0',
|
||||||
|
`female_9` int(11) NOT NULL default '0',
|
||||||
|
`female_11` int(11) NOT NULL default '0',
|
||||||
|
`projects_1` int(11) NOT NULL default '0',
|
||||||
|
`projects_4` int(11) NOT NULL default '0',
|
||||||
|
`projects_7` int(11) NOT NULL default '0',
|
||||||
|
`projects_9` int(11) NOT NULL default '0',
|
||||||
|
`projects_11` int(11) NOT NULL default '0',
|
||||||
|
`publicschools` int(11) NOT NULL default '0',
|
||||||
|
`privateschools` int(11) NOT NULL default '0',
|
||||||
|
`schooldistricts` int(11) NOT NULL default '0',
|
||||||
|
`studentsvisiting` int(11) NOT NULL default '0',
|
||||||
|
`publicvisiting` int(11) NOT NULL default '0',
|
||||||
|
`firstnations` int(11) NOT NULL default '0',
|
||||||
|
`innercity` int(11) NOT NULL default '0',
|
||||||
|
`teacherssupporting` int(11) NOT NULL default '0',
|
||||||
|
`increasedinterest` int(11) NOT NULL default '0',
|
||||||
|
`consideringcareer` int(11) NOT NULL default '0',
|
||||||
|
`next_chair_name` varchar(128) NOT NULL default '',
|
||||||
|
`next_chairemail` varchar(64) NOT NULL default '',
|
||||||
|
`next_chair_hphone` varchar(32) NOT NULL default '',
|
||||||
|
`next_chair_bphone` varchar(32) NOT NULL default '',
|
||||||
|
`next_chair_fax` varchar(32) NOT NULL default '',
|
||||||
|
`scholarships` text NOT NULL,
|
||||||
|
`delegate1` varchar(64) NOT NULL default '',
|
||||||
|
`delegate2` varchar(64) NOT NULL default '',
|
||||||
|
`delegate3` varchar(64) NOT NULL default '',
|
||||||
|
`delegate4` varchar(64) NOT NULL default '',
|
||||||
|
`delegate1_email` tinytext NOT NULL,
|
||||||
|
`delegate2_email` tinytext NOT NULL,
|
||||||
|
`delegate3_email` tinytext NOT NULL,
|
||||||
|
`delegate4_email` tinytext NOT NULL,
|
||||||
|
`delegate1_size` enum('small','medium','large','xlarge') NOT NULL default 'small',
|
||||||
|
`delegate2_size` enum('small','medium','large','xlarge') NOT NULL default 'small',
|
||||||
|
`delegate3_size` enum('small','medium','large','xlarge') NOT NULL default 'small',
|
||||||
|
`delegate4_size` enum('small','medium','large','xlarge') NOT NULL default 'small',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) TYPE=MyISAM ;
|
||||||
|
|
||||||
|
ALTER TABLE `schools` ADD `atrisk` ENUM( 'no', 'yes' ) NOT NULL default 'no';
|
||||||
|
|
||||||
|
-- Update the designate into '', public, indpendent, and home, more useful for
|
||||||
|
-- SFIAB. This pre-conversions are for everyone in BC who imported the science
|
||||||
|
-- world school list
|
||||||
|
UPDATE schools SET designate='public' WHERE designate='Standard';
|
||||||
|
UPDATE schools SET designate='independent' WHERE designate='Independent';
|
||||||
|
UPDATE schools SET designate='public' WHERE designate='Alternate';
|
||||||
|
UPDATE schools SET designate='public' WHERE designate='PRP';
|
||||||
|
UPDATE schools SET designate='public' WHERE designate='Continuing Education';
|
||||||
|
UPDATE schools SET designate='public' WHERE designate='Youth Containment Ctr';
|
||||||
|
UPDATE schools SET designate='home' WHERE designate='Distributed Learning';
|
||||||
|
UPDATE schools SET designate='independent' WHERE designate='Offshore';
|
||||||
|
ALTER TABLE `schools` CHANGE `designate` `designate` ENUM( '', 'public', 'independent', 'home' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user