Add more school information to the schools database (school lanaguage, school level, principal and school email addresS)

This commit is contained in:
james 2006-10-15 17:11:56 +00:00
parent 0f26d12fe7
commit 4ee617eb52
3 changed files with 29 additions and 2 deletions

View File

@ -43,6 +43,9 @@
$exec="UPDATE schools SET ".
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
"schoollang='".mysql_escape_string(stripslashes($_POST['schoollang']))."', ".
"schoollevel='".mysql_escape_string(stripslashes($_POST['schoollevel']))."', ".
"school='".mysql_escape_string(stripslashes($_POST['school']))."', ".
"board='".mysql_escape_string(stripslashes($_POST['board']))."', ".
"district='".mysql_escape_string(stripslashes($_POST['district']))."', ".
@ -50,6 +53,8 @@
"city='".mysql_escape_string(stripslashes($_POST['city']))."', ".
"province_code='".mysql_escape_string(stripslashes($_POST['province_code']))."', ".
"postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."', ".
"principal='".mysql_escape_string(stripslashes($_POST['principal']))."', ".
"schoolemail='".mysql_escape_string(stripslashes($_POST['schoolemail']))."', ".
"phone='".mysql_escape_string(stripslashes($_POST['phone']))."', ".
"fax='".mysql_escape_string(stripslashes($_POST['fax']))."', ".
"sciencehead='".mysql_escape_string(stripslashes($_POST['sciencehead']))."', ".
@ -101,6 +106,18 @@
echo "<table>\n";
echo "<tr><td>".i18n("School Name")."</td><td><input type=\"text\" name=\"school\" value=\"".htmlspecialchars($r->school)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("School Language")."</td><td>";
echo "<select name=\"schoollang\">";
echo "<option value=\"\">".i18n("Choose")."</option>\n";
foreach($config['languages'] AS $k=>$l)
{
if($r->schoollang==$k) $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$k\">".i18n($l)."</option>\n";
}
echo "</select>";
echo "</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 District")."</td><td><input type=\"text\" name=\"district\" value=\"".htmlspecialchars($r->district)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("Address")."</td><td><input type=\"text\" name=\"address\" value=\"".htmlspecialchars($r->address)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
@ -111,6 +128,8 @@
echo "<tr><td>".i18n("Postal Code")."</td><td><input type=\"text\" name=\"postalcode\" value=\"$r->postalcode\" size=\"8\" maxlength=\"7\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone")."</td><td><input type=\"text\" name=\"phone\" value=\"".htmlspecialchars($r->phone)."\" size=\"16\" maxlength=\"16\" /></td></tr>\n";
echo "<tr><td>".i18n("Fax")."</td><td><input type=\"text\" name=\"fax\" value=\"".htmlspecialchars($r->fax)."\" size=\"16\" maxlength=\"16\" /></td></tr>\n";
echo "<tr><td>".i18n("Principal")."</td><td><input type=\"text\" name=\"principal\" value=\"".htmlspecialchars($r->principal)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("School Email")."</td><td><input type=\"text\" name=\"schoolemail\" value=\"".htmlspecialchars($r->schoolemail)."\" size=\"60\" maxlength=\"128\" /></td></tr>\n";
echo "<tr><td>".i18n("Access Code")."</td><td><input type=\"text\" name=\"accesscode\" value=\"".htmlspecialchars($r->accesscode)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td colspan=2><br /><b>".i18n("Science head/teacher or science fair contact at school")."</b></td></tr>";
echo "<tr><td>".i18n("Name")."</td><td><input type=\"text\" name=\"sciencehead\" value=\"".htmlspecialchars($r->sciencehead)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";

View File

@ -51,7 +51,7 @@
$loaded=0;
foreach($CSVP->data AS $row)
{
mysql_query("INSERT INTO schools (school,board,district,phone,fax,address,city,province_code,postalcode,sciencehead,scienceheademail,scienceheadphone,accesscode,registration_password,projectlimit,projectlimitper,year) VALUES (
mysql_query("INSERT INTO schools (school,schoollang,schoollevel,board,district,phone,fax,address,city,province_code,postalcode,principal,schoolemail,sciencehead,scienceheademail,scienceheadphone,accesscode,registration_password,projectlimit,projectlimitper,year) VALUES (
'".mysql_escape_string(stripslashes($row[0]))."',
'".mysql_escape_string(stripslashes($row[1]))."',
'".mysql_escape_string(stripslashes($row[2]))."',
@ -68,6 +68,10 @@
'".mysql_escape_string(stripslashes($row[13]))."',
'".mysql_escape_string(stripslashes($row[14]))."',
'".mysql_escape_string(stripslashes($row[15]))."',
'".mysql_escape_string(stripslashes($row[16]))."',
'".mysql_escape_string(stripslashes($row[17]))."',
'".mysql_escape_string(stripslashes($row[18]))."',
'".mysql_escape_string(stripslashes($row[19]))."',
'".$config['FAIRYEAR']."')");
if(!mysql_Error())
$loaded++;
@ -96,7 +100,7 @@
echo i18n("Choose the CSV file containing the school information. The COLUMNS of the file must contain the following information, in this exact order, separated by comma's (,) with fields optionally enclosed by quotes (\"):");
echo "<br />";
echo "<br />";
echo i18n("School Name, Board, District, Phone, Fax, Address, City, Province, Postal Code, Science Head, Science Head Email, Science Head Phone, Access Code, Registration Password, Project Limit, Project Limit Per(total or agecategory)");
echo i18n("School Name, School Lang, School Level, Board, District, Phone, Fax, Address, City, Province, Postal Code, Principal, School Email, Science Head, Science Head Email, Science Head Phone, Access Code, Registration Password, Project Limit, Project Limit Per(total or agecategory)");
echo "<br />";
echo "<br />";

4
db/db.update.26.sql Normal file
View File

@ -0,0 +1,4 @@
ALTER TABLE `schools` ADD `principal` VARCHAR( 64 ) NOT NULL AFTER `postalcode` ;
ALTER TABLE `schools` ADD `schoolemail` VARCHAR( 128 ) NOT NULL AFTER `principal` ;
ALTER TABLE `schools` ADD `schoollang` VARCHAR( 2 ) NOT NULL AFTER `school` ;
ALTER TABLE `schools` ADD `schoollevel` VARCHAR( 32 ) NOT NULL AFTER `schoollang` ;